From 574ac287ed70220008d5c5cc90c59474a5e984f5 Mon Sep 17 00:00:00 2001 From: abn Date: Wed, 20 Jan 2016 14:17:50 +0100 Subject: [PATCH] MEDCoupling API change - stage #1 --- .../IO/MEDFileFieldRepresentationTree.cxx | 80 +++++++++---------- .../IO/MEDFileFieldRepresentationTree.hxx | 14 ++-- src/Plugins/MEDReader/Test/testMEDReader0.py | 6 +- src/Plugins/MEDReader/Test/testMEDReader11.py | 2 +- src/Plugins/MEDReader/Test/testMEDReader13.py | 2 +- src/Plugins/MEDReader/Test/testMEDReader14.py | 6 +- src/Plugins/MEDReader/Test/testMEDReader16.py | 2 +- src/Plugins/MEDReader/Test/testMEDReader17.py | 2 +- src/Plugins/MEDReader/Test/testMEDReader2.py | 2 +- src/Plugins/MEDReader/Test/testMEDReader4.py | 2 +- src/Plugins/MEDReader/Test/testMEDReader5.py | 2 +- src/Plugins/MEDReader/Test/testMEDReader6.py | 2 +- 12 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx index 9c19bfdf..c065849c 100644 --- a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx +++ b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx @@ -198,21 +198,21 @@ MEDFileFieldRepresentationLeavesArrays::MEDFileFieldRepresentationLeavesArrays() { } -MEDFileFieldRepresentationLeavesArrays::MEDFileFieldRepresentationLeavesArrays(const MEDCoupling::MEDCouplingAutoRefCountObjectPtr& arr):MEDCoupling::MEDCouplingAutoRefCountObjectPtr(arr),_activated(false),_id(-1) +MEDFileFieldRepresentationLeavesArrays::MEDFileFieldRepresentationLeavesArrays(const MEDCoupling::MCAuto& arr):MEDCoupling::MCAuto(arr),_activated(false),_id(-1) { std::vector< std::vector > typs((operator->())->getTypesOfFieldAvailable()); if(typs.size()<1) throw INTERP_KERNEL::Exception("There is a big internal problem in MEDLoader ! The field time spitting has failed ! A CRASH will occur soon !"); if(typs[0].size()!=1) throw INTERP_KERNEL::Exception("There is a big internal problem in MEDLoader ! The field spitting by spatial discretization has failed ! A CRASH will occur soon !"); - MEDCoupling::MEDCouplingAutoRefCountObjectPtr fd(MEDCouplingFieldDiscretization::New(typs[0][0])); + MEDCoupling::MCAuto fd(MEDCouplingFieldDiscretization::New(typs[0][0])); std::ostringstream oss2; oss2 << (operator->())->getName() << ZE_SEP << fd->getRepr(); _ze_name=oss2.str(); } MEDFileFieldRepresentationLeavesArrays& MEDFileFieldRepresentationLeavesArrays::operator=(const MEDFileFieldRepresentationLeavesArrays& other) { - MEDCoupling::MEDCouplingAutoRefCountObjectPtr::operator=(other); + MEDCoupling::MCAuto::operator=(other); _id=-1; _activated=false; _ze_name=other._ze_name; @@ -278,7 +278,7 @@ void MEDFileFieldRepresentationLeavesArrays::appendFields(const MEDTimeReq *tr, tr->initIterator(); for(int timeStepId=0;timeStepIdsize();timeStepId++,++(*tr)) { - MEDCouplingAutoRefCountObjectPtr f1ts((operator->())->getTimeStepAtPos(tr->getCurrent())); + MCAuto f1ts((operator->())->getTimeStepAtPos(tr->getCurrent())); MEDFileAnyTypeField1TS *f1tsPtr(f1ts); MEDFileField1TS *f1tsPtrDbl(dynamic_cast(f1tsPtr)); MEDFileIntField1TS *f1tsPtrInt(dynamic_cast(f1tsPtr)); @@ -291,7 +291,7 @@ void MEDFileFieldRepresentationLeavesArrays::appendFields(const MEDTimeReq *tr, throw INTERP_KERNEL::Exception("MEDFileFieldRepresentationLeavesArrays::appendFields : only FLOAT64 and INT32 fields are dealt for the moment !"); MEDFileField1TSStructItem fsst(MEDFileField1TSStructItem::BuildItemFrom(f1ts,mst)); f1ts->loadArraysIfNecessary(); - MEDCouplingAutoRefCountObjectPtr v(mml->buildDataArray(fsst,globs,crudeArr)); + MCAuto v(mml->buildDataArray(fsst,globs,crudeArr)); postProcessedArr=v; // std::vector discs(f1ts->getTypesOfFieldAvailable()); @@ -439,8 +439,8 @@ MEDFileFieldRepresentationLeaves::MEDFileFieldRepresentationLeaves():_cached_ds( { } -MEDFileFieldRepresentationLeaves::MEDFileFieldRepresentationLeaves(const std::vector< MEDCoupling::MEDCouplingAutoRefCountObjectPtr >& arr, - const MEDCoupling::MEDCouplingAutoRefCountObjectPtr& fsp):_arrays(arr.size()),_fsp(fsp),_cached_ds(0) +MEDFileFieldRepresentationLeaves::MEDFileFieldRepresentationLeaves(const std::vector< MEDCoupling::MCAuto >& arr, + const MEDCoupling::MCAuto& fsp):_arrays(arr.size()),_fsp(fsp),_cached_ds(0) { for(std::size_t i=0;i mst(MEDFileMeshStruct::New(meshes->getMeshWithName(_arrays[0]->getMeshName().c_str()))); + MCAuto mst(MEDFileMeshStruct::New(meshes->getMeshWithName(_arrays[0]->getMeshName().c_str()))); for(std::vector::const_iterator it=_arrays.begin();it!=_arrays.end();it++) if((*it).getStatus()) { @@ -636,9 +636,9 @@ vtkUnstructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInt DataArrayByte *typesMC(0); DataArrayInt *cellLocationsMC(0),*cellsMC(0),*faceLocationsMC(0),*facesMC(0); bool statusOfCoords(mm->buildVTUArrays(coordsMC,typesMC,cellLocationsMC,cellsMC,faceLocationsMC,facesMC)); - MEDCouplingAutoRefCountObjectPtr coordsSafe(coordsMC); - MEDCouplingAutoRefCountObjectPtr typesSafe(typesMC); - MEDCouplingAutoRefCountObjectPtr cellLocationsSafe(cellLocationsMC),cellsSafe(cellsMC),faceLocationsSafe(faceLocationsMC),facesSafe(facesMC); + MCAuto coordsSafe(coordsMC); + MCAuto typesSafe(typesMC); + MCAuto cellLocationsSafe(cellLocationsMC),cellsSafe(cellsMC),faceLocationsSafe(faceLocationsMC),facesSafe(facesMC); // int nbOfCells(typesSafe->getNbOfElems()); vtkUnstructuredGrid *ret(vtkUnstructuredGrid::New()); @@ -766,7 +766,7 @@ vtkStructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInter } else { - MEDCouplingAutoRefCountObjectPtr coords2(coords->changeNbOfComponents(3,0.)); + MCAuto coords2(coords->changeNbOfComponents(3,0.)); da->SetArray(coords2->getPointer(),coords2->getNbOfElems(),0,VTK_DATA_ARRAY_FREE);//let VTK deal with double * coords2->accessToMemArray().setSpecificDeallocator(0); } @@ -784,8 +784,8 @@ vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolatio const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate::VTK_DATA_ARRAY_FREE; vtkDataSet *ret(0); //_fsp->isDataSetSupportEqualToThePreviousOne(i,globs); - MEDCouplingAutoRefCountObjectPtr mml(_fsp->buildFromScratchDataSetSupport(0,globs));//0=timestep Id. Make the hypothesis that support does not change - MEDCouplingAutoRefCountObjectPtr mml2(mml->prepare()); + MCAuto mml(_fsp->buildFromScratchDataSetSupport(0,globs));//0=timestep Id. Make the hypothesis that support does not change + MCAuto mml2(mml->prepare()); MEDMeshMultiLev *ptMML2(mml2); if(!_cached_ds) { @@ -1113,7 +1113,7 @@ void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileNam MEDCoupling::MEDFileMesh *tmp(_ms->getMeshAtPos(i)); MEDCoupling::MEDFileUMesh *tmp2(dynamic_cast(tmp)); if(tmp2) - MEDCouplingAutoRefCountObjectPtr tmp3(tmp2->zipCoords()); + MCAuto tmp3(tmp2->zipCoords()); } _fields=MEDFileFields::LoadPartOf(fileName,false,_ms);//false is important to not read the values #else @@ -1124,8 +1124,8 @@ void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileNam } else { - MEDCouplingAutoRefCountObjectPtr sr(MEDCoupling::SauvReader::New(fileName)); - MEDCouplingAutoRefCountObjectPtr mfd(sr->loadInMEDFileDS()); + MCAuto sr(MEDCoupling::SauvReader::New(fileName)); + MCAuto mfd(sr->loadInMEDFileDS()); _ms=mfd->getMeshes(); _ms->incrRef(); int nbMeshes(_ms->getNumberOfMeshes()); for(int i=0;icartesianizeMe(); _fields->removeFieldsWithoutAnyTimeStep(); std::vector meshNames(_ms->getMeshesNames()); - std::vector< MEDCouplingAutoRefCountObjectPtr > fields_per_mesh(meshNames.size()); + std::vector< MCAuto > fields_per_mesh(meshNames.size()); for(std::size_t i=0;ipartOfThisLyingOnSpecifiedMeshName(meshNames[i].c_str()); } - std::vector< MEDCouplingAutoRefCountObjectPtr > allFMTSLeavesToDisplaySafe; + std::vector< MCAuto > allFMTSLeavesToDisplaySafe; std::size_t k(0); - for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator fields=fields_per_mesh.begin();fields!=fields_per_mesh.end();fields++) + for(std::vector< MCAuto >::const_iterator fields=fields_per_mesh.begin();fields!=fields_per_mesh.end();fields++) { for(int j=0;j<(*fields)->getNumberOfFields();j++) { - MEDCouplingAutoRefCountObjectPtr fmts((*fields)->getFieldAtPos((int)j)); - std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > tmp(fmts->splitDiscretizations()); + MCAuto fmts((*fields)->getFieldAtPos((int)j)); + std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > tmp(fmts->splitDiscretizations()); // EDF 8655 - for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > >::const_iterator it=tmp.begin();it!=tmp.end();it++) + for(std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > >::const_iterator it=tmp.begin();it!=tmp.end();it++) { if(!(*it)->presenceOfMultiDiscPerGeoType()) allFMTSLeavesToDisplaySafe.push_back(*it); else {// The case of some parts of field have more than one discretization per geo type. - std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > subTmp((*it)->splitMultiDiscrPerGeoTypes()); + std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > subTmp((*it)->splitMultiDiscrPerGeoTypes()); std::size_t it0Cnt(0); - for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > >::iterator it0=subTmp.begin();it0!=subTmp.end();it0++,it0Cnt++)//not const because setName + for(std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > >::iterator it0=subTmp.begin();it0!=subTmp.end();it0++,it0Cnt++)//not const because setName { std::ostringstream oss; oss << (*it0)->getName() << "_" << std::setfill('M') << std::setw(3) << it0Cnt; (*it0)->setName(oss.str()); @@ -1190,7 +1190,7 @@ void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileNam } std::vector< std::vector > allFMTSLeavesPerTimeSeries(MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(allFMTSLeavesToDisplay)); // memory safety part - std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr > > allFMTSLeavesPerTimeSeriesSafe(allFMTSLeavesPerTimeSeries.size()); + std::vector< std::vector< MCAuto > > allFMTSLeavesPerTimeSeriesSafe(allFMTSLeavesPerTimeSeries.size()); for(std::size_t j=0;j meshNamesLoc; - std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr > > splitByMeshName; + std::vector< std::vector< MCAuto > > splitByMeshName; for(std::size_t j=0;jgetMeshName()); @@ -1223,13 +1223,13 @@ void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileNam _data_structure[i].resize(meshNamesLoc.size()); for(std::size_t j=0;j > fsp; + std::vector< MCAuto > fsp; std::vector< MEDFileAnyTypeFieldMultiTS *> sbmn(splitByMeshName[j].size()); for(std::size_t k=0;k > commonSupSplit(MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(sbmn,_ms->getMeshWithName(meshNamesLoc[j].c_str()),fsp)); - std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr > > commonSupSplitSafe(commonSupSplit.size()); + std::vector< std::vector< MCAuto > > commonSupSplitSafe(commonSupSplit.size()); this->_data_structure[i][j].resize(commonSupSplit.size()); for(std::size_t k=0;kgetMeshAtPos(i)); std::vector levs(mm->getNonEmptyLevels()); - MEDCoupling::MEDCouplingAutoRefCountObjectPtr f1tsMultiLev(MEDCoupling::MEDFileField1TS::New()); + MEDCoupling::MCAuto f1tsMultiLev(MEDCoupling::MEDFileField1TS::New()); MEDFileUMesh *mmu(dynamic_cast(mm)); if(mmu) { @@ -1425,9 +1425,9 @@ void MEDFileFieldRepresentationTree::AppendFieldFromMeshes(const MEDCoupling::ME for(std::vector::const_iterator gt=gts.begin();gt!=gts.end();gt++) { MEDCoupling::MEDCouplingMesh *m(mmu->getDirectUndergroundSingleGeoTypeMesh(*gt)); - MEDCoupling::MEDCouplingAutoRefCountObjectPtr f(MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS)); + MEDCoupling::MCAuto f(MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS)); f->setMesh(m); - MEDCoupling::MEDCouplingAutoRefCountObjectPtr arr(MEDCoupling::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected()); + MEDCoupling::MCAuto arr(MEDCoupling::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected()); arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA)); arr->iota(); f->setArray(arr); @@ -1440,10 +1440,10 @@ void MEDFileFieldRepresentationTree::AppendFieldFromMeshes(const MEDCoupling::ME std::vector levsExt(mm->getNonEmptyLevelsExt()); if(levsExt.size()==levs.size()+1) { - MEDCoupling::MEDCouplingAutoRefCountObjectPtr m(mm->getMeshAtLevel(1)); - MEDCoupling::MEDCouplingAutoRefCountObjectPtr f(MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_NODES)); + MEDCoupling::MCAuto m(mm->getMeshAtLevel(1)); + MEDCoupling::MCAuto f(MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_NODES)); f->setMesh(m); - MEDCoupling::MEDCouplingAutoRefCountObjectPtr arr(MEDCoupling::DataArrayDouble::New()); arr->alloc(m->getNumberOfNodes()); + MEDCoupling::MCAuto arr(MEDCoupling::DataArrayDouble::New()); arr->alloc(m->getNumberOfNodes()); arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA)); arr->iota(); f->setArray(arr); f->setName(BuildAUniqueArrayNameForMesh(mm->getName(),ret)); @@ -1455,10 +1455,10 @@ void MEDFileFieldRepresentationTree::AppendFieldFromMeshes(const MEDCoupling::ME } else { - MEDCoupling::MEDCouplingAutoRefCountObjectPtr m(mm->getMeshAtLevel(0)); - MEDCoupling::MEDCouplingAutoRefCountObjectPtr f(MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS)); + MEDCoupling::MCAuto m(mm->getMeshAtLevel(0)); + MEDCoupling::MCAuto f(MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS)); f->setMesh(m); - MEDCoupling::MEDCouplingAutoRefCountObjectPtr arr(MEDCoupling::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected()); + MEDCoupling::MCAuto arr(MEDCoupling::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected()); arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA)); arr->iota(); f->setArray(arr); @@ -1466,7 +1466,7 @@ void MEDFileFieldRepresentationTree::AppendFieldFromMeshes(const MEDCoupling::ME f1tsMultiLev->setFieldNoProfileSBT(f); } // - MEDCoupling::MEDCouplingAutoRefCountObjectPtr fmtsMultiLev(MEDCoupling::MEDFileFieldMultiTS::New()); + MEDCoupling::MCAuto fmtsMultiLev(MEDCoupling::MEDFileFieldMultiTS::New()); fmtsMultiLev->pushBackTimeStep(f1tsMultiLev); ret->pushField(fmtsMultiLev); } @@ -1488,7 +1488,7 @@ std::string MEDFileFieldRepresentationTree::BuildAUniqueArrayNameForMesh(const s MEDCoupling::MEDFileFields *MEDFileFieldRepresentationTree::BuildFieldFromMeshes(const MEDCoupling::MEDFileMeshes *ms) { - MEDCoupling::MEDCouplingAutoRefCountObjectPtr ret(MEDCoupling::MEDFileFields::New()); + MEDCoupling::MCAuto ret(MEDCoupling::MEDFileFields::New()); AppendFieldFromMeshes(ms,ret); return ret.retn(); } diff --git a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx index 2e5234c6..364a1c2c 100644 --- a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx +++ b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx @@ -61,11 +61,11 @@ private: mutable std::vector< std::vector< std::pair< vtkQuadratureSchemeDefinition *, unsigned char > > > _defs; }; -class MEDLOADERFORPV_EXPORT MEDFileFieldRepresentationLeavesArrays : public MEDCoupling::MEDCouplingAutoRefCountObjectPtr +class MEDLOADERFORPV_EXPORT MEDFileFieldRepresentationLeavesArrays : public MEDCoupling::MCAuto { public: MEDFileFieldRepresentationLeavesArrays(); - MEDFileFieldRepresentationLeavesArrays(const MEDCoupling::MEDCouplingAutoRefCountObjectPtr& arr); + MEDFileFieldRepresentationLeavesArrays(const MEDCoupling::MCAuto& arr); MEDFileFieldRepresentationLeavesArrays& operator=(const MEDFileFieldRepresentationLeavesArrays& other); int getId() const; void setId(int& id) const; @@ -97,8 +97,8 @@ class MEDLOADERFORPV_EXPORT MEDFileFieldRepresentationLeaves { public: MEDFileFieldRepresentationLeaves(); - MEDFileFieldRepresentationLeaves(const std::vector< MEDCoupling::MEDCouplingAutoRefCountObjectPtr >& arr, - const MEDCoupling::MEDCouplingAutoRefCountObjectPtr& fsp); + MEDFileFieldRepresentationLeaves(const std::vector< MEDCoupling::MCAuto >& arr, + const MEDCoupling::MCAuto& fsp); ~MEDFileFieldRepresentationLeaves(); bool empty() const; void setId(int& id) const; @@ -125,7 +125,7 @@ private: void appendFields(const MEDTimeReq *tr, const MEDCoupling::MEDFileFieldGlobsReal *globs, const MEDCoupling::MEDMeshMultiLev *mml, const MEDCoupling::MEDFileMeshes *meshes, vtkDataSet *ds) const; private: std::vector _arrays; - MEDCoupling::MEDCouplingAutoRefCountObjectPtr _fsp; + MEDCoupling::MCAuto _fsp; mutable vtkDataSet *_cached_ds; }; @@ -171,8 +171,8 @@ private: private: // 1st : timesteps, 2nd : meshName, 3rd : common support std::vector< std::vector< std::vector< MEDFileFieldRepresentationLeaves > > > _data_structure; - MEDCoupling::MEDCouplingAutoRefCountObjectPtr _ms; - MEDCoupling::MEDCouplingAutoRefCountObjectPtr _fields; + MEDCoupling::MCAuto _ms; + MEDCoupling::MCAuto _fields; }; class MEDLOADERFORPV_EXPORT TimeKeeper diff --git a/src/Plugins/MEDReader/Test/testMEDReader0.py b/src/Plugins/MEDReader/Test/testMEDReader0.py index 371de599..254bf8d1 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader0.py +++ b/src/Plugins/MEDReader/Test/testMEDReader0.py @@ -39,7 +39,7 @@ f0z.setMesh(mz) f0z.setArray(arr0) f0z.setGaussLocalizationOnType(NORM_QUAD9,[-1,-1,1,-1,1,1,-1,1,0,-1,1,0,0,1,-1,0,0,0],[-0.774597,-0.774597,0.774597,-0.774597,0.774597,0.774597,-0.774597,0.774597,0,-0.774597,0.774597,0,0,0.774597,-0.774597,0,0,0,-0.774597,-0.774597,0.774597,-0.774597,0.774597,0.774597,-0.774597,0.774597,0,-0.774597,0.774597,0,0,0.774597,-0.774597,0,0,0,-0.774597,-0.774597,0.774597,-0.774597,0.774597,0.774597,-0.774597,0.774597,0,-0.774597,0.774597,0,0,0.774597,-0.774597,0,0,0],[0.308642,0.308642,0.308642,0.308642,0.493827,0.493827,0.493827,0.493827,0.790123,0.308642,0.308642,0.308642,0.308642,0.493827,0.493827,0.493827,0.493827,0.790123,0.308642,0.308642,0.308642,0.308642,0.493827,0.493827,0.493827,0.493827,0.790123]) f0z.setName("SolutionSIEF_ELGA") -f0z.checkCoherency() +f0z.checkConsistencyLight() ff0z=MEDFileField1TS() ff0z.setFieldNoProfileSBT(f0z) # @@ -48,7 +48,7 @@ arr1.setInfoOnComponents(['VMIS','TRESCA']) f1z=MEDCouplingFieldDouble(ON_GAUSS_NE) ; f1z.setName("SolutionSIEQ_ELNO") f1z.setArray(arr1) f1z.setMesh(mz) -f1z.checkCoherency() +f1z.checkConsistencyLight() ff1z=MEDFileField1TS() ff1z.setFieldNoProfileSBT(f1z) # @@ -56,7 +56,7 @@ arr2=DataArrayDouble([4.938269266683534e-28,-6.232001151245993e-28,1.06022905661 arr2.setInfoOnComponents(['DRX','DRZ']) f2z=MEDCouplingFieldDouble(ON_NODES) ; f2z.setName("SolutionDEPL") ; f2z.setArray(arr2) f2z.setMesh(mz) -f2z.checkCoherency() +f2z.checkConsistencyLight() ff2z=MEDFileField1TS() ff2z.setFieldNoProfileSBT(f2z) # diff --git a/src/Plugins/MEDReader/Test/testMEDReader11.py b/src/Plugins/MEDReader/Test/testMEDReader11.py index 944abb26..8fafbc31 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader11.py +++ b/src/Plugins/MEDReader/Test/testMEDReader11.py @@ -85,7 +85,7 @@ for name,arrs in [("ENERGIE RECUE",(nrj_0_1,nrj_0_1)),("ENTHALPIE",(h_0,h_1)),(" f1ts0=MEDFileField1TS() f=MEDCouplingFieldDouble(ON_CELLS) ; f.setName(name) ; f.setTime(ft,dt,it) ; f.setMesh(sup) f.setArray(arrs[its]) - f.checkCoherency() + f.checkConsistencyLight() f1ts0.setFieldProfile(f,mm,0,pfl0) fmts0.pushBackTimeStep(f1ts0) pass diff --git a/src/Plugins/MEDReader/Test/testMEDReader13.py b/src/Plugins/MEDReader/Test/testMEDReader13.py index 3ede8aab..bca68aa7 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader13.py +++ b/src/Plugins/MEDReader/Test/testMEDReader13.py @@ -34,7 +34,7 @@ m.insertNextCell(NORM_TRI3,[0,1,3]) ; m.insertNextCell(NORM_TRI3,[1,2,3]) f=MEDCouplingFieldDouble(ON_GAUSS_NE) ; f.setName("fieldELNO") ; f.setMesh(m) arr=DataArrayDouble([0.2,1.1,0.7,0.5,-0.3,0.4]) f.setArray(DataArrayDouble.Meld(4*[arr])) -f.checkCoherency() +f.checkConsistencyLight() WriteField(fname,f,True) ################### MED write is done -> Go to MEDReader diff --git a/src/Plugins/MEDReader/Test/testMEDReader14.py b/src/Plugins/MEDReader/Test/testMEDReader14.py index cbd947d0..731dbcd7 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader14.py +++ b/src/Plugins/MEDReader/Test/testMEDReader14.py @@ -78,7 +78,7 @@ for i in xrange(5): fNode.setGaussLocalizationOnCells(DataArrayInt.Range(0,12,1),[0.,0.,1.,0.,0.,1.],[0.1,0.1,0.8,0.1,0.1,0.8],3*[0.16666666666666666]) fNode.setGaussLocalizationOnCells(DataArrayInt.Range(12,24,1),[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[-0.577350,-0.577350,0.577350,-0.577350,0.577350,0.577350,-0.577350,0.577350],4*[1.]) arr=DataArrayDouble(2*(12*3+12*4)) ; arr.iota(0+1000*i) ; arr.rearrange(2) - fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"]) ; fNode.checkCoherency() + fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"]) ; fNode.checkConsistencyLight() fNode.setName(fieldName0) f.setFieldProfile(fNode,mm,0,zePfl0) # @@ -91,7 +91,7 @@ for i in xrange(5): fNode.setGaussLocalizationOnCells(DataArrayInt.Range(4,10,1),[-1.,1.],[-0.5,0.,0.5],[1.,1.,1.]) fNode.setGaussLocalizationOnCells(DataArrayInt.Range(10,14,1),[-1.,1.],[-0.6,-0.2,0.2,0.6],[1.,1.,1.,1.]) arr=DataArrayDouble(2*(4*2+6*3+4*4)) ; arr.iota(100+1000*i) ; arr.rearrange(2) - fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"]) ; fNode.checkCoherency() + fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"]) ; fNode.checkConsistencyLight() fNode.setName(fieldName0) f.setFieldProfile(fNode,mm,-1,zePfl1) fs0.pushBackTimeStep(f) @@ -104,7 +104,7 @@ for i in xrange(5): fNode.setGaussLocalizationOnCells(DataArrayInt.Range(0,4,1),[-1.,1.],[-0.6,-0.2,0.2,0.6],[1.,1.,1.,1.]) fNode.setGaussLocalizationOnCells(DataArrayInt.Range(4,10,1),[-1.,1.],[-0.6666666666666667,-0.33333333333333337,0.,0.33333333333333337,0.6666666666666667],[1.,1.,1.,1.,1.]) arr=DataArrayDouble(2*(4*4+6*5)) ; arr.iota(500+1000*i) ; arr.rearrange(2) - fNode.setArray(arr) ; arr.setInfoOnComponents(["C1 [m]","C2 [s^2]"]) ; fNode.checkCoherency() + fNode.setArray(arr) ; arr.setInfoOnComponents(["C1 [m]","C2 [s^2]"]) ; fNode.checkConsistencyLight() f.setFieldProfile(fNode,mm,-1,zePfl2) fs1.pushBackTimeStep(f) # diff --git a/src/Plugins/MEDReader/Test/testMEDReader16.py b/src/Plugins/MEDReader/Test/testMEDReader16.py index 2b5487c1..9e382deb 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader16.py +++ b/src/Plugins/MEDReader/Test/testMEDReader16.py @@ -35,7 +35,7 @@ grp3=DataArrayInt([0,1,2,3]) ; grp3.setName("grp3") mm.setGroupsAtLevel(0,[grp0,grp1,grp2,grp3]) f=MEDCouplingFieldDouble(ON_GAUSS_NE) ; f.setMesh(m) ; f.setName("MyField") ; f.setTime(0.,0,0) arr2=DataArrayDouble(4*4*2) ; arr2.iota() ; arr2.rearrange(2) ; arr2.setInfoOnComponents(["aa","bbb"]) -f.setArray(arr2) ; arr2+=0.1 ; f.checkCoherency() +f.setArray(arr2) ; arr2+=0.1 ; f.checkConsistencyLight() mm.write(fname,2) WriteFieldUsingAlreadyWrittenMesh(fname,f) # diff --git a/src/Plugins/MEDReader/Test/testMEDReader17.py b/src/Plugins/MEDReader/Test/testMEDReader17.py index 5e25a6de..d5dc9b92 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader17.py +++ b/src/Plugins/MEDReader/Test/testMEDReader17.py @@ -35,7 +35,7 @@ grp3=DataArrayInt([0,1,2,3]) ; grp3.setName("grp3") mm.setGroupsAtLevel(0,[grp0,grp1,grp2,grp3]) f=MEDCouplingFieldDouble(ON_GAUSS_NE) ; f.setMesh(m) ; f.setName("MyField") ; f.setTime(0.,0,0) arr2=DataArrayDouble(4*4*2) ; arr2.iota() ; arr2.rearrange(2) ; arr2.setInfoOnComponents(["aa","bbb"]) -f.setArray(arr2) ; arr2+=0.1 ; f.checkCoherency() +f.setArray(arr2) ; arr2+=0.1 ; f.checkConsistencyLight() mm.write(fname,2) WriteFieldUsingAlreadyWrittenMesh(fname,f) # diff --git a/src/Plugins/MEDReader/Test/testMEDReader2.py b/src/Plugins/MEDReader/Test/testMEDReader2.py index 78d8f819..40a364d2 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader2.py +++ b/src/Plugins/MEDReader/Test/testMEDReader2.py @@ -46,7 +46,7 @@ mm.write(fname,2) pfl=DataArrayInt([7,8,9,10,13,14,15,16,19,20,21,22,25,26,27,28]) ; pfl.setName("pfl") f=MEDCouplingFieldDouble(ON_CELLS) ; f.setName("ACellField") arr=DataArrayDouble(16) ; arr.iota() -arr2=arr.deepCpy() ; arr2.reverse() +arr2=arr.deepCopy() ; arr2.reverse() arr=DataArrayDouble.Meld(arr,arr2) ; arr.setInfoOnComponents(["aa","bbb"]) f.setArray(arr) f1ts=MEDFileField1TS() diff --git a/src/Plugins/MEDReader/Test/testMEDReader4.py b/src/Plugins/MEDReader/Test/testMEDReader4.py index 4b0541ed..93cde273 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader4.py +++ b/src/Plugins/MEDReader/Test/testMEDReader4.py @@ -42,7 +42,7 @@ f1ts1=MEDFileField1TS() f0=MEDCouplingFieldDouble(ON_NODES) ; f0.setMesh(m0) ; f0.setName("f0NoPfl") arr0=DataArrayDouble([0.,1.,2.,3.,1.,1.5,2.2,3.1,2.,2.2,3.,3.1,3.,3.1,3.5,4.]) f0.setArray(arr0) -f0.checkCoherency() +f0.checkConsistencyLight() f1ts0.setFieldNoProfileSBT(f0) # pfl1=DataArrayInt([0,1,2,3,4,5,6,8,9,12]) ; pfl1.setName("pfl1") diff --git a/src/Plugins/MEDReader/Test/testMEDReader5.py b/src/Plugins/MEDReader/Test/testMEDReader5.py index 71b61df7..1c5fcfe1 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader5.py +++ b/src/Plugins/MEDReader/Test/testMEDReader5.py @@ -32,7 +32,7 @@ arr=DataArrayDouble(5) ; arr.iota() c=MEDCouplingCMesh("mesh") c.setCoords(arr,arr,arr) m=c.buildUnstructured() -mbis=m.deepCpy() ; mbis.translate([5,0,0]) ; mbis.tetrahedrize(PLANAR_FACE_5) +mbis=m.deepCopy() ; mbis.translate([5,0,0]) ; mbis.tetrahedrize(PLANAR_FACE_5) m=MEDCouplingUMesh.MergeUMeshes([mbis,m]) ; m.setName(c.getName()) mm=MEDFileUMesh() mm.setMeshAtLevel(0,m) diff --git a/src/Plugins/MEDReader/Test/testMEDReader6.py b/src/Plugins/MEDReader/Test/testMEDReader6.py index 1a76bfe9..b8099be6 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader6.py +++ b/src/Plugins/MEDReader/Test/testMEDReader6.py @@ -47,7 +47,7 @@ fGauss.setGaussLocalizationOnType(NORM_TRI3,[0.,0.,1.,0.,0.,1.],[0.1,0.1,0.05,0. fGauss.setGaussLocalizationOnType(NORM_QUAD4,[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[-0.9,-0.9,0.,0.,0.9,0.9],[0.2,0.3,0.5]) fGauss.setArray(DataArrayDouble([0.9,1.3,0.22,1.3,1.62,2.21,1.62,2.72,2.95,2.54,2.25,2.16,1.58,1.05,3.13,2.91,2.82,1.41,1.58,1.95,3.59,3.53,3.59,2.82,2.91,3.13,2.25,2.54,2.95])) fGauss.getArray().setInfoOnComponent(0,"C0") -fGauss.checkCoherency() +fGauss.checkConsistencyLight() # f1ts=MEDFileField1TS() f1ts.setFieldNoProfileSBT(fGauss) -- 2.39.2