From: Anthony Geay Date: Tue, 19 Jan 2016 16:27:30 +0000 (+0100) Subject: 2nd step. X-Git-Tag: V8_0_0b1~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=efadd75b7a6e2bedd20e6fe6b9245b61887e5562;p=tools%2Fmedcoupling.git 2nd step. --- diff --git a/src/INTERP_KERNELTest/Interpolation3DTest.cxx b/src/INTERP_KERNELTest/Interpolation3DTest.cxx index 1cdf7d2e3..54f9709f7 100644 --- a/src/INTERP_KERNELTest/Interpolation3DTest.cxx +++ b/src/INTERP_KERNELTest/Interpolation3DTest.cxx @@ -42,7 +42,7 @@ //#define VOL_PREC 1.0e-6 -using namespace ParaMEDMEM; +using namespace MEDCoupling; using namespace INTERP_KERNEL; double Interpolation3DTest::sumRow(const IntersectionMatrix& m, int i) const @@ -71,7 +71,7 @@ double Interpolation3DTest::sumCol(const IntersectionMatrix& m, int i) const } -void Interpolation3DTest::getVolumes(ParaMEDMEM::MEDCouplingUMesh& mesh, double *tab) const +void Interpolation3DTest::getVolumes(MEDCoupling::MEDCouplingUMesh& mesh, double *tab) const { MEDCouplingAutoRefCountObjectPtr vol=mesh->getMeasureField(true); std::copy(vol->getArray()->begin(),vol->getArray()->end(),tab); diff --git a/src/INTERP_KERNELTest/InterpolationOptionsTest.cxx b/src/INTERP_KERNELTest/InterpolationOptionsTest.cxx index 9bc5c7406..1c85bcbb3 100644 --- a/src/INTERP_KERNELTest/InterpolationOptionsTest.cxx +++ b/src/INTERP_KERNELTest/InterpolationOptionsTest.cxx @@ -28,7 +28,7 @@ #include #include -using namespace ParaMEDMEM; +using namespace MEDCoupling; namespace INTERP_TEST { diff --git a/src/INTERP_KERNELTest/MEDMeshMaker.cxx b/src/INTERP_KERNELTest/MEDMeshMaker.cxx index f0538b113..cbb9a91f4 100644 --- a/src/INTERP_KERNELTest/MEDMeshMaker.cxx +++ b/src/INTERP_KERNELTest/MEDMeshMaker.cxx @@ -22,9 +22,9 @@ #include "MEDMeshMaker.hxx" -using namespace ParaMEDMEM; +using namespace MEDCoupling; -ParaMEDMEM::MEDCouplingUMesh *MEDMeshMaker(int dim, int nbedge) +MEDCoupling::MEDCouplingUMesh *MEDMeshMaker(int dim, int nbedge) { MEDCouplingAutoRefCountObjectPtr c=MEDCouplingCMesh::New(); MEDCouplingAutoRefCountObjectPtr arr=DataArrayDouble::New(); diff --git a/src/INTERP_KERNELTest/MEDMeshMaker.hxx b/src/INTERP_KERNELTest/MEDMeshMaker.hxx index 44bcdf19b..b2738760a 100644 --- a/src/INTERP_KERNELTest/MEDMeshMaker.hxx +++ b/src/INTERP_KERNELTest/MEDMeshMaker.hxx @@ -19,4 +19,4 @@ #include "MEDCouplingUMesh.hxx" -ParaMEDMEM::MEDCouplingUMesh *MEDMeshMaker(int dim, int nbedge); +MEDCoupling::MEDCouplingUMesh *MEDMeshMaker(int dim, int nbedge); diff --git a/src/INTERP_KERNELTest/MeshTestToolkit.hxx b/src/INTERP_KERNELTest/MeshTestToolkit.hxx index 0144c9d0f..8153d9ba8 100644 --- a/src/INTERP_KERNELTest/MeshTestToolkit.hxx +++ b/src/INTERP_KERNELTest/MeshTestToolkit.hxx @@ -37,7 +37,7 @@ namespace INTERP_KERNEL } -namespace ParaMEDMEM +namespace MEDCoupling { class MEDCouplingUMesh; } @@ -71,9 +71,9 @@ namespace INTERP_TEST double sumCol(const IntersectionMatrix& m, int i) const; - void getVolumes(ParaMEDMEM::MEDCouplingUMesh& mesh, double* tab) const; + void getVolumes(MEDCoupling::MEDCouplingUMesh& mesh, double* tab) const; - bool testVolumes(const IntersectionMatrix& m, ParaMEDMEM::MEDCouplingUMesh& sMesh, ParaMEDMEM::MEDCouplingUMesh& tMesh) const; + bool testVolumes(const IntersectionMatrix& m, MEDCoupling::MEDCouplingUMesh& sMesh, MEDCoupling::MEDCouplingUMesh& tMesh) const; double sumVolume(const IntersectionMatrix& m) const; diff --git a/src/INTERP_KERNELTest/MeshTestToolkit.txx b/src/INTERP_KERNELTest/MeshTestToolkit.txx index 2c80463b8..0256d65fa 100644 --- a/src/INTERP_KERNELTest/MeshTestToolkit.txx +++ b/src/INTERP_KERNELTest/MeshTestToolkit.txx @@ -49,7 +49,7 @@ #include //#define VOL_PREC 1.0e-6 -using namespace ParaMEDMEM; +using namespace MEDCoupling; using namespace INTERP_KERNEL; namespace INTERP_TEST @@ -104,7 +104,7 @@ namespace INTERP_TEST * @param tab pointer to double[no. elements of mesh] array in which to store the volumes */ template - void MeshTestToolkit::getVolumes(ParaMEDMEM::MEDCouplingUMesh& mesh, double *tab) const + void MeshTestToolkit::getVolumes(MEDCoupling::MEDCouplingUMesh& mesh, double *tab) const { MEDCouplingAutoRefCountObjectPtr vol=mesh.getMeasureField(true); std::copy(vol->getArray()->begin(),vol->getArray()->end(),tab); @@ -150,7 +150,7 @@ namespace INTERP_TEST * @return true if the condition is verified, false if not. */ template - bool MeshTestToolkit::testVolumes(const IntersectionMatrix& m, ParaMEDMEM::MEDCouplingUMesh& sMesh, ParaMEDMEM::MEDCouplingUMesh& tMesh) const + bool MeshTestToolkit::testVolumes(const IntersectionMatrix& m, MEDCoupling::MEDCouplingUMesh& sMesh, MEDCoupling::MEDCouplingUMesh& tMesh) const { bool ok = true; diff --git a/src/MEDPartitioner/MEDPARTITIONER_ConnectZone.cxx b/src/MEDPartitioner/MEDPARTITIONER_ConnectZone.cxx index 402d66249..8f99e885d 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ConnectZone.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ConnectZone.cxx @@ -23,7 +23,7 @@ #include -using namespace ParaMEDMEM; +using namespace MEDCoupling; MEDPARTITIONER::ConnectZone::ConnectZone(): _name("") @@ -76,12 +76,12 @@ int MEDPARTITIONER::ConnectZone::getLocalDomainNumber() const return _local_domain_number; } -ParaMEDMEM::MEDCouplingUMesh *MEDPARTITIONER::ConnectZone::getLocalMesh() const +MEDCoupling::MEDCouplingUMesh *MEDPARTITIONER::ConnectZone::getLocalMesh() const { return _local_mesh; } -ParaMEDMEM::MEDCouplingUMesh *MEDPARTITIONER::ConnectZone::getDistantMesh() const +MEDCoupling::MEDCouplingUMesh *MEDPARTITIONER::ConnectZone::getDistantMesh() const { return _distant_mesh; } @@ -112,7 +112,7 @@ int MEDPARTITIONER::ConnectZone::getNodeNumber() const return _node_corresp->getNumberOf(); } -const ParaMEDMEM::MEDCouplingSkyLineArray * MEDPARTITIONER::ConnectZone::getNodeCorresp() const +const MEDCoupling::MEDCouplingSkyLineArray * MEDPARTITIONER::ConnectZone::getNodeCorresp() const { return _node_corresp; } @@ -132,7 +132,7 @@ int MEDPARTITIONER::ConnectZone::getFaceNumber() const return _face_corresp->getNumberOf(); } -const ParaMEDMEM::MEDCouplingSkyLineArray * MEDPARTITIONER::ConnectZone::getFaceCorresp() const +const MEDCoupling::MEDCouplingSkyLineArray * MEDPARTITIONER::ConnectZone::getFaceCorresp() const { return _face_corresp; } @@ -189,7 +189,7 @@ int MEDPARTITIONER::ConnectZone::getEntityCorrespLength(int localEntity, return 0; } -const ParaMEDMEM::MEDCouplingSkyLineArray * +const MEDCoupling::MEDCouplingSkyLineArray * MEDPARTITIONER::ConnectZone::getEntityCorresp(int localEntity, int distantEntity) const { typedef std::map, MEDCouplingSkyLineArray*>::const_iterator map_iter; @@ -236,12 +236,12 @@ void MEDPARTITIONER::ConnectZone::setLocalDomainNumber(int localDomainNumber) _local_domain_number=localDomainNumber; } -void MEDPARTITIONER::ConnectZone::setLocalMesh(ParaMEDMEM::MEDCouplingUMesh * localMesh) +void MEDPARTITIONER::ConnectZone::setLocalMesh(MEDCoupling::MEDCouplingUMesh * localMesh) { _local_mesh=localMesh; } -void MEDPARTITIONER::ConnectZone::setDistantMesh(ParaMEDMEM::MEDCouplingUMesh * distantMesh) +void MEDPARTITIONER::ConnectZone::setDistantMesh(MEDCoupling::MEDCouplingUMesh * distantMesh) { _distant_mesh=distantMesh; } @@ -330,8 +330,8 @@ void MEDPARTITIONER::ConnectZone::setEntityCorresp(int localEntity, int distantE void MEDPARTITIONER::ConnectZone::setEntityCorresp(int localEntity, int distantEntity, MEDCouplingSkyLineArray *array) { - ParaMEDMEM::MEDCouplingSkyLineArray * nullArray = 0; - std::map < std::pair , ParaMEDMEM::MEDCouplingSkyLineArray * >::iterator it; + MEDCoupling::MEDCouplingSkyLineArray * nullArray = 0; + std::map < std::pair , MEDCoupling::MEDCouplingSkyLineArray * >::iterator it; it = _entity_corresp.insert ( std::make_pair( std::make_pair(localEntity,distantEntity), nullArray )).first; if ( it->second != nullArray ) delete it->second; diff --git a/src/MEDPartitioner/MEDPARTITIONER_ConnectZone.hxx b/src/MEDPartitioner/MEDPARTITIONER_ConnectZone.hxx index 9572db1c8..3ec4096a1 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ConnectZone.hxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ConnectZone.hxx @@ -22,7 +22,7 @@ #include "MEDPARTITIONER.hxx" -namespace ParaMEDMEM +namespace MEDCoupling { class MEDCouplingUMesh; class MEDCouplingSkyLineArray; @@ -45,18 +45,18 @@ namespace MEDPARTITIONER std::string getDescription() const ; int getDistantDomainNumber() const ; int getLocalDomainNumber() const ; - ParaMEDMEM::MEDCouplingUMesh *getLocalMesh() const ; - ParaMEDMEM::MEDCouplingUMesh *getDistantMesh() const ; + MEDCoupling::MEDCouplingUMesh *getLocalMesh() const ; + MEDCoupling::MEDCouplingUMesh *getDistantMesh() const ; bool isEntityCorrespPresent(int localEntity,int distantEntity) const; const int *getNodeCorrespIndex() const; const int *getNodeCorrespValue() const; int getNodeNumber() const; - const ParaMEDMEM::MEDCouplingSkyLineArray * getNodeCorresp() const; + const MEDCoupling::MEDCouplingSkyLineArray * getNodeCorresp() const; const int *getFaceCorrespIndex() const; const int *getFaceCorrespValue() const; int getFaceNumber() const; - const ParaMEDMEM::MEDCouplingSkyLineArray * getFaceCorresp() const; + const MEDCoupling::MEDCouplingSkyLineArray * getFaceCorresp() const; const int *getEntityCorrespIndex(int localEntity, int distantEntity) const; const int *getEntityCorrespValue(int localEntity, @@ -65,7 +65,7 @@ namespace MEDPARTITIONER int distantEntity) const; int getEntityCorrespLength(int localEntity, int distantEntity) const; - const ParaMEDMEM::MEDCouplingSkyLineArray * getEntityCorresp(int localEntity, + const MEDCoupling::MEDCouplingSkyLineArray * getEntityCorresp(int localEntity, int distantEntity) const; std::vector< std::pair< int,int > > getEntities() const; @@ -73,30 +73,30 @@ namespace MEDPARTITIONER void setDescription(const std::string& description) ; void setDistantDomainNumber(int distantDomainNumber) ; void setLocalDomainNumber(int distantDomainNumber) ; - void setLocalMesh(ParaMEDMEM::MEDCouplingUMesh * localMesh) ; - void setDistantMesh(ParaMEDMEM::MEDCouplingUMesh * distantMesh) ; + void setLocalMesh(MEDCoupling::MEDCouplingUMesh * localMesh) ; + void setDistantMesh(MEDCoupling::MEDCouplingUMesh * distantMesh) ; void setNodeCorresp(const int * nodeCorresp, int nbnode); - void setNodeCorresp(ParaMEDMEM::MEDCouplingSkyLineArray* array); + void setNodeCorresp(MEDCoupling::MEDCouplingSkyLineArray* array); void setFaceCorresp(const int * faceCorresp, int nbface); - void setFaceCorresp(ParaMEDMEM::MEDCouplingSkyLineArray* array); + void setFaceCorresp(MEDCoupling::MEDCouplingSkyLineArray* array); void setEntityCorresp(int localEntity, int distantEntity, const int * entityCorresp, int nbentity); void setEntityCorresp(int localEntity, int distantEntity, - ParaMEDMEM::MEDCouplingSkyLineArray *array); + MEDCoupling::MEDCouplingSkyLineArray *array); private : std::string _name; std::string _description; int _local_domain_number; int _distant_domain_number; - ParaMEDMEM::MEDCouplingUMesh * _local_mesh; - ParaMEDMEM::MEDCouplingUMesh * _distant_mesh; + MEDCoupling::MEDCouplingUMesh * _local_mesh; + MEDCoupling::MEDCouplingUMesh * _distant_mesh; - ParaMEDMEM::MEDCouplingSkyLineArray * _node_corresp; - ParaMEDMEM::MEDCouplingSkyLineArray * _face_corresp; + MEDCoupling::MEDCouplingSkyLineArray * _node_corresp; + MEDCoupling::MEDCouplingSkyLineArray * _face_corresp; - std::map < std::pair , ParaMEDMEM::MEDCouplingSkyLineArray * > _entity_corresp; + std::map < std::pair , MEDCoupling::MEDCouplingSkyLineArray * > _entity_corresp; }; } # endif diff --git a/src/MEDPartitioner/MEDPARTITIONER_Graph.cxx b/src/MEDPartitioner/MEDPARTITIONER_Graph.cxx index 1904ae4f5..8ae65517b 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_Graph.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_Graph.cxx @@ -23,7 +23,7 @@ #include -MEDPARTITIONER::Graph::Graph(ParaMEDMEM::MEDCouplingSkyLineArray *array, int *edgeweight):_graph(array),_partition(0),_edge_weight(edgeweight),_cell_weight(0) +MEDPARTITIONER::Graph::Graph(MEDCoupling::MEDCouplingSkyLineArray *array, int *edgeweight):_graph(array),_partition(0),_edge_weight(edgeweight),_cell_weight(0) { } @@ -37,7 +37,7 @@ int MEDPARTITIONER::Graph::nbDomains() const { std::set domains; if ( _partition ) - if ( ParaMEDMEM::DataArrayInt* array = _partition->getValueArray() ) + if ( MEDCoupling::DataArrayInt* array = _partition->getValueArray() ) { for ( const int * dom = array->begin(); dom != array->end(); ++dom ) domains.insert( *dom ); diff --git a/src/MEDPartitioner/MEDPARTITIONER_Graph.hxx b/src/MEDPartitioner/MEDPARTITIONER_Graph.hxx index 12227bdb0..8a2755c37 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_Graph.hxx +++ b/src/MEDPartitioner/MEDPARTITIONER_Graph.hxx @@ -24,7 +24,7 @@ #include -namespace ParaMEDMEM +namespace MEDCoupling { class MEDCouplingSkyLineArray; } @@ -39,7 +39,7 @@ namespace MEDPARTITIONER Graph(){}; //creates a graph from a SKYLINEARRAY - Graph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, int* edgeweight=0); + Graph(MEDCoupling::MEDCouplingSkyLineArray* graph, int* edgeweight=0); virtual ~Graph(); void setEdgesWeights(int *edgeweight) { _edge_weight=edgeweight; } @@ -57,12 +57,12 @@ namespace MEDPARTITIONER // returns nb of domains in _partition int nbDomains() const; - const ParaMEDMEM::MEDCouplingSkyLineArray *getGraph() const { return _graph; } - const ParaMEDMEM::MEDCouplingSkyLineArray *getPartition() const { return _partition; } + const MEDCoupling::MEDCouplingSkyLineArray *getGraph() const { return _graph; } + const MEDCoupling::MEDCouplingSkyLineArray *getPartition() const { return _partition; } protected: - ParaMEDMEM::MEDCouplingSkyLineArray* _graph; - ParaMEDMEM::MEDCouplingSkyLineArray* _partition; + MEDCoupling::MEDCouplingSkyLineArray* _graph; + MEDCoupling::MEDCouplingSkyLineArray* _partition; int* _edge_weight; int* _cell_weight; }; diff --git a/src/MEDPartitioner/MEDPARTITIONER_JointFinder.cxx b/src/MEDPartitioner/MEDPARTITIONER_JointFinder.cxx index 1e826eac7..9421b8cf0 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_JointFinder.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_JointFinder.cxx @@ -50,8 +50,8 @@ 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); + std::vector rev(nbdomain,(MEDCoupling::DataArrayInt*) 0); + std::vector revIndx(nbdomain,(MEDCoupling::DataArrayInt*) 0); int meshDim=-1; int spaceDim=-1; @@ -60,11 +60,11 @@ void MEDPARTITIONER::JointFinder::findCommonDistantNodes() { if(!_domain_selector->isMyDomain(mydomain)) continue; - const ParaMEDMEM::MEDCouplingUMesh* myMesh=_mesh_collection.getMesh(mydomain); + 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::DataArrayInt::New(); + revIndx[mydomain] = MEDCoupling::DataArrayInt::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)) diff --git a/src/MEDPartitioner/MEDPARTITIONER_MEDPartitioner.cxx b/src/MEDPartitioner/MEDPARTITIONER_MEDPartitioner.cxx index 57e9ae919..c97c36b03 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MEDPartitioner.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MEDPartitioner.cxx @@ -55,7 +55,7 @@ MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const std::string& filename, int parallelizer.evaluateMemory(); } -MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const ParaMEDMEM::MEDFileData* filedata, int ndomains, const std::string& library,bool creates_boundary_faces, bool create_joints, bool mesure_memory): +MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const MEDCoupling::MEDFileData* filedata, int ndomains, const std::string& library,bool creates_boundary_faces, bool create_joints, bool mesure_memory): _input_collection( 0 ), _output_collection( 0 ), _new_topology( 0 ) { MyGlobals::_World_Size = 1; @@ -77,7 +77,7 @@ MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const ParaMEDMEM::MEDFileData* fi parallelizer.evaluateMemory(); } -MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const ParaMEDMEM::MEDFileData* filedata, MEDPARTITIONER ::Graph* graph, bool creates_boundary_faces, bool create_joints, bool mesure_memory): +MEDPARTITIONER::MEDPartitioner::MEDPartitioner(const MEDCoupling::MEDFileData* filedata, MEDPARTITIONER ::Graph* graph, bool creates_boundary_faces, bool create_joints, bool mesure_memory): _input_collection( 0 ), _output_collection( 0 ), _new_topology( 0 ) { MyGlobals::_World_Size = 1; @@ -128,15 +128,15 @@ void MEDPARTITIONER::MEDPartitioner::write(const std::string& filename) parallelizer.evaluateMemory(); } -ParaMEDMEM::MEDFileData* MEDPARTITIONER::MEDPartitioner::getMEDFileData() +MEDCoupling::MEDFileData* MEDPARTITIONER::MEDPartitioner::getMEDFileData() { return _output_collection->retrieveDriver()->getMEDFileData(); } -MEDPARTITIONER::Graph* MEDPARTITIONER::MEDPartitioner::Graph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, Graph::splitter_type split, int* edgeweight) +MEDPARTITIONER::Graph* MEDPARTITIONER::MEDPartitioner::Graph(MEDCoupling::MEDCouplingSkyLineArray* graph, Graph::splitter_type split, int* edgeweight) { MEDPARTITIONER::Graph* cellGraph=0; - ParaMEDMEM::MEDCouplingSkyLineArray* arr = new ParaMEDMEM::MEDCouplingSkyLineArray(graph->getIndexArray(), graph->getValueArray()); + MEDCoupling::MEDCouplingSkyLineArray* arr = new MEDCoupling::MEDCouplingSkyLineArray(graph->getIndexArray(), graph->getValueArray()); switch (split) { case Graph::METIS: diff --git a/src/MEDPartitioner/MEDPARTITIONER_MEDPartitioner.hxx b/src/MEDPartitioner/MEDPARTITIONER_MEDPartitioner.hxx index fecaf0cc9..0b0a420c6 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MEDPartitioner.hxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MEDPartitioner.hxx @@ -26,7 +26,7 @@ #include #include -namespace ParaMEDMEM +namespace MEDCoupling { class MEDFileData; } @@ -40,14 +40,14 @@ namespace MEDPARTITIONER { public: MEDPartitioner(const std::string& filename, int ndomains=1, const std::string& library="metis",bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false); - MEDPartitioner(const ParaMEDMEM::MEDFileData* fileData, int ndomains=1, const std::string& library="metis",bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false); - MEDPartitioner(const ParaMEDMEM::MEDFileData* fileData, Graph* graph, bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false); - static MEDPARTITIONER::Graph* Graph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, Graph::splitter_type split=Graph::METIS, int* edgeweight=0); + MEDPartitioner(const MEDCoupling::MEDFileData* fileData, int ndomains=1, const std::string& library="metis",bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false); + MEDPartitioner(const MEDCoupling::MEDFileData* fileData, Graph* graph, bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false); + static MEDPARTITIONER::Graph* Graph(MEDCoupling::MEDCouplingSkyLineArray* graph, Graph::splitter_type split=Graph::METIS, int* edgeweight=0); void write(const std::string& filename); - ParaMEDMEM::MEDFileData* getMEDFileData(); + MEDCoupling::MEDFileData* getMEDFileData(); ~MEDPartitioner(); - ParaMEDMEM::MEDFileData *convertToMEDFileData(MeshCollection* meshcollection); + MEDCoupling::MEDFileData *convertToMEDFileData(MeshCollection* meshcollection); void createPartitionCollection(int ndomains, const std::string& library,bool creates_boundary_faces, bool create_joints, bool mesure_memory); private: diff --git a/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx b/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx index d0ad9d4cb..ebf0ecceb 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.cxx @@ -106,7 +106,7 @@ MEDPARTITIONER::MeshCollection::MeshCollection(MeshCollection& initialCollection _joint_finder(0) { std::vector > > new2oldIds(initialCollection.getTopology()->nbDomain()); - std::vector o2nRenumber; + std::vector o2nRenumber; castCellMeshes(initialCollection, new2oldIds, o2nRenumber ); @@ -206,7 +206,7 @@ MEDPARTITIONER::MeshCollection::MeshCollection(MeshCollection& initialCollection void MEDPARTITIONER::MeshCollection::castCellMeshes(MeshCollection& initialCollection, std::vector > >& new2oldIds, - std::vector & o2nRenumber) + std::vector & o2nRenumber) { if (MyGlobals::_Verbose>10) std::cout << "proc " << MyGlobals::_Rank << " : castCellMeshes" << std::endl; @@ -220,11 +220,11 @@ void MEDPARTITIONER::MeshCollection::castCellMeshes(MeshCollection& initialColle o2nRenumber.resize(nbNewDomain,0); int rank=MyGlobals::_Rank; //splitting the initial domains into smaller bits - std::vector > splitMeshes; + std::vector > splitMeshes; splitMeshes.resize(nbNewDomain); for (int inew=0; inewbuildPartOfMySelf(&new2oldIds[iold][inew][0], &new2oldIds[iold][inew][0]+new2oldIds[iold][inew].size(), true); @@ -280,7 +280,7 @@ void MEDPARTITIONER::MeshCollection::castCellMeshes(MeshCollection& initialColle std::cout << "proc " << rank << " : castCellMeshes fusing" << std::endl; for (int inew=0; inew meshes; + std::vector meshes; for (int i=0; i<(int)splitMeshes[inew].size(); i++) if (splitMeshes[inew][i]!=0) @@ -296,13 +296,13 @@ void MEDPARTITIONER::MeshCollection::castCellMeshes(MeshCollection& initialColle } else { - _mesh[inew]=ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes(meshes); + _mesh[inew]=MEDCoupling::MEDCouplingUMesh::MergeUMeshes(meshes); o2nRenumber[inew]=_mesh[inew]->sortCellsInMEDFileFrmt(); bool areNodesMerged; int nbNodesMerged; if (meshes.size()>1) { - ParaMEDMEM::DataArrayInt* array=_mesh[inew]->mergeNodes(1e-12,areNodesMerged,nbNodesMerged); + MEDCoupling::DataArrayInt* array=_mesh[inew]->mergeNodes(1e-12,areNodesMerged,nbNodesMerged); array->decrRef(); // array is not used in this case } _mesh[inew]->zipCoords(); @@ -334,7 +334,7 @@ void MEDPARTITIONER::MeshCollection::createNodeMapping( MeshCollection& initialC if (!isParallelMode() || (_domain_selector->isMyDomain(iold))) { // std::map >, int > nodeClassifier; - ParaMEDMEM::DataArrayDouble* coords = initialCollection.getMesh(iold)->getCoords(); + MEDCoupling::DataArrayDouble* coords = initialCollection.getMesh(iold)->getCoords(); double* coordsPtr=coords->getPointer(); dim = coords->getNumberOfComponents(); int nvertices=initialCollection.getMesh(iold)->getNumberOfNodes(); @@ -356,9 +356,9 @@ void MEDPARTITIONER::MeshCollection::createNodeMapping( MeshCollection& initialC _domain_selector->sendMesh(*(getMesh(inew)), _domain_selector->getProcessorID(iold)); else if (isParallelMode() && !_domain_selector->isMyDomain(inew)&& _domain_selector->isMyDomain(iold)) { - ParaMEDMEM::MEDCouplingUMesh* mesh; + MEDCoupling::MEDCouplingUMesh* mesh; _domain_selector->recvMesh(mesh, _domain_selector->getProcessorID(inew)); - ParaMEDMEM::DataArrayDouble* coords = mesh->getCoords(); + MEDCoupling::DataArrayDouble* coords = mesh->getCoords(); for (int inode=0; inodegetNumberOfNodes();inode++) { double* coordsPtr=coords->getPointer()+inode*dim; @@ -374,7 +374,7 @@ void MEDPARTITIONER::MeshCollection::createNodeMapping( MeshCollection& initialC if (!isParallelMode() || (_domain_selector->isMyDomain(inew) && _domain_selector->isMyDomain(iold))) #endif { - ParaMEDMEM::DataArrayDouble* coords = getMesh(inew)->getCoords(); + MEDCoupling::DataArrayDouble* coords = getMesh(inew)->getCoords(); for (int inode=0; inode<_mesh[inew]->getNumberOfNodes();inode++) { double* coordsPtr=coords->getPointer()+inode*dim; @@ -394,7 +394,7 @@ void MEDPARTITIONER::MeshCollection::createNodeMapping( MeshCollection& initialC } -void getNodeIds(ParaMEDMEM::MEDCouplingUMesh& meshOne, ParaMEDMEM::MEDCouplingUMesh& meshTwo, std::vector& nodeIds) +void getNodeIds(MEDCoupling::MEDCouplingUMesh& meshOne, MEDCoupling::MEDCouplingUMesh& meshTwo, std::vector& nodeIds) { using std::vector; using MEDPARTITIONER::BBTreeOfDim; @@ -402,7 +402,7 @@ void getNodeIds(ParaMEDMEM::MEDCouplingUMesh& meshOne, ParaMEDMEM::MEDCouplingUM double* bbox; BBTreeOfDim* tree = 0; int nv1=meshOne.getNumberOfNodes(); - ParaMEDMEM::DataArrayDouble* coords=meshOne.getCoords(); + MEDCoupling::DataArrayDouble* coords=meshOne.getCoords(); int dim = coords->getNumberOfComponents(); bbox=new double[nv1*2*dim]; @@ -456,15 +456,15 @@ void MEDPARTITIONER::MeshCollection::castFaceMeshes(MeshCollection& initialColle int nbNewDomain=_topology->nbDomain(); int nbOldDomain=initialCollection.getTopology()->nbDomain(); - vector& meshesCastFrom=initialCollection.getFaceMesh(); - vector& meshesCastTo=this->getFaceMesh(); + vector& meshesCastFrom=initialCollection.getFaceMesh(); + vector& meshesCastTo=this->getFaceMesh(); - vector< vector > splitMeshes; + vector< vector > splitMeshes; splitMeshes.resize(nbNewDomain); for (int inew=0; inewgetNumberOfCells() > 0) { splitMeshes[inew][iold]= - (ParaMEDMEM::MEDCouplingUMesh*) + (MEDCoupling::MEDCouplingUMesh*) ( meshesCastFrom[iold]->buildPartOfMySelf(&new2oldIds[iold][inew][0], &new2oldIds[iold][inew][0]+new2oldIds[iold][inew].size(), true) @@ -557,7 +557,7 @@ void MEDPARTITIONER::MeshCollection::castFaceMeshes(MeshCollection& initialColle //send/receive stuff if (isParallelMode()) { - ParaMEDMEM::MEDCouplingUMesh *empty=CreateEmptyMEDCouplingUMesh(); + MEDCoupling::MEDCouplingUMesh *empty=CreateEmptyMEDCouplingUMesh(); for (int iold=0; iold myMeshes; + vector myMeshes; for (int iold=0; ioldgetNumberOfCells()>0) myMeshes.push_back(umesh); } - ParaMEDMEM::MEDCouplingUMesh *bndMesh = 0; + MEDCoupling::MEDCouplingUMesh *bndMesh = 0; if ( _subdomain_boundary_creates && _mesh[inew] && _mesh[inew]->getNumberOfCells()>0 ) { bndMesh = - ((ParaMEDMEM::MEDCouplingUMesh *)_mesh[inew]->buildBoundaryMesh(/*keepCoords=*/true)); + ((MEDCoupling::MEDCouplingUMesh *)_mesh[inew]->buildBoundaryMesh(/*keepCoords=*/true)); if (bndMesh->getNumberOfCells()>0) myMeshes.push_back( bndMesh ); } if (myMeshes.size()>0) { - meshesCastTo[inew]=ParaMEDMEM::MEDCouplingUMesh::MergeUMeshes(myMeshes); + meshesCastTo[inew]=MEDCoupling::MEDCouplingUMesh::MergeUMeshes(myMeshes); meshesCastTo[inew]->sortCellsInMEDFileFrmt()->decrRef(); } else { - ParaMEDMEM::MEDCouplingUMesh *empty=CreateEmptyMEDCouplingUMesh(); + MEDCoupling::MEDCouplingUMesh *empty=CreateEmptyMEDCouplingUMesh(); meshesCastTo[inew]=empty; } for (int iold=0; iold& meshesCastFrom, - std::vector& meshesCastTo, - std::vector& arrayFrom, +void MEDPARTITIONER::MeshCollection::castIntField(std::vector& meshesCastFrom, + std::vector& meshesCastTo, + std::vector& arrayFrom, std::string nameArrayTo) { using std::vector; @@ -648,11 +648,11 @@ void MEDPARTITIONER::MeshCollection::castIntField(std::vector99) std::cout<<"making accelerating structures"< acceleratingStructures(ioldMax); - std::vectorbbox(ioldMax); + std::vectorbbox(ioldMax); for (int iold =0; iold< ioldMax; iold++) if (isParallelMode() && _domain_selector->isMyDomain(iold)) { - ParaMEDMEM::DataArrayDouble* sourceCoords=meshesCastFrom[iold]->getBarycenterAndOwner(); + MEDCoupling::DataArrayDouble* sourceCoords=meshesCastFrom[iold]->getBarycenterAndOwner(); bbox[iold]=sourceCoords->computeBBoxPerTuple(1.e-6); acceleratingStructures[iold]=new BBTreeOfDim( sourceCoords->getNumberOfComponents(), bbox[iold]->getConstPointer(),0,0,bbox[iold]->getNumberOfTuples()); sourceCoords->decrRef(); @@ -689,7 +689,7 @@ void MEDPARTITIONER::MeshCollection::castIntField(std::vector recvIds; - ParaMEDMEM::MEDCouplingUMesh* recvMesh; + MEDCoupling::MEDCouplingUMesh* recvMesh; _domain_selector->recvMesh(recvMesh,_domain_selector->getProcessorID(iold)); //receive vector if (MyGlobals::_Verbose>400) std::cout<<"proc "<<_domain_selector->rank()<<" : castIntField recIntVec "<getConstPointer(); int targetSize=targetMesh.getNumberOfCells(); int sourceSize=sourceMesh.getNumberOfCells(); @@ -741,7 +741,7 @@ void MEDPARTITIONER::MeshCollection::remapIntField(int inew, int iold, const BBTreeOfDim* tree; bool cleantree=false; - ParaMEDMEM::DataArrayDouble* sourceBBox=0; + MEDCoupling::DataArrayDouble* sourceBBox=0; int dim = targetCoords->getNumberOfComponents(); if (myTree==0) { @@ -755,7 +755,7 @@ void MEDPARTITIONER::MeshCollection::remapIntField(int inew, int iold, { if (MyGlobals::_Is0verbose>100) std::cout << "create " << cle << " size " << targetSize << std::endl; - ParaMEDMEM::DataArrayInt* p=ParaMEDMEM::DataArrayInt::New(); + MEDCoupling::DataArrayInt* p=MEDCoupling::DataArrayInt::New(); p->alloc(targetSize,1); p->fillWithZero(); toArray=p->getPointer(); @@ -830,7 +830,7 @@ void MEDPARTITIONER::MeshCollection::castAllFields(MeshCollection& initialCollec if (isParallelMode() && _domain_selector->isMyDomain(iold) && !_domain_selector->isMyDomain(inew)) { int target=_domain_selector->getProcessorID(inew); - ParaMEDMEM::DataArrayDouble* field=initialCollection.getField(descriptionField,iold); + MEDCoupling::DataArrayDouble* field=initialCollection.getField(descriptionField,iold); if (MyGlobals::_Verbose>10) std::cout << "proc " << _domain_selector->rank() << " : castAllFields sendDouble" << std::endl; SendDataArrayDouble(field, target); @@ -842,7 +842,7 @@ void MEDPARTITIONER::MeshCollection::castAllFields(MeshCollection& initialCollec //receive vector if (MyGlobals::_Verbose>10) std::cout << "proc " << _domain_selector->rank() << " : castAllFields recvDouble" << std::endl; - ParaMEDMEM::DataArrayDouble* field=RecvDataArrayDouble(source); + MEDCoupling::DataArrayDouble* field=RecvDataArrayDouble(source); remapDoubleField(inew,iold,field,nameArrayTo,descriptionField); } } @@ -854,7 +854,7 @@ void MEDPARTITIONER::MeshCollection::castAllFields(MeshCollection& initialCollec for (int iold=0; ioldisMyDomain(iold) && _domain_selector->isMyDomain(inew))) { - ParaMEDMEM::DataArrayDouble* field=initialCollection.getField(descriptionField,iold); + MEDCoupling::DataArrayDouble* field=initialCollection.getField(descriptionField,iold); remapDoubleField(inew,iold,field,nameArrayTo,descriptionField); } } @@ -862,7 +862,7 @@ void MEDPARTITIONER::MeshCollection::castAllFields(MeshCollection& initialCollec } void MEDPARTITIONER::MeshCollection::remapDoubleField(int inew, int iold, - ParaMEDMEM::DataArrayDouble* fromArray, + MEDCoupling::DataArrayDouble* fromArray, std::string nameArrayTo, std::string descriptionField) //here we use 'cellFamily_ccI inew iold' set in remapIntField @@ -871,7 +871,7 @@ void MEDPARTITIONER::MeshCollection::remapDoubleField(int inew, int iold, throw INTERP_KERNEL::Exception("Error remapDoubleField only on cellFieldDouble"); std::string key=Cle2ToStr("cellFamily_ccI",inew,iold); - std::map::iterator it1; + std::map::iterator it1; it1=_map_dataarray_int.find(key); if (it1==_map_dataarray_int.end()) { @@ -880,7 +880,7 @@ void MEDPARTITIONER::MeshCollection::remapDoubleField(int inew, int iold, return; } //create ccI in remapIntField - ParaMEDMEM::DataArrayInt *ccI=it1->second; + MEDCoupling::DataArrayInt *ccI=it1->second; if (MyGlobals::_Verbose>300) std::cout << "proc " << MyGlobals::_Rank << " : remapDoubleField " << key << " size " << ccI->getNbOfElems() << std::endl; @@ -903,14 +903,14 @@ void MEDPARTITIONER::MeshCollection::remapDoubleField(int inew, int iold, " nbComponents " << fromArray->getNumberOfComponents() << std::endl; } - ParaMEDMEM::DataArrayDouble* field=0; - std::map::iterator it2; + MEDCoupling::DataArrayDouble* field=0; + std::map::iterator it2; it2=_map_dataarray_double.find(key); if (it2==_map_dataarray_double.end()) { if (MyGlobals::_Verbose>300) std::cout << "proc "<< MyGlobals::_Rank << " : remapDoubleField key '" << key << "' not found and create it" << std::endl; - field=ParaMEDMEM::DataArrayDouble::New(); + field=MEDCoupling::DataArrayDouble::New(); _map_dataarray_double[key]=field; field->alloc(nbcell*nbPtGauss,nbcomp); field->fillWithZero(); @@ -953,7 +953,7 @@ void MEDPARTITIONER::MeshCollection::remapDoubleField(int inew, int iold, namespace { - using namespace ParaMEDMEM; + using namespace MEDCoupling; //================================================================================ /*! * \brief Sort correspondence ids of one domain and permute ids of the other accordingly @@ -1029,7 +1029,7 @@ namespace //================================================================================ void MEDPARTITIONER::MeshCollection::buildConnectZones( const NodeMapping& nodeMapping, - const std::vector & o2nRenumber, + const std::vector & o2nRenumber, int nbInitialDomains) { if ( !MyGlobals::_Create_Joints || _topology->nbDomain() < 2 ) @@ -1137,11 +1137,11 @@ void MEDPARTITIONER::MeshCollection::buildConnectZones( const NodeMapping& nodeM cz->getLocalDomainNumber () > (int)_mesh.size() || cz->getDistantDomainNumber() > (int)_mesh.size() ) continue; - ParaMEDMEM::MEDCouplingUMesh* mesh1 = _mesh[ cz->getLocalDomainNumber () ]; - ParaMEDMEM::MEDCouplingUMesh* mesh2 = _mesh[ cz->getDistantDomainNumber() ]; + MEDCoupling::MEDCouplingUMesh* mesh1 = _mesh[ cz->getLocalDomainNumber () ]; + MEDCoupling::MEDCouplingUMesh* mesh2 = _mesh[ cz->getDistantDomainNumber() ]; // separate ids of two domains - const ParaMEDMEM::MEDCouplingSkyLineArray *corrArray = cz->getEntityCorresp( 0, 0 ); + const MEDCoupling::MEDCouplingSkyLineArray *corrArray = cz->getEntityCorresp( 0, 0 ); const DataArrayInt* ids12 = corrArray->getValueArray(); MEDCouplingAutoRefCountObjectPtr ids1, ids2, ids12Sorted; ids1 = ids12->selectByTupleId2( 0, corrArray->getLength(), 2 ); @@ -1251,7 +1251,7 @@ void MEDPARTITIONER::MeshCollection::buildConnectZones( const NodeMapping& nodeM cz21 = czVec[j]; // separate ids of two domains - const ParaMEDMEM::MEDCouplingSkyLineArray *corrArray = cz->getNodeCorresp(); + const MEDCoupling::MEDCouplingSkyLineArray *corrArray = cz->getNodeCorresp(); const DataArrayInt *ids12 = corrArray->getValueArray(); MEDCouplingAutoRefCountObjectPtr ids1, ids2, ids12Sorted; ids1 = ids12->selectByTupleId2( 0, corrArray->getLength(), 2 ); @@ -1283,9 +1283,9 @@ void MEDPARTITIONER::MeshCollection::buildBoundaryFaces() if ( getMeshDimension() < 2 ) return; - using ParaMEDMEM::MEDCouplingUMesh; - using ParaMEDMEM::DataArrayDouble; - using ParaMEDMEM::DataArrayInt; + using MEDCoupling::MEDCouplingUMesh; + using MEDCoupling::DataArrayDouble; + using MEDCoupling::DataArrayInt; std::vector& faceMeshes = getFaceMesh(); int nbMeshes = faceMeshes.size(); @@ -1445,7 +1445,7 @@ void MEDPARTITIONER::MeshCollection::createJointGroup( const std::vector< int >& { if ( totalNbFaces > 0 ) { - ParaMEDMEM::DataArrayInt* p=ParaMEDMEM::DataArrayInt::New(); + MEDCoupling::DataArrayInt* p=MEDCoupling::DataArrayInt::New(); p->alloc( totalNbFaces, 1 ); p->fillWithZero(); famIDs = p->getPointer(); @@ -1748,11 +1748,11 @@ MEDPARTITIONER::MeshCollection::~MeshCollection() if (_face_family_ids[i]!=0) _face_family_ids[i]->decrRef(); - for (std::map::iterator it=_map_dataarray_int.begin() ; it!=_map_dataarray_int.end(); it++ ) + for (std::map::iterator it=_map_dataarray_int.begin() ; it!=_map_dataarray_int.end(); it++ ) if ((*it).second!=0) (*it).second->decrRef(); - for (std::map::iterator it=_map_dataarray_double.begin() ; it!=_map_dataarray_double.end(); it++ ) + for (std::map::iterator it=_map_dataarray_double.begin() ; it!=_map_dataarray_double.end(); it++ ) if ((*it).second!=0) (*it).second->decrRef(); @@ -1850,22 +1850,22 @@ int MEDPARTITIONER::MeshCollection::getNbOfLocalFaces() const return nb; } -std::vector& MEDPARTITIONER::MeshCollection::getMesh() +std::vector& MEDPARTITIONER::MeshCollection::getMesh() { return _mesh; } -std::vector& MEDPARTITIONER::MeshCollection::getFaceMesh() +std::vector& MEDPARTITIONER::MeshCollection::getFaceMesh() { return _face_mesh; } -ParaMEDMEM::MEDCouplingUMesh* MEDPARTITIONER::MeshCollection::getMesh(int idomain) const +MEDCoupling::MEDCouplingUMesh* MEDPARTITIONER::MeshCollection::getMesh(int idomain) const { return _mesh[idomain]; } -ParaMEDMEM::MEDCouplingUMesh* MEDPARTITIONER::MeshCollection::getFaceMesh(int idomain) +MEDCoupling::MEDCouplingUMesh* MEDPARTITIONER::MeshCollection::getFaceMesh(int idomain) { return _face_mesh[idomain]; } @@ -1903,7 +1903,7 @@ void MEDPARTITIONER::MeshCollection::setTopology(Topology* topo, bool takeOwnesh * \param edgeweight returns the pointer to the table that contains the edgeweights * (only used if indivisible regions are required) */ -void MEDPARTITIONER::MeshCollection::buildCellGraph(ParaMEDMEM::MEDCouplingSkyLineArray* & array, int *& edgeweights ) +void MEDPARTITIONER::MeshCollection::buildCellGraph(MEDCoupling::MEDCouplingSkyLineArray* & array, int *& edgeweights ) { using std::map; @@ -1912,7 +1912,7 @@ void MEDPARTITIONER::MeshCollection::buildCellGraph(ParaMEDMEM::MEDCouplingSkyLi using std::pair; if (_topology->nbDomain()>1) throw INTERP_KERNEL::Exception("buildCellGraph should be used for one domain only"); - const ParaMEDMEM::MEDCouplingUMesh* mesh=_mesh[0]; + const MEDCoupling::MEDCouplingUMesh* mesh=_mesh[0]; if (MyGlobals::_Verbose>50) std::cout<<"getting nodal connectivity"< value; vector index(1,0); - array=new ParaMEDMEM::MEDCouplingSkyLineArray(index,value); + array=new MEDCoupling::MEDCouplingSkyLineArray(index,value); return; } array=mesh->generateGraph(); @@ -1933,7 +1933,7 @@ void MEDPARTITIONER::MeshCollection::buildCellGraph(ParaMEDMEM::MEDCouplingSkyLi * \param edgeweight returns the pointer to the table that contains the edgeweights * (only used if indivisible regions are required) */ -void MEDPARTITIONER::MeshCollection::buildParallelCellGraph(ParaMEDMEM::MEDCouplingSkyLineArray* & array, int *& edgeweights ) +void MEDPARTITIONER::MeshCollection::buildParallelCellGraph(MEDCoupling::MEDCouplingSkyLineArray* & array, int *& edgeweights ) { using std::multimap; using std::vector; @@ -1968,8 +1968,8 @@ void MEDPARTITIONER::MeshCollection::buildParallelCellGraph(ParaMEDMEM::MEDCoupl continue; meshDim = _mesh[idomain]->getMeshDimension(); - ParaMEDMEM::DataArrayInt* index=ParaMEDMEM::DataArrayInt::New(); - ParaMEDMEM::DataArrayInt* revConn=ParaMEDMEM::DataArrayInt::New(); + MEDCoupling::DataArrayInt* index=MEDCoupling::DataArrayInt::New(); + MEDCoupling::DataArrayInt* revConn=MEDCoupling::DataArrayInt::New(); int nbNodes=_mesh[idomain]->getNumberOfNodes(); _mesh[idomain]->getReverseNodalConnectivity(revConn,index); //problem saturation over 1 000 000 nodes for 1 proc @@ -2101,7 +2101,7 @@ void MEDPARTITIONER::MeshCollection::buildParallelCellGraph(ParaMEDMEM::MEDCoupl } } - array=new ParaMEDMEM::MEDCouplingSkyLineArray(index,value); + array=new MEDCoupling::MEDCouplingSkyLineArray(index,value); if (MyGlobals::_Verbose>100) { @@ -2140,7 +2140,7 @@ MEDPARTITIONER::Topology* MEDPARTITIONER::MeshCollection::createPartition(int nb if (nbdomain <1) throw INTERP_KERNEL::Exception("Number of subdomains must be > 0"); - ParaMEDMEM::MEDCouplingSkyLineArray* array=0; + MEDCoupling::MEDCouplingSkyLineArray* array=0; int* edgeweights=0; if (_topology->nbDomain()>1 || isParallelMode()) @@ -2214,7 +2214,7 @@ MEDPARTITIONER::Topology* MEDPARTITIONER::MeshCollection::createPartition(int nb */ MEDPARTITIONER::Topology* MEDPARTITIONER::MeshCollection::createPartition(const int* partition) { - ParaMEDMEM::MEDCouplingSkyLineArray* array=0; + MEDCoupling::MEDCouplingSkyLineArray* array=0; int* edgeweights=0; if ( _topology->nbDomain()>1) @@ -2250,7 +2250,7 @@ void MEDPARTITIONER::MeshCollection::setDomainNames(const std::string& name) } } -ParaMEDMEM::DataArrayDouble *MEDPARTITIONER::MeshCollection::getField(std::string descriptionField, int iold) +MEDCoupling::DataArrayDouble *MEDPARTITIONER::MeshCollection::getField(std::string descriptionField, int iold) //getField look for and read it if not done, and assume decrRef() in ~MeshCollection; //something like MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(name,f1->getMesh()->getName(),0,f1->getName(),0,1); { @@ -2261,7 +2261,7 @@ ParaMEDMEM::DataArrayDouble *MEDPARTITIONER::MeshCollection::getField(std::strin { if (MyGlobals::_Verbose>300) std::cout << "proc " << rank << " : YET READ getField : " << descriptionIold << std::endl; - ParaMEDMEM::DataArrayDouble* res=_map_dataarray_double[descriptionIold]; + MEDCoupling::DataArrayDouble* res=_map_dataarray_double[descriptionIold]; return res; } if (MyGlobals::_Verbose>200) @@ -2274,10 +2274,10 @@ ParaMEDMEM::DataArrayDouble *MEDPARTITIONER::MeshCollection::getField(std::strin FieldShortDescriptionToData(descriptionIold, fieldName, typeField, entity, DT, IT); meshName=MyGlobals::_Mesh_Names[iold]; - ParaMEDMEM::MEDCouplingFieldDouble* f2=MEDLoader::ReadField((ParaMEDMEM::TypeOfField) typeField, + MEDCoupling::MEDCouplingFieldDouble* f2=MEDLoader::ReadField((MEDCoupling::TypeOfField) typeField, fileName, meshName, 0, fieldName, DT, IT); - ParaMEDMEM::DataArrayDouble* res=f2->getArray(); + MEDCoupling::DataArrayDouble* res=f2->getArray(); //to know names of components std::vector browse=BrowseFieldDouble(f2); std::string localFieldInformation=descriptionIold+SerializeFromVectorOfString(browse); @@ -2364,8 +2364,8 @@ void MEDPARTITIONER::MeshCollection::filterFaceOnCell() { if (MyGlobals::_Verbose>200) std::cout << "proc " << MyGlobals::_Rank << " : filterFaceOnCell on inewDomain " << inew << " nbOfFaces " << _face_mesh[inew]->getNumberOfCells() << std::endl; - ParaMEDMEM::MEDCouplingUMesh* mcel=_mesh[inew]; - ParaMEDMEM::MEDCouplingUMesh* mfac=_face_mesh[inew]; + MEDCoupling::MEDCouplingUMesh* mcel=_mesh[inew]; + MEDCoupling::MEDCouplingUMesh* mfac=_face_mesh[inew]; //to have cellnode=f(facenode)... inodeCell=nodeIds[inodeFace] std::vector nodeIds; @@ -2373,8 +2373,8 @@ void MEDPARTITIONER::MeshCollection::filterFaceOnCell() if (nodeIds.size()==0) continue; //one empty mesh nothing to do - ParaMEDMEM::DataArrayInt *revNodalCel=ParaMEDMEM::DataArrayInt::New(); - ParaMEDMEM::DataArrayInt *revNodalIndxCel=ParaMEDMEM::DataArrayInt::New(); + MEDCoupling::DataArrayInt *revNodalCel=MEDCoupling::DataArrayInt::New(); + MEDCoupling::DataArrayInt *revNodalIndxCel=MEDCoupling::DataArrayInt::New(); mcel->getReverseNodalConnectivity(revNodalCel,revNodalIndxCel); int *revC=revNodalCel->getPointer(); int *revIndxC=revNodalIndxCel->getPointer(); @@ -2436,7 +2436,7 @@ void MEDPARTITIONER::MeshCollection::filterFaceOnCell() if ( faceOnCell.empty() ) _face_mesh[inew] = CreateEmptyMEDCouplingUMesh(); else - _face_mesh[inew] = (ParaMEDMEM::MEDCouplingUMesh *) + _face_mesh[inew] = (MEDCoupling::MEDCouplingUMesh *) mfac->buildPartOfMySelf( &faceOnCell[0], &faceOnCell[0] + faceOnCell.size(),true); mfac->decrRef(); @@ -2444,8 +2444,8 @@ void MEDPARTITIONER::MeshCollection::filterFaceOnCell() std::string key = Cle1ToStr("faceFamily_toArray",inew); if ( getMapDataArrayInt().count( key )) { - ParaMEDMEM::DataArrayInt * & fam = getMapDataArrayInt()[ key ]; - ParaMEDMEM::DataArrayInt * famFilter = ParaMEDMEM::DataArrayInt::New(); + MEDCoupling::DataArrayInt * & fam = getMapDataArrayInt()[ key ]; + MEDCoupling::DataArrayInt * famFilter = MEDCoupling::DataArrayInt::New(); famFilter->alloc(faceOnCell.size(),1); int* pfamFilter = famFilter->getPointer(); int* pfam = fam->getPointer(); diff --git a/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.hxx b/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.hxx index 7f7ad1316..77adb0407 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.hxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MeshCollection.hxx @@ -30,7 +30,7 @@ #include "BBTree.txx" -namespace ParaMEDMEM +namespace MEDCoupling { class MEDCouplingUMesh; class DataArrayInt; @@ -73,9 +73,9 @@ namespace MEDPARTITIONER void setDriverType(MEDPARTITIONER::DriverType type) { _driver_type=type; } //creation of the cell graph - void buildCellGraph(ParaMEDMEM::MEDCouplingSkyLineArray* & array,int *& edgeweights ); + void buildCellGraph(MEDCoupling::MEDCouplingSkyLineArray* & array,int *& edgeweights ); //creation of the cell graph - void buildParallelCellGraph(ParaMEDMEM::MEDCouplingSkyLineArray* & array,int *& edgeweights ); + void buildParallelCellGraph(MEDCoupling::MEDCouplingSkyLineArray* & array,int *& edgeweights ); //creation and partition of the associated graph Topology* createPartition(int nbdomain, Graph::splitter_type type = Graph::METIS, @@ -92,24 +92,24 @@ namespace MEDPARTITIONER int getNbOfLocalFaces() const; //getting a reference to mesh vector - std::vector& getMesh(); - std::vector& getFaceMesh(); - std::vector >& getGroupMeshes(); + std::vector& getMesh(); + std::vector& getFaceMesh(); + std::vector >& getGroupMeshes(); - ParaMEDMEM::MEDCouplingUMesh* getMesh(int idomain) const; - ParaMEDMEM::MEDCouplingUMesh* getFaceMesh(int idomain); - std::vector& getGroupMeshes(int idomain); + MEDCoupling::MEDCouplingUMesh* getMesh(int idomain) const; + MEDCoupling::MEDCouplingUMesh* getFaceMesh(int idomain); + std::vector& getGroupMeshes(int idomain); - std::vector& getCellFamilyIds() { return _cell_family_ids; } - std::vector& getFaceFamilyIds() { return _face_family_ids; } + std::vector& getCellFamilyIds() { return _cell_family_ids; } + std::vector& getFaceFamilyIds() { return _face_family_ids; } - std::map& getMapDataArrayInt() { return _map_dataarray_int; } - std::map& getMapDataArrayDouble() { return _map_dataarray_double; } + std::map& getMapDataArrayInt() { return _map_dataarray_int; } + std::map& getMapDataArrayDouble() { return _map_dataarray_double; } std::map& getFamilyInfo() { return _family_info; } std::map >& getGroupInfo() { return _group_info; } - ParaMEDMEM::DataArrayDouble* getField(std::string descriptionField, int iold); + MEDCoupling::DataArrayDouble* getField(std::string descriptionField, int iold); std::vector& getFieldDescriptions() { return _field_descriptions; } void prepareFieldDescriptions(); void filterFaceOnCell(); @@ -142,7 +142,7 @@ namespace MEDPARTITIONER void castCellMeshes(MeshCollection& initialCollection, std::vector > >& new2oldIds, - std::vector & o2nRenumber); + std::vector & o2nRenumber); //creates faces on the new collection void castFaceMeshes(MeshCollection& initialCollection, @@ -151,16 +151,16 @@ namespace MEDPARTITIONER //constructing connect zones void buildConnectZones( const NodeMapping& nodeMapping, - const std::vector & o2nRenumber, + const std::vector & o2nRenumber, int nbInitialDomains ); // Find faces common with neighbor domains and put them in groups void buildBoundaryFaces(); private: - void castIntField(std::vector& meshesCastFrom, - std::vector& meshesCastTo, - std::vector& arrayFrom, + void castIntField(std::vector& meshesCastFrom, + std::vector& meshesCastTo, + std::vector& arrayFrom, std::string nameArrayTo); void castAllFields(MeshCollection& initialCollection, @@ -170,14 +170,14 @@ namespace MEDPARTITIONER void remapIntField(int inew, int iold, - const ParaMEDMEM::MEDCouplingUMesh& sourceMesh, - const ParaMEDMEM::MEDCouplingUMesh& targetMesh, + const MEDCoupling::MEDCouplingUMesh& sourceMesh, + const MEDCoupling::MEDCouplingUMesh& targetMesh, const int* fromArray, std::string nameArrayTo, const BBTreeOfDim* tree); void remapDoubleField(int inew, int iold, - ParaMEDMEM::DataArrayDouble* fromArray, + MEDCoupling::DataArrayDouble* fromArray, std::string nameArrayTo, std::string descriptionField); @@ -200,20 +200,20 @@ namespace MEDPARTITIONER ParaDomainSelector* _domain_selector; //links to meshes - std::vector _mesh; - std::vector _face_mesh; + std::vector _mesh; + std::vector _face_mesh; //index of a non empty mesh within _mesh (in parallel mode all of meshes can be empty) int _i_non_empty_mesh; //family ids storages - std::vector _cell_family_ids; - std::vector _face_family_ids; + std::vector _cell_family_ids; + std::vector _face_family_ids; //DataArrayInt* storages - std::map _map_dataarray_int; + std::map _map_dataarray_int; //DataArrayDouble* storages - std::map _map_dataarray_double; + std::map _map_dataarray_double; //fields to be partitioned std::vector _field_descriptions; diff --git a/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionDriver.cxx b/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionDriver.cxx index e7b9237ae..7f1b1fffe 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionDriver.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionDriver.cxx @@ -66,14 +66,14 @@ int MeshCollectionDriver::readSeq(const char* filename, const char* meshname) MyGlobals::_File_Names.resize(1); MyGlobals::_File_Names[0]=std::string(filename); - ParaMEDMEM::MEDFileUMesh* mfm=ParaMEDMEM::MEDFileUMesh::New(filename,meshname); + MEDCoupling::MEDFileUMesh* mfm=MEDCoupling::MEDFileUMesh::New(filename,meshname); //puts the only mesh in the mesh vector (_collection->getMesh()).push_back(mfm->getLevel0Mesh(false)); (_collection->getFaceMesh()).push_back(mfm->getLevelM1Mesh(false)); //reading family ids - ParaMEDMEM::DataArrayInt* cellIds(mfm->getFamilyFieldAtLevel(0)->deepCpy()); - ParaMEDMEM::DataArrayInt* faceIds(mfm->getFamilyFieldAtLevel(-1)->deepCpy()); + MEDCoupling::DataArrayInt* cellIds(mfm->getFamilyFieldAtLevel(0)->deepCpy()); + MEDCoupling::DataArrayInt* faceIds(mfm->getFamilyFieldAtLevel(-1)->deepCpy()); (_collection->getCellFamilyIds()).push_back(cellIds); (_collection->getFaceFamilyIds()).push_back(faceIds); @@ -91,7 +91,7 @@ int MeshCollectionDriver::readSeq(const char* filename, const char* meshname) } -void MeshCollectionDriver::readMEDFileData(const ParaMEDMEM::MEDFileData* filedata) +void MeshCollectionDriver::readMEDFileData(const MEDCoupling::MEDFileData* filedata) { const int nbDomains = filedata->getMeshes()->getNumberOfMeshes(); _collection->getMesh() .resize( nbDomains, 0 ); @@ -101,7 +101,7 @@ void MeshCollectionDriver::readMEDFileData(const ParaMEDMEM::MEDFileData* fileda for (int i=0; i(filedata->getMeshes()->getMeshAtPos(i)); + MEDCoupling::MEDFileUMesh *mfm = dynamic_cast(filedata->getMeshes()->getMeshAtPos(i)); readData(mfm,i); if ( mfm && mfm->getMeshDimension() > 0 ) _collection->setNonEmptyMesh( i ); @@ -124,25 +124,25 @@ void MeshCollectionDriver::readMEDFileData(const ParaMEDMEM::MEDFileData* fileda void MeshCollectionDriver::readFileData(std::string file,std::string meshname,int idomain) const { - ParaMEDMEM::MEDFileUMesh* mfm=ParaMEDMEM::MEDFileUMesh::New(file,meshname); + MEDCoupling::MEDFileUMesh* mfm=MEDCoupling::MEDFileUMesh::New(file,meshname); readData(mfm,idomain); mfm->decrRef(); } -void MeshCollectionDriver::readData(ParaMEDMEM::MEDFileUMesh* mfm, int idomain) const +void MeshCollectionDriver::readData(MEDCoupling::MEDFileUMesh* mfm, int idomain) const { std::vector nonEmpty=mfm->getNonEmptyLevels(); try { (_collection->getMesh())[idomain]=mfm->getLevel0Mesh(false); //reading families groups - ParaMEDMEM::DataArrayInt* cellIds(mfm->getFamilyFieldAtLevel(0)->deepCpy()); + MEDCoupling::DataArrayInt* cellIds(mfm->getFamilyFieldAtLevel(0)->deepCpy()); (_collection->getCellFamilyIds())[idomain]=cellIds; } catch(...) { (_collection->getMesh())[idomain]=CreateEmptyMEDCouplingUMesh(); // or 0 if you want tests; - ParaMEDMEM::DataArrayInt* empty=ParaMEDMEM::DataArrayInt::New(); + MEDCoupling::DataArrayInt* empty=MEDCoupling::DataArrayInt::New(); empty->alloc(0,1); (_collection->getCellFamilyIds())[idomain]=empty; std::cout<<"\nNO Level0Mesh (Cells)\n"; @@ -153,7 +153,7 @@ void MeshCollectionDriver::readData(ParaMEDMEM::MEDFileUMesh* mfm, int idomain) { (_collection->getFaceMesh())[idomain]=mfm->getLevelM1Mesh(false); //reading families groups - ParaMEDMEM::DataArrayInt* faceIds(mfm->getFamilyFieldAtLevel(-1)->deepCpy()); + MEDCoupling::DataArrayInt* faceIds(mfm->getFamilyFieldAtLevel(-1)->deepCpy()); (_collection->getFaceFamilyIds())[idomain]=faceIds; if (MyGlobals::_Verbose>10) std::cout << "proc " << MyGlobals::_Rank << " : WITH Faces\n"; @@ -166,7 +166,7 @@ void MeshCollectionDriver::readData(ParaMEDMEM::MEDFileUMesh* mfm, int idomain) catch(...) { (_collection->getFaceMesh())[idomain]=CreateEmptyMEDCouplingUMesh(); // or 0 if you want test; - ParaMEDMEM::DataArrayInt* empty=ParaMEDMEM::DataArrayInt::New(); + MEDCoupling::DataArrayInt* empty=MEDCoupling::DataArrayInt::New(); (_collection->getFaceFamilyIds())[idomain]=empty; if (MyGlobals::_Verbose>10) std::cout << "proc " << MyGlobals::_Rank << " : WITHOUT Faces\n"; @@ -192,19 +192,19 @@ void MeshCollectionDriver::readSubdomain(int idomain) MyGlobals::_Field_Descriptions.push_back(SerializeFromVectorOfString(localFields)); } -ParaMEDMEM::MEDFileMesh* MeshCollectionDriver::getMesh(int idomain) const +MEDCoupling::MEDFileMesh* MeshCollectionDriver::getMesh(int idomain) const { - ParaMEDMEM::MEDFileUMesh* mfm = ParaMEDMEM::MEDFileUMesh::New(); + MEDCoupling::MEDFileUMesh* mfm = MEDCoupling::MEDFileUMesh::New(); - ParaMEDMEM::MEDCouplingUMesh* cellMesh=_collection->getMesh(idomain); - ParaMEDMEM::MEDCouplingUMesh* faceMesh=_collection->getFaceMesh(idomain); + MEDCoupling::MEDCouplingUMesh* cellMesh=_collection->getMesh(idomain); + MEDCoupling::MEDCouplingUMesh* faceMesh=_collection->getFaceMesh(idomain); // std::string cleFilter=Cle1ToStr("filterFaceOnCell",idomain); - // ParaMEDMEM::DataArrayInt* filter=0; + // MEDCoupling::DataArrayInt* filter=0; // if (_collection->getMapDataArrayInt().find(cleFilter)!=_collection->getMapDataArrayInt().end()) // { // filter=_collection->getMapDataArrayInt().find(cleFilter)->second; // int* index=filter->getPointer(); - // faceMeshFilter=(ParaMEDMEM::MEDCouplingUMesh *) faceMesh->buildPartOfMySelf(index,index+filter->getNbOfElems(),true); + // faceMeshFilter=(MEDCoupling::MEDCouplingUMesh *) faceMesh->buildPartOfMySelf(index,index+filter->getNbOfElems(),true); // faceMesh=faceMeshFilter; // } // if (faceMeshFilter!=0) @@ -233,12 +233,12 @@ ParaMEDMEM::MEDFileMesh* MeshCollectionDriver::getMesh(int idomain) const mfm->setMeshAtLevel( -1, faceMesh ); } - // ParaMEDMEM::MEDCouplingUMesh* boundaryMesh=0; + // MEDCoupling::MEDCouplingUMesh* boundaryMesh=0; // if (MyGlobals::_Creates_Boundary_Faces>0) // { // //try to write Boundary meshes // bool keepCoords=false; //TODO or true - // boundaryMesh=(ParaMEDMEM::MEDCouplingUMesh *) cellMesh->buildBoundaryMesh(keepCoords); + // boundaryMesh=(MEDCoupling::MEDCouplingUMesh *) cellMesh->buildBoundaryMesh(keepCoords); // boundaryMesh->setName("boundaryMesh"); // if (boundaryMesh!=0) // { @@ -258,13 +258,13 @@ ParaMEDMEM::MEDFileMesh* MeshCollectionDriver::getMesh(int idomain) const // add joints - using ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr; - using ParaMEDMEM::MEDCouplingSkyLineArray; - using ParaMEDMEM::MEDFileJoint; - using ParaMEDMEM::MEDFileJointCorrespondence; - using ParaMEDMEM::MEDFileJointOneStep; - using ParaMEDMEM::MEDFileJoints; - using ParaMEDMEM::MEDFileJoints; + using MEDCoupling::MEDCouplingAutoRefCountObjectPtr; + using MEDCoupling::MEDCouplingSkyLineArray; + using MEDCoupling::MEDFileJoint; + using MEDCoupling::MEDFileJointCorrespondence; + using MEDCoupling::MEDFileJointOneStep; + using MEDCoupling::MEDFileJoints; + using MEDCoupling::MEDFileJoints; if ( _collection->getCZ().size() > 0 ) { @@ -326,7 +326,7 @@ ParaMEDMEM::MEDFileMesh* MeshCollectionDriver::getMesh(int idomain) const return mfm; } -ParaMEDMEM::MEDCouplingFieldDouble* MeshCollectionDriver::getField(std::string key, std::string description, ParaMEDMEM::DataArrayDouble* data, ParaMEDMEM::MEDFileMesh* mfm, int idomain) const +MEDCoupling::MEDCouplingFieldDouble* MeshCollectionDriver::getField(std::string key, std::string description, MEDCoupling::DataArrayDouble* data, MEDCoupling::MEDFileMesh* mfm, int idomain) const { std::string desc=description; if (MyGlobals::_Verbose>20) @@ -337,7 +337,7 @@ ParaMEDMEM::MEDCouplingFieldDouble* MeshCollectionDriver::getField(std::string k double time=StrToDouble(ExtractFromDescription(desc, "time=")); int typeData=StrToInt(ExtractFromDescription(desc, "typeData=")); std::string entityName=ExtractFromDescription(desc, "entityName="); - ParaMEDMEM::MEDCouplingFieldDouble* field=0; + MEDCoupling::MEDCouplingFieldDouble* field=0; if (typeData!=6) { std::cout << "WARNING : writeMedFile : typeData " << typeData << " not implemented for fields\n"; @@ -345,12 +345,12 @@ ParaMEDMEM::MEDCouplingFieldDouble* MeshCollectionDriver::getField(std::string k if (entityName=="MED_CELL") { //there is a field of idomain to write - field=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS,ParaMEDMEM::ONE_TIME); + field=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS,MEDCoupling::ONE_TIME); } if (entityName=="MED_NODE_ELEMENT") { //there is a field of idomain to write - field=ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_GAUSS_NE,ParaMEDMEM::ONE_TIME); + field=MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_GAUSS_NE,MEDCoupling::ONE_TIME); } if (!field) { @@ -360,7 +360,7 @@ ParaMEDMEM::MEDCouplingFieldDouble* MeshCollectionDriver::getField(std::string k { field->setName(fieldName); field->setMesh(mfm->getMeshAtLevel(0)); - ParaMEDMEM::DataArrayDouble *da=data; + MEDCoupling::DataArrayDouble *da=data; //get information for components etc.. std::vector r1; r1=SelectTagsInVectorOfString(MyGlobals::_General_Informations,"fieldName="+fieldName); @@ -387,18 +387,18 @@ ParaMEDMEM::MEDCouplingFieldDouble* MeshCollectionDriver::getField(std::string k void MeshCollectionDriver::writeMedFile(int idomain, const std::string& distfilename) const { - ParaMEDMEM::MEDFileMesh* mfm = getMesh( idomain ); + MEDCoupling::MEDFileMesh* mfm = getMesh( idomain ); mfm->write(distfilename,2); std::string key="/inewFieldDouble="+IntToStr(idomain)+"/"; - std::map::iterator it; + std::map::iterator it; int nbfFieldFound=0; for (it=_collection->getMapDataArrayDouble().begin() ; it!=_collection->getMapDataArrayDouble().end(); it++) { size_t found=(*it).first.find(key); if (found==std::string::npos) continue; - ParaMEDMEM::MEDCouplingFieldDouble* field=0; + MEDCoupling::MEDCouplingFieldDouble* field=0; field = getField(key, (*it).first, (*it).second, mfm, idomain); nbfFieldFound++; try @@ -420,31 +420,31 @@ void MeshCollectionDriver::writeMedFile(int idomain, const std::string& distfile mfm->decrRef(); } -ParaMEDMEM::MEDFileData* MeshCollectionDriver::getMEDFileData() +MEDCoupling::MEDFileData* MeshCollectionDriver::getMEDFileData() { - ParaMEDMEM::MEDFileData* newdata = ParaMEDMEM::MEDFileData::New(); + MEDCoupling::MEDFileData* newdata = MEDCoupling::MEDFileData::New(); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr meshes; - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr fields; - meshes = ParaMEDMEM::MEDFileMeshes::New(); - fields = ParaMEDMEM::MEDFileFields::New(); + MEDCoupling::MEDCouplingAutoRefCountObjectPtr meshes; + MEDCoupling::MEDCouplingAutoRefCountObjectPtr fields; + meshes = MEDCoupling::MEDFileMeshes::New(); + fields = MEDCoupling::MEDFileFields::New(); for (size_t i=0; i<_collection->getMesh().size(); i++) { - ParaMEDMEM::MEDFileMesh* mfm = getMesh( i ); + MEDCoupling::MEDFileMesh* mfm = getMesh( i ); meshes->pushMesh(mfm); std::string key="/inewFieldDouble="+IntToStr(i)+"/"; - std::map::iterator it; - ParaMEDMEM::MEDFileFieldMultiTS* fieldsMTS = ParaMEDMEM::MEDFileFieldMultiTS::New(); + std::map::iterator it; + MEDCoupling::MEDFileFieldMultiTS* fieldsMTS = MEDCoupling::MEDFileFieldMultiTS::New(); for (it=_collection->getMapDataArrayDouble().begin() ; it!=_collection->getMapDataArrayDouble().end(); it++) { size_t found=(*it).first.find(key); if (found==std::string::npos) continue; - ParaMEDMEM::MEDCouplingFieldDouble* field=0; + MEDCoupling::MEDCouplingFieldDouble* field=0; field=getField(key, (*it).first, (*it).second, mfm, i); - ParaMEDMEM::MEDFileField1TS* f1ts = ParaMEDMEM::MEDFileField1TS::New(); + MEDCoupling::MEDFileField1TS* f1ts = MEDCoupling::MEDFileField1TS::New(); f1ts->setFieldNoProfileSBT(field); fieldsMTS->pushBackTimeStep(f1ts); diff --git a/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionDriver.hxx b/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionDriver.hxx index c378a3408..83d34f448 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionDriver.hxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionDriver.hxx @@ -25,7 +25,7 @@ #include #include -namespace ParaMEDMEM +namespace MEDCoupling { class DataArrayDouble; class MEDCouplingFieldDouble; @@ -46,15 +46,15 @@ namespace MEDPARTITIONER virtual ~MeshCollectionDriver() { } virtual int read(const char*, ParaDomainSelector* sel=0) = 0; int readSeq(const char*,const char*); - ParaMEDMEM::MEDFileData *getMEDFileData(); + MEDCoupling::MEDFileData *getMEDFileData(); virtual void write(const char*, ParaDomainSelector* sel=0) const = 0; - void readMEDFileData(const ParaMEDMEM::MEDFileData* filedata); + void readMEDFileData(const MEDCoupling::MEDFileData* filedata); protected: void readSubdomain(int idomain); - void readData(ParaMEDMEM::MEDFileUMesh* mfm, int idomain) const; + void readData(MEDCoupling::MEDFileUMesh* mfm, int idomain) const; void readFileData(std::string file,std::string meshname,int idomain) const; - ParaMEDMEM::MEDFileMesh* getMesh(int idomain) const; - ParaMEDMEM::MEDCouplingFieldDouble* getField(std::string key, std::string description, ParaMEDMEM::DataArrayDouble* data, ParaMEDMEM::MEDFileMesh* mfm, int idomain) const; + MEDCoupling::MEDFileMesh* getMesh(int idomain) const; + MEDCoupling::MEDCouplingFieldDouble* getField(std::string key, std::string description, MEDCoupling::DataArrayDouble* data, MEDCoupling::MEDFileMesh* mfm, int idomain) const; void writeMedFile(int idomain, const std::string& distfilename) const; protected: MeshCollection* _collection; diff --git a/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx b/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx index 4eb8360cb..48144dc76 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx @@ -52,7 +52,7 @@ MeshCollectionMedAsciiDriver::MeshCollectionMedAsciiDriver(MeshCollection* colle *\param filename ascii file containing the list of MED v2.3 files * */ -int MeshCollectionMedAsciiDriver::read(ParaMEDMEM::MEDFileData* filedata) +int MeshCollectionMedAsciiDriver::read(MEDCoupling::MEDFileData* filedata) { readMEDFileData(filedata); diff --git a/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedAsciiDriver.hxx b/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedAsciiDriver.hxx index 2a22d9446..a013128c1 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedAsciiDriver.hxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionMedAsciiDriver.hxx @@ -32,7 +32,7 @@ namespace MEDPARTITIONER MeshCollectionMedAsciiDriver(MeshCollection*); virtual ~MeshCollectionMedAsciiDriver() { } int read(const char*, ParaDomainSelector* sel=0); - int read(ParaMEDMEM::MEDFileData*); + int read(MEDCoupling::MEDFileData*); void write(const char*, ParaDomainSelector* sel=0) const; private: std::string _master_filename; diff --git a/src/MEDPartitioner/MEDPARTITIONER_MetisGraph.cxx b/src/MEDPartitioner/MEDPARTITIONER_MetisGraph.cxx index 7e3533815..56bd6b32a 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MetisGraph.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MetisGraph.cxx @@ -37,7 +37,7 @@ METISGraph::METISGraph():Graph() { } -METISGraph::METISGraph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, int* edgeweight) +METISGraph::METISGraph(MEDCoupling::MEDCouplingSkyLineArray* graph, int* edgeweight) :Graph(graph,edgeweight) { } @@ -113,7 +113,7 @@ void METISGraph::partGraph(int ndomain, //creating a skylinearray with no copy of the index and partition array //the fifth argument true specifies that only the pointers are passed //to the object - _partition = new ParaMEDMEM::MEDCouplingSkyLineArray(index,value); + _partition = new MEDCoupling::MEDCouplingSkyLineArray(index,value); #endif } diff --git a/src/MEDPartitioner/MEDPARTITIONER_MetisGraph.hxx b/src/MEDPartitioner/MEDPARTITIONER_MetisGraph.hxx index 5954f9e4d..14c2210a0 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MetisGraph.hxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MetisGraph.hxx @@ -31,7 +31,7 @@ namespace MEDPARTITIONER { public: METISGraph(); - METISGraph(ParaMEDMEM::MEDCouplingSkyLineArray*, int *edgeweight=0); + METISGraph(MEDCoupling::MEDCouplingSkyLineArray*, int *edgeweight=0); virtual ~METISGraph(); void partGraph(int ndomain, const std::string& options_string="", ParaDomainSelector *sel=0); }; diff --git a/src/MEDPartitioner/MEDPARTITIONER_ParMetisGraph.cxx b/src/MEDPartitioner/MEDPARTITIONER_ParMetisGraph.cxx index 4c424f09f..7b9b456b0 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ParMetisGraph.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ParMetisGraph.cxx @@ -39,7 +39,7 @@ ParMETISGraph::ParMETISGraph():Graph() { } -ParMETISGraph::ParMETISGraph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, int* edgeweight) +ParMETISGraph::ParMETISGraph(MEDCoupling::MEDCouplingSkyLineArray* graph, int* edgeweight) :Graph(graph,edgeweight) { } @@ -137,7 +137,7 @@ void ParMETISGraph::partGraph(int ndomain, //the fifth argument true specifies that only the pointers are passed //to the object - _partition = new ParaMEDMEM::MEDCouplingSkyLineArray(index,value); + _partition = new MEDCoupling::MEDCouplingSkyLineArray(index,value); #endif } diff --git a/src/MEDPartitioner/MEDPARTITIONER_ParMetisGraph.hxx b/src/MEDPartitioner/MEDPARTITIONER_ParMetisGraph.hxx index 2d61cec26..7baf14cd9 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ParMetisGraph.hxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ParMetisGraph.hxx @@ -31,7 +31,7 @@ namespace MEDPARTITIONER { public: ParMETISGraph(); - ParMETISGraph(ParaMEDMEM::MEDCouplingSkyLineArray*, int *edgeweight=0); + ParMETISGraph(MEDCoupling::MEDCouplingSkyLineArray*, int *edgeweight=0); virtual ~ParMETISGraph(); void partGraph(int ndomain, const std::string& options_string="", ParaDomainSelector *sel=0); }; diff --git a/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.cxx b/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.cxx index 7658b72f7..492af222f 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.cxx @@ -133,7 +133,7 @@ int MEDPARTITIONER::ParaDomainSelector::getProcessorID(int domainIndex) const * 1) for MED_CELL to know global id shift for domains at graph construction; * 2) for sub-entity to know total nb of sub-entities before creating those of joints */ -void MEDPARTITIONER::ParaDomainSelector::gatherNbOf(const std::vector& domain_meshes) +void MEDPARTITIONER::ParaDomainSelector::gatherNbOf(const std::vector& domain_meshes) { evaluateMemory(); // get nb of elems of each domain mesh @@ -530,7 +530,7 @@ double MEDPARTITIONER::ParaDomainSelector::getPassedTime() const \param target processor id of the target */ -void MEDPARTITIONER::ParaDomainSelector::sendMesh(const ParaMEDMEM::MEDCouplingUMesh& mesh, int target) const +void MEDPARTITIONER::ParaDomainSelector::sendMesh(const MEDCoupling::MEDCouplingUMesh& mesh, int target) const { #ifndef HAVE_MPI throw INTERP_KERNEL::Exception("ParaDomainSelector::sendMesh : incoherent call in non_MPI mode"); @@ -552,8 +552,8 @@ void MEDPARTITIONER::ParaDomainSelector::sendMesh(const ParaMEDMEM::MEDCouplingU if (mesh.getNumberOfCells()>0) //no sends if empty { - ParaMEDMEM::DataArrayInt *v1Local=0; - ParaMEDMEM::DataArrayDouble *v2Local=0; + MEDCoupling::DataArrayInt *v1Local=0; + MEDCoupling::DataArrayDouble *v2Local=0; //serialization of local mesh to send data to distant proc. mesh.serialize(v1Local,v2Local); int nbLocalElems=0; @@ -583,7 +583,7 @@ void MEDPARTITIONER::ParaDomainSelector::sendMesh(const ParaMEDMEM::MEDCouplingU \param mesh pointer to mesh that is filled \param source processor id of the incoming messages */ -void MEDPARTITIONER::ParaDomainSelector::recvMesh(ParaMEDMEM::MEDCouplingUMesh*& mesh, int source)const +void MEDPARTITIONER::ParaDomainSelector::recvMesh(MEDCoupling::MEDCouplingUMesh*& mesh, int source)const { #ifndef HAVE_MPI throw INTERP_KERNEL::Exception("ParaDomainSelector::recvMesh : incoherent call in non_MPI mode"); @@ -606,14 +606,14 @@ void MEDPARTITIONER::ParaDomainSelector::recvMesh(ParaMEDMEM::MEDCouplingUMesh*& int NumberOfCells=tinyInfoDistant[tinyVecSize-1]; if (NumberOfCells>0) { - ParaMEDMEM::DataArrayInt *v1Distant=ParaMEDMEM::DataArrayInt::New(); - ParaMEDMEM::DataArrayDouble *v2Distant=ParaMEDMEM::DataArrayDouble::New(); + MEDCoupling::DataArrayInt *v1Distant=MEDCoupling::DataArrayInt::New(); + MEDCoupling::DataArrayDouble *v2Distant=MEDCoupling::DataArrayDouble::New(); //Building the right instance of copy of distant mesh. - ParaMEDMEM::MEDCouplingPointSet *distant_mesh_tmp= - ParaMEDMEM::MEDCouplingPointSet::BuildInstanceFromMeshType( - (ParaMEDMEM::MEDCouplingMeshType) tinyInfoDistant[0]); + MEDCoupling::MEDCouplingPointSet *distant_mesh_tmp= + MEDCoupling::MEDCouplingPointSet::BuildInstanceFromMeshType( + (MEDCoupling::MEDCouplingMeshType) tinyInfoDistant[0]); std::vector unusedTinyDistantSts; - mesh=dynamic_cast (distant_mesh_tmp); + mesh=dynamic_cast (distant_mesh_tmp); mesh->resizeForUnserialization(tinyInfoDistant,v1Distant,v2Distant,unusedTinyDistantSts); int nbDistElem=0; diff --git a/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.hxx b/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.hxx index 7db3c6082..eeb6cce62 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.hxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ParaDomainSelector.hxx @@ -25,7 +25,7 @@ #include #include -namespace ParaMEDMEM +namespace MEDCoupling { class MEDCouplingUMesh; } @@ -64,7 +64,7 @@ namespace MEDPARTITIONER int getNbTotalFaces() { return _face_shift_by_domain.back(); }; //Collect nb of entities on procs - void gatherNbOf(const std::vector& domain_meshes); + void gatherNbOf(const std::vector& domain_meshes); //distribution of the graph vertices among the processors int* getProcVtxdist() const; @@ -97,8 +97,8 @@ namespace MEDPARTITIONER //Evaluate current memory usage and return the maximal one in KB int evaluateMemory() const; - void sendMesh(const ParaMEDMEM::MEDCouplingUMesh& mesh, int target) const; - void recvMesh(ParaMEDMEM::MEDCouplingUMesh*& mesh, int source) const; + void sendMesh(const MEDCoupling::MEDCouplingUMesh& mesh, int target) const; + void recvMesh(MEDCoupling::MEDCouplingUMesh*& mesh, int source) const; private: int _rank; //my rank int _world_size; //nb of processors diff --git a/src/MEDPartitioner/MEDPARTITIONER_ParallelTopology.cxx b/src/MEDPartitioner/MEDPARTITIONER_ParallelTopology.cxx index b65d3fdd1..d7f5a8508 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ParallelTopology.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ParallelTopology.cxx @@ -45,7 +45,7 @@ ParallelTopology::ParallelTopology():_nb_domain(0),_mesh_dimension(0) } //constructing topology according to mesh collection without global numerotation (use setGlobalNumerotation later) -ParallelTopology::ParallelTopology(const std::vector& meshes) +ParallelTopology::ParallelTopology(const std::vector& meshes) { _nb_domain=meshes.size(); _nb_cells.resize(_nb_domain); @@ -140,7 +140,7 @@ void ParallelTopology::setGlobalNumerotationDefault(ParaDomainSelector* domainSe } //constructing topology according to mesh collection -ParallelTopology::ParallelTopology(const std::vector& meshes, +ParallelTopology::ParallelTopology(const std::vector& meshes, const std::vector& cz, std::vector& cellglobal, std::vector& nodeglobal, @@ -329,7 +329,7 @@ ParallelTopology::ParallelTopology(Graph* graph, Topology* oldTopology, int nb_d { cellCorresp[ idomain ].resize( nb_domain ); } - const ParaMEDMEM::MEDCouplingSkyLineArray* skylinegraph = graph->getGraph(); + const MEDCoupling::MEDCouplingSkyLineArray* skylinegraph = graph->getGraph(); const int* index = skylinegraph->getIndex(); const int* value = skylinegraph->getValue(); const int nbCells = skylinegraph->getNumberOf(); diff --git a/src/MEDPartitioner/MEDPARTITIONER_ParallelTopology.hxx b/src/MEDPartitioner/MEDPARTITIONER_ParallelTopology.hxx index f18723fb2..87be2d380 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ParallelTopology.hxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ParallelTopology.hxx @@ -40,8 +40,8 @@ namespace MEDPARTITIONER public: ParallelTopology(); - ParallelTopology(const std::vector&); - ParallelTopology(const std::vector&, + ParallelTopology(const std::vector&); + ParallelTopology(const std::vector&, const std::vector&, std::vector&, std::vector&, diff --git a/src/MEDPartitioner/MEDPARTITIONER_ScotchGraph.cxx b/src/MEDPartitioner/MEDPARTITIONER_ScotchGraph.cxx index 1289291e1..6ba0b79a7 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ScotchGraph.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ScotchGraph.cxx @@ -39,7 +39,7 @@ SCOTCHGraph::SCOTCHGraph():Graph() { } -SCOTCHGraph::SCOTCHGraph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, int* edgeweight):Graph(graph,edgeweight) +SCOTCHGraph::SCOTCHGraph(MEDCoupling::MEDCouplingSkyLineArray* graph, int* edgeweight):Graph(graph,edgeweight) { } @@ -112,6 +112,6 @@ void SCOTCHGraph::partGraph(int ndomain, const std::string& options_string, Para //creating a skylinearray with no copy of the index and partition array //the fifth argument true specifies that only the pointers are passed //to the object - _partition = new ParaMEDMEM::MEDCouplingSkyLineArray(index,value); + _partition = new MEDCoupling::MEDCouplingSkyLineArray(index,value); #endif } diff --git a/src/MEDPartitioner/MEDPARTITIONER_ScotchGraph.hxx b/src/MEDPartitioner/MEDPARTITIONER_ScotchGraph.hxx index 96f5854b0..6c3a0e172 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_ScotchGraph.hxx +++ b/src/MEDPartitioner/MEDPARTITIONER_ScotchGraph.hxx @@ -31,7 +31,7 @@ namespace MEDPARTITIONER { public: SCOTCHGraph(); - SCOTCHGraph(ParaMEDMEM::MEDCouplingSkyLineArray*, int* edgeweight=0); + SCOTCHGraph(MEDCoupling::MEDCouplingSkyLineArray*, int* edgeweight=0); virtual ~SCOTCHGraph(); void partGraph(int ndomain, const std::string& options_string="", ParaDomainSelector* sel=0); }; diff --git a/src/MEDPartitioner/MEDPARTITIONER_Topology.hxx b/src/MEDPartitioner/MEDPARTITIONER_Topology.hxx index 018388c62..195308f4e 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_Topology.hxx +++ b/src/MEDPartitioner/MEDPARTITIONER_Topology.hxx @@ -25,7 +25,7 @@ #include #include -namespace ParaMEDMEM +namespace MEDCoupling { class MEDCouplingUMesh; } @@ -41,7 +41,7 @@ namespace MEDPARTITIONER { public: Topology() { } - Topology(std::vector, std::vector) { } + Topology(std::vector, std::vector) { } virtual ~Topology() { } /*! converts a list of global cell numbers diff --git a/src/MEDPartitioner/MEDPARTITIONER_UserGraph.cxx b/src/MEDPartitioner/MEDPARTITIONER_UserGraph.cxx index 1d0808471..0a20b4c3d 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_UserGraph.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_UserGraph.cxx @@ -32,7 +32,7 @@ using namespace MEDPARTITIONER; * (domain numbers range from 0 to ndomain-1 * \param n number of cells in the mesh */ -UserGraph::UserGraph(ParaMEDMEM::MEDCouplingSkyLineArray *array, const int *partition, int n):Graph(array,0) +UserGraph::UserGraph(MEDCoupling::MEDCouplingSkyLineArray *array, const int *partition, int n):Graph(array,0) { std::vector index(n+1),value(n); @@ -44,7 +44,7 @@ UserGraph::UserGraph(ParaMEDMEM::MEDCouplingSkyLineArray *array, const int *part value[i]=partition[i]; } - _partition = new ParaMEDMEM::MEDCouplingSkyLineArray(index,value); + _partition = new MEDCoupling::MEDCouplingSkyLineArray(index,value); } diff --git a/src/MEDPartitioner/MEDPARTITIONER_UserGraph.hxx b/src/MEDPartitioner/MEDPARTITIONER_UserGraph.hxx index d6c5f6b5b..70ba46e59 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_UserGraph.hxx +++ b/src/MEDPartitioner/MEDPARTITIONER_UserGraph.hxx @@ -30,7 +30,7 @@ namespace MEDPARTITIONER class MEDPARTITIONER_EXPORT UserGraph : public Graph { public: - UserGraph(ParaMEDMEM::MEDCouplingSkyLineArray*, const int*, int); + UserGraph(MEDCoupling::MEDCouplingSkyLineArray*, const int*, int); virtual ~UserGraph(); void partGraph(int, const std::string& options=std::string(""), ParaDomainSelector *sel=0); }; diff --git a/src/MEDPartitioner/MEDPARTITIONER_Utils.cxx b/src/MEDPartitioner/MEDPARTITIONER_Utils.cxx index 861da009d..d1688a444 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_Utils.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_Utils.cxx @@ -506,17 +506,17 @@ void MEDPARTITIONER::FieldShortDescriptionToData(const std::string& description, IT=StrToInt(ExtractFromDescription(description,"IT=")); } -ParaMEDMEM::DataArrayInt *MEDPARTITIONER::CreateDataArrayIntFromVector(const std::vector& v) +MEDCoupling::DataArrayInt *MEDPARTITIONER::CreateDataArrayIntFromVector(const std::vector& v) { - ParaMEDMEM::DataArrayInt* p=ParaMEDMEM::DataArrayInt::New(); + MEDCoupling::DataArrayInt* p=MEDCoupling::DataArrayInt::New(); p->alloc(v.size(),1); std::copy(v.begin(),v.end(),p->getPointer()); return p; } -ParaMEDMEM::DataArrayInt *MEDPARTITIONER::CreateDataArrayIntFromVector(const std::vector& v,const int nbComponents) +MEDCoupling::DataArrayInt *MEDPARTITIONER::CreateDataArrayIntFromVector(const std::vector& v,const int nbComponents) { - ParaMEDMEM::DataArrayInt* p=ParaMEDMEM::DataArrayInt::New(); + MEDCoupling::DataArrayInt* p=MEDCoupling::DataArrayInt::New(); if (v.size()%nbComponents!=0) throw INTERP_KERNEL::Exception("Problem size modulo nbComponents != 0"); p->alloc(v.size()/nbComponents,nbComponents); @@ -524,9 +524,9 @@ ParaMEDMEM::DataArrayInt *MEDPARTITIONER::CreateDataArrayIntFromVector(const std return p; } -ParaMEDMEM::DataArrayDouble* MEDPARTITIONER::CreateDataArrayDoubleFromVector(const std::vector& v) +MEDCoupling::DataArrayDouble* MEDPARTITIONER::CreateDataArrayDoubleFromVector(const std::vector& v) { - ParaMEDMEM::DataArrayDouble* p=ParaMEDMEM::DataArrayDouble::New(); + MEDCoupling::DataArrayDouble* p=MEDCoupling::DataArrayDouble::New(); p->alloc(v.size(),1); std::copy(v.begin(),v.end(),p->getPointer()); return p; @@ -534,7 +534,7 @@ ParaMEDMEM::DataArrayDouble* MEDPARTITIONER::CreateDataArrayDoubleFromVector(con /*! */ -std::vector MEDPARTITIONER::BrowseFieldDouble(const ParaMEDMEM::MEDCouplingFieldDouble* fd) +std::vector MEDPARTITIONER::BrowseFieldDouble(const MEDCoupling::MEDCouplingFieldDouble* fd) { std::vector res; if (fd->getArray()) @@ -568,7 +568,7 @@ std::vector MEDPARTITIONER::BrowseAllFields(const std::string& myfi MEDLoader::GetAllFieldNamesOnMesh(myfile,meshNames[i]); for (std::size_t j = 0; j < fieldNames.size(); j++) { - std::vector< ParaMEDMEM::TypeOfField > typeFields= + std::vector< MEDCoupling::TypeOfField > typeFields= MEDLoader::GetTypesOfField(myfile, meshNames[i], fieldNames[j]); for (std::size_t k = 0; k < typeFields.size(); k++) { @@ -727,7 +727,7 @@ std::vector MEDPARTITIONER::GetInfosOfField(const char *fileName, c resi.push_back("fileName="); resi.back()+=fileName; resi.push_back("meshName="); resi.back()+=curMeshName; resi.push_back("fieldName="); resi.back()+=curFieldName; - resi.push_back("typeField="); resi.back()+=IntToStr((int)ParaMEDMEM::ON_NODES); + resi.push_back("typeField="); resi.back()+=IntToStr((int)MEDCoupling::ON_NODES); resi.push_back("typeData="); resi.back()+=IntToStr((int)typcha); //6 for double? resi.push_back("nbComponent="); resi.back()+=IntToStr((int)ncomp); resi.push_back("DT="); resi.back()+=IntToStr((int)numdt); @@ -757,9 +757,9 @@ std::vector MEDPARTITIONER::GetInfosOfField(const char *fileName, c nbOfVal << " profilName '" << pflname << "' profileSize " << profilesize << " nbPtGauss " << nbi << std::endl; int typeField=-1; //unknown if (enttype==MED_CELL) - typeField=ParaMEDMEM::ON_CELLS; + typeField=MEDCoupling::ON_CELLS; if (enttype==MED_NODE_ELEMENT) - typeField=ParaMEDMEM::ON_GAUSS_NE; + typeField=MEDCoupling::ON_GAUSS_NE; //if (enttype==??) typeField=ON_GAUSS_PT; std::vector resi; resi.push_back("idomain="); resi.back()+=IntToStr(idomain); @@ -813,13 +813,13 @@ std::vector MEDPARTITIONER::BrowseAllFieldsOnMesh(const std::string /*! * create empty MEDCouplingUMesh* dim 3 */ -ParaMEDMEM::MEDCouplingUMesh* MEDPARTITIONER::CreateEmptyMEDCouplingUMesh() +MEDCoupling::MEDCouplingUMesh* MEDPARTITIONER::CreateEmptyMEDCouplingUMesh() { - ParaMEDMEM::MEDCouplingUMesh* umesh=ParaMEDMEM::MEDCouplingUMesh::New(); + MEDCoupling::MEDCouplingUMesh* umesh=MEDCoupling::MEDCouplingUMesh::New(); umesh->setMeshDimension(3); umesh->allocateCells(0); umesh->finishInsertingCells(); - ParaMEDMEM::DataArrayDouble *myCoords=ParaMEDMEM::DataArrayDouble::New(); + MEDCoupling::DataArrayDouble *myCoords=MEDCoupling::DataArrayDouble::New(); myCoords->alloc(0,3); umesh->setCoords(myCoords); umesh->setName("EMPTY"); diff --git a/src/MEDPartitioner/MEDPARTITIONER_Utils.hxx b/src/MEDPartitioner/MEDPARTITIONER_Utils.hxx index 64fc0c2b9..dada7e03d 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_Utils.hxx +++ b/src/MEDPartitioner/MEDPARTITIONER_Utils.hxx @@ -77,13 +77,13 @@ namespace MEDPARTITIONER MEDPARTITIONER_EXPORT void FieldShortDescriptionToData(const std::string& description, std::string& fieldName, int& typeField, int& entity, int& DT, int& IT); - ParaMEDMEM::DataArrayInt *CreateDataArrayIntFromVector(const std::vector& v); - ParaMEDMEM::DataArrayInt *CreateDataArrayIntFromVector(const std::vector& v, const int nbComponents); - ParaMEDMEM::DataArrayDouble *CreateDataArrayDoubleFromVector(const std::vector& v); + MEDCoupling::DataArrayInt *CreateDataArrayIntFromVector(const std::vector& v); + MEDCoupling::DataArrayInt *CreateDataArrayIntFromVector(const std::vector& v, const int nbComponents); + MEDCoupling::DataArrayDouble *CreateDataArrayDoubleFromVector(const std::vector& v); - ParaMEDMEM::MEDCouplingUMesh *CreateEmptyMEDCouplingUMesh(); + MEDCoupling::MEDCouplingUMesh *CreateEmptyMEDCouplingUMesh(); - std::vector BrowseFieldDouble(const ParaMEDMEM::MEDCouplingFieldDouble* fd); + std::vector BrowseFieldDouble(const MEDCoupling::MEDCouplingFieldDouble* fd); std::vector BrowseAllFields(const std::string& myfile); std::vector BrowseAllFieldsOnMesh(const std::string& myfile, const std::string& mymesh, const int idomain); std::vector GetInfosOfField(const char *fileName, const char *meshName, const int idomain ); @@ -104,10 +104,10 @@ namespace MEDPARTITIONER std::vector* RecvIntVec(int source); void RecvIntVec(std::vector& vec, const int source); - void SendDataArrayInt(const ParaMEDMEM::DataArrayInt* da, const int target); - ParaMEDMEM::DataArrayInt *RecvDataArrayInt(const int source); - void SendDataArrayDouble(const ParaMEDMEM::DataArrayDouble* da, const int target); - ParaMEDMEM::DataArrayDouble *RecvDataArrayDouble(const int source); + void SendDataArrayInt(const MEDCoupling::DataArrayInt* da, const int target); + MEDCoupling::DataArrayInt *RecvDataArrayInt(const int source); + void SendDataArrayDouble(const MEDCoupling::DataArrayDouble* da, const int target); + MEDCoupling::DataArrayDouble *RecvDataArrayDouble(const int source); void TestVectorOfStringMpi(); void TestMapOfStringIntMpi(); diff --git a/src/MEDPartitioner/MEDPARTITIONER_UtilsPara.cxx b/src/MEDPartitioner/MEDPARTITIONER_UtilsPara.cxx index 12b5d6cf5..489fb8fb4 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_UtilsPara.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_UtilsPara.cxx @@ -217,7 +217,7 @@ void MEDPARTITIONER::RecvIntVec(std::vector& vec, const int source) \param da dataArray to be sent \param target processor id of the target */ -void MEDPARTITIONER::SendDataArrayInt(const ParaMEDMEM::DataArrayInt *da, const int target) +void MEDPARTITIONER::SendDataArrayInt(const MEDCoupling::DataArrayInt *da, const int target) { if (da==0) throw INTERP_KERNEL::Exception("Problem send DataArrayInt* NULL"); @@ -240,7 +240,7 @@ void MEDPARTITIONER::SendDataArrayInt(const ParaMEDMEM::DataArrayInt *da, const \param da dataArrayInt that is filled \param source processor id of the incoming messages */ -ParaMEDMEM::DataArrayInt *MEDPARTITIONER::RecvDataArrayInt(const int source) +MEDCoupling::DataArrayInt *MEDPARTITIONER::RecvDataArrayInt(const int source) { int tag = 111004; int size[3]; @@ -251,7 +251,7 @@ ParaMEDMEM::DataArrayInt *MEDPARTITIONER::RecvDataArrayInt(const int source) std::cout << "proc " << MyGlobals::_Rank << " : <-- RecvDataArrayInt " << size[0] << std::endl; if (size[0]!=(size[1]*size[2])) throw INTERP_KERNEL::Exception("Problem in RecvDataArrayInt incoherent sizes"); - ParaMEDMEM::DataArrayInt* da=ParaMEDMEM::DataArrayInt::New(); + MEDCoupling::DataArrayInt* da=MEDCoupling::DataArrayInt::New(); da->alloc(size[1],size[2]); int *p=da->getPointer(); MPI_Recv(const_cast(&p[0]), size[0], MPI_INT, source, tag+100, MPI_COMM_WORLD, &status); @@ -265,7 +265,7 @@ ParaMEDMEM::DataArrayInt *MEDPARTITIONER::RecvDataArrayInt(const int source) \param da dataArray to be sent \param target processor id of the target */ -void MEDPARTITIONER::SendDataArrayDouble(const ParaMEDMEM::DataArrayDouble *da, const int target) +void MEDPARTITIONER::SendDataArrayDouble(const MEDCoupling::DataArrayDouble *da, const int target) { if (da==0) throw INTERP_KERNEL::Exception("Problem send DataArrayDouble* NULL"); @@ -288,7 +288,7 @@ void MEDPARTITIONER::SendDataArrayDouble(const ParaMEDMEM::DataArrayDouble *da, \param da dataArrayDouble that is filled \param source processor id of the incoming messages */ -ParaMEDMEM::DataArrayDouble* MEDPARTITIONER::RecvDataArrayDouble(const int source) +MEDCoupling::DataArrayDouble* MEDPARTITIONER::RecvDataArrayDouble(const int source) { int tag = 111005; int size[3]; @@ -299,7 +299,7 @@ ParaMEDMEM::DataArrayDouble* MEDPARTITIONER::RecvDataArrayDouble(const int sourc std::cout << "proc " << MyGlobals::_Rank << " : <-- RecvDataArrayDouble " << size[0] << std::endl; if (size[0]!=(size[1]*size[2])) throw INTERP_KERNEL::Exception("Problem in RecvDataArrayDouble incoherent sizes"); - ParaMEDMEM::DataArrayDouble* da=ParaMEDMEM::DataArrayDouble::New(); + MEDCoupling::DataArrayDouble* da=MEDCoupling::DataArrayDouble::New(); da->alloc(size[1],size[2]); double *p=da->getPointer(); MPI_Recv(const_cast(&p[0]), size[0], MPI_DOUBLE, source, tag+100, MPI_COMM_WORLD, &status); @@ -458,8 +458,8 @@ void MEDPARTITIONER::TestDataArrayMpi() int rank=MyGlobals::_Rank; //int { - ParaMEDMEM::DataArrayInt* send=ParaMEDMEM::DataArrayInt::New(); - ParaMEDMEM::DataArrayInt* recv=0; + MEDCoupling::DataArrayInt* send=MEDCoupling::DataArrayInt::New(); + MEDCoupling::DataArrayInt* recv=0; int nbOfTuples=5; int numberOfComponents=3; send->alloc(nbOfTuples,numberOfComponents); @@ -487,8 +487,8 @@ void MEDPARTITIONER::TestDataArrayMpi() } //double { - ParaMEDMEM::DataArrayDouble* send=ParaMEDMEM::DataArrayDouble::New(); - ParaMEDMEM::DataArrayDouble* recv=0; + MEDCoupling::DataArrayDouble* send=MEDCoupling::DataArrayDouble::New(); + MEDCoupling::DataArrayDouble* recv=0; int nbOfTuples=5; int numberOfComponents=3; send->alloc(nbOfTuples,numberOfComponents); diff --git a/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx b/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx index b25af62b8..145867be8 100644 --- a/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx +++ b/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx @@ -55,7 +55,7 @@ #endif using namespace std; -using namespace ParaMEDMEM; +using namespace MEDCoupling; using namespace MEDPARTITIONER; void MEDPARTITIONERTest::setSize(int ni, int nj, int nk) @@ -160,7 +160,7 @@ void MEDPARTITIONERTest::tearDown() { } -ParaMEDMEM::MEDCouplingUMesh * MEDPARTITIONERTest::buildCUBE3DMesh() +MEDCoupling::MEDCouplingUMesh * MEDPARTITIONERTest::buildCUBE3DMesh() //only hexa8 { vector conn; @@ -238,7 +238,7 @@ ParaMEDMEM::MEDCouplingUMesh * MEDPARTITIONERTest::buildCUBE3DMesh() return mesh; } -ParaMEDMEM::MEDCouplingUMesh * MEDPARTITIONERTest::buildCARRE3DMesh() +MEDCoupling::MEDCouplingUMesh * MEDPARTITIONERTest::buildCARRE3DMesh() //only quad4 in oblique (k=j) { vector conn; @@ -306,7 +306,7 @@ ParaMEDMEM::MEDCouplingUMesh * MEDPARTITIONERTest::buildCARRE3DMesh() return mesh; } -ParaMEDMEM::MEDCouplingUMesh * MEDPARTITIONERTest::buildFACE3DMesh() +MEDCoupling::MEDCouplingUMesh * MEDPARTITIONERTest::buildFACE3DMesh() //only quad4 on a global face of the CUBE3D (k=0) { vector conn; @@ -459,7 +459,7 @@ void MEDPARTITIONERTest::createTestMeshWithoutField() } { - vector meshes; + vector meshes; MEDCouplingUMesh * mesh1 = buildCUBE3DMesh(); MEDCouplingUMesh * mesh2 = buildFACE3DMesh(); mesh1->setName("testMesh"); @@ -471,7 +471,7 @@ void MEDPARTITIONERTest::createTestMeshWithoutField() meshes.push_back(mesh2); MEDLoader::WriteUMeshes(_file_name_with_faces.c_str(), meshes, true); - ParaMEDMEM::MEDFileUMesh* mfm=ParaMEDMEM::MEDFileUMesh::New(_file_name_with_faces.c_str(), mesh1->getName().c_str()); + MEDCoupling::MEDFileUMesh* mfm=MEDCoupling::MEDFileUMesh::New(_file_name_with_faces.c_str(), mesh1->getName().c_str()); DataArrayInt* FacesFam=DataArrayInt::New(); FacesFam->alloc(mfm->getSizeAtLevel(-1),1); FacesFam->fillWithValue(-1); @@ -494,8 +494,8 @@ void MEDPARTITIONERTest::createTestMeshWithoutField() CellsFam->decrRef(); /*ce truc marche pas! - ParaMEDMEM::MEDFileUMesh* mfm=ParaMEDMEM::MEDFileUMesh::New(_file_name_with_faces.c_str(), mesh1->getName()); - vector ms; + MEDCoupling::MEDFileUMesh* mfm=MEDCoupling::MEDFileUMesh::New(_file_name_with_faces.c_str(), mesh1->getName()); + vector ms; ms.push_back(mesh2); mfm->setGroupsFromScratch(-1, ms); mfm->write(_file_name_with_faces.c_str(),0); @@ -1047,9 +1047,9 @@ void MEDPARTITIONERTest::verifyMetisOrScotchMedpartitionerOnSmallSizeForMesh(std execName=getPartitionerExe(); fileName=_file_name_with_faces; - ParaMEDMEM::MEDFileUMesh* initialMesh=ParaMEDMEM::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str()); - ParaMEDMEM::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false); - ParaMEDMEM::MEDCouplingUMesh* faceMesh=initialMesh->getLevelM1Mesh(false); + MEDCoupling::MEDFileUMesh* initialMesh=MEDCoupling::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str()); + MEDCoupling::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false); + MEDCoupling::MEDCouplingUMesh* faceMesh=initialMesh->getLevelM1Mesh(false); cmd=execName+" --ndomains=5 --split-method="+MetisOrScotch; //on same proc sourceName=fileName; @@ -1064,14 +1064,14 @@ void MEDPARTITIONERTest::verifyMetisOrScotchMedpartitionerOnSmallSizeForMesh(std MEDPARTITIONER::ParaDomainSelector parallelizer(false); MEDPARTITIONER::MeshCollection collection(input,parallelizer); CPPUNIT_ASSERT_EQUAL(3, collection.getMeshDimension()); - std::vectorcellMeshes=collection.getMesh(); + std::vectorcellMeshes=collection.getMesh(); CPPUNIT_ASSERT_EQUAL(5, (int) cellMeshes.size()); int nbcells=0; for (std::size_t i = 0; i < cellMeshes.size(); i++) nbcells+=cellMeshes[i]->getNumberOfCells(); CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), nbcells); - std::vectorfaceMeshes=collection.getFaceMesh(); + std::vectorfaceMeshes=collection.getFaceMesh(); CPPUNIT_ASSERT_EQUAL(5, (int) faceMeshes.size()); int nbfaces=0; for (std::size_t i=0; i < faceMeshes.size(); i++) @@ -1089,18 +1089,18 @@ void MEDPARTITIONERTest::verifyMetisOrScotchMedpartitionerOnSmallSizeForMesh(std CPPUNIT_ASSERT_EQUAL(0, res); string refusedName=targetName+"1.med"; - ParaMEDMEM::MEDFileUMesh* refusedMesh=ParaMEDMEM::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str()); - ParaMEDMEM::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false); - ParaMEDMEM::MEDCouplingUMesh* refusedFaceMesh=refusedMesh->getLevelM1Mesh(false); + MEDCoupling::MEDFileUMesh* refusedMesh=MEDCoupling::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str()); + MEDCoupling::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false); + MEDCoupling::MEDCouplingUMesh* refusedFaceMesh=refusedMesh->getLevelM1Mesh(false); CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), refusedCellMesh->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(faceMesh->getNumberOfCells(), refusedFaceMesh->getNumberOfCells()); /*not the good job - ParaMEDMEM::MEDCouplingMesh* mergeCell=cellMesh->mergeMyselfWith(refusedCellMesh); + MEDCoupling::MEDCouplingMesh* mergeCell=cellMesh->mergeMyselfWith(refusedCellMesh); CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), mergeCell->getNumberOfCells()); - ParaMEDMEM::MEDCouplingMesh* mergeFace=faceMesh->mergeMyselfWith(refusedFaceMesh); + MEDCoupling::MEDCouplingMesh* mergeFace=faceMesh->mergeMyselfWith(refusedFaceMesh); CPPUNIT_ASSERT_EQUAL(faceMesh->getNumberOfCells(), mergeFace->getNumberOfCells()); CPPUNIT_ASSERT(faceMesh->isEqual(refusedFaceMesh,1e-12)); @@ -1147,8 +1147,8 @@ void MEDPARTITIONERTest::verifyMetisOrScotchMedpartitionerOnSmallSizeForFieldOnC fileName=_file_name; fileName.replace(fileName.find(".med"),4,"_WithVecFieldOnCells.med"); - ParaMEDMEM::MEDFileUMesh* initialMesh=ParaMEDMEM::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str()); - ParaMEDMEM::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false); + MEDCoupling::MEDFileUMesh* initialMesh=MEDCoupling::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str()); + MEDCoupling::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false); cmd=execName+" --ndomains=5 --split-method="+MetisOrScotch; //on same proc sourceName=fileName; @@ -1171,8 +1171,8 @@ void MEDPARTITIONERTest::verifyMetisOrScotchMedpartitionerOnSmallSizeForFieldOnC CPPUNIT_ASSERT_EQUAL(0, res); string refusedName=targetName+"1.med"; - ParaMEDMEM::MEDFileUMesh* refusedMesh=ParaMEDMEM::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str()); - ParaMEDMEM::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false); + MEDCoupling::MEDFileUMesh* refusedMesh=MEDCoupling::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str()); + MEDCoupling::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false); CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), refusedCellMesh->getNumberOfCells()); @@ -1236,8 +1236,8 @@ void MEDPARTITIONERTest::verifyMetisOrScotchMedpartitionerOnSmallSizeForFieldOnG fileName=_file_name; fileName.replace(fileName.find(".med"),4,"_WithVecFieldOnGaussNe.med"); - ParaMEDMEM::MEDFileUMesh* initialMesh=ParaMEDMEM::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str()); - ParaMEDMEM::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false); + MEDCoupling::MEDFileUMesh* initialMesh=MEDCoupling::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str()); + MEDCoupling::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false); cmd=execName+" --ndomains=5 --split-method="+MetisOrScotch; //on same proc sourceName=fileName; @@ -1260,8 +1260,8 @@ void MEDPARTITIONERTest::verifyMetisOrScotchMedpartitionerOnSmallSizeForFieldOnG CPPUNIT_ASSERT_EQUAL(0, res); string refusedName=targetName+"1.med"; - ParaMEDMEM::MEDFileUMesh* refusedMesh=ParaMEDMEM::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str()); - ParaMEDMEM::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false); + MEDCoupling::MEDFileUMesh* refusedMesh=MEDCoupling::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str()); + MEDCoupling::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false); CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), refusedCellMesh->getNumberOfCells()); @@ -1450,10 +1450,10 @@ void MEDPARTITIONERTest::testCreateBoundaryFaces2D() std::map< int, int > famId2nb; // count total nb of cells in divided families std::map< int, int >::iterator id2nn; { - const std::vector& famIdsVec = new_collection.getCellFamilyIds(); + const std::vector& famIdsVec = new_collection.getCellFamilyIds(); for ( size_t i = 0; i < famIdsVec.size(); ++i ) { - ParaMEDMEM::DataArrayInt* famIdsArr = famIdsVec[i]; + MEDCoupling::DataArrayInt* famIdsArr = famIdsVec[i]; for ( int j = famIdsArr->getNbOfElems()-1; j >= 0; --j ) { id2nn = famId2nb.insert( make_pair( famIdsArr->getPointer()[j], 0 )).first; @@ -1472,10 +1472,10 @@ void MEDPARTITIONERTest::testCreateBoundaryFaces2D() // Check that "creates boundary faces option is handled" famId2nb.clear(); - const std::vector& famIdsVec = new_collection.getFaceFamilyIds(); + const std::vector& famIdsVec = new_collection.getFaceFamilyIds(); for ( size_t i = 0; i < famIdsVec.size(); ++i ) { - ParaMEDMEM::DataArrayInt* famIdsArr = famIdsVec[i]; + MEDCoupling::DataArrayInt* famIdsArr = famIdsVec[i]; for ( int j = famIdsArr->getNbOfElems()-1; j >= 0; --j ) { id2nn = famId2nb.insert( make_pair( famIdsArr->getPointer()[j], 0 )).first; diff --git a/src/MEDPartitioner/Test/MEDPARTITIONERTest.hxx b/src/MEDPartitioner/Test/MEDPARTITIONERTest.hxx index f6cd5a13b..2f6421597 100644 --- a/src/MEDPartitioner/Test/MEDPARTITIONERTest.hxx +++ b/src/MEDPartitioner/Test/MEDPARTITIONERTest.hxx @@ -93,11 +93,11 @@ public: void setbigSize(); std::string getPartitionerExe() const; std::string getPartitionerParaExe() const; - ParaMEDMEM::MEDCouplingUMesh * buildCUBE3DMesh(); - ParaMEDMEM::MEDCouplingUMesh * buildFACE3DMesh(); - ParaMEDMEM::MEDCouplingUMesh * buildCARRE3DMesh(); - ParaMEDMEM::MEDCouplingFieldDouble * buildVecFieldOnCells(std::string myfileName); - ParaMEDMEM::MEDCouplingFieldDouble * buildVecFieldOnNodes(); + MEDCoupling::MEDCouplingUMesh * buildCUBE3DMesh(); + MEDCoupling::MEDCouplingUMesh * buildFACE3DMesh(); + MEDCoupling::MEDCouplingUMesh * buildCARRE3DMesh(); + MEDCoupling::MEDCouplingFieldDouble * buildVecFieldOnCells(std::string myfileName); + MEDCoupling::MEDCouplingFieldDouble * buildVecFieldOnNodes(); void createTestMeshWithoutField(); void createTestMeshWithVecFieldOnCells(); void createTestMeshWithVecFieldOnNodes(); diff --git a/src/MEDPartitioner/Test/MEDPARTITIONERTestPara.cxx b/src/MEDPartitioner/Test/MEDPARTITIONERTestPara.cxx index 991abf0ae..e66b26c49 100644 --- a/src/MEDPartitioner/Test/MEDPARTITIONERTestPara.cxx +++ b/src/MEDPartitioner/Test/MEDPARTITIONERTestPara.cxx @@ -48,7 +48,7 @@ #include using namespace std; -using namespace ParaMEDMEM; +using namespace MEDCoupling; using namespace MEDPARTITIONER; #if defined(HAVE_MPI) @@ -77,9 +77,9 @@ void MEDPARTITIONERTest::verifyMedpartitionerOnSmallSizeForMesh() execName=getPartitionerParaExe(); fileName=_file_name_with_faces; - ParaMEDMEM::MEDFileUMesh* initialMesh=ParaMEDMEM::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str()); - ParaMEDMEM::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false); - ParaMEDMEM::MEDCouplingUMesh* faceMesh=initialMesh->getLevelM1Mesh(false); + MEDCoupling::MEDFileUMesh* initialMesh=MEDCoupling::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str()); + MEDCoupling::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false); + MEDCoupling::MEDCouplingUMesh* faceMesh=initialMesh->getLevelM1Mesh(false); cmd="mpirun -np 5 "+execName+" --ndomains=5 --split-method=metis"; //on same proc sourceName=fileName; @@ -94,14 +94,14 @@ void MEDPARTITIONERTest::verifyMedpartitionerOnSmallSizeForMesh() MEDPARTITIONER::ParaDomainSelector parallelizer(false); MEDPARTITIONER::MeshCollection collection(input,parallelizer); CPPUNIT_ASSERT_EQUAL(3, collection.getMeshDimension()); - std::vectorcellMeshes=collection.getMesh(); + std::vectorcellMeshes=collection.getMesh(); CPPUNIT_ASSERT_EQUAL(5, (int) cellMeshes.size()); int nbcells=0; for (std::size_t i = 0; i < cellMeshes.size(); i++) nbcells+=cellMeshes[i]->getNumberOfCells(); CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), nbcells); - std::vectorfaceMeshes=collection.getFaceMesh(); + std::vectorfaceMeshes=collection.getFaceMesh(); CPPUNIT_ASSERT_EQUAL(5, (int) faceMeshes.size()); int nbfaces=0; for (std::size_t i=0; i < faceMeshes.size(); i++) @@ -119,18 +119,18 @@ void MEDPARTITIONERTest::verifyMedpartitionerOnSmallSizeForMesh() CPPUNIT_ASSERT_EQUAL(0, res); string refusedName=targetName+"1.med"; - ParaMEDMEM::MEDFileUMesh* refusedMesh=ParaMEDMEM::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str()); - ParaMEDMEM::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false); - ParaMEDMEM::MEDCouplingUMesh* refusedFaceMesh=refusedMesh->getLevelM1Mesh(false); + MEDCoupling::MEDFileUMesh* refusedMesh=MEDCoupling::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str()); + MEDCoupling::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false); + MEDCoupling::MEDCouplingUMesh* refusedFaceMesh=refusedMesh->getLevelM1Mesh(false); CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), refusedCellMesh->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(faceMesh->getNumberOfCells(), refusedFaceMesh->getNumberOfCells()); /*not the good job - ParaMEDMEM::MEDCouplingMesh* mergeCell=cellMesh->mergeMyselfWith(refusedCellMesh); + MEDCoupling::MEDCouplingMesh* mergeCell=cellMesh->mergeMyselfWith(refusedCellMesh); CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), mergeCell->getNumberOfCells()); - ParaMEDMEM::MEDCouplingMesh* mergeFace=faceMesh->mergeMyselfWith(refusedFaceMesh); + MEDCoupling::MEDCouplingMesh* mergeFace=faceMesh->mergeMyselfWith(refusedFaceMesh); CPPUNIT_ASSERT_EQUAL(faceMesh->getNumberOfCells(), mergeFace->getNumberOfCells()); CPPUNIT_ASSERT(faceMesh->isEqual(refusedFaceMesh,1e-12)); @@ -175,8 +175,8 @@ void MEDPARTITIONERTest::verifyMedpartitionerOnSmallSizeForFieldOnCells() fileName=_file_name; fileName.replace(fileName.find(".med"),4,"_WithVecFieldOnCells.med"); - ParaMEDMEM::MEDFileUMesh* initialMesh=ParaMEDMEM::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str()); - ParaMEDMEM::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false); + MEDCoupling::MEDFileUMesh* initialMesh=MEDCoupling::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str()); + MEDCoupling::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false); cmd="mpirun -np 5 "+execName+" --ndomains=5 --split-method=metis"; //on same proc sourceName=fileName; @@ -199,8 +199,8 @@ void MEDPARTITIONERTest::verifyMedpartitionerOnSmallSizeForFieldOnCells() CPPUNIT_ASSERT_EQUAL(0, res); string refusedName=targetName+"1.med"; - ParaMEDMEM::MEDFileUMesh* refusedMesh=ParaMEDMEM::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str()); - ParaMEDMEM::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false); + MEDCoupling::MEDFileUMesh* refusedMesh=MEDCoupling::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str()); + MEDCoupling::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false); CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), refusedCellMesh->getNumberOfCells()); @@ -262,8 +262,8 @@ void MEDPARTITIONERTest::verifyMedpartitionerOnSmallSizeForFieldOnGaussNe() fileName=_file_name; fileName.replace(fileName.find(".med"),4,"_WithVecFieldOnGaussNe.med"); - ParaMEDMEM::MEDFileUMesh* initialMesh=ParaMEDMEM::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str()); - ParaMEDMEM::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false); + MEDCoupling::MEDFileUMesh* initialMesh=MEDCoupling::MEDFileUMesh::New(fileName.c_str(),_mesh_name.c_str()); + MEDCoupling::MEDCouplingUMesh* cellMesh=initialMesh->getLevel0Mesh(false); cmd="mpirun -np 5 "+execName+" --ndomains=5 --split-method=metis"; //on same proc sourceName=fileName; @@ -286,8 +286,8 @@ void MEDPARTITIONERTest::verifyMedpartitionerOnSmallSizeForFieldOnGaussNe() CPPUNIT_ASSERT_EQUAL(0, res); string refusedName=targetName+"1.med"; - ParaMEDMEM::MEDFileUMesh* refusedMesh=ParaMEDMEM::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str()); - ParaMEDMEM::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false); + MEDCoupling::MEDFileUMesh* refusedMesh=MEDCoupling::MEDFileUMesh::New(refusedName.c_str(),_mesh_name.c_str()); + MEDCoupling::MEDCouplingUMesh* refusedCellMesh=refusedMesh->getLevel0Mesh(false); CPPUNIT_ASSERT_EQUAL(cellMesh->getNumberOfCells(), refusedCellMesh->getNumberOfCells()); diff --git a/src/MEDPartitioner_Swig/MEDPartitionerCommon.i b/src/MEDPartitioner_Swig/MEDPartitionerCommon.i index 93a390a81..10bacf9fd 100644 --- a/src/MEDPartitioner_Swig/MEDPartitionerCommon.i +++ b/src/MEDPartitioner_Swig/MEDPartitionerCommon.i @@ -28,7 +28,7 @@ #include "MEDPARTITIONER.hxx" #include "MEDPARTITIONER_Graph.hxx" -using namespace ParaMEDMEM; +using namespace MEDCoupling; using namespace INTERP_KERNEL; using namespace MEDPARTITIONER; %} @@ -39,7 +39,7 @@ using namespace MEDPARTITIONER; %newobject MEDPARTITIONER::MEDPartitioner::New; %newobject MEDPARTITIONER::MEDPartitioner::Graph; %newobject MEDPARTITIONER::MEDPartitioner::getMEDFileData; -%feature("unref") ParaMEDMEM::MEDFileData "$this->decrRef();" +%feature("unref") MEDCoupling::MEDFileData "$this->decrRef();" %nodefaultctor; @@ -51,8 +51,8 @@ namespace MEDPARTITIONER { public: virtual void partGraph(int ndomain, const std::string& options_string="", ParaDomainSelector *sel=0) throw(INTERP_KERNEL::Exception); - const ParaMEDMEM::MEDCouplingSkyLineArray *getGraph() const; - const ParaMEDMEM::MEDCouplingSkyLineArray *getPartition() const; + const MEDCoupling::MEDCouplingSkyLineArray *getGraph() const; + const MEDCoupling::MEDCouplingSkyLineArray *getPartition() const; int nbVertices() const; }; @@ -60,10 +60,10 @@ namespace MEDPARTITIONER { public: MEDPartitioner(const std::string& filename, int ndomains=1, const std::string& library="metis",bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception); - MEDPartitioner(const ParaMEDMEM::MEDFileData* fileData, int ndomains=1, const std::string& library="metis",bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception); - MEDPartitioner(const ParaMEDMEM::MEDFileData* fileData, Graph* graph, bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception); - static MEDPARTITIONER::Graph* Graph(ParaMEDMEM::MEDCouplingSkyLineArray* graph, Graph::splitter_type split=Graph::METIS, int* edgeweight=0) throw(INTERP_KERNEL::Exception); - ParaMEDMEM::MEDFileData* getMEDFileData() throw(INTERP_KERNEL::Exception); + MEDPartitioner(const MEDCoupling::MEDFileData* fileData, int ndomains=1, const std::string& library="metis",bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception); + MEDPartitioner(const MEDCoupling::MEDFileData* fileData, Graph* graph, bool creates_boundary_faces=false, bool create_joints=false, bool mesure_memory=false) throw(INTERP_KERNEL::Exception); + static MEDPARTITIONER::Graph* Graph(MEDCoupling::MEDCouplingSkyLineArray* graph, Graph::splitter_type split=Graph::METIS, int* edgeweight=0) throw(INTERP_KERNEL::Exception); + MEDCoupling::MEDFileData* getMEDFileData() throw(INTERP_KERNEL::Exception); void write(const std::string& filename) throw(INTERP_KERNEL::Exception); }; } diff --git a/src/RENUMBER/RENUMBER_BOOSTRenumbering.cxx b/src/RENUMBER/RENUMBER_BOOSTRenumbering.cxx index 8b0f45885..99c225ec5 100644 --- a/src/RENUMBER/RENUMBER_BOOSTRenumbering.cxx +++ b/src/RENUMBER/RENUMBER_BOOSTRenumbering.cxx @@ -28,9 +28,9 @@ #include #include -void BOOSTRenumbering::renumber(const int *graph, const int *index_graph, int nbCell, ParaMEDMEM::DataArrayInt *&iperm, ParaMEDMEM::DataArrayInt *&perm) +void BOOSTRenumbering::renumber(const int *graph, const int *index_graph, int nbCell, MEDCoupling::DataArrayInt *&iperm, MEDCoupling::DataArrayInt *&perm) { - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr out0(ParaMEDMEM::DataArrayInt::New()),out1(ParaMEDMEM::DataArrayInt::New()); + MEDCoupling::MEDCouplingAutoRefCountObjectPtr out0(MEDCoupling::DataArrayInt::New()),out1(MEDCoupling::DataArrayInt::New()); out0->alloc(nbCell,1); out1->alloc(nbCell,1); out0->fillWithZero(); out1->fillWithZero(); // diff --git a/src/RENUMBER/RENUMBER_BOOSTRenumbering.hxx b/src/RENUMBER/RENUMBER_BOOSTRenumbering.hxx index 31e7d1eba..0f7614d4f 100644 --- a/src/RENUMBER/RENUMBER_BOOSTRenumbering.hxx +++ b/src/RENUMBER/RENUMBER_BOOSTRenumbering.hxx @@ -26,7 +26,7 @@ class RENUMBER_EXPORT BOOSTRenumbering:public Renumbering { public: - void renumber(const int *graph, const int *index_graph, int nbCell, ParaMEDMEM::DataArrayInt *&iperm, ParaMEDMEM::DataArrayInt *&perm); + void renumber(const int *graph, const int *index_graph, int nbCell, MEDCoupling::DataArrayInt *&iperm, MEDCoupling::DataArrayInt *&perm); }; #endif /*BOOSTRENUMBERING_HXX_*/ diff --git a/src/RENUMBER/RENUMBER_METISRenumbering.cxx b/src/RENUMBER/RENUMBER_METISRenumbering.cxx index 66820b686..065df9235 100644 --- a/src/RENUMBER/RENUMBER_METISRenumbering.cxx +++ b/src/RENUMBER/RENUMBER_METISRenumbering.cxx @@ -33,9 +33,9 @@ extern "C" #include "RENUMBER_METISRenumbering.hxx" -void METISRenumbering::renumber(const int *graph, const int *index_graph, int nbCell, ParaMEDMEM::DataArrayInt *&iperm, ParaMEDMEM::DataArrayInt *&perm) +void METISRenumbering::renumber(const int *graph, const int *index_graph, int nbCell, MEDCoupling::DataArrayInt *&iperm, MEDCoupling::DataArrayInt *&perm) { - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr out0(ParaMEDMEM::DataArrayInt::New()),out1(ParaMEDMEM::DataArrayInt::New()); + MEDCoupling::MEDCouplingAutoRefCountObjectPtr out0(MEDCoupling::DataArrayInt::New()),out1(MEDCoupling::DataArrayInt::New()); out0->alloc(nbCell,1); out1->alloc(nbCell,1); out0->fillWithZero(); out1->fillWithZero(); int num_flag=1; diff --git a/src/RENUMBER/RENUMBER_METISRenumbering.hxx b/src/RENUMBER/RENUMBER_METISRenumbering.hxx index ca20175eb..4eb5b7775 100644 --- a/src/RENUMBER/RENUMBER_METISRenumbering.hxx +++ b/src/RENUMBER/RENUMBER_METISRenumbering.hxx @@ -26,7 +26,7 @@ class RENUMBER_EXPORT METISRenumbering:public Renumbering { public: - virtual void renumber(const int *graph, const int *index_graph, int nb_cell, ParaMEDMEM::DataArrayInt *&iperm, ParaMEDMEM::DataArrayInt *&perm); + virtual void renumber(const int *graph, const int *index_graph, int nb_cell, MEDCoupling::DataArrayInt *&iperm, MEDCoupling::DataArrayInt *&perm); }; #endif /*METISRENUMBERING_HXX_*/ diff --git a/src/RENUMBER/RENUMBER_Renumbering.hxx b/src/RENUMBER/RENUMBER_Renumbering.hxx index 6c21ee45c..9df7ebe96 100644 --- a/src/RENUMBER/RENUMBER_Renumbering.hxx +++ b/src/RENUMBER/RENUMBER_Renumbering.hxx @@ -22,7 +22,7 @@ #include "RENUMBERDefines.hxx" #include -namespace ParaMEDMEM +namespace MEDCoupling { class DataArrayInt; } @@ -30,7 +30,7 @@ namespace ParaMEDMEM class RENUMBER_EXPORT Renumbering { public: - virtual void renumber(const int *graph, const int *index_graph, int nbCell, ParaMEDMEM::DataArrayInt *&iperm, ParaMEDMEM::DataArrayInt *&perm) = 0; + virtual void renumber(const int *graph, const int *index_graph, int nbCell, MEDCoupling::DataArrayInt *&iperm, MEDCoupling::DataArrayInt *&perm) = 0; virtual ~Renumbering() { } }; diff --git a/src/RENUMBER/renumbering.cxx b/src/RENUMBER/renumbering.cxx index 1fd4e3b73..4afad1524 100644 --- a/src/RENUMBER/renumbering.cxx +++ b/src/RENUMBER/renumbering.cxx @@ -32,7 +32,7 @@ #include using namespace std; -using namespace ParaMEDMEM; +using namespace MEDCoupling; using namespace MED_RENUMBER; int main(int argc, char** argv) diff --git a/src/RENUMBER_Swig/MEDRenumberCommon.i b/src/RENUMBER_Swig/MEDRenumberCommon.i index 85f5d7e7c..8a5de767d 100644 --- a/src/RENUMBER_Swig/MEDRenumberCommon.i +++ b/src/RENUMBER_Swig/MEDRenumberCommon.i @@ -31,7 +31,7 @@ #include "RenumberingFactory.hxx" #include "RENUMBER_Renumbering.hxx" -using namespace ParaMEDMEM; +using namespace MEDCoupling; using namespace INTERP_KERNEL; using namespace MED_RENUMBER; %} @@ -61,17 +61,17 @@ class Renumbering public: %extend { - virtual PyObject *renumber(const ParaMEDMEM::DataArrayInt *graph, const ParaMEDMEM::DataArrayInt *index_graph) throw(INTERP_KERNEL::Exception) + virtual PyObject *renumber(const MEDCoupling::DataArrayInt *graph, const MEDCoupling::DataArrayInt *index_graph) throw(INTERP_KERNEL::Exception) { if(!graph || !index_graph) throw INTERP_KERNEL::Exception("wrap of Renumbering::renumber : One of the input arrays is NULL !"); if(!graph->isAllocated() || !index_graph->isAllocated()) throw INTERP_KERNEL::Exception("wrap of Renumbering::renumber : One of the input arrays is not allocated !"); - ParaMEDMEM::DataArrayInt *out0(0),*out1(0); + MEDCoupling::DataArrayInt *out0(0),*out1(0); self->renumber(graph->begin(),index_graph->begin(),index_graph->getNumberOfTuples()-1,out0,out1); PyObject *ret=PyTuple_New(2); - PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(out0),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 )); - PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(out1),SWIGTYPE_p_ParaMEDMEM__DataArrayInt, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,0,SWIG_NewPointerObj(SWIG_as_voidptr(out0),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); + PyTuple_SetItem(ret,1,SWIG_NewPointerObj(SWIG_as_voidptr(out1),SWIGTYPE_p_MEDCoupling__DataArrayInt, SWIG_POINTER_OWN | 0 )); return ret; } }