X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDPartitioner%2FMEDPARTITIONER_JointFinder.cxx;h=3826f44fc6b6ee0042ef17383f5a17d290127ea0;hb=7cdd24293941a0a2fd7a93adf86ce293ece155b8;hp=0875976f9b9a3e08e609457ef6c73ba87f69b049;hpb=f1a947b32a36d8dc8e3079b25305bb50e8cb59a0;p=tools%2Fmedcoupling.git diff --git a/src/MEDPartitioner/MEDPARTITIONER_JointFinder.cxx b/src/MEDPartitioner/MEDPARTITIONER_JointFinder.cxx index 0875976f9..3826f44fc 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_JointFinder.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_JointFinder.cxx @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2013 CEA/DEN, EDF R&D +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -50,9 +50,9 @@ void MEDPARTITIONER::JointFinder::findCommonDistantNodes() int nbproc=_domain_selector->nbProcs(); std::vector bbtree(nbdomain,(BBTreeOfDim*) 0); std::vector bbxi(nbdomain,(double*) 0); - std::vector rev(nbdomain,(ParaMEDMEM::DataArrayInt*) 0); - std::vector revIndx(nbdomain,(ParaMEDMEM::DataArrayInt*) 0); - int meshDim=-1; + std::vector rev(nbdomain,(MEDCoupling::DataArrayIdType*) 0); + std::vector revIndx(nbdomain,(MEDCoupling::DataArrayIdType*) 0); + //int meshDim=-1; int spaceDim=-1; //init rev and revIndx and bbtree for my domain (of me:proc n) @@ -60,11 +60,11 @@ void MEDPARTITIONER::JointFinder::findCommonDistantNodes() { if(!_domain_selector->isMyDomain(mydomain)) continue; - const ParaMEDMEM::MEDCouplingUMesh* myMesh=_mesh_collection.getMesh(mydomain); - meshDim = myMesh->getMeshDimension(); + const MEDCoupling::MEDCouplingUMesh* myMesh=_mesh_collection.getMesh(mydomain); + //meshDim = myMesh->getMeshDimension(); spaceDim= myMesh->getSpaceDimension(); - rev[mydomain] = ParaMEDMEM::DataArrayInt::New(); - revIndx[mydomain] = ParaMEDMEM::DataArrayInt::New(); + rev[mydomain] = MEDCoupling::DataArrayIdType::New(); + revIndx[mydomain] = MEDCoupling::DataArrayIdType::New(); myMesh->getReverseNodalConnectivity(rev[mydomain],revIndx[mydomain]); double* bbx=new double[2*spaceDim*myMesh->getNumberOfNodes()]; for (int i=0; igetNumberOfNodes()*spaceDim; i++) @@ -84,7 +84,7 @@ void MEDPARTITIONER::JointFinder::findCommonDistantNodes() { for (int itarget=0; itargetisMyDomain(isource)&&_domain_selector->isMyDomain(itarget)) continue; if (_domain_selector->isMyDomain(isource)) @@ -97,7 +97,7 @@ void MEDPARTITIONER::JointFinder::findCommonDistantNodes() SendDoubleVec(vec,targetProc); //retrieving target data for storage in commonDistantNodes array - std::vector localCorrespondency; + std::vector localCorrespondency; RecvIntVec(localCorrespondency, targetProc); for (std::size_t i=0; i recvVec; RecvDoubleVec(recvVec,sourceProc); - std::map commonNodes; // (local nodes, distant nodes) list - for (int inode=0; inode<(recvVec.size()/spaceDim); inode++) + std::map commonNodes; // (local nodes, distant nodes) list + for (mcIdType inode=0; inode inodes; + std::vector inodes; bbtree[itarget]->getIntersectingElems(bbox,inodes); delete [] bbox; @@ -131,16 +131,16 @@ void MEDPARTITIONER::JointFinder::findCommonDistantNodes() } } - std::vector nodeCellCorrespondency; - for (std::map::iterator iter=commonNodes.begin(); iter!=commonNodes.end(); iter++) + std::vector nodeCellCorrespondency; + for (std::map::iterator iter=commonNodes.begin(); iter!=commonNodes.end(); iter++) { _node_node[itarget][isource].push_back(std::make_pair(iter->first, iter->second));//storing node pairs in a vector - const int* revIndxPtr=revIndx[itarget]->getConstPointer(); - const int* revPtr=rev[itarget]->getConstPointer(); - for (int icell=revIndxPtr[iter->first]; icellfirst+1]; icell++) + const mcIdType* revIndxPtr=revIndx[itarget]->getConstPointer(); + const mcIdType* revPtr=rev[itarget]->getConstPointer(); + for (mcIdType icell=revIndxPtr[iter->first]; icellfirst+1]; icell++) { nodeCellCorrespondency.push_back(iter->second); // - int globalCell=_topology->convertCellToGlobal(itarget,revPtr[icell]); + mcIdType globalCell=_topology->convertCellToGlobal(itarget,revPtr[icell]); nodeCellCorrespondency.push_back(globalCell); } } @@ -166,12 +166,12 @@ void MEDPARTITIONER::JointFinder::findCommonDistantNodes() std::cout << "proc " << _domain_selector->rank() << " : end JointFinder::findCommonDistantNodes" << std::endl; } -std::vector > >& MEDPARTITIONER::JointFinder::getDistantNodeCell() +std::vector > >& MEDPARTITIONER::JointFinder::getDistantNodeCell() { return _distant_node_cell; } -std::vector > > >& MEDPARTITIONER::JointFinder::getNodeNode() +std::vector > > >& MEDPARTITIONER::JointFinder::getNodeNode() { return _node_node; } @@ -200,7 +200,7 @@ void MEDPARTITIONER::JointFinder::print() { for (int itarget=0; itarget::iterator it; + std::multimap::iterator it; for (it=_distant_node_cell[isource][itarget].begin() ; it!=_distant_node_cell[isource][itarget].end(); it++) { std::cout << " nc" << _domain_selector->rank() << "|" << itarget << "|" << isource << "|" << (*it).first << "=" << (*it).second;