X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDPartitioner%2FMEDPARTITIONER_Utils.cxx;h=51543f52f97c52ac37423abdf1a066a87f21ccac;hb=c8d33262ed6d2041da8512b02f8c8b4ffadf733d;hp=e88101649156c5d3675355b2c956c576ce2b2a0d;hpb=fb512e2b77325290aaa2b4c9fd8f22d5949b6369;p=tools%2Fmedcoupling.git diff --git a/src/MEDPartitioner/MEDPARTITIONER_Utils.cxx b/src/MEDPartitioner/MEDPARTITIONER_Utils.cxx index e88101649..51543f52f 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_Utils.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_Utils.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D +// Copyright (C) 2007-2015 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -45,6 +45,7 @@ int MEDPARTITIONER::MyGlobals::_World_Size=-1; int MEDPARTITIONER::MyGlobals::_Randomize=0; int MEDPARTITIONER::MyGlobals::_Atomize=0; int MEDPARTITIONER::MyGlobals::_Creates_Boundary_Faces=0; +int MEDPARTITIONER::MyGlobals::_Create_Joints=0; std::vector MEDPARTITIONER::MyGlobals::_File_Names; std::vector MEDPARTITIONER::MyGlobals::_Mesh_Names; std::vector MEDPARTITIONER::MyGlobals::_Field_Descriptions; @@ -505,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); @@ -523,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; @@ -533,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()) @@ -559,20 +560,20 @@ std::vector MEDPARTITIONER::BrowseFieldDouble(const ParaMEDMEM::MED std::vector MEDPARTITIONER::BrowseAllFields(const std::string& myfile) { std::vector res; - std::vector meshNames=MEDLoader::GetMeshNames(myfile); + std::vector meshNames=MEDCoupling::GetMeshNames(myfile); for (std::size_t i=0; i fieldNames= - MEDLoader::GetAllFieldNamesOnMesh(myfile,meshNames[i]); + MEDCoupling::GetAllFieldNamesOnMesh(myfile,meshNames[i]); for (std::size_t j = 0; j < fieldNames.size(); j++) { - std::vector< ParaMEDMEM::TypeOfField > typeFields= - MEDLoader::GetTypesOfField(myfile, meshNames[i], fieldNames[j]); + std::vector< MEDCoupling::TypeOfField > typeFields= + MEDCoupling::GetTypesOfField(myfile, meshNames[i], fieldNames[j]); for (std::size_t k = 0; k < typeFields.size(); k++) { std::vector< std::pair< int, int > > its= - MEDLoader::GetFieldIterations(typeFields[k], myfile, meshNames[i], fieldNames[j]); + GetFieldIterations(typeFields[k], myfile, meshNames[i], fieldNames[j]); if (MyGlobals::_Is0verbose>100) std::cout<< "fieldName " << fieldNames[j] << " typeField " << typeFields[k] << " its.size() " << its.size() << std::endl; for (std::size_t m = 0; m < its.size(); m++) @@ -726,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); @@ -756,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); @@ -812,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");