char *MEDCouplingFieldDoubleServant::getName()
{
- return CORBA::string_dup(getPointer()->getName());
+ return CORBA::string_dup(getPointer()->getName().c_str());
}
SALOME_TYPES::ListOfString *MEDCouplingFieldDoubleServant::getInfoOnComponents()
char *MEDCouplingMeshServant::getName()
{
- return CORBA::string_dup(getPointer()->getName());
+ return CORBA::string_dup(getPointer()->getName().c_str());
}
void MEDCouplingMeshServant::getTinyInfo(SALOME_TYPES::ListOfDouble_out da, SALOME_TYPES::ListOfLong_out la, SALOME_TYPES::ListOfString_out sa)
%newobject ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh;
%newobject ParaMEDMEM::MEDCouplingStructuredMesh::buildStructuredSubPart;
%newobject ParaMEDMEM::MEDCouplingStructuredMesh::BuildExplicitIdsFrom;
+%newobject ParaMEDMEM::MEDCouplingStructuredMesh::Build1GTNodalConnectivity;
%newobject ParaMEDMEM::MEDCouplingCMesh::New;
%newobject ParaMEDMEM::MEDCouplingCMesh::clone;
%newobject ParaMEDMEM::MEDCouplingCMesh::getCoordsAt;
{
public:
void setName(const char *name);
- const char *getName() const;
+ std::string getName() const;
void setDescription(const char *descr);
- const char *getDescription() const;
+ std::string getDescription() const;
void setTime(double val, int iteration, int order);
void setTimeUnit(const char *unit);
const char *getTimeUnit() const;
return MEDCouplingStructuredMesh::BuildExplicitIdsFrom(tmp5,inp);
}
+ static DataArrayInt *Build1GTNodalConnectivity(PyObject *li) throw(INTERP_KERNEL::Exception)
+ {
+ int szArr,sw,iTypppArr;
+ std::vector<int> stdvecTyyppArr;
+ const int *tmp=convertObjToPossibleCpp1_Safe(li,sw,szArr,iTypppArr,stdvecTyyppArr);
+ return MEDCouplingStructuredMesh::Build1GTNodalConnectivity(tmp,tmp+szArr);
+ }
+
static PyObject *IsPartStructured(PyObject *li, PyObject *st) throw(INTERP_KERNEL::Exception)
{
int szArr,sw,iTypppArr;
virtual void copyTinyStringsFrom(const MEDCouplingField *other) throw(INTERP_KERNEL::Exception);
void setMesh(const ParaMEDMEM::MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
void setName(const char *name) throw(INTERP_KERNEL::Exception);
- const char *getDescription() const throw(INTERP_KERNEL::Exception);
+ std::string getDescription() const throw(INTERP_KERNEL::Exception);
void setDescription(const char *desc) throw(INTERP_KERNEL::Exception);
- const char *getName() const throw(INTERP_KERNEL::Exception);
+ std::string getName() const throw(INTERP_KERNEL::Exception);
TypeOfField getTypeOfField() const throw(INTERP_KERNEL::Exception);
NatureOfField getNature() const throw(INTERP_KERNEL::Exception);
virtual void setNature(NatureOfField nat) throw(INTERP_KERNEL::Exception);
MEDFileFields *fs=_fields;
if(fs)
for(std::size_t i=0;i<meshesImpacted.size();i++)
- fs->renumberEntitiesLyingOnMesh(meshesImpacted[i]->getName(),oldCodeOfMeshImpacted[i],newCodeOfMeshImpacted[i],renumParamsOfMeshImpacted[i]);
+ fs->renumberEntitiesLyingOnMesh(meshesImpacted[i]->getName().c_str(),oldCodeOfMeshImpacted[i],newCodeOfMeshImpacted[i],renumParamsOfMeshImpacted[i]);
}
return !meshesImpacted.empty();
}
return finishField(type,glob,dads,locs,mesh,isPfl,arrOut,nasc);
}
MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m2=mesh->buildPart(da->getConstPointer(),da->getConstPointer()+da->getNbOfElems());
- m2->setName(mesh->getName());
+ m2->setName(mesh->getName().c_str());
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=finishField(type,glob,dads,locs,m2,isPfl,arrOut,nasc);
isPfl=true;
return ret.retn();
{
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> da3=da->transformWithIndArrR(arr2->begin(),arr2->end());
arrOut->renumberInPlace(da3->getConstPointer());
- mesh2->setName(mesh->getName());
+ mesh2->setName(mesh->getName().c_str());
ret->setMesh(mesh2);
return ret.retn();
}
MEDCouplingFieldDouble *MEDFileAnyTypeField1TSWithoutSDA::getFieldOnMeshAtLevel(TypeOfField type, int renumPol, const MEDFileFieldGlobsReal *glob, const MEDCouplingMesh *mesh, const DataArrayInt *cellRenum, const DataArrayInt *nodeRenum, MEDCouplingAutoRefCountObjectPtr<DataArray>& arrOut, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception)
{
static const char msg1[]="MEDFileField1TSWithoutSDA::getFieldOnMeshAtLevel : request for a renumbered field following mesh numbering whereas it is a profile field !";
- int meshId=getMeshIdFromMeshName(mesh->getName());
+ int meshId=getMeshIdFromMeshName(mesh->getName().c_str());
bool isPfl=false;
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=_field_per_mesh[meshId]->getFieldOnMeshAtLevel(type,glob,mesh,isPfl,arrOut,nasc);
switch(renumPol)
DataArray *MEDFileAnyTypeField1TSWithoutSDA::getFieldWithProfile(TypeOfField type, int meshDimRelToMax, const MEDFileMesh *mesh, DataArrayInt *&pfl, const MEDFileFieldGlobsReal *glob, const MEDFileFieldNameScope& nasc) const throw(INTERP_KERNEL::Exception)
{
MEDCouplingAutoRefCountObjectPtr<MEDCouplingMesh> m=mesh->getGenMeshAtLevel(meshDimRelToMax);
- int meshId=getMeshIdFromMeshName(mesh->getName());
+ int meshId=getMeshIdFromMeshName(mesh->getName().c_str());
MEDCouplingAutoRefCountObjectPtr<DataArray> ret=_field_per_mesh[meshId]->getFieldOnMeshAtLevelWithPfl(type,m,pfl,glob,nasc);
ret->setName(nasc.getName().c_str());
return ret.retn();
{
public:
void MEDLOADER_EXPORT simpleRepr(std::ostream& oss) const;
- const MEDLOADER_EXPORT std::string& getName() const { return _name; }
+ std::string MEDLOADER_EXPORT getName() const { return _name; }
void MEDLOADER_EXPORT setName(const char *name);
static MEDFileFieldLoc *New(med_idt fid, const char *locName);
static MEDFileFieldLoc *New(med_idt fid, int id);
std::vector<int> levs(1,0);
return MEDMeshMultiLev::New(mst->getTheMesh(),levs);
}
+ else
+ return MEDMeshMultiLev::NewOnlyOnNode(mst->getTheMesh(),_already_checked[pos1][0].getPfl(globs));
}
}
throw INTERP_KERNEL::Exception("MEDMeshMultiLev::New 2 : unrecognized type of mesh ! Must be in [MEDFileUMesh,MEDFileCMesh,MEDFileCurveLinearMesh] !");
}
+MEDMeshMultiLev *MEDMeshMultiLev::NewOnlyOnNode(const MEDFileMesh *m, const DataArrayInt *pflOnNode) throw(INTERP_KERNEL::Exception)
+{
+ std::vector<int> levs(1,0);
+ MEDCouplingAutoRefCountObjectPtr<MEDMeshMultiLev> ret(MEDMeshMultiLev::New(m,levs));
+ ret->selectPartOfNodes(pflOnNode);
+ return ret.retn();
+}
+
void MEDMeshMultiLev::setNodeReduction(const DataArrayInt *nr)
{
if(nr)
}
}
+void MEDUMeshMultiLev::selectPartOfNodes(const DataArrayInt *pflNodes) throw(INTERP_KERNEL::Exception)
+{
+ if(!pflNodes || !pflNodes->isAllocated())
+ return ;
+ /*std::vector<int> ngs(getNodeGridStructure());
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(MEDCouplingStructuredMesh::Build1GTNodalConnectivity(&ngs[0],&ngs[0]+ngs.size()));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> m(MEDCoupling1SGTUMesh::New("",GMEDCouplingStructuredMesh::etGeoTypeGivenMeshDimension(ngs.size())));
+ m->setNodalConnectivity(conn);
+ DataArrayInt *cellIds=0;
+ m->fillCellIdsToKeepFromNodeIds(pflNodes->begin(),pflNodes->end(),true,cellIds);
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellIdsSafe(cellIds);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> m2(m->buildPartOfMySelfKeepCoords(cellIds->begin(),cellIds->end()));
+ int tmp=-1;
+ _node_reduction=m2->getNodeIdsInUse(tmp);*/
+}
+
MEDCMeshMultiLev *MEDCMeshMultiLev::New(const MEDFileCMesh *m, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception)
{
return new MEDCMeshMultiLev(m,levs);
}
}
-MEDCMeshMultiLev::MEDCMeshMultiLev(const MEDFileCMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities):MEDMeshMultiLev(gts,pfls,nbEntities)
+MEDCMeshMultiLev::MEDCMeshMultiLev(const MEDFileCMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities):MEDStructuredMeshMultiLev(gts,pfls,nbEntities)
{
if(!m)
throw INTERP_KERNEL::Exception("MEDCMeshMultiLev constructor 2 : null input pointer !");
}
}
+std::vector<int> MEDCMeshMultiLev::getNodeGridStructure() const throw(INTERP_KERNEL::Exception)
+{
+ std::vector<int> ret(_coords.size());
+ for(std::size_t i=0;i<_coords.size();i++)
+ ret[i]=_coords[i]->getNumberOfTuples();
+ return ret;
+}
+
+//=
+
MEDCurveLinearMeshMultiLev *MEDCurveLinearMeshMultiLev::New(const MEDFileCurveLinearMesh *m, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception)
{
return new MEDCurveLinearMeshMultiLev(m,levs);
_structure=m->getMesh()->getNodeGridStructure();
}
-MEDCurveLinearMeshMultiLev::MEDCurveLinearMeshMultiLev(const MEDFileCurveLinearMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities):MEDMeshMultiLev(gts,pfls,nbEntities)
+MEDCurveLinearMeshMultiLev::MEDCurveLinearMeshMultiLev(const MEDFileCurveLinearMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities):MEDStructuredMeshMultiLev(gts,pfls,nbEntities)
{
if(!m)
throw INTERP_KERNEL::Exception("MEDCurveLinearMeshMultiLev constructor 2 : null input pointer !");
_coords=coords;
_structure=m->getMesh()->getNodeGridStructure();
}
+
+std::vector<int> MEDCurveLinearMeshMultiLev::getNodeGridStructure() const throw(INTERP_KERNEL::Exception)
+{
+ return _structure;
+}
+
+//=
+
+MEDStructuredMeshMultiLev::MEDStructuredMeshMultiLev()
+{
+}
+
+MEDStructuredMeshMultiLev::MEDStructuredMeshMultiLev(const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities):MEDMeshMultiLev(gts,pfls,nbEntities)
+{
+}
+
+void MEDStructuredMeshMultiLev::selectPartOfNodes(const DataArrayInt *pflNodes) throw(INTERP_KERNEL::Exception)
+{
+ if(!pflNodes || !pflNodes->isAllocated())
+ return ;
+ std::vector<int> ngs(getNodeGridStructure());
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> conn(MEDCouplingStructuredMesh::Build1GTNodalConnectivity(&ngs[0],&ngs[0]+ngs.size()));
+ MEDCouplingAutoRefCountObjectPtr<MEDCoupling1SGTUMesh> m(MEDCoupling1SGTUMesh::New("",MEDCouplingStructuredMesh::GetGeoTypeGivenMeshDimension(ngs.size())));
+ m->setNodalConnectivity(conn);
+ DataArrayInt *cellIds=0;
+ m->fillCellIdsToKeepFromNodeIds(pflNodes->begin(),pflNodes->end(),true,cellIds);
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cellIdsSafe(cellIds);
+ MEDCouplingAutoRefCountObjectPtr<MEDCouplingPointSet> m2(m->buildPartOfMySelfKeepCoords(cellIds->begin(),cellIds->end()));
+ int tmp=-1;
+ _node_reduction=m2->getNodeIdsInUse(tmp);
+}
public:
static MEDMeshMultiLev *New(const MEDFileMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities) throw(INTERP_KERNEL::Exception);
static MEDMeshMultiLev *New(const MEDFileMesh *m, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
+ static MEDMeshMultiLev *NewOnlyOnNode(const MEDFileMesh *m, const DataArrayInt *pflOnNode) throw(INTERP_KERNEL::Exception);
void setNodeReduction(const DataArrayInt *nr);
+ virtual void selectPartOfNodes(const DataArrayInt *pflNodes) throw(INTERP_KERNEL::Exception) = 0;
protected:
MEDMeshMultiLev();
MEDMeshMultiLev(const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
public:
static MEDUMeshMultiLev *New(const MEDFileUMesh *m, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
static MEDUMeshMultiLev *New(const MEDFileUMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities) throw(INTERP_KERNEL::Exception);
+ void selectPartOfNodes(const DataArrayInt *pflNodes) throw(INTERP_KERNEL::Exception);
private:
MEDUMeshMultiLev(const MEDFileUMesh *m, const std::vector<int>& levs);
MEDUMeshMultiLev(const MEDFileUMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> > _parts;
};
- class MEDCMeshMultiLev : public MEDMeshMultiLev
+ class MEDStructuredMeshMultiLev : public MEDMeshMultiLev
+ {
+ public:
+ void selectPartOfNodes(const DataArrayInt *pflNodes) throw(INTERP_KERNEL::Exception);
+ virtual std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception) = 0;
+ protected:
+ MEDStructuredMeshMultiLev();
+ MEDStructuredMeshMultiLev(const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
+ };
+
+ class MEDCMeshMultiLev : public MEDStructuredMeshMultiLev
{
public:
static MEDCMeshMultiLev *New(const MEDFileCMesh *m, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
static MEDCMeshMultiLev *New(const MEDFileCMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities) throw(INTERP_KERNEL::Exception);
+ std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
private:
MEDCMeshMultiLev(const MEDFileCMesh *m, const std::vector<int>& levs);
MEDCMeshMultiLev(const MEDFileCMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> > _coords;
};
- class MEDCurveLinearMeshMultiLev : public MEDMeshMultiLev
+ class MEDCurveLinearMeshMultiLev : public MEDStructuredMeshMultiLev
{
public:
static MEDCurveLinearMeshMultiLev *New(const MEDFileCurveLinearMesh *m, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
static MEDCurveLinearMeshMultiLev *New(const MEDFileCurveLinearMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls , const std::vector<int>& nbEntities) throw(INTERP_KERNEL::Exception);
+ std::vector<int> getNodeGridStructure() const throw(INTERP_KERNEL::Exception);
private:
MEDCurveLinearMeshMultiLev(const MEDFileCurveLinearMesh *m, const std::vector<int>& levs);
MEDCurveLinearMeshMultiLev(const MEDFileCurveLinearMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> cc=_coords->deepCpy();
umesh->setCoords(cc);
MEDFileUMeshSplitL1::ClearNonDiscrAttributes(umesh);
- umesh->setName(getName());
+ umesh->setName(getName().c_str());
return umesh;
}
}
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> szOfCellGrpOfSameType(tmp00);
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> idInMsOfCellGrpOfSameType(tmp11);
//
- newm1->setName(getName());
+ newm1->setName(getName().c_str());
const DataArrayInt *fam=getFamilyFieldAtLevel(-1);
if(!fam)
throw INTERP_KERNEL::Exception("MEDFileUMesh::duplicateNodesOnM1Group : internal problem !");
for(std::vector<const MEDCouplingUMesh *>::const_iterator it=ms.begin();it!=ms.end();it++)
{
int mdim=(*it)->getMeshDimension();
- setName((*it)->getName());
+ setName((*it)->getName().c_str());
setMeshAtLevel(mdim-zeDim,const_cast<MEDCouplingUMesh *>(*it),renum);
}
setName(name.c_str());
return ret;
}
-const char *MEDFileMeshMultiTS::getName() const throw(INTERP_KERNEL::Exception)
+std::string MEDFileMeshMultiTS::getName() const throw(INTERP_KERNEL::Exception)
{
if(_mesh_one_ts.empty())
throw INTERP_KERNEL::Exception("MEDFileMeshMultiTS::getName : no time steps set !");
virtual void clearNonDiscrAttributes() const;
void setName(const char *name) { _name=name; }
bool changeNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
- const char *getName() const { return _name.c_str(); }
+ std::string getName() const { return _name; }
const char *getUnivName() const { return _univ_name.c_str(); }
bool getUnivNameWrStatus() const { return _univ_wr_status; }
void setUnivNameWrStatus(bool newStatus) { _univ_wr_status=newStatus; }
void setDescription(const char *name) { _desc_name=name; }
- const char *getDescription() const { return _desc_name.c_str(); }
+ std::string getDescription() const { return _desc_name; }
void setOrder(int order) { _order=order; }
int getOrder() const { return _order; }
void setIteration(int it) { _iteration=it; }
static MEDFileMeshMultiTS *New(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception);
MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
std::size_t getHeapMemorySize() const;
- const char *getName() const throw(INTERP_KERNEL::Exception);
+ std::string getName() const throw(INTERP_KERNEL::Exception);
void setName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
bool changeNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
MEDFileMesh *getOneTimeStep() const throw(INTERP_KERNEL::Exception);
const MEDCoupling1GTUMesh *tmp(*it);
if(tmp)
{
- (const_cast<MEDCoupling1GTUMesh *>(tmp))->setName(master.getName());
- (const_cast<MEDCoupling1GTUMesh *>(tmp))->setDescription(master.getDescription());
+ (const_cast<MEDCoupling1GTUMesh *>(tmp))->setName(master.getName().c_str());
+ (const_cast<MEDCoupling1GTUMesh *>(tmp))->setDescription(master.getDescription().c_str());
(const_cast<MEDCoupling1GTUMesh *>(tmp))->setTime(master.getTimeValue(),master.getIteration(),master.getOrder());
(const_cast<MEDCoupling1GTUMesh *>(tmp))->setTimeUnit(master.getTimeUnit());
}
const MEDCouplingUMesh *m(_m);
if(m)
{
- (const_cast<MEDCouplingUMesh *>(m))->setName(master.getName());
- (const_cast<MEDCouplingUMesh *>(m))->setDescription(master.getDescription());
+ (const_cast<MEDCouplingUMesh *>(m))->setName(master.getName().c_str());
+ (const_cast<MEDCouplingUMesh *>(m))->setDescription(master.getDescription().c_str());
(const_cast<MEDCouplingUMesh *>(m))->setTime(master.getTimeValue(),master.getIteration(),master.getOrder());
(const_cast<MEDCouplingUMesh *>(m))->setTimeUnit(master.getTimeUnit());
}
{
public:
void setDescription(const char *name) { _desc_name=name; }
- const char *getDescription() const { return _desc_name.c_str(); }
+ std::string getDescription() const { return _desc_name; }
void setTimeUnit(const char *unit) { _dt_unit=unit; }
- const char *getTimeUnit() const { return _dt_unit.c_str(); }
+ std::string getTimeUnit() const { return _dt_unit; }
std::size_t getHeapMemSizeOfStrings() const;
bool isEqualStrings(const MEDFileParameterTinyInfo& other, std::string& what) const;
protected:
virtual std::string simpleRepr() const;
std::size_t getHeapMemorySize() const;
void setName(const char *name) throw(INTERP_KERNEL::Exception) { _name=name; }
- const char *getName() const throw(INTERP_KERNEL::Exception) { return _name.c_str(); }
+ std::string getName() const throw(INTERP_KERNEL::Exception) { return _name; }
void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
private:
MEDFileParameterDouble1TS();
static MEDFileParameterMultiTS *New();
static MEDFileParameterMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
static MEDFileParameterMultiTS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
- const char *getName() const { return _name.c_str(); }
+ std::string getName() const { return _name; }
void setName(const char *name) { _name=name; }
std::size_t getHeapMemorySize() const;
MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
MEDLoaderNS::writeFieldWithoutReadingAndMappingOfMeshInFile(fileName,f,false);
else
{
- MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm=MEDFileMesh::New(fileName,f->getMesh()->getName());
+ MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> mm=MEDFileMesh::New(fileName,f->getMesh()->getName().c_str());
const MEDFileMesh *mmPtr(mm);
const MEDFileUMesh *mmuPtr=dynamic_cast<const MEDFileUMesh *>(mmPtr);
if(!mmuPtr)
coords->decrRef();
- if ( !mesh->getName() || strlen( mesh->getName() ) == 0 )
+ if ( !mesh->getName().c_str() || strlen( mesh->getName().c_str() ) == 0 )
mesh->setName( "MESH" );
return mesh;
vector< vector<TypeOfField> > typesF;
vector< vector<string> > pfls, locs;
fields[i]->getFieldSplitedByType( iters[0].first, iters[0].second,
- _fileMesh->getName(), types, typesF, pfls, locs);
+ _fileMesh->getName().c_str(), types, typesF, pfls, locs);
int dimRelExt;
for ( size_t iType = 0; iType < types.size(); ++iType )
{
vector< vector<TypeOfField> > typesF;
vector< vector<string> > pfls, locs;
_cellFields[i]->getFieldSplitedByType( iters[0].first, iters[0].second,
- _fileMesh->getName(), types, typesF, pfls, locs);
+ _fileMesh->getName().c_str(), types, typesF, pfls, locs);
nb += 2 * types.size(); // x 2 - a type can be on nodes and on cells at the same time
}
vector< vector<TypeOfField> > typesF;
vector< vector<string> > pfls, locs;
vector< vector< std::pair<int,int> > > valsVec;
- valsVec=_nodeFields[iF]->getFieldSplitedByType( it.first, it.second, _fileMesh->getName(),
+ valsVec=_nodeFields[iF]->getFieldSplitedByType( it.first, it.second, _fileMesh->getName().c_str(),
types, typesF, pfls, locs);
// believe that there can be only one type in a nodal field,
// so do not use a loop on types
vector< vector<TypeOfField> > typesF;
vector< vector<string> > pfls, locs;
vector< vector< std::pair<int,int> > > valsVec;
- valsVec = _nodeFields[iF]->getFieldSplitedByType( it.first, it.second, _fileMesh->getName(),
+ valsVec = _nodeFields[iF]->getFieldSplitedByType( it.first, it.second, _fileMesh->getName().c_str(),
types, typesF, pfls, locs);
// believe that there can be only one type in a nodal field,
// so do not perform a loop on types
vector< vector<TypeOfField> > typesF;
vector< vector<string> > pfls, locs;
vector< vector< std::pair<int,int> > > valsVec;
- valsVec = _cellFields[iF]->getFieldSplitedByType( it.first, it.second, _fileMesh->getName(),
+ valsVec = _cellFields[iF]->getFieldSplitedByType( it.first, it.second, _fileMesh->getName().c_str(),
types, typesF, pfls, locs);
for ( size_t i = 0; i < valsVec.size(); ++i )
nbSub += valsVec[i].size();
vector<INTERP_KERNEL::NormalizedCellType> types;
vector< vector<TypeOfField> > typesF;
vector< vector<string> > pfls, locs;
- _cellFields[iF]->getFieldSplitedByType( it.first, it.second, _fileMesh->getName(),
+ _cellFields[iF]->getFieldSplitedByType( it.first, it.second, _fileMesh->getName().c_str(),
types, typesF, pfls, locs);
for ( size_t iType = 0; iType < pfls.size(); ++iType )
for ( size_t iP = 0; iP < pfls[iType].size(); ++iP )
vector< vector<TypeOfField> > typesF;
vector< vector<string> > pfls, locs;
vector< vector< std::pair<int,int> > > valsVec;
- valsVec = _cellFields[iF]->getFieldSplitedByType( iter, order, _fileMesh->getName(),
+ valsVec = _cellFields[iF]->getFieldSplitedByType( iter, order, _fileMesh->getName().c_str(),
types, typesF, pfls, locs);
for ( size_t iType = 0; iType < pfls.size(); ++iType )
for ( size_t iP = 0; iP < pfls[iType].size(); ++iP )
virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
virtual void clearNonDiscrAttributes() const throw(INTERP_KERNEL::Exception);
void setName(const char *name);
- const char *getName();
+ std::string getName();
const char *getUnivName() const;
bool getUnivNameWrStatus() const;
void setUnivNameWrStatus(bool newStatus);
void setDescription(const char *name);
- const char *getDescription() const;
+ std::string getDescription() const;
void setOrder(int order);
int getOrder() const;
void setIteration(int it);
static MEDFileMeshMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
static MEDFileMeshMultiTS *New(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception);
MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
- const char *getName() const throw(INTERP_KERNEL::Exception);
+ std::string getName() const throw(INTERP_KERNEL::Exception);
void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
void setOneTimeStep(MEDFileMesh *mesh1TimeStep) throw(INTERP_KERNEL::Exception);
%extend
class MEDFileFieldLoc : public RefCountObject
{
public:
- const std::string& getName() const;
+ std::string getName() const;
int getDimension() const;
int getNumberOfGaussPoints() const;
int getNumberOfPointsInCells() const;
{
public:
void setDescription(const char *name);
- const char *getDescription() const;
+ std::string getDescription() const;
void setTimeUnit(const char *unit);
- const char *getTimeUnit() const;
+ std::string getTimeUnit() const;
};
class MEDFileParameterDouble1TS : public MEDFileParameterDouble1TSWTI, public MEDFileParameterTinyInfo
virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
virtual std::string simpleRepr() const throw(INTERP_KERNEL::Exception);
void setName(const char *name) throw(INTERP_KERNEL::Exception);
- const char *getName() const throw(INTERP_KERNEL::Exception);
+ std::string getName() const throw(INTERP_KERNEL::Exception);
void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
%extend
{
static MEDFileParameterMultiTS *New();
static MEDFileParameterMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
static MEDFileParameterMultiTS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
- const char *getName() const;
+ std::string getName() const;
void setName(const char *name);
MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
MEDCouplingUMesh *mesh=build1DMesh_1();
mesh->checkCoherency();
MEDLoader::WriteUMesh("file1.med",mesh,true);
- MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile("file1.med",mesh->getName(),0);
+ MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile("file1.med",mesh->getName().c_str(),0);
CPPUNIT_ASSERT(mesh->isEqual(mesh_rw,1e-12));
mesh_rw->decrRef();
mesh->decrRef();
MEDCouplingUMesh *mesh=build2DCurveMesh_1();
mesh->checkCoherency();
MEDLoader::WriteUMesh("file2.med",mesh,true);
- MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile("file2.med",mesh->getName(),0);
+ MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile("file2.med",mesh->getName().c_str(),0);
CPPUNIT_ASSERT(mesh->isEqual(mesh_rw,1e-12));
mesh_rw->decrRef();
mesh->decrRef();
MEDCouplingUMesh *mesh=build2DMesh_1();
mesh->checkCoherency();
MEDLoader::WriteUMesh("file3.med",mesh,true);
- MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile("file3.med",mesh->getName(),0);
+ MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile("file3.med",mesh->getName().c_str(),0);
CPPUNIT_ASSERT(mesh->isEqual(mesh_rw,1e-12));
mesh_rw->decrRef();
mesh->decrRef();
MEDCouplingUMesh *mesh=build3DSurfMesh_1();
mesh->checkCoherency();
MEDLoader::WriteUMesh("file4.med",mesh,true);
- MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile("file4.med",mesh->getName(),0);
+ MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile("file4.med",mesh->getName().c_str(),0);
CPPUNIT_ASSERT(mesh->isEqual(mesh_rw,1e-12));
mesh_rw->decrRef();
mesh->decrRef();
MEDCouplingUMesh *mesh=build3DMesh_1();
mesh->checkCoherency();
MEDLoader::WriteUMesh("file5.med",mesh,true);
- MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile("file5.med",mesh->getName(),0);
+ MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile("file5.med",mesh->getName().c_str(),0);
CPPUNIT_ASSERT(mesh->isEqual(mesh_rw,1e-12));
mesh_rw->decrRef();
mesh->decrRef();
{
MEDCouplingFieldDouble *f1=buildVecFieldOnCells_1();
MEDLoader::WriteField("file6.med",f1,true);
- MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell("file6.med",f1->getMesh()->getName(),0,f1->getName(),0,1);
+ MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell("file6.med",f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),0,1);
CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
f1->decrRef();
f2->decrRef();
//
f1=buildVecFieldOnNodes_1();
MEDLoader::WriteField("file7.med",f1,true);
- f2=MEDLoader::ReadFieldNode("file7.med",f1->getMesh()->getName(),0,f1->getName(),2,3);
+ f2=MEDLoader::ReadFieldNode("file7.med",f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,3);
CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
// testing kind message on error of field type.
- CPPUNIT_ASSERT_THROW(MEDLoader::ReadFieldCell("file7.med",f1->getMesh()->getName(),0,f1->getName(),2,3),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(MEDLoader::ReadFieldCell("file7.med",f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,3),INTERP_KERNEL::Exception);
//
f1->decrRef();
f2->decrRef();
tmp[0]=VAL2;
MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
//retrieving time steps...
- MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName(),0,f1->getName(),8,9);
+ MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),8,9);
f1->setTime(10.,8,9);
tmp[0]=VAL1;
CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
f2->decrRef();
- f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName(),0,f1->getName(),0,1);
+ f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),0,1);
MEDCouplingFieldDouble *f3=buildVecFieldOnCells_1();
CPPUNIT_ASSERT(f3->isEqual(f2,1e-12,1e-12));
f3->decrRef();
f2->decrRef();
- f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName(),0,f1->getName(),18,19);
+ f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),18,19);
f1->setTime(10.14,18,19);
tmp[0]=VAL2;
CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
//test of throw on invalid (dt,it)
- CPPUNIT_ASSERT_THROW(MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName(),0,f1->getName(),28,19),INTERP_KERNEL::Exception);
+ CPPUNIT_ASSERT_THROW(MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),28,19),INTERP_KERNEL::Exception);
f2->decrRef();
f1->decrRef();
//ON NODES
f1->setTime(210.,208,209);
tmp[3]=VAL2;
MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName2,f1);
- f2=MEDLoader::ReadFieldNode(fileName2,f1->getMesh()->getName(),0,f1->getName(),108,109);
+ f2=MEDLoader::ReadFieldNode(fileName2,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),108,109);
f1->setTime(110.,108,109);
tmp[3]=VAL1;
CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
f2->decrRef();
- f2=MEDLoader::ReadFieldNode(fileName2,f1->getMesh()->getName(),0,f1->getName(),2,3);
+ f2=MEDLoader::ReadFieldNode(fileName2,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,3);
f3=buildVecFieldOnNodes_1();
CPPUNIT_ASSERT(f3->isEqual(f2,1e-12,1e-12));
f3->decrRef();
f2->decrRef();
- f2=MEDLoader::ReadFieldNode(fileName2,f1->getMesh()->getName(),0,f1->getName(),208,209);
+ f2=MEDLoader::ReadFieldNode(fileName2,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),208,209);
f1->setTime(210.,208,209);
tmp[3]=VAL2;
CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
MEDLoader::WriteUMesh(fileName,mesh1,true);
const int part1[5]={1,2,4,13,15};
MEDCouplingUMesh *mesh2=(MEDCouplingUMesh *)mesh1->buildPartOfMySelf(part1,part1+5,true);
- mesh2->setName(mesh1->getName());//<- important for the test
+ mesh2->setName(mesh1->getName().c_str());//<- important for the test
//
int nbOfCells=mesh2->getNumberOfCells();
CPPUNIT_ASSERT_EQUAL(5,nbOfCells);
//
MEDLoader::WriteField(fileName,f1,false);//<- false important for the test
//
- MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName(),0,f1->getName(),2,7);
- std::vector<ParaMEDMEM::TypeOfField> types=MEDLoader::GetTypesOfField(fileName,f1->getMesh()->getName(),f1->getName());
+ MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,7);
+ std::vector<ParaMEDMEM::TypeOfField> types=MEDLoader::GetTypesOfField(fileName,f1->getMesh()->getName().c_str(),f1->getName().c_str());
CPPUNIT_ASSERT_EQUAL(1,(int)types.size());
CPPUNIT_ASSERT(types[0]==ON_CELLS);
f2->checkCoherency();
f1->checkCoherency();
const int arr2[2]={1,4};//node ids are 2,4,5,3,6,7
MEDCouplingFieldDouble *f2=f1->buildSubPart(arr2,arr2+2);
- (const_cast<MEDCouplingMesh *>(f2->getMesh()))->setName(f1->getMesh()->getName());
+ (const_cast<MEDCouplingMesh *>(f2->getMesh()))->setName(f1->getMesh()->getName().c_str());
MEDLoader::WriteField(fileName,f2,false);//<- false important for the test
//
- MEDCouplingFieldDouble *f3=MEDLoader::ReadFieldNode(fileName,f2->getMesh()->getName(),0,f2->getName(),2,7);
+ MEDCouplingFieldDouble *f3=MEDLoader::ReadFieldNode(fileName,f2->getMesh()->getName().c_str(),0,f2->getName().c_str(),2,7);
f3->checkCoherency();
CPPUNIT_ASSERT(f3->isEqual(f2,1e-12,1e-12));
f3->decrRef();
f2->renumberNodes(arr3);
MEDLoader::WriteUMesh(fileName2,m,true);
MEDLoader::WriteField(fileName2,f2,false);//<- false important for the test
- f3=MEDLoader::ReadFieldNode(fileName2,f2->getMesh()->getName(),0,f2->getName(),2,7);
+ f3=MEDLoader::ReadFieldNode(fileName2,f2->getMesh()->getName().c_str(),0,f2->getName().c_str(),2,7);
f3->checkCoherency();
CPPUNIT_ASSERT(f3->isEqual(f2,1e-12,1e-12));
f3->decrRef();
f1->renumberNodes(renumArr);
f1->checkCoherency();
MEDLoader::WriteField(fileName,f1,false);//<- false important for the test
- MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldNode(fileName,f1->getMesh()->getName(),0,f1->getName(),2,7);
+ MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldNode(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,7);
CPPUNIT_ASSERT(f2->isEqual(f1,1e-12,1e-12));
//
f2->decrRef();
const char fileName[]="file13.med";
MEDCouplingFieldDouble *f1=buildVecFieldOnGauss_1();
MEDLoader::WriteField(fileName,f1,true);
- MEDCouplingFieldDouble *f2=MEDLoader::ReadField(ON_GAUSS_PT,fileName,f1->getMesh()->getName(),0,f1->getName(),1,5);
+ MEDCouplingFieldDouble *f2=MEDLoader::ReadField(ON_GAUSS_PT,fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),1,5);
CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
f2->decrRef();
f1->decrRef();
const char fileName[]="file14.med";
MEDCouplingFieldDouble *f1=buildVecFieldOnGaussNE_1();
MEDLoader::WriteField(fileName,f1,true);
- MEDCouplingFieldDouble *f2=MEDLoader::ReadField(ON_GAUSS_NE,fileName,f1->getMesh()->getName(),0,f1->getName(),1,5);
+ MEDCouplingFieldDouble *f2=MEDLoader::ReadField(ON_GAUSS_NE,fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),1,5);
CPPUNIT_ASSERT(f1->isEqual(f2,1e-12,1e-12));
f2->decrRef();
f1->decrRef();
mesh->renumberCells(renumber1,false);
mesh->checkCoherency();
MEDLoader::WriteUMesh(fileName,mesh,true);
- MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile(fileName,mesh->getName(),0);
+ MEDCouplingUMesh *mesh_rw=MEDLoader::ReadUMeshFromFile(fileName,mesh->getName().c_str(),0);
CPPUNIT_ASSERT(mesh->isEqual(mesh_rw,1e-12));
mesh_rw->decrRef();
mesh->decrRef();
const int renumber1[6]={2,1,5,0,3,4};
f1->renumberCells(renumber1,false);
MEDLoader::WriteField(fileName,f1,true);
- MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(fileName,mesh->getName(),0,f1->getName(),2,7);
+ MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(fileName,mesh->getName().c_str(),0,f1->getName().c_str(),2,7);
CPPUNIT_ASSERT(f2->isEqual(f1,1e-12,1e-12));
f2->decrRef();
//
its.push_back(std::pair<int,int>(1,2));
its.push_back(std::pair<int,int>(3,4));
its.push_back(std::pair<int,int>(5,6));
- std::vector<MEDCouplingFieldDouble *> fs=MEDLoader::ReadFieldsOnSameMesh(ON_CELLS,fileName,f_1->getMesh()->getName(),0,f_1->getName(),its);
+ std::vector<MEDCouplingFieldDouble *> fs=MEDLoader::ReadFieldsOnSameMesh(ON_CELLS,fileName,f_1->getMesh()->getName().c_str(),0,f_1->getName().c_str(),its);
CPPUNIT_ASSERT_EQUAL(3,(int)fs.size());
const MEDCouplingMesh *mm=fs[0]->getMesh();
CPPUNIT_ASSERT(fs[0]->isEqual(f_1,1e-12,1e-12));
meshes.push_back(m2d);
meshes.push_back(m3d);
MEDLoader::WriteUMeshes(fileName,meshes,true);
- MEDCouplingUMesh *m3d_bis=MEDLoader::ReadUMeshFromFile(fileName,m2d->getName(),0);
+ MEDCouplingUMesh *m3d_bis=MEDLoader::ReadUMeshFromFile(fileName,m2d->getName().c_str(),0);
CPPUNIT_ASSERT(!m3d_bis->isEqual(m3d,1e-12));
- m3d_bis->setName(m3d->getName());
+ m3d_bis->setName(m3d->getName().c_str());
CPPUNIT_ASSERT(m3d_bis->isEqual(m3d,1e-12));
- MEDCouplingUMesh *m2d_bis=MEDLoader::ReadUMeshFromFile(fileName,m2d->getName(),-1);//-1 for faces
+ MEDCouplingUMesh *m2d_bis=MEDLoader::ReadUMeshFromFile(fileName,m2d->getName().c_str(),-1);//-1 for faces
CPPUNIT_ASSERT(m2d_bis->isEqual(m2d,1e-12));
// Creation of a field on faces.
MEDCouplingFieldDouble *f1=MEDCouplingFieldDouble::New(ON_CELLS,ONE_TIME);
f1->setTime(3.14,2,7);
f1->checkCoherency();
MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f1);
- MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName(),-1,f1->getName(),2,7);
+ MEDCouplingFieldDouble *f2=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),-1,f1->getName().c_str(),2,7);
CPPUNIT_ASSERT(f2->isEqual(f1,1e-12,1e-12));
f1->decrRef();
f2->decrRef();
f2->checkCoherency();
//
MEDLoader::WriteField(fileName,f1,true);
- std::vector<ParaMEDMEM::TypeOfField> ts=MEDLoader::GetTypesOfField(fileName,f1->getMesh()->getName(),f1->getName());
+ std::vector<ParaMEDMEM::TypeOfField> ts=MEDLoader::GetTypesOfField(fileName,f1->getMesh()->getName().c_str(),f1->getName().c_str());
CPPUNIT_ASSERT_EQUAL(1,(int)ts.size());
CPPUNIT_ASSERT_EQUAL(ON_CELLS,ts[0]);
- std::vector<std::string> fs=MEDLoader::GetAllFieldNamesOnMesh(fileName,f1->getMesh()->getName());
+ std::vector<std::string> fs=MEDLoader::GetAllFieldNamesOnMesh(fileName,f1->getMesh()->getName().c_str());
CPPUNIT_ASSERT_EQUAL(1,(int)fs.size());
CPPUNIT_ASSERT(fs[0]=="FieldMix");
MEDLoader::WriteFieldUsingAlreadyWrittenMesh(fileName,f2);
- fs=MEDLoader::GetAllFieldNamesOnMesh(fileName,f1->getMesh()->getName());
+ fs=MEDLoader::GetAllFieldNamesOnMesh(fileName,f1->getMesh()->getName().c_str());
CPPUNIT_ASSERT_EQUAL(1,(int)fs.size());
CPPUNIT_ASSERT(fs[0]=="FieldMix");
//
- ts=MEDLoader::GetTypesOfField(fileName,f1->getMesh()->getName(),f1->getName());
+ ts=MEDLoader::GetTypesOfField(fileName,f1->getMesh()->getName().c_str(),f1->getName().c_str());
CPPUNIT_ASSERT_EQUAL(2,(int)ts.size());
CPPUNIT_ASSERT_EQUAL(ON_NODES,ts[0]);
CPPUNIT_ASSERT_EQUAL(ON_CELLS,ts[1]);
//
- MEDCouplingFieldDouble *f3=MEDLoader::ReadFieldNode(fileName,f1->getMesh()->getName(),0,f1->getName(),2,7);
+ MEDCouplingFieldDouble *f3=MEDLoader::ReadFieldNode(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,7);
CPPUNIT_ASSERT(f3->isEqual(f2,1e-12,1e-12));
f3->decrRef();
- f3=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName(),0,f1->getName(),2,7);
+ f3=MEDLoader::ReadFieldCell(fileName,f1->getMesh()->getName().c_str(),0,f1->getName().c_str(),2,7);
CPPUNIT_ASSERT(f3->isEqual(f1,1e-12,1e-12));
f3->decrRef();
//
}
// "Field on 2 faces"
MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> fieldOnFaces =
- dynamic_cast<MEDFileFieldMultiTS *>(d2->getFields()->getFieldWithName(f1->getName()));
+ dynamic_cast<MEDFileFieldMultiTS *>(d2->getFields()->getFieldWithName(f1->getName().c_str()));
io1 = fieldOnFaces->getIterations();
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> fof =
fieldOnFaces->getFieldOnMeshAtLevel(f1->getTypeOfField(),io1[0].first,io1[0].second,um1);
long sourceid = _meshHandlerMap[meshid]->sourceid;
const char * filepath = source_to_file((_datasourceHandlerMap[sourceid])->uri);
- const char * meshName = myMesh->getName();
+ const char * meshName = myMesh->getName().c_str();
LOG("getFieldDouble: field "<<fieldHandler->fieldname<<" loaded from file "<<filepath);
TypeOfField type = (TypeOfField)fieldHandler->type;
int meshDimRelToMax = 0;
MEDOP::FieldHandler * MEDDataManager_i::addField(MEDCouplingFieldDouble * fieldDouble,
long meshHandlerId)
{
- const char * fieldName = fieldDouble->getName();
- const char * meshName = fieldDouble->getMesh()->getName();
+ const char * fieldName = fieldDouble->getName().c_str();
+ const char * meshName = fieldDouble->getMesh()->getName().c_str();
TypeOfField type = fieldDouble->getTypeOfField();
int iteration, order;
fileNames[i]=sstr.str();
}
if(myRank==0)
- WriteMasterFile(fileName,fileNames,mesh->getCellMesh()->getName());
+ WriteMasterFile(fileName,fileNames,mesh->getCellMesh()->getName().c_str());
MEDLoader::WriteUMesh(fileNames[myRank].c_str(),dynamic_cast<MEDCouplingUMesh *>(mesh->getCellMesh()),true);
}