throw INTERP_KERNEL::Exception("MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh : the first instance in input parts is null !");
const DataArrayDouble *coords(firstPart->getCoords());
int meshDim(firstPart->getMeshDimension());
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret(MEDCouplingUMesh::New(firstPart->getName(),meshDim)); ret->setDescription(firstPart->getDescription());
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> 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++)
if(gts.size()!=1)
throw INTERP_KERNEL::Exception("MEDCoupling1SGTUMesh::New : input mesh must have exactly one geometric type !");
int geoType((int)*gts.begin());
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New(m->getName(),*gts.begin()));
- ret->setCoords(m->getCoords()); ret->setDescription(m->getDescription());
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> 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<DataArrayInt> conn(DataArrayInt::New()); conn->alloc(nbCells*nbOfNodesPerCell,1);
MEDCouplingUMesh *MEDCoupling1SGTUMesh::buildUnstructured() const throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName(),getMeshDimension());
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName().c_str(),getMeshDimension());
ret->setCoords(getCoords());
const int *nodalConn=_conn->begin();
int nbCells=getNumberOfCells();
MEDCouplingPointSet *MEDCoupling1SGTUMesh::buildPartOfMySelfKeepCoords(const int *begin, const int *end) const
{
int ncell=getNumberOfCells();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName(),*_cm));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName().c_str(),*_cm));
ret->setCoords(_coords);
std::size_t nbOfElemsRet=std::distance(begin,end);
const int *inConn=_conn->getConstPointer();
{
int ncell=getNumberOfCells();
int nbOfElemsRet=DataArray::GetNumberOfItemGivenBESRelative(start,end,step,"MEDCoupling1SGTUMesh::buildPartOfMySelfKeepCoords2 : ");
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName(),*_cm));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName().c_str(),*_cm));
ret->setCoords(_coords);
const int *inConn=_conn->getConstPointer();
int sz=getNumberOfNodesPerCell();
MEDCoupling1SGTUMesh *MEDCoupling1SGTUMesh::buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName(),*_cm));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(new MEDCoupling1SGTUMesh(getName().c_str(),*_cm));
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp1;
const DataArrayInt *nodalConn(_conn);
if(!nodalConn)
MEDCouplingUMesh *MEDCoupling1DGTUMesh::buildUnstructured() const throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName(),getMeshDimension());
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName().c_str(),getMeshDimension());
ret->setCoords(getCoords());
const int *nodalConn=_conn->begin(),*nodalConnI=_conn_indx->begin();
int nbCells=getNumberOfCells();//checkCoherency
MEDCouplingPointSet *MEDCoupling1DGTUMesh::buildPartOfMySelfKeepCoords(const int *begin, const int *end) const
{
checkCoherency();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName().c_str(),*_cm));
ret->setCoords(_coords);
DataArrayInt *c=0,*ci=0;
MEDCouplingUMesh::ExtractFromIndexedArrays(begin,end,_conn,_conn_indx,c,ci);
MEDCouplingPointSet *MEDCoupling1DGTUMesh::buildPartOfMySelfKeepCoords2(int start, int end, int step) const
{
checkCoherency();
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> 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);
*/
MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::copyWithNodalConnectivityPacked(bool& isShallowCpyOfNodalConnn) const throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName().c_str(),*_cm));
DataArrayInt *nc=0,*nci=0;
isShallowCpyOfNodalConnn=retrievePackedNodalConnectivity(nc,nci);
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> ncs(nc),ncis(nci);
MEDCoupling1DGTUMesh *MEDCoupling1DGTUMesh::buildSetInstanceFromThis(int spaceDim) const throw(INTERP_KERNEL::Exception)
{
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName(),*_cm));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(new MEDCoupling1DGTUMesh(getName().c_str(),*_cm));
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp1,tmp2;
const DataArrayInt *nodalConn(_conn),*nodalConnI(_conn_indx);
if(!nodalConn)
if(gts.size()!=1)
throw INTERP_KERNEL::Exception("MEDCoupling1DGTUMesh::New : input mesh must have exactly one geometric type !");
int geoType((int)*gts.begin());
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(MEDCoupling1DGTUMesh::New(m->getName(),*gts.begin()));
- ret->setCoords(m->getCoords()); ret->setDescription(m->getDescription());
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1DGTUMesh> ret(MEDCoupling1DGTUMesh::New(m->getName().c_str(),*gts.begin()));
+ ret->setCoords(m->getCoords()); ret->setDescription(m->getDescription().c_str());
int nbCells(m->getNumberOfCells());
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(DataArrayInt::New()),connI(DataArrayInt::New());
conn->alloc(m->getMeshLength()-nbCells,1); connI->alloc(nbCells+1,1);
if(_mesh2D!=0)
_mesh2D->incrRef();
computeExtrusion(mesh3D);
- setName(mesh3D->getName());
+ setName(mesh3D->getName().c_str());
}
catch(INTERP_KERNEL::Exception& e)
{
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;
}
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);
disc=_type->clone();
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> 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();
}
MEDCouplingTimeDiscretization *td=_time_discr->keepSelectedComponents(compoIds);
td->copyTinyAttrFrom(*_time_discr);
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=new MEDCouplingFieldDouble(getNature(),td,_type->clone());
- ret->setName(getName());
+ ret->setName(getName().c_str());
ret->setMesh(getMesh());
return ret.retn();
}
td->copyTinyAttrFrom(*f1->_time_discr);
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> 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();
}
tds[i]=a[i]->_time_discr;
}
MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> 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<MEDCouplingFieldDouble> 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();
}
}
TypeOfField typ=cur->getTypeOfField();
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());
}
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; }
{
DataArrayInt *cellIdsKept=0;
fillCellIdsToKeepFromNodeIds(begin,end,fullyIn,cellIdsKept);
- cellIdsKept->setName(getName());
+ cellIdsKept->setName(getName().c_str());
return cellIdsKept;
}
int ns[3];
getNodeGridStructure(ns);
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(Build1GTNodalConnectivity(ns,ns+meshDim));
- MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New(getName(),GetGeoTypeGivenMeshDimension(meshDim)));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> ret(MEDCoupling1SGTUMesh::New(getName().c_str(),GetGeoTypeGivenMeshDimension(meshDim)));
ret->setNodalConnectivity(conn); ret->setCoords(coords);
return ret->buildUnstructured();
}
}
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> 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;
}
}
}
- arr2->setName(other->getName());
+ arr2->setName(other->getName().c_str());
if(arr2->presenceOfValue(0))
return false;
arr=arr2.retn();
int mdim=getMeshDimension();
if(mdim<0)
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::buildSetInstanceFromThis : invalid mesh dimension ! Should be >= 0 !");
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName(),mdim);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName().c_str(),mdim);
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> tmp1,tmp2;
bool needToCpyCT=true;
if(!_nodal_connec)
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<MEDCoupling1GTUMesh> ret=MEDCoupling1GTUMesh::New(getName(),typ);
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> ret=MEDCoupling1GTUMesh::New(getName().c_str(),typ);
ret->setCoords(getCoords());
MEDCoupling1SGTUMesh *retC=dynamic_cast<MEDCoupling1SGTUMesh *>((MEDCoupling1GTUMesh*)ret);
if(retC)
tmp->alloc(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();
std::vector<DataArrayInt *> partition=partitionBySpreadZone();
std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > partitionAuto; partitionAuto.reserve(partition.size());
std::copy(partition.begin(),partition.end(),std::back_insert_iterator<std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > >(partitionAuto));
- MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName(),mdim);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New(getName().c_str(),mdim);
ret->setCoords(getCoords());
ret->allocateCells((int)partition.size());
//
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();
//
CPPUNIT_ASSERT_EQUAL(3,(int)v.size());
std::vector<const MEDCouplingUMesh *> 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<MEDCouplingUMesh *>::const_iterator iter=v.begin();iter!=v.end();iter++)
(*iter)->decrRef();
int cells2[2]={25,26};
DataArrayInt* arr1;
- MEDCouplingUMesh *partMesh2=
- dynamic_cast<MEDCouplingUMesh *>(mesh1->buildPartAndReduceNodes(cells2,cells2+2,arr1));
+ MEDCouplingCMesh *partMesh2=
+ dynamic_cast<MEDCouplingCMesh *>(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());
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());
//
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();
//
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();
//
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();
CPPUNIT_ASSERT_EQUAL((std::size_t)18,ids->getNbOfElems());
CPPUNIT_ASSERT(std::equal(expected3,expected3+18,ids->getConstPointer()));
MEDCouplingUMesh *part=dynamic_cast<MEDCouplingUMesh *>(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<MEDCouplingUMesh *>(part->buildPartOfMySelf2(1,18,2,true));
DataArrayInt *ids2=DataArrayInt::Range(0,18,2);