From 0de3ecddfda5a60cbb17ffa0a5ee53540178e063 Mon Sep 17 00:00:00 2001 From: ageay Date: Tue, 23 Jul 2013 12:58:32 +0000 Subject: [PATCH] All getName method return std::string now --- src/MEDCoupling/MEDCoupling1GTUMesh.cxx | 28 +++++++++---------- src/MEDCoupling/MEDCouplingExtrudedMesh.cxx | 4 +-- src/MEDCoupling/MEDCouplingField.hxx | 4 +-- src/MEDCoupling/MEDCouplingFieldDouble.cxx | 20 ++++++------- src/MEDCoupling/MEDCouplingMesh.hxx | 4 +-- src/MEDCoupling/MEDCouplingPointSet.cxx | 2 +- src/MEDCoupling/MEDCouplingStructuredMesh.cxx | 2 +- src/MEDCoupling/MEDCouplingUMesh.cxx | 12 ++++---- .../Test/MEDCouplingBasicsTest1.cxx | 14 +++++----- .../Test/MEDCouplingBasicsTest3.cxx | 4 +-- .../Test/MEDCouplingBasicsTest4.cxx | 2 +- .../Test/MEDCouplingBasicsTest5.cxx | 2 +- 12 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx index 2fa8f049e..3125889a6 100644 --- a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx +++ b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx @@ -398,7 +398,7 @@ MEDCouplingUMesh *MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(const std::v throw INTERP_KERNEL::Exception("MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh : the first instance in input parts is null !"); const DataArrayDouble *coords(firstPart->getCoords()); int meshDim(firstPart->getMeshDimension()); - MEDCouplingAutoRefCountObjectPtr ret(MEDCouplingUMesh::New(firstPart->getName(),meshDim)); ret->setDescription(firstPart->getDescription()); + MEDCouplingAutoRefCountObjectPtr ret(MEDCouplingUMesh::New(firstPart->getName().c_str(),meshDim)); ret->setDescription(firstPart->getDescription().c_str()); ret->setCoords(coords); int nbOfCells(0),connSize(0); for(std::vector< const MEDCoupling1GTUMesh *>::const_iterator it=parts.begin();it!=parts.end();it++) @@ -486,8 +486,8 @@ MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::New(const MEDCouplingUMesh *m) throw if(gts.size()!=1) throw INTERP_KERNEL::Exception("MEDCoupling1SGTUMesh::New : input mesh must have exactly one geometric type !"); int geoType((int)*gts.begin()); - MEDCouplingAutoRefCountObjectPtr ret(MEDCoupling1SGTUMesh::New(m->getName(),*gts.begin())); - ret->setCoords(m->getCoords()); ret->setDescription(m->getDescription()); + MEDCouplingAutoRefCountObjectPtr ret(MEDCoupling1SGTUMesh::New(m->getName().c_str(),*gts.begin())); + ret->setCoords(m->getCoords()); ret->setDescription(m->getDescription().c_str()); int nbCells(m->getNumberOfCells()); int nbOfNodesPerCell(ret->getNumberOfNodesPerCell()); MEDCouplingAutoRefCountObjectPtr conn(DataArrayInt::New()); conn->alloc(nbCells*nbOfNodesPerCell,1); @@ -907,7 +907,7 @@ MEDCouplingMesh *MEDCoupling1SGTUMesh::mergeMyselfWith(const MEDCouplingMesh *ot MEDCouplingUMesh *MEDCoupling1SGTUMesh::buildUnstructured() const throw(INTERP_KERNEL::Exception) { - MEDCouplingAutoRefCountObjectPtr ret=MEDCouplingUMesh::New(getName(),getMeshDimension()); + MEDCouplingAutoRefCountObjectPtr ret=MEDCouplingUMesh::New(getName().c_str(),getMeshDimension()); ret->setCoords(getCoords()); const int *nodalConn=_conn->begin(); int nbCells=getNumberOfCells(); @@ -1127,7 +1127,7 @@ MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::Merge1SGTUMeshesLL(std::vector ret(new MEDCoupling1SGTUMesh(getName(),*_cm)); + MEDCouplingAutoRefCountObjectPtr ret(new MEDCoupling1SGTUMesh(getName().c_str(),*_cm)); ret->setCoords(_coords); std::size_t nbOfElemsRet=std::distance(begin,end); const int *inConn=_conn->getConstPointer(); @@ -1153,7 +1153,7 @@ MEDCouplingPointSet *MEDCoupling1SGTUMesh::buildPartOfMySelfKeepCoords2(int star { int ncell=getNumberOfCells(); int nbOfElemsRet=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCoupling1SGTUMesh::buildPartOfMySelfKeepCoords2 : "); - MEDCouplingAutoRefCountObjectPtr ret(new MEDCoupling1SGTUMesh(getName(),*_cm)); + MEDCouplingAutoRefCountObjectPtr ret(new MEDCoupling1SGTUMesh(getName().c_str(),*_cm)); ret->setCoords(_coords); const int *inConn=_conn->getConstPointer(); int sz=getNumberOfNodesPerCell(); @@ -1177,7 +1177,7 @@ MEDCouplingPointSet *MEDCoupling1SGTUMesh::buildPartOfMySelfKeepCoords2(int star MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception) { - MEDCouplingAutoRefCountObjectPtr ret(new MEDCoupling1SGTUMesh(getName(),*_cm)); + MEDCouplingAutoRefCountObjectPtr ret(new MEDCoupling1SGTUMesh(getName().c_str(),*_cm)); MEDCouplingAutoRefCountObjectPtr tmp1; const DataArrayInt *nodalConn(_conn); if(!nodalConn) @@ -2018,7 +2018,7 @@ MEDCouplingMesh *MEDCoupling1DGTUMesh::mergeMyselfWith(const MEDCouplingMesh *ot MEDCouplingUMesh *MEDCoupling1DGTUMesh::buildUnstructured() const throw(INTERP_KERNEL::Exception) { - MEDCouplingAutoRefCountObjectPtr ret=MEDCouplingUMesh::New(getName(),getMeshDimension()); + MEDCouplingAutoRefCountObjectPtr ret=MEDCouplingUMesh::New(getName().c_str(),getMeshDimension()); ret->setCoords(getCoords()); const int *nodalConn=_conn->begin(),*nodalConnI=_conn_indx->begin(); int nbCells=getNumberOfCells();//checkCoherency @@ -2104,7 +2104,7 @@ MEDCouplingPointSet *MEDCoupling1DGTUMesh::mergeMyselfWithOnSameCoords(const MED MEDCouplingPointSet *MEDCoupling1DGTUMesh::buildPartOfMySelfKeepCoords(const int *begin, const int *end) const { checkCoherency(); - MEDCouplingAutoRefCountObjectPtr ret(new MEDCoupling1DGTUMesh(getName(),*_cm)); + MEDCouplingAutoRefCountObjectPtr ret(new MEDCoupling1DGTUMesh(getName().c_str(),*_cm)); ret->setCoords(_coords); DataArrayInt *c=0,*ci=0; MEDCouplingUMesh::ExtractFromIndexedArrays(begin,end,_conn,_conn_indx,c,ci); @@ -2116,7 +2116,7 @@ MEDCouplingPointSet *MEDCoupling1DGTUMesh::buildPartOfMySelfKeepCoords(const int MEDCouplingPointSet *MEDCoupling1DGTUMesh::buildPartOfMySelfKeepCoords2(int start, int end, int step) const { checkCoherency(); - MEDCouplingAutoRefCountObjectPtr ret(new MEDCoupling1DGTUMesh(getName(),*_cm)); + MEDCouplingAutoRefCountObjectPtr ret(new MEDCoupling1DGTUMesh(getName().c_str(),*_cm)); ret->setCoords(_coords); DataArrayInt *c=0,*ci=0; MEDCouplingUMesh::ExtractFromIndexedArrays2(start,end,step,_conn,_conn_indx,c,ci); @@ -2403,7 +2403,7 @@ DataArrayInt *MEDCoupling1DGTUMesh::getNodalConnectivityIndex() const throw(INTE */ MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::copyWithNodalConnectivityPacked(bool& isShallowCpyOfNodalConnn) const throw(INTERP_KERNEL::Exception) { - MEDCouplingAutoRefCountObjectPtr ret(new MEDCoupling1DGTUMesh(getName(),*_cm)); + MEDCouplingAutoRefCountObjectPtr ret(new MEDCoupling1DGTUMesh(getName().c_str(),*_cm)); DataArrayInt *nc=0,*nci=0; isShallowCpyOfNodalConnn=retrievePackedNodalConnectivity(nc,nci); MEDCouplingAutoRefCountObjectPtr ncs(nc),ncis(nci); @@ -2586,7 +2586,7 @@ MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::Merge1DGTUMeshesLL(std::vector ret(new MEDCoupling1DGTUMesh(getName(),*_cm)); + MEDCouplingAutoRefCountObjectPtr ret(new MEDCoupling1DGTUMesh(getName().c_str(),*_cm)); MEDCouplingAutoRefCountObjectPtr tmp1,tmp2; const DataArrayInt *nodalConn(_conn),*nodalConnI(_conn_indx); if(!nodalConn) @@ -2673,8 +2673,8 @@ MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::New(const MEDCouplingUMesh *m) throw if(gts.size()!=1) throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::New : input mesh must have exactly one geometric type !"); int geoType((int)*gts.begin()); - MEDCouplingAutoRefCountObjectPtr ret(MEDCoupling1DGTUMesh::New(m->getName(),*gts.begin())); - ret->setCoords(m->getCoords()); ret->setDescription(m->getDescription()); + MEDCouplingAutoRefCountObjectPtr ret(MEDCoupling1DGTUMesh::New(m->getName().c_str(),*gts.begin())); + ret->setCoords(m->getCoords()); ret->setDescription(m->getDescription().c_str()); int nbCells(m->getNumberOfCells()); MEDCouplingAutoRefCountObjectPtr conn(DataArrayInt::New()),connI(DataArrayInt::New()); conn->alloc(m->getMeshLength()-nbCells,1); connI->alloc(nbCells+1,1); diff --git a/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx b/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx index 2e2b03870..8f22b05f4 100644 --- a/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx +++ b/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx @@ -96,7 +96,7 @@ try:_mesh2D(const_cast(mesh2D)),_mesh1D(MEDCouplingUMesh::Ne if(_mesh2D!=0) _mesh2D->incrRef(); computeExtrusion(mesh3D); - setName(mesh3D->getName()); + setName(mesh3D->getName().c_str()); } catch(INTERP_KERNEL::Exception& e) { @@ -438,7 +438,7 @@ MEDCouplingUMesh *MEDCouplingExtrudedMesh::build3DUnstructuredMesh() const MEDCouplingUMesh *ret=_mesh2D->buildExtrudedMesh(_mesh1D,0); const int *renum=_mesh3D_ids->getConstPointer(); ret->renumberCells(renum,false); - ret->setName(getName()); + ret->setName(getName().c_str()); return ret; } diff --git a/src/MEDCoupling/MEDCouplingField.hxx b/src/MEDCoupling/MEDCouplingField.hxx index 52a2b92c0..284d04799 100644 --- a/src/MEDCoupling/MEDCouplingField.hxx +++ b/src/MEDCoupling/MEDCouplingField.hxx @@ -54,9 +54,9 @@ namespace ParaMEDMEM void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh); const ParaMEDMEM::MEDCouplingMesh *getMesh() const { return _mesh; } void setName(const char *name) { _name=name; } - const char *getDescription() const { return _desc.c_str(); } + std::string getDescription() const { return _desc; } void setDescription(const char *desc) { _desc=desc; } - const char *getName() const { return _name.c_str(); } + std::string getName() const { return _name; } TypeOfField getTypeOfField() const; NatureOfField getNature() const; virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception); diff --git a/src/MEDCoupling/MEDCouplingFieldDouble.cxx b/src/MEDCoupling/MEDCouplingFieldDouble.cxx index 1cdd440bf..45488f602 100644 --- a/src/MEDCoupling/MEDCouplingFieldDouble.cxx +++ b/src/MEDCoupling/MEDCouplingFieldDouble.cxx @@ -212,8 +212,8 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::buildNewTimeReprFromThis(TypeOfT disc=_type->clone(); MEDCouplingAutoRefCountObjectPtr ret=new MEDCouplingFieldDouble(getNature(),tdo,disc.retn()); ret->setMesh(getMesh()); - ret->setName(getName()); - ret->setDescription(getDescription()); + ret->setName(getName().c_str()); + ret->setDescription(getDescription().c_str()); return ret.retn(); } @@ -2531,7 +2531,7 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::keepSelectedComponents(const std MEDCouplingTimeDiscretization *td=_time_discr->keepSelectedComponents(compoIds); td->copyTinyAttrFrom(*_time_discr); MEDCouplingAutoRefCountObjectPtr ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone()); - ret->setName(getName()); + ret->setName(getName().c_str()); ret->setMesh(getMesh()); return ret.retn(); } @@ -2598,8 +2598,8 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::MergeFields(const MEDCouplingFie td->copyTinyAttrFrom(*f1->_time_discr); MEDCouplingAutoRefCountObjectPtr ret=new MEDCouplingFieldDouble(f1->getNature(),td,f1->_type->clone()); ret->setMesh(m); - ret->setName(f1->getName()); - ret->setDescription(f1->getDescription()); + ret->setName(f1->getName().c_str()); + ret->setDescription(f1->getDescription().c_str()); return ret.retn(); } @@ -2644,13 +2644,13 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::MergeFields(const std::vector_time_discr; } MEDCouplingAutoRefCountObjectPtr m=MEDCouplingUMesh::MergeUMeshes(ms2); - m->setName(ms2[0]->getName()); m->setDescription(ms2[0]->getDescription()); + m->setName(ms2[0]->getName().c_str()); m->setDescription(ms2[0]->getDescription().c_str()); MEDCouplingTimeDiscretization *td=tds[0]->aggregate(tds); td->copyTinyAttrFrom(*(a[0]->_time_discr)); MEDCouplingAutoRefCountObjectPtr ret=new MEDCouplingFieldDouble(a[0]->getNature(),td,a[0]->_type->clone()); ret->setMesh(m); - ret->setName(a[0]->getName()); - ret->setDescription(a[0]->getDescription()); + ret->setName(a[0]->getName().c_str()); + ret->setDescription(a[0]->getDescription().c_str()); return ret.retn(); } @@ -3098,9 +3098,9 @@ void MEDCouplingFieldDouble::WriteVTK(const char *fileName, const std::vectorgetTypeOfField(); if(typ==ON_CELLS) - cur->getArray()->writeVTK(coss,8,cur->getName()); + cur->getArray()->writeVTK(coss,8,cur->getName().c_str()); else if(typ==ON_NODES) - cur->getArray()->writeVTK(noss,8,cur->getName()); + cur->getArray()->writeVTK(noss,8,cur->getName().c_str()); } m->writeVTKAdvanced(fileName,coss.str(),noss.str()); } diff --git a/src/MEDCoupling/MEDCouplingMesh.hxx b/src/MEDCoupling/MEDCouplingMesh.hxx index 52cbc72c5..cd460600b 100644 --- a/src/MEDCoupling/MEDCouplingMesh.hxx +++ b/src/MEDCoupling/MEDCouplingMesh.hxx @@ -53,9 +53,9 @@ namespace ParaMEDMEM public: std::size_t getHeapMemorySize() const; void setName(const char *name) { _name=name; } - const char *getName() const { return _name.c_str(); } + std::string getName() const { return _name; } void setDescription(const char *descr) { _description=descr; } - const char *getDescription() const { return _description.c_str(); } + std::string getDescription() const { return _description; } double getTime(int& iteration, int& order) const { iteration=_iteration; order=_order; return _time; } void setTime(double val, int iteration, int order) { _time=val; _iteration=iteration; _order=order; } void setTimeUnit(const char *unit) { _time_unit=unit; } diff --git a/src/MEDCoupling/MEDCouplingPointSet.cxx b/src/MEDCoupling/MEDCouplingPointSet.cxx index f8c5f4183..961fb248a 100644 --- a/src/MEDCoupling/MEDCouplingPointSet.cxx +++ b/src/MEDCoupling/MEDCouplingPointSet.cxx @@ -1496,7 +1496,7 @@ DataArrayInt *MEDCouplingPointSet::getCellIdsLyingOnNodes(const int *begin, cons { DataArrayInt *cellIdsKept=0; fillCellIdsToKeepFromNodeIds(begin,end,fullyIn,cellIdsKept); - cellIdsKept->setName(getName()); + cellIdsKept->setName(getName().c_str()); return cellIdsKept; } diff --git a/src/MEDCoupling/MEDCouplingStructuredMesh.cxx b/src/MEDCoupling/MEDCouplingStructuredMesh.cxx index 6127b68c6..ae715ec5d 100644 --- a/src/MEDCoupling/MEDCouplingStructuredMesh.cxx +++ b/src/MEDCoupling/MEDCouplingStructuredMesh.cxx @@ -270,7 +270,7 @@ MEDCouplingUMesh *MEDCouplingStructuredMesh::buildUnstructured() const throw(INT int ns[3]; getNodeGridStructure(ns); MEDCouplingAutoRefCountObjectPtr conn(Build1GTNodalConnectivity(ns,ns+meshDim)); - MEDCouplingAutoRefCountObjectPtr ret(MEDCoupling1SGTUMesh::New(getName(),GetGeoTypeGivenMeshDimension(meshDim))); + MEDCouplingAutoRefCountObjectPtr ret(MEDCoupling1SGTUMesh::New(getName().c_str(),GetGeoTypeGivenMeshDimension(meshDim))); ret->setNodalConnectivity(conn); ret->setCoords(coords); return ret->buildUnstructured(); } diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index f90c9c49a..ea3d4f8fa 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -1785,7 +1785,7 @@ bool MEDCouplingUMesh::areCellsIncludedIn(const MEDCouplingUMesh *other, int com } MEDCouplingAutoRefCountObjectPtr o2n=mesh->zipConnectivityTraducer(compType,nbOfCells); arr=o2n->substr(nbOfCells); - arr->setName(other->getName()); + arr->setName(other->getName().c_str()); int tmp; if(other->getNumberOfCells()==0) return true; @@ -1829,7 +1829,7 @@ bool MEDCouplingUMesh::areCellsIncludedIn2(const MEDCouplingUMesh *other, DataAr } } } - arr2->setName(other->getName()); + arr2->setName(other->getName().c_str()); if(arr2->presenceOfValue(0)) return false; arr=arr2.retn(); @@ -2799,7 +2799,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildSetInstanceFromThis(int spaceDim) const int mdim=getMeshDimension(); if(mdim<0) throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSetInstanceFromThis : invalid mesh dimension ! Should be >= 0 !"); - MEDCouplingAutoRefCountObjectPtr ret=MEDCouplingUMesh::New(getName(),mdim); + MEDCouplingAutoRefCountObjectPtr ret=MEDCouplingUMesh::New(getName().c_str(),mdim); MEDCouplingAutoRefCountObjectPtr tmp1,tmp2; bool needToCpyCT=true; if(!_nodal_connec) @@ -6709,7 +6709,7 @@ MEDCoupling1GTUMesh *MEDCouplingUMesh::convertIntoSingleGeoTypeMesh() const thro if(_types.size()!=1) throw INTERP_KERNEL::Exception("MEDCouplingUMesh::convertIntoSingleGeoTypeMesh : current mesh does not contain exactly one geometric type !"); INTERP_KERNEL::NormalizedCellType typ=*_types.begin(); - MEDCouplingAutoRefCountObjectPtr ret=MEDCoupling1GTUMesh::New(getName(),typ); + MEDCouplingAutoRefCountObjectPtr ret=MEDCoupling1GTUMesh::New(getName().c_str(),typ); ret->setCoords(getCoords()); MEDCoupling1SGTUMesh *retC=dynamic_cast((MEDCoupling1GTUMesh*)ret); if(retC) @@ -7408,7 +7408,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::FuseUMeshesOnSameCoords(const std::vectoralloc(curNbOfCells,1); std::copy(o2nPtr+offset,o2nPtr+offset+curNbOfCells,tmp->getPointer()); offset+=curNbOfCells; - tmp->setName(meshes[i]->getName()); + tmp->setName(meshes[i]->getName().c_str()); corr[i]=tmp; } return ret.retn(); @@ -9175,7 +9175,7 @@ MEDCouplingUMesh *MEDCouplingUMesh::buildSpreadZonesWithPoly() const throw(INTER std::vector partition=partitionBySpreadZone(); std::vector< MEDCouplingAutoRefCountObjectPtr > partitionAuto; partitionAuto.reserve(partition.size()); std::copy(partition.begin(),partition.end(),std::back_insert_iterator > >(partitionAuto)); - MEDCouplingAutoRefCountObjectPtr ret=MEDCouplingUMesh::New(getName(),mdim); + MEDCouplingAutoRefCountObjectPtr ret=MEDCouplingUMesh::New(getName().c_str(),mdim); ret->setCoords(getCoords()); ret->allocateCells((int)partition.size()); // diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx index 6fa8ba4cd..c89197389 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest1.cxx @@ -1346,15 +1346,15 @@ void MEDCouplingBasicsTest1::testMergeMeshOnSameCoords1() CPPUNIT_ASSERT_EQUAL(15,m4->getNumberOfCells()); const int cells1[5]={0,1,2,3,4}; MEDCouplingPointSet *m1_1=m4->buildPartOfMySelf(cells1,cells1+5,true); - m1_1->setName(m1->getName()); + m1_1->setName(m1->getName().c_str()); CPPUNIT_ASSERT(m1->isEqual(m1_1,1e-12)); const int cells2[5]={5,6,7,8,9}; MEDCouplingPointSet *m2_1=m4->buildPartOfMySelf(cells2,cells2+5,true); - m2_1->setName(m2->getName()); + m2_1->setName(m2->getName().c_str()); CPPUNIT_ASSERT(m2->isEqual(m2_1,1e-12)); const int cells3[5]={10,11,12,13,14}; MEDCouplingPointSet *m3_1=m4->buildPartOfMySelf(cells3,cells3+5,true); - m3_1->setName(m3->getName()); + m3_1->setName(m3->getName().c_str()); CPPUNIT_ASSERT(m3->isEqual(m3_1,1e-12)); m1_1->decrRef(); m2_1->decrRef(); m3_1->decrRef(); // @@ -2012,7 +2012,7 @@ void MEDCouplingBasicsTest1::testSplitByType() CPPUNIT_ASSERT_EQUAL(3,(int)v.size()); std::vector v2(v.begin(),v.end()); MEDCouplingUMesh *m2=MEDCouplingUMesh::MergeUMeshesOnSameCoords(v2); - m2->setName(m1->getName()); + m2->setName(m1->getName().c_str()); CPPUNIT_ASSERT(m1->isEqual(m2,1.e-12)); for(std::vector::const_iterator iter=v.begin();iter!=v.end();iter++) (*iter)->decrRef(); @@ -2504,8 +2504,8 @@ void MEDCouplingBasicsTest1::testCMesh2() int cells2[2]={25,26}; DataArrayInt* arr1; - MEDCouplingUMesh *partMesh2= - dynamic_cast(mesh1->buildPartAndReduceNodes(cells2,cells2+2,arr1)); + MEDCouplingCMesh *partMesh2= + dynamic_cast(mesh1->buildPartAndReduceNodes(cells2,cells2+2,arr1)); CPPUNIT_ASSERT(partMesh2); CPPUNIT_ASSERT_EQUAL(2,partMesh2->getNumberOfCellsWithType(INTERP_KERNEL::NORM_HEXA8)); CPPUNIT_ASSERT_EQUAL(12,partMesh2->getNumberOfNodes()); @@ -2666,7 +2666,7 @@ void MEDCouplingBasicsTest1::testChangeSpaceDimension() CPPUNIT_ASSERT_EQUAL(3,m1->getSpaceDimension()); m1->changeSpaceDimension(2); CPPUNIT_ASSERT_EQUAL(2,m1->getSpaceDimension()); - m1->setName(m2->getName()); + m1->setName(m2->getName().c_str()); CPPUNIT_ASSERT(m1->isEqual(m2,1e-12)); m1->changeSpaceDimension(3); CPPUNIT_ASSERT_EQUAL(3,m1->getSpaceDimension()); diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest3.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest3.cxx index bda6db201..65fb32382 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest3.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest3.cxx @@ -2406,7 +2406,7 @@ void MEDCouplingBasicsTest3::testMergeUMeshes2() // const int vec3[5]={0,1,2,3,4}; MEDCouplingUMesh *m4_1=(MEDCouplingUMesh *)m4->buildPartOfMySelf(vec3,vec3+5,false); - m4_1->setName(m1->getName()); + m4_1->setName(m1->getName().c_str()); CPPUNIT_ASSERT(m4_1->isEqual(m1,1e-12)); m4_1->decrRef(); // @@ -2424,7 +2424,7 @@ void MEDCouplingBasicsTest3::testMergeUMeshes2() CPPUNIT_ASSERT_EQUAL(2,m4_3->getNumberOfCells()); CPPUNIT_ASSERT_EQUAL(3,m4_3->getNumberOfNodes()); m3_2->zipCoords(); - m4_3->setName(m3_2->getName()); + m4_3->setName(m3_2->getName().c_str()); CPPUNIT_ASSERT(m4_3->isEqual(m3_2,1e-12)); m4_3->decrRef(); // diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx index 9e88f8e27..8170b7085 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest4.cxx @@ -1714,7 +1714,7 @@ void MEDCouplingBasicsTest4::testUMeshMergeMeshesCVW1() MEDCouplingUMesh *m=build3DSurfTargetMesh_1(); MEDCouplingUMesh *m2=MEDCouplingUMesh::New("toto",2); MEDCouplingUMesh *m3=MEDCouplingUMesh::MergeUMeshes(m,m2); - m3->setName(m->getName()); + m3->setName(m->getName().c_str()); CPPUNIT_ASSERT(m->isEqual(m3,1e-12)); m3->decrRef(); m->decrRef(); diff --git a/src/MEDCoupling/Test/MEDCouplingBasicsTest5.cxx b/src/MEDCoupling/Test/MEDCouplingBasicsTest5.cxx index a4d9b168b..09854dfc7 100644 --- a/src/MEDCoupling/Test/MEDCouplingBasicsTest5.cxx +++ b/src/MEDCoupling/Test/MEDCouplingBasicsTest5.cxx @@ -1353,7 +1353,7 @@ void MEDCouplingBasicsTest5::testComputeSkin1() CPPUNIT_ASSERT_EQUAL((std::size_t)18,ids->getNbOfElems()); CPPUNIT_ASSERT(std::equal(expected3,expected3+18,ids->getConstPointer())); MEDCouplingUMesh *part=dynamic_cast(umesh->buildFacePartOfMySelfNode(ids->begin(),ids->end(),true)); - part->setName(skin->getName()); + part->setName(skin->getName().c_str()); CPPUNIT_ASSERT(part->isEqual(skin,1e-12)); MEDCouplingUMesh *part2=dynamic_cast(part->buildPartOfMySelf2(1,18,2,true)); DataArrayInt *ids2=DataArrayInt::Range(0,18,2); -- 2.39.2