From: Anthony Geay Date: Tue, 5 Jan 2016 07:45:41 +0000 (+0100) Subject: API modification (simplification) : MEDFileMesh::getGenMeshAtLevel -> MEDFileMesh... X-Git-Tag: V7_8_0a1~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8c3dcf5940836637ac7bcb000049e833c5581eb7;p=tools%2Fmedcoupling.git API modification (simplification) : MEDFileMesh::getGenMeshAtLevel -> MEDFileMesh::getMeshAtLevel. --- diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index 709fd85cd..bc43c5362 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -434,6 +434,21 @@ std::string DataArray::BuildInfoFromVarAndUnit(const std::string& var, const std return oss.str(); } +std::string DataArray::GetAxTypeRepr(MEDCouplingAxisType at) +{ + switch(at) + { + case AX_CART: + return std::string("AX_CART"); + case AX_CYL: + return std::string("AX_CYL"); + case AX_SPHER: + return std::string("AX_SPHER"); + default: + throw INTERP_KERNEL::Exception("DataArray::GetAxTypeRepr : unrecognized axis type enum !"); + } +} + /*! * Returns a new DataArray by concatenating all given arrays, so that (1) the number * of tuples in the result array is a sum of the number of tuples of given arrays and (2) diff --git a/src/MEDCoupling/MEDCouplingMemArray.hxx b/src/MEDCoupling/MEDCouplingMemArray.hxx index 66bbb6bd9..cf1ee4e70 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.hxx +++ b/src/MEDCoupling/MEDCouplingMemArray.hxx @@ -177,6 +177,7 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT static std::string GetVarNameFromInfo(const std::string& info); MEDCOUPLING_EXPORT static std::string GetUnitFromInfo(const std::string& info); MEDCOUPLING_EXPORT static std::string BuildInfoFromVarAndUnit(const std::string& var, const std::string& unit); + MEDCOUPLING_EXPORT static std::string GetAxTypeRepr(MEDCouplingAxisType at); MEDCOUPLING_EXPORT static DataArray *Aggregate(const std::vector& arrs); MEDCOUPLING_EXPORT virtual void reprStream(std::ostream& stream) const = 0; MEDCOUPLING_EXPORT virtual void reprZipStream(std::ostream& stream) const = 0; diff --git a/src/MEDCoupling_Swig/MEDCouplingMemArray.i b/src/MEDCoupling_Swig/MEDCouplingMemArray.i index e47f1e1f2..77e88536e 100644 --- a/src/MEDCoupling_Swig/MEDCouplingMemArray.i +++ b/src/MEDCoupling_Swig/MEDCouplingMemArray.i @@ -253,6 +253,7 @@ namespace ParaMEDMEM static std::string GetVarNameFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception); static std::string GetUnitFromInfo(const std::string& info) throw(INTERP_KERNEL::Exception); static std::string BuildInfoFromVarAndUnit(const std::string& var, const std::string& unit) throw(INTERP_KERNEL::Exception); + static std::string GetAxTypeRepr(MEDCouplingAxisType at) throw(INTERP_KERNEL::Exception); void updateTime() const; %extend { diff --git a/src/MEDLoader/MEDFileField.cxx b/src/MEDLoader/MEDFileField.cxx index 932e70028..0918d29d4 100644 --- a/src/MEDLoader/MEDFileField.cxx +++ b/src/MEDLoader/MEDFileField.cxx @@ -4595,7 +4595,7 @@ void MEDFileAnyTypeField1TSWithoutSDA::setFieldProfile(const MEDCouplingFieldDou std::vector idsInPflPerType; std::vector idsPerType; std::vector code,code2; - MEDCouplingAutoRefCountObjectPtr m=mesh->getGenMeshAtLevel(meshDimRelToMax); + MEDCouplingAutoRefCountObjectPtr m(mesh->getMeshAtLevel(meshDimRelToMax)); if(type!=ON_NODES) { m->splitProfilePerType(profile,code,idsInPflPerType,idsPerType); @@ -4796,7 +4796,7 @@ MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldAtLevel(TypeOf */ MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldOnMeshAtLevel(TypeOfField type, int meshDimRelToMax, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDFileMesh *mesh, MEDCouplingAutoRefCountObjectPtr& arrOut, const MEDFileFieldNameScope& nasc) const { - MEDCouplingAutoRefCountObjectPtr m=mesh->getGenMeshAtLevel(meshDimRelToMax,false); + MEDCouplingAutoRefCountObjectPtr m(mesh->getMeshAtLevel(meshDimRelToMax,false)); const DataArrayInt *d=mesh->getNumberFieldAtLevel(meshDimRelToMax); const DataArrayInt *e=mesh->getNumberFieldAtLevel(1); if(meshDimRelToMax==1) @@ -4938,7 +4938,7 @@ MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldOnMeshAtLevel( */ DataArray *MEDFileAnyTypeField1TSWithoutSDA::getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const { - MEDCouplingAutoRefCountObjectPtr m=mesh->getGenMeshAtLevel(meshDimRelToMax); + MEDCouplingAutoRefCountObjectPtr m(mesh->getMeshAtLevel(meshDimRelToMax)); int meshId=getMeshIdFromMeshName(mesh->getName().c_str()); MEDCouplingAutoRefCountObjectPtr ret=_field_per_mesh[meshId]->getFieldOnMeshAtLevelWithPfl(type,m,pfl,glob,nasc); ret->setName(nasc.getName().c_str()); diff --git a/src/MEDLoader/MEDFileMesh.cxx b/src/MEDLoader/MEDFileMesh.cxx index c858bf9f0..692da3e72 100644 --- a/src/MEDLoader/MEDFileMesh.cxx +++ b/src/MEDLoader/MEDFileMesh.cxx @@ -2005,7 +2005,7 @@ std::vector MEDFileMesh::getAllGeoTypes() con std::vector MEDFileMesh::getDistributionOfTypes(int meshDimRelToMax) const { - MEDCouplingAutoRefCountObjectPtr mLev(getGenMeshAtLevel(meshDimRelToMax)); + MEDCouplingAutoRefCountObjectPtr mLev(getMeshAtLevel(meshDimRelToMax)); return mLev->getDistributionOfTypes(); } @@ -2538,6 +2538,18 @@ void MEDFileMesh::getEquivalencesRepr(std::ostream& oss) const _equiv->getRepr(oss); } +void MEDFileMesh::checkCartesian() const +{ + if(getAxType()!=AX_CART) + { + std::ostringstream oss; oss << "MEDFileMesh::checkCartesian : request for method that is dedicated to a cartesian convention ! But you are not in cartesian convention (" << DataArray::GetAxTypeRepr(getAxType()) << ")."; + oss << std::endl << "To perform operation you have two possiblities :" << std::endl; + oss << " - call setAxType(AX_CART)" << std::endl; + oss << " - call cartesianize()"; + throw INTERP_KERNEL::Exception(oss.str().c_str()); + } +} + /*! * \brief Return number of joints, which is equal to number of adjacent mesh domains */ @@ -3359,7 +3371,6 @@ DataArrayInt *MEDFileUMesh::getFamiliesArr(int meshDimRelToMaxExt, const std::ve * \return MEDCouplingUMesh * - a pointer to MEDCouplingUMesh that the caller is to * delete using decrRef() as it is no more needed. * \throw If there are no mesh entities of \a meshDimRelToMaxExt dimension in \a this mesh. - * \sa getGenMeshAtLevel() */ MEDCouplingUMesh *MEDFileUMesh::getMeshAtLevel(int meshDimRelToMaxExt, bool renum) const { @@ -3380,25 +3391,6 @@ MEDCouplingUMesh *MEDFileUMesh::getMeshAtLevel(int meshDimRelToMaxExt, bool renu return l1->getWholeMesh(renum); } -/*! - * Returns a MEDCouplingUMesh of a given relative dimension. - * \warning If \a meshDimRelToMaxExt == 1 (which means nodes), the returned mesh **is not - * valid**. This is a feature, because MEDLoader does not create cells that do not exist! - * To build a valid MEDCouplingUMesh from the returned one in this case, - * call MEDCouplingUMesh::Build0DMeshFromCoords(). - * \param [in] meshDimRelToMax - the relative dimension of interest. - * \param [in] renum - if \c true, the returned mesh is permuted according to the - * optional numbers of mesh entities. - * \return MEDCouplingMesh * - a pointer to MEDCouplingUMesh that the caller is to - * delete using decrRef() as it is no more needed. - * \throw If there are no mesh entities of \a meshDimRelToMax dimension in \a this mesh. - * \sa getMeshAtLevel() - */ -MEDCouplingMesh *MEDFileUMesh::getGenMeshAtLevel(int meshDimRelToMax, bool renum) const -{ - return getMeshAtLevel(meshDimRelToMax,renum); -} - std::vector MEDFileUMesh::getDistributionOfTypes(int meshDimRelToMax) const { const MEDFileUMeshSplitL1 *l1(getMeshAtLevSafe(meshDimRelToMax)); @@ -5602,7 +5594,7 @@ void MEDFileStructuredMesh::deepCpyAttributes() * \return MEDCouplingMesh * - a pointer to MEDCouplingMesh that the caller is to * delete using decrRef() as it is no more needed. */ -MEDCouplingMesh *MEDFileStructuredMesh::getGenMeshAtLevel(int meshDimRelToMax, bool renum) const +MEDCouplingMesh *MEDFileStructuredMesh::getMeshAtLevel(int meshDimRelToMax, bool renum) const { if(renum) throw INTERP_KERNEL::Exception("MEDFileCurveLinearMesh does not support renumbering ! To do it perform request of renum array directly !"); @@ -5618,9 +5610,9 @@ MEDCouplingMesh *MEDFileStructuredMesh::getGenMeshAtLevel(int meshDimRelToMax, b case -1: { if(!m) - throw INTERP_KERNEL::Exception("MEDFileStructuredMesh::getGenMeshAtLevel : level -1 requested must be non empty to be able to compute unstructured sub mesh !"); + throw INTERP_KERNEL::Exception("MEDFileStructuredMesh::getMeshAtLevel : level -1 requested must be non empty to be able to compute unstructured sub mesh !"); buildMinusOneImplicitPartIfNeeded(); - MEDCouplingMesh *ret(_faces_if_necessary); + MEDCoupling1SGTUMesh *ret(_faces_if_necessary); if(ret) ret->incrRef(); return ret; diff --git a/src/MEDLoader/MEDFileMesh.hxx b/src/MEDLoader/MEDFileMesh.hxx index acbf042b1..e52dafada 100644 --- a/src/MEDLoader/MEDFileMesh.hxx +++ b/src/MEDLoader/MEDFileMesh.hxx @@ -85,7 +85,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT virtual void write(const std::string& fileName, int mode) const; MEDLOADER_EXPORT virtual void write(med_idt fid) const; MEDLOADER_EXPORT virtual int getSizeAtLevel(int meshDimRelToMaxExt) const = 0; - MEDLOADER_EXPORT virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const = 0; + MEDLOADER_EXPORT virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const = 0; MEDLOADER_EXPORT virtual std::vector getDistributionOfTypes(int meshDimRelToMax) const; MEDLOADER_EXPORT virtual void whichAreNodesFetched(const MEDFileField1TSStructItem& st, const MEDFileFieldGlobsReal *globs, std::vector& nodesFetched) const = 0; MEDLOADER_EXPORT virtual MEDFileMesh *cartesianize() const = 0; @@ -210,6 +210,7 @@ namespace ParaMEDMEM void deepCpyEquivalences(const MEDFileMesh& other); bool areEquivalencesEqual(const MEDFileMesh *other, std::string& what) const; void getEquivalencesRepr(std::ostream& oss) const; + void checkCartesian() const; protected: int _order; int _iteration; @@ -291,8 +292,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const; MEDLOADER_EXPORT MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector& fams, bool renum=false) const; MEDLOADER_EXPORT DataArrayInt *getFamiliesArr(int meshDimRelToMaxExt, const std::vector& fams, bool renum=false) const; - MEDLOADER_EXPORT MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const; - MEDLOADER_EXPORT MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const; + MEDLOADER_EXPORT MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const; MEDLOADER_EXPORT std::vector getDistributionOfTypes(int meshDimRelToMax) const; MEDLOADER_EXPORT MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const; MEDLOADER_EXPORT MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const; @@ -386,7 +386,7 @@ namespace ParaMEDMEM MEDLOADER_EXPORT std::vector getFamArrNonEmptyLevelsExt() const; MEDLOADER_EXPORT std::vector getNumArrNonEmptyLevelsExt() const; MEDLOADER_EXPORT std::vector getNameArrNonEmptyLevelsExt() const; - MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const; + MEDLOADER_EXPORT MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const; MEDLOADER_EXPORT int getSizeAtLevel(int meshDimRelToMaxExt) const; MEDLOADER_EXPORT int getNumberOfNodes() const; MEDLOADER_EXPORT int getNumberOfCellsAtLevel(int meshDimRelToMaxExt) const; diff --git a/src/MEDLoader/MEDLoader.cxx b/src/MEDLoader/MEDLoader.cxx index 70c6d889a..af614c4f3 100644 --- a/src/MEDLoader/MEDLoader.cxx +++ b/src/MEDLoader/MEDLoader.cxx @@ -1231,15 +1231,15 @@ std::vector MEDLoader::ReadFieldsGaussNEOn ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldCell(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) { - MEDCouplingAutoRefCountObjectPtr ff=MEDFileField1TS::New(fileName,fieldName,iteration,order); - MEDCouplingAutoRefCountObjectPtr mm=MEDFileMesh::New(fileName,meshName); - MEDCouplingAutoRefCountObjectPtr m=mm->getGenMeshAtLevel(meshDimRelToMax,false); + MEDCouplingAutoRefCountObjectPtr ff(MEDFileField1TS::New(fileName,fieldName,iteration,order)); + MEDCouplingAutoRefCountObjectPtr mm(MEDFileMesh::New(fileName,meshName)); + MEDCouplingAutoRefCountObjectPtr m(mm->getMeshAtLevel(meshDimRelToMax,false)); MEDFileMesh *mPtr(mm); MEDFileUMesh *muPtr=dynamic_cast(mPtr); - MEDCouplingAutoRefCountObjectPtr ret=ff->getFieldOnMeshAtLevel(ON_CELLS,m); + MEDCouplingAutoRefCountObjectPtr ret(ff->getFieldOnMeshAtLevel(ON_CELLS,m)); if(muPtr) { - const DataArrayInt *num=muPtr->getNumberFieldAtLevel(meshDimRelToMax); + const DataArrayInt *num(muPtr->getNumberFieldAtLevel(meshDimRelToMax)); if(num) ret->renumberCells(num->begin()); } @@ -1248,17 +1248,17 @@ ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldCell(const std::string& ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldNode(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) { - MEDCouplingAutoRefCountObjectPtr ff=MEDFileField1TS::New(fileName,fieldName,iteration,order); - MEDCouplingAutoRefCountObjectPtr mm=MEDFileMesh::New(fileName,meshName); - MEDCouplingAutoRefCountObjectPtr m=mm->getGenMeshAtLevel(meshDimRelToMax,false); + MEDCouplingAutoRefCountObjectPtr ff(MEDFileField1TS::New(fileName,fieldName,iteration,order)); + MEDCouplingAutoRefCountObjectPtr mm(MEDFileMesh::New(fileName,meshName)); + MEDCouplingAutoRefCountObjectPtr m(mm->getMeshAtLevel(meshDimRelToMax,false)); MEDFileMesh *mPtr(mm); - MEDCouplingAutoRefCountObjectPtr ret=ff->getFieldOnMeshAtLevel(ON_NODES,m); + MEDCouplingAutoRefCountObjectPtr ret(ff->getFieldOnMeshAtLevel(ON_NODES,m)); MEDFileUMesh *muPtr=dynamic_cast(mPtr); if(ff->getPflsReallyUsed().empty()) { if(muPtr) { - const DataArrayInt *num=muPtr->getNumberFieldAtLevel(meshDimRelToMax); + const DataArrayInt *num(muPtr->getNumberFieldAtLevel(meshDimRelToMax)); if(num) ret->renumberCells(num->begin()); } @@ -1266,19 +1266,19 @@ ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldNode(const std::string& else { DataArrayInt *pfl=0,*arr2=0; - MEDCouplingAutoRefCountObjectPtr arr=ff->getFieldWithProfile(ON_NODES,meshDimRelToMax,mm,pfl); + MEDCouplingAutoRefCountObjectPtr arr(ff->getFieldWithProfile(ON_NODES,meshDimRelToMax,mm,pfl)); MEDCouplingAutoRefCountObjectPtr pflSafe(pfl); - MEDCouplingAutoRefCountObjectPtr mp=m->getCellIdsFullyIncludedInNodeIds(pfl->begin(),pfl->end()); - MEDCouplingAutoRefCountObjectPtr mzip=static_cast(m->buildPartAndReduceNodes(mp->begin(),mp->end(),arr2)); + MEDCouplingAutoRefCountObjectPtr mp(m->getCellIdsFullyIncludedInNodeIds(pfl->begin(),pfl->end())); + MEDCouplingAutoRefCountObjectPtr mzip(static_cast(m->buildPartAndReduceNodes(mp->begin(),mp->end(),arr2))); MEDCouplingAutoRefCountObjectPtr arr2Safe(arr2); - MEDCouplingAutoRefCountObjectPtr arr3=arr2->invertArrayO2N2N2O(mzip->getNumberOfNodes()); + MEDCouplingAutoRefCountObjectPtr arr3(arr2->invertArrayO2N2N2O(mzip->getNumberOfNodes())); MEDCouplingAutoRefCountObjectPtr pflSorted(pflSafe->deepCpy()); pflSorted->sort(true); if(!arr3->isEqualWithoutConsideringStr(*pflSorted)) throw INTERP_KERNEL::Exception("MEDLoader::ReadFieldNode : not implemented yet !"); if(!arr3->isEqualWithoutConsideringStr(*pflSafe)) { - MEDCouplingAutoRefCountObjectPtr o2n2=pflSafe->checkAndPreparePermutation(); - MEDCouplingAutoRefCountObjectPtr n2o2=o2n2->invertArrayO2N2N2O(o2n2->getNumberOfTuples()); + MEDCouplingAutoRefCountObjectPtr o2n2(pflSafe->checkAndPreparePermutation()); + MEDCouplingAutoRefCountObjectPtr n2o2(o2n2->invertArrayO2N2N2O(o2n2->getNumberOfTuples())); mzip->renumberNodes(n2o2->begin(),n2o2->getNumberOfTuples()); arr->setName(""); ret->setArray(arr); @@ -1290,15 +1290,15 @@ ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldNode(const std::string& ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldGauss(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) { - MEDCouplingAutoRefCountObjectPtr ff=MEDFileField1TS::New(fileName,fieldName,iteration,order); - MEDCouplingAutoRefCountObjectPtr mm=MEDFileMesh::New(fileName,meshName); - MEDCouplingAutoRefCountObjectPtr m=mm->getGenMeshAtLevel(meshDimRelToMax,false); + MEDCouplingAutoRefCountObjectPtr ff(MEDFileField1TS::New(fileName,fieldName,iteration,order)); + MEDCouplingAutoRefCountObjectPtr mm(MEDFileMesh::New(fileName,meshName)); + MEDCouplingAutoRefCountObjectPtr m(mm->getMeshAtLevel(meshDimRelToMax,false)); MEDFileMesh *mPtr(mm); MEDFileUMesh *muPtr=dynamic_cast(mPtr); - MEDCouplingAutoRefCountObjectPtr ret=ff->getFieldOnMeshAtLevel(ON_GAUSS_PT,m); + MEDCouplingAutoRefCountObjectPtr ret(ff->getFieldOnMeshAtLevel(ON_GAUSS_PT,m)); if(muPtr) { - const DataArrayInt *num=muPtr->getNumberFieldAtLevel(meshDimRelToMax); + const DataArrayInt *num(muPtr->getNumberFieldAtLevel(meshDimRelToMax)); if(num) ret->renumberCells(num->begin()); } @@ -1307,15 +1307,15 @@ ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldGauss(const std::string& ParaMEDMEM::MEDCouplingFieldDouble *MEDLoader::ReadFieldGaussNE(const std::string& fileName, const std::string& meshName, int meshDimRelToMax, const std::string& fieldName, int iteration, int order) { - MEDCouplingAutoRefCountObjectPtr ff=MEDFileField1TS::New(fileName,fieldName,iteration,order); - MEDCouplingAutoRefCountObjectPtr mm=MEDFileMesh::New(fileName,meshName); - MEDCouplingAutoRefCountObjectPtr m=mm->getGenMeshAtLevel(meshDimRelToMax,false); + MEDCouplingAutoRefCountObjectPtr ff(MEDFileField1TS::New(fileName,fieldName,iteration,order)); + MEDCouplingAutoRefCountObjectPtr mm(MEDFileMesh::New(fileName,meshName)); + MEDCouplingAutoRefCountObjectPtr m(mm->getMeshAtLevel(meshDimRelToMax,false)); MEDFileMesh *mPtr(mm); MEDFileUMesh *muPtr=dynamic_cast(mPtr); - MEDCouplingAutoRefCountObjectPtr ret=ff->getFieldOnMeshAtLevel(ON_GAUSS_NE,m); + MEDCouplingAutoRefCountObjectPtr ret(ff->getFieldOnMeshAtLevel(ON_GAUSS_NE,m)); if(muPtr) { - const DataArrayInt *num=muPtr->getNumberFieldAtLevel(meshDimRelToMax); + const DataArrayInt *num(muPtr->getNumberFieldAtLevel(meshDimRelToMax)); if(num) ret->renumberCells(num->begin()); } diff --git a/src/MEDLoader/SauvWriter.cxx b/src/MEDLoader/SauvWriter.cxx index 701ab1e95..c6c05c629 100644 --- a/src/MEDLoader/SauvWriter.cxx +++ b/src/MEDLoader/SauvWriter.cxx @@ -374,7 +374,7 @@ void SauvWriter::fillFamilySubMeshes() for ( size_t iDim = 0; iDim < dims.size(); ++iDim ) { int dimRelExt = dims[ iDim ]; - MEDCouplingAutoRefCountObjectPtr< MEDCouplingMesh > mesh = _fileMesh->getGenMeshAtLevel(dimRelExt); + MEDCouplingAutoRefCountObjectPtr< MEDCouplingMesh > mesh = _fileMesh->getMeshAtLevel(dimRelExt); const DataArrayInt * famIds = _fileMesh->getFamilyFieldAtLevel(dimRelExt); if ( !famIds ) continue; @@ -564,7 +564,7 @@ void SauvWriter::makeProfileIDs( SubMesh* sm, const DataArrayInt* profile ) { MEDCouplingAutoRefCountObjectPtr< MEDCouplingMesh > - mesh = _fileMesh->getGenMeshAtLevel(sm->_dimRelExt); + mesh = _fileMesh->getMeshAtLevel(sm->_dimRelExt); const MEDCouplingUMesh* uMesh = dynamic_cast< const MEDCouplingUMesh* > ((const MEDCouplingMesh*) mesh ); if ( sm->_dimRelExt == 1 ) type = INTERP_KERNEL::NORM_POINT1; @@ -661,7 +661,7 @@ void SauvWriter::write(const std::string& fileName) void SauvWriter::writeFileHead() { - MEDCouplingAutoRefCountObjectPtr< MEDCouplingMesh > mesh = _fileMesh->getGenMeshAtLevel(0); + MEDCouplingAutoRefCountObjectPtr< MEDCouplingMesh > mesh = _fileMesh->getMeshAtLevel(0); *_sauvFile << " ENREGISTREMENT DE TYPE 4" << endl @@ -743,7 +743,7 @@ void SauvWriter::writeSubMeshes() { // write each sub-type as a SAUV sub-mesh MEDCouplingAutoRefCountObjectPtr< MEDCouplingMesh > - mesh = _fileMesh->getGenMeshAtLevel( sm._dimRelExt ); + mesh = _fileMesh->getMeshAtLevel( sm._dimRelExt ); MEDCouplingAutoRefCountObjectPtr< MEDCouplingUMesh> umesh = mesh->buildUnstructured(); @@ -841,7 +841,7 @@ void SauvWriter::writeCompoundSubMesh(int iSub) void SauvWriter::writeNodes() { - MEDCouplingAutoRefCountObjectPtr< MEDCouplingMesh > mesh = _fileMesh->getGenMeshAtLevel( 1 ); + MEDCouplingAutoRefCountObjectPtr< MEDCouplingMesh > mesh = _fileMesh->getMeshAtLevel( 1 ); MEDCouplingAutoRefCountObjectPtr< MEDCouplingUMesh > umesh = mesh->buildUnstructured(); // write the index connecting nodes with their coodrinates diff --git a/src/MEDLoader/Swig/MEDLoaderCommon.i b/src/MEDLoader/Swig/MEDLoaderCommon.i index 45f7ef9e8..2dedfa744 100644 --- a/src/MEDLoader/Swig/MEDLoaderCommon.i +++ b/src/MEDLoader/Swig/MEDLoaderCommon.i @@ -88,7 +88,7 @@ using namespace ParaMEDMEM; %newobject ParaMEDMEM::MEDFileMesh::createNewEmpty; %newobject ParaMEDMEM::MEDFileMesh::deepCpy; %newobject ParaMEDMEM::MEDFileMesh::shallowCpy; -%newobject ParaMEDMEM::MEDFileMesh::getGenMeshAtLevel; +%newobject ParaMEDMEM::MEDFileMesh::getMeshAtLevel; %newobject ParaMEDMEM::MEDFileMesh::__getitem__; %newobject ParaMEDMEM::MEDFileMesh::getGroupArr; %newobject ParaMEDMEM::MEDFileMesh::getGroupsArr; @@ -112,7 +112,6 @@ using namespace ParaMEDMEM; %newobject ParaMEDMEM::MEDFileUMesh::getGroups; %newobject ParaMEDMEM::MEDFileUMesh::getFamily; %newobject ParaMEDMEM::MEDFileUMesh::getFamilies; -%newobject ParaMEDMEM::MEDFileUMesh::getMeshAtLevel; %newobject ParaMEDMEM::MEDFileUMesh::getLevel0Mesh; %newobject ParaMEDMEM::MEDFileUMesh::getLevelM1Mesh; %newobject ParaMEDMEM::MEDFileUMesh::getLevelM2Mesh; @@ -964,7 +963,7 @@ namespace ParaMEDMEM virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception); virtual std::string advancedRepr() const throw(INTERP_KERNEL::Exception); // - virtual MEDCouplingMesh *getGenMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception); + virtual MEDCouplingMesh *getMeshAtLevel(int meshDimRelToMax, bool renum=false) const throw(INTERP_KERNEL::Exception); virtual void setFamilyFieldArr(int meshDimRelToMaxExt, DataArrayInt *famArr) throw(INTERP_KERNEL::Exception); virtual void setRenumFieldArr(int meshDimRelToMaxExt, DataArrayInt *renumArr) throw(INTERP_KERNEL::Exception); virtual void setNameFieldAtLevel(int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr) throw(INTERP_KERNEL::Exception); @@ -992,7 +991,7 @@ namespace ParaMEDMEM MEDCouplingMesh *__getitem__(int meshDimRelToMaxExt) const throw(INTERP_KERNEL::Exception) { - return self->getGenMeshAtLevel(meshDimRelToMaxExt,false); + return self->getMeshAtLevel(meshDimRelToMaxExt,false); } PyObject *getTime() throw(INTERP_KERNEL::Exception) @@ -1186,7 +1185,6 @@ namespace ParaMEDMEM MEDCouplingUMesh *getFamily(int meshDimRelToMaxExt, const std::string& fam, bool renum=false) const throw(INTERP_KERNEL::Exception); MEDCouplingUMesh *getFamilies(int meshDimRelToMaxExt, const std::vector& fams, bool renum=false) const throw(INTERP_KERNEL::Exception); DataArrayInt *getNodeGroupsArr(const std::vector& grps, bool renum=false) const throw(INTERP_KERNEL::Exception); - MEDCouplingUMesh *getMeshAtLevel(int meshDimRelToMaxExt, bool renum=false) const throw(INTERP_KERNEL::Exception); MEDCouplingUMesh *getLevel0Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception); MEDCouplingUMesh *getLevelM1Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception); MEDCouplingUMesh *getLevelM2Mesh(bool renum=false) const throw(INTERP_KERNEL::Exception); diff --git a/src/MEDLoader/Swig/SauvLoaderTest.py b/src/MEDLoader/Swig/SauvLoaderTest.py index 3e0a45fcf..06756dd34 100644 --- a/src/MEDLoader/Swig/SauvLoaderTest.py +++ b/src/MEDLoader/Swig/SauvLoaderTest.py @@ -125,13 +125,13 @@ class SauvLoaderTest(unittest.TestCase): self.assertTrue( "groupe5" in groups ) self.assertTrue( "maa1" in groups ) self.assertEqual(16,m.getSizeAtLevel(0)) - um0 = m.getGenMeshAtLevel(0) + um0 = m.getMeshAtLevel(0) self.assertEqual(12, um0.getNumberOfCellsWithType( NORM_TETRA4 )) self.assertEqual(2, um0.getNumberOfCellsWithType( NORM_PYRA5 )) self.assertEqual(2, um0.getNumberOfCellsWithType( NORM_HEXA8 )) - um1 = m.getGenMeshAtLevel(-1) + um1 = m.getMeshAtLevel(-1) self.assertEqual(2, um1.getNumberOfCellsWithType( NORM_TRI3 )) - pointeUM0 = pointeMedMesh.getGenMeshAtLevel(0) + pointeUM0 = pointeMedMesh.getMeshAtLevel(0) self.assertTrue(m.getCoords().isEqualWithoutConsideringStr(pointeMedMesh.getCoords(),1e-12)) self.assertEqual( um0.getMeasureField(0).accumulate(0), pointeUM0.getMeasureField(0).accumulate(0),1e-12) diff --git a/src/MEDLoader/Test/SauvLoaderTest.cxx b/src/MEDLoader/Test/SauvLoaderTest.cxx index a7bdb44fb..4fda6a246 100644 --- a/src/MEDLoader/Test/SauvLoaderTest.cxx +++ b/src/MEDLoader/Test/SauvLoaderTest.cxx @@ -250,14 +250,14 @@ void SauvLoaderTest::testMed2Sauv() CPPUNIT_ASSERT( std::find(groups.begin(),groups.end(),"groupe5") != groups.end() ); CPPUNIT_ASSERT( std::find(groups.begin(),groups.end(),"maa1") != groups.end() ); CPPUNIT_ASSERT_EQUAL(16,m->getSizeAtLevel(0)); - MEDCouplingAutoRefCountObjectPtr um0 = m->getGenMeshAtLevel(0); + MEDCouplingAutoRefCountObjectPtr um0 = m->getMeshAtLevel(0); CPPUNIT_ASSERT_EQUAL(12, um0->getNumberOfCellsWithType( INTERP_KERNEL::NORM_TETRA4 )); CPPUNIT_ASSERT_EQUAL(2, um0->getNumberOfCellsWithType( INTERP_KERNEL::NORM_PYRA5 )); CPPUNIT_ASSERT_EQUAL(2, um0->getNumberOfCellsWithType( INTERP_KERNEL::NORM_HEXA8 )); - MEDCouplingAutoRefCountObjectPtr um1 = m->getGenMeshAtLevel(-1); + MEDCouplingAutoRefCountObjectPtr um1 = m->getMeshAtLevel(-1); CPPUNIT_ASSERT_EQUAL(2, um1->getNumberOfCellsWithType( INTERP_KERNEL::NORM_TRI3 )); MEDCouplingAutoRefCountObjectPtr pointeUM0 = - static_cast( pointeMedMesh->getGenMeshAtLevel(0)); + static_cast( pointeMedMesh->getMeshAtLevel(0)); DataArrayDouble *coo = m->getCoords(); DataArrayDouble *pointeCoo = pointeMedMesh->getCoords(); CPPUNIT_ASSERT(coo->isEqualWithoutConsideringStr(*pointeCoo,1e-12)); diff --git a/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionDriver.cxx b/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionDriver.cxx index 68f12e7a5..e7b9237ae 100644 --- a/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionDriver.cxx +++ b/src/MEDPartitioner/MEDPARTITIONER_MeshCollectionDriver.cxx @@ -359,7 +359,7 @@ ParaMEDMEM::MEDCouplingFieldDouble* MeshCollectionDriver::getField(std::string k if (field && typeData==6) { field->setName(fieldName); - field->setMesh(mfm->getGenMeshAtLevel(0)); + field->setMesh(mfm->getMeshAtLevel(0)); ParaMEDMEM::DataArrayDouble *da=data; //get information for components etc.. std::vector r1;