Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MEDCoupling::MEDFileMesh Class Referenceabstract
Inheritance diagram for MEDCoupling::MEDFileMesh:
Collaboration diagram for MEDCoupling::MEDFileMesh:

Public Member Functions

virtual void addFamily (const std::string &familyName, int id)
 
void addFamilyOnGrp (const std::string &grpName, const std::string &famName)
 
virtual void addGroup (int meshDimRelToMaxExt, const DataArrayInt *ids)=0
 
virtual void addNodeGroup (const DataArrayInt *ids)=0
 
virtual std::string advancedRepr () const =0
 
bool areFamsEqual (const MEDFileMesh *other, std::string &what) const
 
bool areGrpsEqual (const MEDFileMesh *other, std::string &what) const
 
void assignFamilyNameWithGroupName ()
 
virtual int buildImplicitPartIfAny (INTERP_KERNEL::NormalizedCellType gt) const =0
 
virtual MEDFileMeshcartesianize () const =0
 
void changeAllGroupsContainingFamily (const std::string &familyNameToChange, const std::vector< std::string > &newFamiliesNames)
 
void changeFamilyId (int oldId, int newId)
 
void changeFamilyName (const std::string &oldName, const std::string &newName)
 
void changeGroupName (const std::string &oldName, const std::string &newName)
 
bool changeNames (const std::vector< std::pair< std::string, std::string > > &modifTab)
 
void checkOrphanFamilyZero () const
 
void clearFamGrpMaps ()
 
void clearFamMap ()
 
void clearGrpMap ()
 
virtual void clearNonDiscrAttributes () const
 
DataArrayIntcomputeAllFamilyIdsInUse () const
 
void copyFamGrpMapsFrom (const MEDFileMesh &other)
 
virtual void createGroupOnAll (int meshDimRelToMaxExt, const std::string &groupName)
 
virtual MEDFileMeshcreateNewEmpty () const =0
 
virtual MEDFileMeshdeepCopy () const =0
 
bool ensureDifferentFamIdsPerLevel ()
 
bool existsFamily (int famId) const
 
bool existsFamily (const std::string &familyName) const
 
bool existsGroup (const std::string &groupName) const
 
std::string findOrCreateAndGiveFamilyWithId (int id, bool &created)
 
DataArrayIntgetAllFamiliesIdsReferenced () const
 
std::vector
< INTERP_KERNEL::NormalizedCellType
getAllGeoTypes () const
 
MEDCouplingAxisType getAxisType () const
 
std::string getDescription () const
 
std::vector< const
BigMemoryObject * > 
getDirectChildrenWithNull () const
 
virtual std::vector< int > getDistributionOfTypes (int meshDimRelToMax) const
 
MEDFileEquivalences * getEquivalences ()
 
const MEDFileEquivalences * getEquivalences () const
 
virtual std::vector< int > getFamArrNonEmptyLevelsExt () const =0
 
virtual DataArrayIntgetFamiliesArr (int meshDimRelToMaxExt, const std::vector< std::string > &fams, bool renum=false) const =0
 
std::vector< int > getFamiliesIds (const std::vector< std::string > &famNames) const
 
std::vector< int > getFamiliesIdsOnGroup (const std::string &name) const
 
std::vector< std::string > getFamiliesNames () const
 
std::vector< std::string > getFamiliesNamesWithFilePointOfView () const
 
std::vector< std::string > getFamiliesOnGroup (const std::string &name) const
 
std::vector< std::string > getFamiliesOnGroups (const std::vector< std::string > &grps) const
 
virtual DataArrayIntgetFamilyArr (int meshDimRelToMaxExt, const std::string &fam, bool renum=false) const
 
virtual const DataArrayIntgetFamilyFieldAtLevel (int meshDimRelToMaxExt) const =0
 
virtual DataArrayIntgetFamilyFieldAtLevel (int meshDimRelToMaxExt)=0
 
int getFamilyId (const std::string &name) const
 
const std::map< std::string,
int > & 
getFamilyInfo () const
 
std::string getFamilyNameGivenId (int id) const
 
std::vector< int > getFamNonEmptyLevels (const std::string &fam) const
 
std::vector< int > getFamNonEmptyLevelsExt (const std::string &fam) const
 
virtual std::vector< int > getFamsNonEmptyLevels (const std::vector< std::string > &fams) const =0
 
virtual std::vector< int > getFamsNonEmptyLevelsExt (const std::vector< std::string > &fams) const =0
 
virtual std::vector
< INTERP_KERNEL::NormalizedCellType
getGeoTypesAtLevel (int meshDimRelToMax) const =0
 
virtual DataArrayIntgetGroupArr (int meshDimRelToMaxExt, const std::string &grp, bool renum=false) const
 
const std::map< std::string,
std::vector< std::string > > & 
getGroupInfo () const
 
virtual DataArrayIntgetGroupsArr (int meshDimRelToMaxExt, const std::vector< std::string > &grps, bool renum=false) const
 
std::vector< std::string > getGroupsNames () const
 
std::vector< std::string > getGroupsOnFamily (const std::string &name) const
 
std::vector< std::string > getGroupsOnSpecifiedLev (int meshDimRelToMaxExt) const
 
std::vector< int > getGrpNonEmptyLevels (const std::string &grp) const
 
std::vector< int > getGrpNonEmptyLevelsExt (const std::string &grp) const
 
std::vector< int > getGrpsNonEmptyLevels (const std::vector< std::string > &grps) const
 
std::vector< int > getGrpsNonEmptyLevelsExt (const std::vector< std::string > &grps) const
 
std::size_t getHeapMemorySizeWithoutChildren () const
 
int getIteration () const
 
MEDFileJoints * getJoints () const
 
int getMaxAbsFamilyId () const
 
virtual int getMaxAbsFamilyIdInArrays () const =0
 
int getMaxFamilyId () const
 
virtual int getMaxFamilyIdInArrays () const =0
 
virtual MEDCouplingMeshgetMeshAtLevel (int meshDimRelToMax, bool renum=false) const =0
 
virtual int getMeshDimension () const =0
 
int getMinFamilyId () const
 
virtual int getMinFamilyIdInArrays () const =0
 
std::string getName () const
 
virtual std::vector< int > getNameArrNonEmptyLevelsExt () const =0
 
virtual const DataArrayAsciiChargetNameFieldAtLevel (int meshDimRelToMaxExt) const =0
 
virtual DataArrayIntgetNodeFamiliesArr (const std::vector< std::string > &fams, bool renum=false) const
 
virtual DataArrayIntgetNodeFamilyArr (const std::string &fam, bool renum=false) const
 
virtual DataArrayIntgetNodeGroupArr (const std::string &grp, bool renum=false) const
 
virtual DataArrayIntgetNodeGroupsArr (const std::vector< std::string > &grps, bool renum=false) const
 
virtual std::vector< int > getNonEmptyLevels () const =0
 
virtual std::vector< int > getNonEmptyLevelsExt () const =0
 
virtual std::vector< int > getNumArrNonEmptyLevelsExt () const =0
 
virtual const DataArrayIntgetNumberFieldAtLevel (int meshDimRelToMaxExt) const =0
 
virtual int getNumberOfCellsAtLevel (int meshDimRelToMaxExt) const =0
 
virtual int getNumberOfCellsWithType (INTERP_KERNEL::NormalizedCellType ct) const =0
 
int getNumberOfJoints () const
 
virtual int getNumberOfNodes () const =0
 
DataArrayIntgetOrCreateAndGetFamilyFieldAtLevel (int meshDimRelToMaxExt)
 
int getOrder () const
 
virtual const DataArrayIntgetRevNumberFieldAtLevel (int meshDimRelToMaxExt) const =0
 
virtual int getSizeAtLevel (int meshDimRelToMaxExt) const =0
 
int getTheMaxAbsFamilyId () const
 
int getTheMaxFamilyId () const
 
int getTheMinFamilyId () const
 
double getTime (int &dt, int &it) const
 
std::string getTimeUnit () const
 
double getTimeValue () const
 
std::string getUnivName () const
 
bool getUnivNameWrStatus () const
 
virtual bool hasImplicitPart () const =0
 
void initializeEquivalences ()
 
virtual bool isEqual (const MEDFileMesh *other, double eps, std::string &what) const
 
virtual bool keepFamIdsOnlyOnLevs (const std::vector< int > &famIds, const std::vector< int > &levs)
 
void killEquivalences ()
 
virtual void killStructureElements ()
 
void normalizeFamIdsMEDFile ()
 
void normalizeFamIdsTrio ()
 
virtual bool presenceOfStructureElements () const =0
 
void rearrangeFamilies ()
 
virtual void releaseImplicitPartIfAny () const =0
 
std::vector< std::string > removeEmptyGroups ()
 
void removeFamiliesReferedByNoGroups ()
 
void removeFamily (const std::string &name)
 
void removeGroup (const std::string &name)
 
std::vector< std::string > removeOrphanFamilies ()
 
std::vector< std::string > removeOrphanGroups ()
 
void setAxisType (MEDCouplingAxisType at)
 
void setDescription (const std::string &name)
 
void setFamiliesIdsOnGroup (const std::string &name, const std::vector< int > &famIds)
 
void setFamiliesOnGroup (const std::string &name, const std::vector< std::string > &fams)
 
virtual void setFamilyFieldArr (int meshDimRelToMaxExt, DataArrayInt *famArr)=0
 
void setFamilyId (const std::string &familyName, int id)
 
void setFamilyIdUnique (const std::string &familyName, int id)
 
void setFamilyInfo (const std::map< std::string, int > &info)
 
void setGroupInfo (const std::map< std::string, std::vector< std::string > > &info)
 
virtual void setGroupsAtLevel (int meshDimRelToMaxExt, const std::vector< const DataArrayInt * > &grps, bool renum=false)
 
void setGroupsOnFamily (const std::string &famName, const std::vector< std::string > &grps)
 
void setIteration (int it)
 
void setJoints (MEDFileJoints *joints)
 
virtual void setName (const std::string &name)
 
virtual void setNameFieldAtLevel (int meshDimRelToMaxExt, DataArrayAsciiChar *nameArr)=0
 
void setOrder (int order)
 
virtual void setRenumFieldArr (int meshDimRelToMaxExt, DataArrayInt *renumArr)=0
 
void setTime (int dt, int it, double time)
 
void setTimeUnit (const std::string &unit)
 
void setTimeValue (double time)
 
void setUnivNameWrStatus (bool newStatus)
 
virtual MEDFileMeshshallowCpy () const =0
 
virtual std::string simpleRepr () const
 
virtual bool unPolyze (std::vector< int > &oldCode, std::vector< int > &newCode, DataArrayInt *&o2nRenumCell)=0
 
virtual void whichAreNodesFetched (const MEDFileField1TSStructItem &st, const MEDFileFieldGlobsReal *globs, std::vector< bool > &nodesFetched) const =0
 
void writeLL (med_idt fid) const
 

Static Public Member Functions

static TypeOfField ConvertFromMEDFileEntity (med_entity_type etype)
 
static
INTERP_KERNEL::NormalizedCellType 
ConvertFromMEDFileGeoType (med_geometry_type geoType)
 
static std::string GetMagicFamilyStr ()
 
static MEDFileMeshNew (const std::string &fileName, MEDFileMeshReadSelector *mrs=0)
 
static MEDFileMeshNew (med_idt fid, MEDFileMeshReadSelector *mrs=0)
 
static MEDFileMeshNew (DataArrayByte *db)
 
static MEDFileMeshNew (const std::string &fileName, const std::string &mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0, MEDFileJoints *joints=0)
 
static MEDFileMeshNew (med_idt fid, const std::string &mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0, MEDFileJoints *joints=0)
 

Static Public Attributes

static const char DFT_FAM_NAME [] ="FAMILLE_ZERO"
 

Protected Member Functions

void addFamilyOnAllGroupsHaving (const std::string &famName, const std::string &otherFamName)
 
void addGroupUnderground (bool isNodeGroup, const DataArrayInt *ids, DataArrayInt *famArr)
 
virtual void appendFamilyEntries (const DataArrayInt *famIds, const std::vector< std::vector< int > > &fidsOfGrps, const std::vector< std::string > &grpNames)
 
bool areEquivalencesEqual (const MEDFileMesh *other, std::string &what) const
 
virtual void changeFamilyIdArr (int oldId, int newId)=0
 
void checkCartesian () const
 
void dealWithTinyInfo (const MEDCouplingMesh *m)
 
void deepCpyEquivalences (const MEDFileMesh &other)
 
virtual std::list< MCAuto
< DataArrayInt > > 
getAllNonNullFamilyIds () const =0
 
void getEquivalencesRepr (std::ostream &oss) const
 
void getFamilyRepr (std::ostream &oss) const
 
void loadEquivalences (med_idt fid)
 
void loadJointsFromFile (med_idt fid, MEDFileJoints *toUseInstedOfReading=0)
 
virtual void loadLL (med_idt fid, const std::string &mName, int dt, int it, MEDFileMeshReadSelector *mrs)=0
 
void loadLLWithAdditionalItems (med_idt fid, const std::string &mName, int dt, int it, MEDFileMeshReadSelector *mrs)
 
 MEDFileMesh ()
 
void setUnivName (const std::string &name)
 
virtual void synchronizeTinyInfoOnLeaves () const =0
 
void writeJoints (med_idt fid) const
 
- Protected Member Functions inherited from MEDCoupling::RefCountObject
 RefCountObject ()
 
 RefCountObject (const RefCountObject &other)
 
virtual ~RefCountObject ()
 
- Protected Member Functions inherited from MEDCoupling::RefCountObjectOnly
 RefCountObjectOnly ()
 
 RefCountObjectOnly (const RefCountObjectOnly &other)
 
virtual ~RefCountObjectOnly ()
 

Static Protected Member Functions

static void ChangeAllGroupsContainingFamily (std::map< std::string, std::vector< std::string > > &groups, const std::string &familyNameToChange, const std::vector< std::string > &newFamiliesNames)
 
static std::string CreateNameNotIn (const std::string &nameTry, const std::vector< std::string > &namesToAvoid)
 
static std::string FindOrCreateAndGiveFamilyWithId (std::map< std::string, int > &families, int id, bool &created)
 
static int PutInThirdComponentOfCodeOffset (std::vector< int > &code, int strt)
 
static void TranslateFamilyIds (int offset, DataArrayInt *famArr, std::vector< std::vector< int > > &famIdsPerGrp)
 

Protected Attributes

MEDCouplingAxisType _axis_type
 
std::string _desc_name
 
std::string _dt_unit
 
MCAuto< MEDFileEquivalences > _equiv
 
std::map< std::string, int > _families
 
std::map< std::string,
std::vector< std::string > > 
_groups
 
int _iteration
 
MCAuto< MEDFileJoints > _joints
 
std::string _name
 
int _order
 
double _time
 
std::string _univ_name
 
bool _univ_wr_status
 

Constructor & Destructor Documentation

MEDFileMesh::MEDFileMesh ( )
protected

Member Function Documentation

MEDFileMesh * MEDFileMesh::New ( const std::string &  fileName,
MEDFileMeshReadSelector *  mrs = 0 
)
static

Returns a new MEDFileMesh holding the mesh data that has been read from a given MED file. The first mesh in the file is loaded.

Parameters
[in]fileName- the name of MED file to read.
Returns
MEDFileMesh * - a new instance of MEDFileMesh. The caller is to delete this mesh using decrRef() as it is no more needed.
Exceptions
Ifthe file is not readable.
Ifthere is no meshes in the file.
Ifthe mesh in the file is of a not supported type.

Referenced by MEDCoupling::MEDFileAnyTypeField1TSWithoutSDA::getFieldAtLevel(), MEDCoupling::MEDFileAnyTypeField1TSWithoutSDA::getFieldAtTopLevel(), New(), MEDCoupling::ReadField(), MEDCoupling::ReadFieldCell(), MEDCoupling::ReadFieldGauss(), MEDCoupling::ReadFieldGaussNE(), MEDCoupling::ReadFieldNode(), MEDCoupling::ReadFieldsOnSameMesh(), MEDCoupling::ReadMeshFromFile(), MEDCoupling::ReadUMeshFromFamilies(), MEDCoupling::ReadUMeshFromFile(), MEDCoupling::ReadUMeshFromGroups(), and MEDCoupling::WriteField().

static MEDFileMesh* MEDCoupling::MEDFileMesh::New ( DataArrayByte db)
static
MEDFileMesh * MEDFileMesh::New ( const std::string &  fileName,
const std::string &  mName,
int  dt = -1,
int  it = -1,
MEDFileMeshReadSelector *  mrs = 0,
MEDFileJoints *  joints = 0 
)
static

Returns a new MEDFileMesh holding the mesh data that has been read from a given MED file. The mesh to load is specified by its name and numbers of a time step and an iteration.

Parameters
[in]fileName- the name of MED file to read.
[in]mName- the name of the mesh to read.
[in]dt- the number of a time step.
[in]it- the number of an iteration.
[in]joints- the sub-domain joints to use instead of those that can be read from the MED file. Usually this joints are those just read by another iteration of mName mesh, when this method is called by MEDFileMeshMultiTS::New()
Returns
MEDFileMesh * - a new instance of MEDFileMesh. The caller is to delete this mesh using decrRef() as it is no more needed.
Exceptions
Ifthe file is not readable.
Ifthere is no mesh with given attributes in the file.
Ifthe mesh in the file is of a not supported type.

References New().

MEDFileMesh * MEDFileMesh::New ( med_idt  fid,
const std::string &  mName,
int  dt = -1,
int  it = -1,
MEDFileMeshReadSelector *  mrs = 0,
MEDFileJoints *  joints = 0 
)
static
void MEDFileMesh::writeLL ( med_idt  fid) const

Writes this mesh into an open MED file specified by its descriptor.

Parameters
[in]fid- the MED file descriptor.
Exceptions
Ifthe mesh name is not set.
Ifthe file is open for reading only.
Ifthe writing mode == 1 and the same data is present in an existing file.

References _equiv, _name, addFamily(), DFT_FAM_NAME, existsFamily(), and writeJoints().

virtual MEDFileMesh* MEDCoupling::MEDFileMesh::createNewEmpty ( ) const
pure virtual
virtual MEDFileMesh* MEDCoupling::MEDFileMesh::deepCopy ( ) const
pure virtual
virtual MEDFileMesh* MEDCoupling::MEDFileMesh::shallowCpy ( ) const
pure virtual
bool MEDFileMesh::isEqual ( const MEDFileMesh other,
double  eps,
std::string &  what 
) const
virtual

Checks if this and another mesh are equal.

Parameters
[in]other- the mesh to compare with.
[in]eps- a precision used to compare real values.
[in,out]what- the string returning description of unequal data.
Returns
bool - true if the meshes are equal, false, else.

Reimplemented in MEDCoupling::MEDFileCurveLinearMesh, MEDCoupling::MEDFileCMesh, MEDCoupling::MEDFileStructuredMesh, and MEDCoupling::MEDFileUMesh.

References _desc_name, _dt_unit, _iteration, _name, _order, _time, areEquivalencesEqual(), areFamsEqual(), and areGrpsEqual().

Referenced by MEDCoupling::MEDFileUMesh::isEqual(), and MEDCoupling::MEDFileStructuredMesh::isEqual().

void MEDFileMesh::clearNonDiscrAttributes ( ) const
virtual
void MEDFileMesh::setName ( const std::string &  name)
virtual
bool MEDFileMesh::changeNames ( const std::vector< std::pair< std::string, std::string > > &  modifTab)
std::string MEDCoupling::MEDFileMesh::getUnivName ( ) const

References _univ_name.

bool MEDCoupling::MEDFileMesh::getUnivNameWrStatus ( ) const

References _univ_wr_status.

void MEDCoupling::MEDFileMesh::setUnivNameWrStatus ( bool  newStatus)

References _univ_wr_status.

void MEDCoupling::MEDFileMesh::setDescription ( const std::string &  name)
std::string MEDCoupling::MEDFileMesh::getDescription ( ) const

References _desc_name.

Referenced by simpleRepr().

void MEDCoupling::MEDFileMesh::setOrder ( int  order)
int MEDCoupling::MEDFileMesh::getOrder ( ) const
void MEDCoupling::MEDFileMesh::setIteration ( int  it)
int MEDCoupling::MEDFileMesh::getIteration ( ) const
void MEDCoupling::MEDFileMesh::setTimeValue ( double  time)
void MEDCoupling::MEDFileMesh::setTime ( int  dt,
int  it,
double  time 
)

References _iteration, _order, and _time.

double MEDCoupling::MEDFileMesh::getTime ( int &  dt,
int &  it 
) const

References _iteration, _order, and _time.

double MEDCoupling::MEDFileMesh::getTimeValue ( ) const

References _time.

void MEDCoupling::MEDFileMesh::setTimeUnit ( const std::string &  unit)
std::string MEDCoupling::MEDFileMesh::getTimeUnit ( ) const

References _dt_unit.

std::vector< INTERP_KERNEL::NormalizedCellType > MEDFileMesh::getAllGeoTypes ( ) const
virtual int MEDCoupling::MEDFileMesh::getNumberOfNodes ( ) const
pure virtual
virtual int MEDCoupling::MEDFileMesh::getNumberOfCellsAtLevel ( int  meshDimRelToMaxExt) const
pure virtual
virtual bool MEDCoupling::MEDFileMesh::hasImplicitPart ( ) const
pure virtual
virtual int MEDCoupling::MEDFileMesh::buildImplicitPartIfAny ( INTERP_KERNEL::NormalizedCellType  gt) const
pure virtual
virtual void MEDCoupling::MEDFileMesh::releaseImplicitPartIfAny ( ) const
pure virtual
virtual std::vector<INTERP_KERNEL::NormalizedCellType> MEDCoupling::MEDFileMesh::getGeoTypesAtLevel ( int  meshDimRelToMax) const
pure virtual
virtual int MEDCoupling::MEDFileMesh::getNumberOfCellsWithType ( INTERP_KERNEL::NormalizedCellType  ct) const
pure virtual
virtual std::vector<int> MEDCoupling::MEDFileMesh::getNonEmptyLevels ( ) const
pure virtual
virtual std::vector<int> MEDCoupling::MEDFileMesh::getNonEmptyLevelsExt ( ) const
pure virtual
virtual std::vector<int> MEDCoupling::MEDFileMesh::getFamArrNonEmptyLevelsExt ( ) const
pure virtual
virtual std::vector<int> MEDCoupling::MEDFileMesh::getNumArrNonEmptyLevelsExt ( ) const
pure virtual
virtual std::vector<int> MEDCoupling::MEDFileMesh::getNameArrNonEmptyLevelsExt ( ) const
pure virtual
virtual int MEDCoupling::MEDFileMesh::getSizeAtLevel ( int  meshDimRelToMaxExt) const
pure virtual
std::vector< int > MEDFileMesh::getDistributionOfTypes ( int  meshDimRelToMax) const
virtual
See Also
getAllDistributionOfTypes

Reimplemented in MEDCoupling::MEDFileUMesh.

References MEDCoupling::MEDCouplingMesh::getDistributionOfTypes(), and getMeshAtLevel().

virtual void MEDCoupling::MEDFileMesh::whichAreNodesFetched ( const MEDFileField1TSStructItem &  st,
const MEDFileFieldGlobsReal globs,
std::vector< bool > &  nodesFetched 
) const
pure virtual
virtual MEDFileMesh* MEDCoupling::MEDFileMesh::cartesianize ( ) const
pure virtual
virtual bool MEDCoupling::MEDFileMesh::presenceOfStructureElements ( ) const
pure virtual
virtual void MEDCoupling::MEDFileMesh::killStructureElements ( )
virtual

Reimplemented in MEDCoupling::MEDFileUMesh.

bool MEDFileMesh::areFamsEqual ( const MEDFileMesh other,
std::string &  what 
) const

Checks if this and another mesh contains the same families.

Parameters
[in]other- the mesh to compare with this one.
[in,out]what- an unused parameter.
Returns
bool - true if number of families and their ids are the same in the two meshes. Families with the id == 0 are not considered.

References _families.

Referenced by isEqual().

bool MEDFileMesh::areGrpsEqual ( const MEDFileMesh other,
std::string &  what 
) const

Checks if this and another mesh contains the same groups.

Parameters
[in]other- the mesh to compare with this one.
[in,out]what- a string describing a difference of groups of the two meshes in case if this method returns false.
Returns
bool - true if number of groups and families constituting them are the same in the two meshes.

References _groups.

Referenced by isEqual().

bool MEDFileMesh::existsGroup ( const std::string &  groupName) const

Checks if a group with a given name exists in this mesh.

Parameters
[in]groupName- the group name.
Returns
bool - true the group groupName exists in this mesh.

References _groups.

Referenced by createGroupOnAll().

bool MEDFileMesh::existsFamily ( int  famId) const

Checks if a family with a given id exists in this mesh.

Parameters
[in]famId- the family id.
Returns
bool - true the family with the id famId exists in this mesh.

References _families.

Referenced by addGroupUnderground(), and writeLL().

bool MEDFileMesh::existsFamily ( const std::string &  familyName) const

Checks if a family with a given name exists in this mesh.

Parameters
[in]familyName- the family name.
Returns
bool - true the family familyName exists in this mesh.

References _families.

void MEDFileMesh::setFamilyId ( const std::string &  familyName,
int  id 
)

Sets an id of a family.

Parameters
[in]familyName- the family name.
[in]id- a new id of the family.

References _families.

Referenced by MEDCoupling::MEDFileUMesh::New().

void MEDFileMesh::setFamilyIdUnique ( const std::string &  familyName,
int  id 
)

References _families.

void MEDFileMesh::addFamily ( const std::string &  familyName,
int  famId 
)
virtual

Adds a family to this mesh.

Parameters
[in]familyName- a name of the family.
[in]famId- an id of the family.
Exceptions
Ifa family with the same name or id already exists in this mesh.

References _families.

Referenced by MEDCoupling::MEDFileUMesh::buildInnerBoundaryAlongM1Group(), and writeLL().

void MEDFileMesh::createGroupOnAll ( int  meshDimRelToMaxExt,
const std::string &  groupName 
)
virtual

Creates a group including all mesh entities of given dimension.

Warning
This method does not guarantee that the created group includes mesh entities of only meshDimRelToMaxExt dimension in the case if some family id is present in family fields of different dimensions. To assure this, call ensureDifferentFamIdsPerLevel() before calling this method.
Parameters
[in]meshDimRelToMaxExt- a relative dimension of mesh entities to include to the group.
[in]groupName- a name of the new group.
Exceptions
Ifa group named groupName already exists.
Ifno mesh entities of dimension meshDimRelToMaxExt exist in this mesh.
Ifno family field of dimension meshDimRelToMaxExt is present in this mesh.

References _groups, MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayTemplate< T >::end(), existsGroup(), findOrCreateAndGiveFamilyWithId(), MEDCoupling::DataArrayInt::getDifferentValues(), getFamilyFieldAtLevel(), and getNonEmptyLevelsExt().

bool MEDFileMesh::keepFamIdsOnlyOnLevs ( const std::vector< int > &  famIds,
const std::vector< int > &  vMeshDimRelToMaxExt 
)
virtual

Ensures that given family ids do not present in family fields of dimensions different than given ones. If a family id is present in the family fields of dimensions different than the given ones, a new family is created and the whole data is updated accordingly.

Parameters
[in]famIds- a sequence of family ids to check.
[in]vMeshDimRelToMaxExt- a sequence of relative dimensions to which the famIds should exclusively belong.
Returns
bool - true if no modification is done in this mesh by this method.

References _families, addFamilyOnAllGroupsHaving(), MEDCoupling::DataArrayTemplate< T >::begin(), CreateNameNotIn(), MEDCoupling::DataArrayTemplate< T >::end(), MEDCoupling::DataArrayInt::getDifferentValues(), getFamiliesNames(), getFamilyFieldAtLevel(), getFamilyNameGivenId(), getMaxFamilyId(), and getNonEmptyLevelsExt().

void MEDFileMesh::addFamilyOnGrp ( const std::string &  grpName,
const std::string &  famName 
)

Adds a family to a given group in this mesh. If the group with a given name does not exist, it is created.

Parameters
[in]grpName- the name of the group to add the family in.
[in]famName- the name of the family to add to the group named grpName.
Exceptions
IfgrpName or famName is an empty string.
Ifno family named famName is present in this mesh.

References _groups, and getFamiliesNames().

Referenced by MEDCoupling::MEDFileUMesh::buildInnerBoundaryAlongM1Group(), and ensureDifferentFamIdsPerLevel().

std::string MEDFileMesh::findOrCreateAndGiveFamilyWithId ( int  id,
bool &  created 
)

Returns a name of the family having a given id or, if no such a family exists, creates a new uniquely named family and returns its name.

Parameters
[in]id- the id of the family whose name is required.
[out]created- returns true if the new family has been created, false, else.
Returns
std::string - the name of the existing or the created family.
Exceptions
Ifit is not possible to create a unique family name.

References _families, and FindOrCreateAndGiveFamilyWithId().

Referenced by createGroupOnAll(), and ensureDifferentFamIdsPerLevel().

void MEDFileMesh::setFamilyInfo ( const std::map< std::string, int > &  info)

Sets names and ids of all families in this mesh.

Parameters
[in]info- a map of a family name to a family id.

References _families.

Referenced by MEDCoupling::MEDFileUMesh::Aggregate().

void MEDFileMesh::setGroupInfo ( const std::map< std::string, std::vector< std::string > > &  info)

Sets names of all groups and families constituting them in this mesh.

Parameters
[in]info- a map of a group name to a vector of names of families constituting the group.

References _groups.

Referenced by MEDCoupling::MEDFileUMesh::Aggregate().

void MEDFileMesh::copyFamGrpMapsFrom ( const MEDFileMesh other)

Copies data on groups and families from another mesh.

Parameters
[in]other- the mesh to copy the data from.

References _families, and _groups.

Referenced by MEDCoupling::MEDFileUMesh::extractPart(), MEDCoupling::MEDFileUMesh::linearToQuadratic(), and MEDCoupling::MEDFileUMesh::quadraticToLinear().

void MEDFileMesh::clearGrpMap ( )

This method clear all the groups in the map. So this method does not operate at all on arrays. So this method can lead to orphan families.

See Also
MEDFileMesh::clearFamMap, MEDFileMesh::clearFamGrpMaps

References _groups.

Referenced by clearFamGrpMaps().

void MEDFileMesh::clearFamMap ( )

This method clear all the families in the map. So this method does not operate at all on arrays. WARNING ! if there are some groups lying on cleared families, those groups will be impacted !

See Also
MEDFileMesh::clearFamMap, MEDFileMesh::clearFamGrpMaps

References _families.

Referenced by clearFamGrpMaps().

void MEDFileMesh::clearFamGrpMaps ( )

This method clear all the families and groups in the map. So this method does not operate at all on arrays. As all groups and families entry will be removed after the call of MEDFileMesh::setFamilyFieldArr method with 0 or None (python) in the 2nd parameter can be useful to reduce the size of the object.

See Also
MEDFileMesh::clearFamMap, MEDFileMesh::clearFamMap

References clearFamMap(), and clearGrpMap().

const std::map<std::string,int>& MEDCoupling::MEDFileMesh::getFamilyInfo ( ) const

References _families.

const std::map<std::string, std::vector<std::string> >& MEDCoupling::MEDFileMesh::getGroupInfo ( ) const

References _groups.

std::vector< std::string > MEDFileMesh::getFamiliesOnGroup ( const std::string &  name) const

Returns names of families constituting a group.

Parameters
[in]name- the name of the group of interest.
Returns
std::vector<std::string> - a sequence of names of the families.
Exceptions
Ifthe name of a nonexistent group is specified.

References _groups, and getGroupsNames().

Referenced by getGrpNonEmptyLevels(), and getGrpNonEmptyLevelsExt().

std::vector< std::string > MEDFileMesh::getFamiliesOnGroups ( const std::vector< std::string > &  grps) const

Returns names of families constituting some groups.

Parameters
[in]grps- a sequence of names of groups of interest.
Returns
std::vector<std::string> - a sequence of names of the families.
Exceptions
Ifa name of a nonexistent group is present in grps.

References _groups, _name, and getGroupsNames().

Referenced by MEDCoupling::MEDFileUMesh::getGroups(), getGroupsArr(), getGrpsNonEmptyLevels(), and getGrpsNonEmptyLevelsExt().

std::vector< int > MEDFileMesh::getFamiliesIdsOnGroup ( const std::string &  name) const

Returns ids of families constituting a group.

Parameters
[in]name- the name of the group of interest.
Returns
std::vector<int> - sequence of ids of the families.
Exceptions
Ifthe name of a nonexistent group is specified.

References _groups, getFamiliesIds(), and getGroupsNames().

void MEDFileMesh::setFamiliesOnGroup ( const std::string &  name,
const std::vector< std::string > &  fams 
)

Sets names of families constituting a group. If data on families of this group is already present, it is overwritten. Every family in fams is checked, and if a family is not yet in this mesh, the default group id 0 is assigned to it.

Parameters
[in]name- the name of the group of interest.
[in]fams- a sequence of names of families constituting the group.

References _families, and _groups.

void MEDFileMesh::setFamiliesIdsOnGroup ( const std::string &  name,
const std::vector< int > &  famIds 
)

Sets families constituting a group. The families are specified by their ids. If a family name is not found by its id, an exception is thrown. If several families have same id, the first one in lexical order is taken.

Parameters
[in]name- the name of the group of interest.
[in]famIds- a sequence of ids of families constituting the group.
Exceptions
Ifa family name is not found by its id.

References _groups, and getFamilyNameGivenId().

std::vector< std::string > MEDFileMesh::getGroupsOnFamily ( const std::string &  name) const

Returns names of groups including a given family.

Parameters
[in]name- the name of the family of interest.
Returns
std::vector<std::string> - a sequence of names of groups including the family.

References _groups.

Referenced by assignFamilyNameWithGroupName(), ensureDifferentFamIdsPerLevel(), getFamilyRepr(), and removeOrphanFamilies().

void MEDFileMesh::setGroupsOnFamily ( const std::string &  famName,
const std::vector< std::string > &  grps 
)

Adds an existing family to groups.

Parameters
[in]famName- a name of family to add to grps.
[in]grps- a sequence of group names to add the family in.
Exceptions
Ifa family named famName not yet exists.

References _families, _groups, and getFamiliesNames().

std::vector< std::string > MEDFileMesh::getGroupsNames ( ) const

Returns names of all groups of this mesh.

Returns
std::vector<std::string> - a sequence of group names.

References _groups.

Referenced by addGroupUnderground(), MEDCoupling::MEDFileUMesh::buildExtrudedMesh(), changeGroupName(), getFamiliesIdsOnGroup(), getFamiliesOnGroup(), getFamiliesOnGroups(), getGroupsOnSpecifiedLev(), and removeGroup().

std::vector< std::string > MEDFileMesh::getFamiliesNames ( ) const

Returns names of all families of this mesh.

Returns
std::vector<std::string> - a sequence of family names.

References _families.

Referenced by addFamilyOnGrp(), changeFamilyName(), getFamiliesIds(), getFamiliesNamesWithFilePointOfView(), getFamilyId(), keepFamIdsOnlyOnLevs(), normalizeFamIdsMEDFile(), normalizeFamIdsTrio(), removeFamily(), removeOrphanFamilies(), and setGroupsOnFamily().

std::vector< std::string > MEDFileMesh::getGroupsOnSpecifiedLev ( int  meshDimRelToMaxExt) const

Returns names of groups that partly or fully appear on the level meshDimRelToMaxExt.

Parameters
[in]meshDimRelToMaxExt- a relative dimension of interest.
Returns
std::vector<std::string> - a sequence of group names at meshDimRelToMaxExt level.

References getGroupsNames(), and getGrpNonEmptyLevelsExt().

std::vector< int > MEDFileMesh::getGrpNonEmptyLevelsExt ( const std::string &  grp) const

Returns all relative mesh levels (including nodes) where a given group is defined.

Parameters
[in]grp- the name of the group of interest.
Returns
std::vector<int> - a sequence of the relative dimensions.

References getFamiliesOnGroup(), and getFamsNonEmptyLevelsExt().

Referenced by getGroupsOnSpecifiedLev().

std::vector< int > MEDFileMesh::getGrpNonEmptyLevels ( const std::string &  grp) const

Returns all relative mesh levels (excluding nodes) where a given group is defined. To include nodes, call getGrpNonEmptyLevelsExt() method.

Parameters
[in]grp- the name of the group of interest.
Returns
std::vector<int> - a sequence of the relative dimensions.

References getFamiliesOnGroup(), and getFamsNonEmptyLevels().

std::vector< int > MEDFileMesh::getGrpsNonEmptyLevels ( const std::vector< std::string > &  grps) const

Returns all relative mesh levels (excluding nodes) where given groups are defined. To include nodes, call getGrpsNonEmptyLevelsExt() method.

Parameters
[in]grps- a sequence of names of the groups of interest.
Returns
std::vector<int> - a sequence of the relative dimensions.

References getFamiliesOnGroups(), and getFamsNonEmptyLevels().

std::vector< int > MEDFileMesh::getGrpsNonEmptyLevelsExt ( const std::vector< std::string > &  grps) const

Returns all relative mesh levels (including nodes) where given groups are defined.

Parameters
[in]grps- a sequence of names of the groups of interest.
Returns
std::vector<int> - a sequence of the relative dimensions.

References getFamiliesOnGroups(), and getFamsNonEmptyLevelsExt().

virtual std::vector<int> MEDCoupling::MEDFileMesh::getFamsNonEmptyLevels ( const std::vector< std::string > &  fams) const
pure virtual
virtual std::vector<int> MEDCoupling::MEDFileMesh::getFamsNonEmptyLevelsExt ( const std::vector< std::string > &  fams) const
pure virtual
std::vector< int > MEDFileMesh::getFamNonEmptyLevels ( const std::string &  fam) const

Returns all relative mesh levels (excluding nodes) where a given family is defined. To include nodes, call getFamNonEmptyLevelsExt() method.

Parameters
[in]fam- the name of the family of interest.
Returns
std::vector<int> - a sequence of the relative dimensions.

References getFamsNonEmptyLevels().

std::vector< int > MEDFileMesh::getFamNonEmptyLevelsExt ( const std::string &  fam) const

Returns all relative mesh levels (including nodes) where a given family is defined.

Parameters
[in]fam- the name of the family of interest.
Returns
std::vector<int> - a sequence of the relative dimensions.

References getFamsNonEmptyLevelsExt().

std::vector< std::string > MEDFileMesh::getFamiliesNamesWithFilePointOfView ( ) const

Returns names of all families of this mesh but like they would be in file. This method is here only for MED file families gurus. If you are a kind user forget this method :-) This method is only useful for aggressive users that want to have in their file a same family lying both on cells and on nodes. This is not a good idea for lisibility ! For your information internaly in memory such families are renamed to have a nicer API.

References getFamiliesNames().

std::string MEDFileMesh::GetMagicFamilyStr ( )
static
void MEDFileMesh::assignFamilyNameWithGroupName ( )

Changes a name of every family, included in one group only, to be same as the group name.

Exceptions
Ifthere are families with equal names in this mesh.

References _families, _groups, and getGroupsOnFamily().

std::vector< std::string > MEDFileMesh::removeEmptyGroups ( )

Removes all groups lying on no family. If there is no empty groups, this is let untouched.

Returns
the removed groups.

References _groups.

Referenced by removeOrphanGroups().

void MEDFileMesh::removeGroup ( const std::string &  name)

Removes a group from this mesh.

Parameters
[in]name- the name of the group to remove.
Exceptions
Ifno group with such a name exists.

References _groups, and getGroupsNames().

void MEDFileMesh::removeFamily ( const std::string &  name)

Removes a family from this mesh.

Parameters
[in]name- the name of the family to remove.
Exceptions
Ifno family with such a name exists.

References _families, _groups, and getFamiliesNames().

std::vector< std::string > MEDFileMesh::removeOrphanGroups ( )

Removes all groups in this that are orphan. A group is orphan if this group lies on a set of families, themselves orphan. A family is said orphan if its id appears nowhere in family field whatever its level. This method also suppresses the orphan families.

Returns
- The list of removed groups names.
See Also
MEDFileMesh::removeOrphanFamilies.

References removeEmptyGroups(), and removeOrphanFamilies().

std::vector< std::string > MEDFileMesh::removeOrphanFamilies ( )

Removes all families in this that are orphan. A family is said orphan if its id appears nowhere in family field whatever its level. Groups are updated in consequence, that is to say all groups lying on orphan family, will see their families list modified.

Returns
- The list of removed families names.
See Also
MEDFileMesh::removeOrphanGroups.

References _families, _groups, computeAllFamilyIdsInUse(), getFamiliesNames(), getGroupsOnFamily(), and MEDCoupling::DataArrayInt::presenceOfValue().

Referenced by rearrangeFamilies(), and removeOrphanGroups().

void MEDFileMesh::removeFamiliesReferedByNoGroups ( )

This method operates only on maps in this. The arrays are not considered here. So this method will remove a family (except "FAMILLE_ZERO" family) if no group lies on it whatever this family is orphan or not.

Warning
this method is different from removeOrphanFamilies that scans family field array to find orphan families.

References _families, _groups, and DFT_FAM_NAME.

Referenced by rearrangeFamilies().

void MEDFileMesh::rearrangeFamilies ( )

This method has no impact on groups. This method only works on families. This method firstly removes families not refered by any groups in this, then all unused entities are put as belonging to family 0 ("FAMILLE_ZERO"). Finally, all orphanFamilies are killed. This method raises an exception if "FAMILLE_ZERO" is already belonging to a group.

See Also
MEDFileMesh::removeOrphanFamilies

References _families, MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayInt::BuildListOfSwitchedOff(), checkOrphanFamilyZero(), MEDCoupling::DataArrayInt::deepCopy(), MEDCoupling::DataArrayTemplate< T >::empty(), MEDCoupling::DataArrayTemplate< T >::end(), getFamilyFieldAtLevel(), getNonEmptyLevelsExt(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), removeFamiliesReferedByNoGroups(), removeOrphanFamilies(), setFamilyFieldArr(), and MEDCoupling::DataArrayInt::switchOnTupleEqualTo().

void MEDFileMesh::checkOrphanFamilyZero ( ) const

This method only checks that "FAMILLE_ZERO" is orphan (not belonging to a group).

References _groups, and DFT_FAM_NAME.

Referenced by rearrangeFamilies().

void MEDFileMesh::changeGroupName ( const std::string &  oldName,
const std::string &  newName 
)

Renames a group in this mesh.

Parameters
[in]oldName- a current name of the group to rename.
[in]newName- a new group name.
Exceptions
Ifno group named oldName exists in this mesh.
Ifa group named newName already exists.

References _groups, and getGroupsNames().

void MEDFileMesh::changeFamilyName ( const std::string &  oldName,
const std::string &  newName 
)

Renames a family in this mesh.

Parameters
[in]oldName- a current name of the family to rename.
[in]newName- a new family name.
Exceptions
Ifno family named oldName exists in this mesh.
Ifa family named newName already exists.

References _families, _groups, and getFamiliesNames().

void MEDFileMesh::changeFamilyId ( int  oldId,
int  newId 
)

Changes an id of a family in this mesh. This method calls changeFamilyIdArr().

Parameters
[in]oldId- a current id of the family.
[in]newId- a new family id.

References _families, and changeFamilyIdArr().

void MEDFileMesh::changeAllGroupsContainingFamily ( const std::string &  familyNameToChange,
const std::vector< std::string > &  newFamiliesNames 
)
int MEDFileMesh::getFamilyId ( const std::string &  name) const

Returns an id of the family having a given name.

Parameters
[in]name- the name of the family of interest.
Returns
int - the id of the family of interest.
Exceptions
Ifno family with such a name exists.

References _families, and getFamiliesNames().

Referenced by MEDCoupling::MEDFileUMesh::convertToExtrudedMesh().

int MEDFileMesh::getMaxAbsFamilyId ( ) const

Returns a maximal abs(id) of families in this mesh.

Returns
int - the maximal norm of family id.
Exceptions
Ifthere are no families in this mesh.

References _families.

Referenced by setGroupsAtLevel().

int MEDFileMesh::getMaxFamilyId ( ) const

Returns a maximal id of families in this mesh.

Returns
int - the maximal family id.
Exceptions
Ifthere are no families in this mesh.

References _families.

Referenced by MEDCoupling::MEDFileUMesh::buildInnerBoundaryAlongM1Group(), ensureDifferentFamIdsPerLevel(), and keepFamIdsOnlyOnLevs().

int MEDFileMesh::getMinFamilyId ( ) const

Returns a minimal id of families in this mesh.

Returns
int - the minimal family id.
Exceptions
Ifthere are no families in this mesh.

References _families.

Referenced by MEDCoupling::MEDFileUMesh::buildInnerBoundaryAlongM1Group().

int MEDFileMesh::getTheMaxAbsFamilyId ( ) const

Returns a maximal id of families in this mesh. Not only named families are considered but all family fields as well.

Returns
int - the maximal family id.

References _families, and getMaxAbsFamilyIdInArrays().

Referenced by addGroupUnderground().

int MEDFileMesh::getTheMaxFamilyId ( ) const

Returns a maximal id of families in this mesh. Not only named families are considered but all family fields as well.

Returns
int - the maximal family id.

References _families, and getMaxFamilyIdInArrays().

int MEDFileMesh::getTheMinFamilyId ( ) const

Returns a minimal id of families in this mesh. Not only named families are considered but all family fields as well.

Returns
int - the minimal family id.

References _families, and getMinFamilyIdInArrays().

virtual int MEDCoupling::MEDFileMesh::getMaxAbsFamilyIdInArrays ( ) const
pure virtual
virtual int MEDCoupling::MEDFileMesh::getMaxFamilyIdInArrays ( ) const
pure virtual
virtual int MEDCoupling::MEDFileMesh::getMinFamilyIdInArrays ( ) const
pure virtual
DataArrayInt * MEDFileMesh::getAllFamiliesIdsReferenced ( ) const
DataArrayInt * MEDFileMesh::computeAllFamilyIdsInUse ( ) const

This method does not consider map of family name, family id. Only family field array on different levels is considered.

See Also
MEDFileMesh::getAllFamiliesIdsReferenced

References MEDCoupling::DataArrayInt::buildUnion(), MEDCoupling::DataArrayInt::getDifferentValues(), getFamArrNonEmptyLevelsExt(), getFamilyFieldAtLevel(), and MEDCoupling::MCAuto< T >::retn().

Referenced by removeOrphanFamilies().

std::vector< int > MEDFileMesh::getFamiliesIds ( const std::vector< std::string > &  fams) const

Returns ids of the families having given names.

Parameters
[in]fams- a sequence of the names of families of interest.
Returns
std::vector<int> - a sequence of the ids of families of interest.
Exceptions
Iffams contains a name of an inexistent family.

References _families, and getFamiliesNames().

Referenced by MEDCoupling::MEDFileUMesh::getFamilies(), MEDCoupling::MEDFileUMesh::getFamiliesArr(), MEDCoupling::MEDFileStructuredMesh::getFamiliesArr(), getFamiliesIdsOnGroup(), MEDCoupling::MEDFileUMesh::getFamsNonEmptyLevels(), and MEDCoupling::MEDFileUMesh::getFamsNonEmptyLevelsExt().

std::string MEDFileMesh::getFamilyNameGivenId ( int  id) const

Returns a name of the family by its id. If there are several families having the given id, the name first in lexical order is returned.

Parameters
[in]id- the id of the family whose name is required.
Returns
std::string - the name of the found family.
Exceptions
Ifno family with the given id exists.

References _families.

Referenced by addGroupUnderground(), ensureDifferentFamIdsPerLevel(), keepFamIdsOnlyOnLevs(), normalizeFamIdsMEDFile(), normalizeFamIdsTrio(), setFamiliesIdsOnGroup(), and MEDCoupling::MEDFileUMesh::setFamilyNameAttachedOnId().

void MEDFileMesh::normalizeFamIdsTrio ( )

This method normalizes fam id with the policy explained underneath. This policy is close to those implemented in SMESH. Level #0 famids > 0, Level #-1 famids < 0, Level #-2 famids=0, Level #1 famids=0 This policy is those used by SMESH and Trio and that is the opposite of those in MED file. This method will throw an exception if a same family id is detected in different level.

Warning
This policy is the opposite of those in MED file documentation ...

References _families, MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayTemplate< T >::end(), ensureDifferentFamIdsPerLevel(), MEDCoupling::DataArrayInt::fillWithZero(), getAllFamiliesIdsReferenced(), MEDCoupling::DataArrayInt::getDifferentValues(), getFamiliesNames(), getFamilyFieldAtLevel(), getFamilyNameGivenId(), getNonEmptyLevelsExt(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), and MEDCoupling::DataArrayInt::presenceOfValue().

void MEDFileMesh::normalizeFamIdsMEDFile ( )

This method normalizes fam id with the following policy. Level #0 famids < 0, Level #-1 famids < 0 and for Level #1 famids >= 0 This policy is those defined in the MED file format but is the opposite of those implemented in SMESH and Trio. This method will throw an exception if a same family id is detected in different level.

References _families, MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayTemplate< T >::end(), ensureDifferentFamIdsPerLevel(), getAllFamiliesIdsReferenced(), MEDCoupling::DataArrayInt::getDifferentValues(), getFamiliesNames(), getFamilyFieldAtLevel(), getFamilyNameGivenId(), getNonEmptyLevelsExt(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), and MEDCoupling::DataArrayInt::presenceOfValue().

std::string MEDFileMesh::simpleRepr ( ) const
virtual

Returns a string describing this mesh. This description includes the mesh name and the mesh description string.

Returns
std::string - the mesh information string.

Reimplemented in MEDCoupling::MEDFileCurveLinearMesh, MEDCoupling::MEDFileCMesh, and MEDCoupling::MEDFileUMesh.

References getDescription(), and getName().

Referenced by MEDCoupling::MEDFileUMesh::simpleRepr(), MEDCoupling::MEDFileCMesh::simpleRepr(), and MEDCoupling::MEDFileCurveLinearMesh::simpleRepr().

virtual std::string MEDCoupling::MEDFileMesh::advancedRepr ( ) const
pure virtual
void MEDFileMesh::setGroupsAtLevel ( int  meshDimRelToMaxExt,
const std::vector< const DataArrayInt * > &  grps,
bool  renum = false 
)
virtual

Adds groups of given dimension and creates corresponding families and family fields given ids of mesh entities of each group.

Parameters
[in]meshDimRelToMaxExt- the relative mesh dimension of given mesh entities.
[in]grps- a sequence of arrays of ids each describing a group.
[in]renum- true means that grps contains not ids but optional numbers of mesh entities.
Exceptions
Ifnames of some groups in grps are equal.
Ifgrps includes a group with an empty name.
Ifgrps includes invalid ids (or numbers if renum == true ).
Ifthere are no mesh entities of meshDimRelToMaxExt dimension in this mesh.

References _families, appendFamilyEntries(), MEDCoupling::DataArrayInt::getDifferentValues(), getMaxAbsFamilyId(), getName(), getRevNumberFieldAtLevel(), getSizeAtLevel(), MEDCoupling::DataArrayInt::MakePartition(), setFamilyFieldArr(), and TranslateFamilyIds().

Referenced by MEDCoupling::MEDFileUMesh::buildExtrudedMesh(), MEDCoupling::MEDFileUMesh::setGroupsFromScratch(), and MEDCoupling::MEDFileUMesh::setGroupsOnSetMesh().

virtual void MEDCoupling::MEDFileMesh::setFamilyFieldArr ( int  meshDimRelToMaxExt,
DataArrayInt famArr 
)
pure virtual
virtual void MEDCoupling::MEDFileMesh::setRenumFieldArr ( int  meshDimRelToMaxExt,
DataArrayInt renumArr 
)
pure virtual
virtual void MEDCoupling::MEDFileMesh::setNameFieldAtLevel ( int  meshDimRelToMaxExt,
DataArrayAsciiChar nameArr 
)
pure virtual
virtual void MEDCoupling::MEDFileMesh::addNodeGroup ( const DataArrayInt ids)
pure virtual
virtual void MEDCoupling::MEDFileMesh::addGroup ( int  meshDimRelToMaxExt,
const DataArrayInt ids 
)
pure virtual
virtual DataArrayInt* MEDCoupling::MEDFileMesh::getFamilyFieldAtLevel ( int  meshDimRelToMaxExt)
pure virtual
DataArrayInt * MEDFileMesh::getOrCreateAndGetFamilyFieldAtLevel ( int  meshDimRelToMaxExt)

This method is nearly like getFamilyFieldAtLevel method. Except that if the array does not exist at the specified level meshDimRelToMaxExt an empty one is created.

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayInt::fillWithZero(), getFamilyFieldAtLevel(), getSizeAtLevel(), MEDCoupling::DataArrayInt::New(), and setFamilyFieldArr().

Referenced by MEDCoupling::MEDFileStructuredMesh::addGroup().

virtual const DataArrayInt* MEDCoupling::MEDFileMesh::getNumberFieldAtLevel ( int  meshDimRelToMaxExt) const
pure virtual
virtual const DataArrayInt* MEDCoupling::MEDFileMesh::getRevNumberFieldAtLevel ( int  meshDimRelToMaxExt) const
pure virtual
virtual const DataArrayAsciiChar* MEDCoupling::MEDFileMesh::getNameFieldAtLevel ( int  meshDimRelToMaxExt) const
pure virtual
virtual DataArrayInt* MEDCoupling::MEDFileMesh::getFamiliesArr ( int  meshDimRelToMaxExt,
const std::vector< std::string > &  fams,
bool  renum = false 
) const
pure virtual
DataArrayInt * MEDFileMesh::getGroupsArr ( int  meshDimRelToMaxExt,
const std::vector< std::string > &  grps,
bool  renum = false 
) const
virtual

Returns ids of mesh entities contained in given groups of a given dimension.

Parameters
[in]meshDimRelToMaxExt- a relative dimension of the mesh entities whose ids are required.
[in]grps- the names of the groups of interest.
[in]renum- if true, the optional numbers of entities, if available, are returned instead of ids.
Returns
DataArrayInt * - a new instance of DataArrayInt holding either ids or numbers, if available and required, of mesh entities of the groups. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthe name of a nonexistent group is present in grps.
Ifthe family field is missing for meshDimRelToMaxExt.

References getFamiliesArr(), and getFamiliesOnGroups().

Referenced by getGroupArr(), and getNodeGroupsArr().

DataArrayInt * MEDFileMesh::getGroupArr ( int  meshDimRelToMaxExt,
const std::string &  grp,
bool  renum = false 
) const
virtual

Returns ids of mesh entities contained in a given group of a given dimension.

Parameters
[in]meshDimRelToMaxExt- a relative dimension of the mesh entities whose ids are required.
[in]grp- the name of the group of interest.
[in]renum- if true, the optional numbers of entities, if available, are returned instead of ids.
Returns
DataArrayInt * - a new instance of DataArrayInt holding either ids or numbers, if available and required, of mesh entities of the group. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthe name of a nonexistent group is specified.
Ifthe family field is missing for meshDimRelToMaxExt.

References getGroupsArr(), and MEDCoupling::DataArray::setName().

Referenced by MEDCoupling::MEDFileUMesh::buildExtrudedMesh(), and MEDCoupling::MEDFileUMesh::buildInnerBoundaryAlongM1Group().

DataArrayInt * MEDFileMesh::getFamilyArr ( int  meshDimRelToMaxExt,
const std::string &  fam,
bool  renum = false 
) const
virtual

Returns ids of mesh entities contained in a given family of a given dimension.

Parameters
[in]meshDimRelToMaxExt- a relative dimension of the mesh entities whose ids are required.
[in]fam- the name of the family of interest.
[in]renum- if true, the optional numbers of entities, if available, are returned instead of ids.
Returns
DataArrayInt * - a new instance of DataArrayInt holding either ids or numbers, if available and required, of mesh entities of the family. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthe family field is missing for meshDimRelToMaxExt.

References getFamiliesArr(), and MEDCoupling::DataArray::setName().

DataArrayInt * MEDFileMesh::getNodeGroupArr ( const std::string &  grp,
bool  renum = false 
) const
virtual

Returns ids of nodes contained in a given group.

Parameters
[in]grp- the name of the group of interest.
[in]renum- if true, the optional numbers of nodes, if available, are returned instead of ids.
Returns
DataArrayInt * - a new instance of DataArrayInt holding either ids or numbers, if available and required, of nodes of the group. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthe name of a nonexistent group is specified.
Ifthe family field is missing for nodes.

References getNodeGroupsArr(), and MEDCoupling::DataArray::setName().

DataArrayInt * MEDFileMesh::getNodeGroupsArr ( const std::vector< std::string > &  grps,
bool  renum = false 
) const
virtual

Returns ids of nodes contained in given groups.

Parameters
[in]grps- the names of the groups of interest.
[in]renum- if true, the optional numbers of nodes, if available, are returned instead of ids.
Returns
DataArrayInt * - a new instance of DataArrayInt holding either ids or numbers, if available and required, of nodes of the groups. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthe name of a nonexistent group is present in grps.
Ifthe family field is missing for nodes.

References getGroupsArr().

Referenced by getNodeGroupArr().

DataArrayInt * MEDFileMesh::getNodeFamilyArr ( const std::string &  fam,
bool  renum = false 
) const
virtual

Returns ids of nodes contained in a given group.

Parameters
[in]grp- the name of the group of interest.
[in]renum- if true, the optional numbers of nodes, if available, are returned instead of ids.
Returns
DataArrayInt * - a new instance of DataArrayInt holding either ids or numbers, if available and required, of nodes of the group. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthe name of a nonexistent group is specified.
Ifthe family field is missing for nodes.

References getNodeFamiliesArr(), and MEDCoupling::DataArray::setName().

DataArrayInt * MEDFileMesh::getNodeFamiliesArr ( const std::vector< std::string > &  fams,
bool  renum = false 
) const
virtual

Returns ids of nodes contained in given families.

Parameters
[in]fams- the names of the families of interest.
[in]renum- if true, the optional numbers of nodes, if available, are returned instead of ids.
Returns
DataArrayInt * - a new instance of DataArrayInt holding either ids or numbers, if available and required, of nodes of the families. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthe family field is missing for nodes.

References getFamiliesArr().

Referenced by getNodeFamilyArr().

virtual bool MEDCoupling::MEDFileMesh::unPolyze ( std::vector< int > &  oldCode,
std::vector< int > &  newCode,
DataArrayInt *&  o2nRenumCell 
)
pure virtual
int MEDFileMesh::getNumberOfJoints ( ) const

Return number of joints, which is equal to number of adjacent mesh domains.

References _joints.

MEDFileJoints * MEDFileMesh::getJoints ( ) const

Return joints with all adjacent mesh domains.

void MEDFileMesh::setJoints ( MEDFileJoints *  joints)
MEDFileEquivalences* MEDCoupling::MEDFileMesh::getEquivalences ( )

References _equiv.

const MEDFileEquivalences* MEDCoupling::MEDFileMesh::getEquivalences ( ) const

References _equiv.

void MEDCoupling::MEDFileMesh::killEquivalences ( )

References _equiv.

void MEDCoupling::MEDFileMesh::initializeEquivalences ( )

References _equiv.

INTERP_KERNEL::NormalizedCellType MEDFileMesh::ConvertFromMEDFileGeoType ( med_geometry_type  geoType)
static
TypeOfField MEDFileMesh::ConvertFromMEDFileEntity ( med_entity_type  etype)
static
void MEDCoupling::MEDFileMesh::setUnivName ( const std::string &  name)
protected

protected because no way in MED file API to specify this name

References _univ_name.

Referenced by MEDCoupling::MEDFileStructuredMesh::loadStrMeshFromFile().

void MEDFileMesh::addFamilyOnAllGroupsHaving ( const std::string &  famName,
const std::string &  otherFamName 
)
protected

This method adds to all groups lying on family with name 'famName' the other family name 'otherFamName'. This method is quite underground because it can lead to unconsistency because family 'otherFamName' is not added into _families. This method is used by MEDFileMesh::keepFamIdsOnlyOnLevs method.

References _groups.

Referenced by keepFamIdsOnlyOnLevs().

void MEDFileMesh::dealWithTinyInfo ( const MEDCouplingMesh m)
protected

This method should be called by any set* method of subclasses to deal automatically with _name attribute. If _name attribute is empty the name of 'm' if taken as _name attribute. If _name is not empty and that 'm' has the same name nothing is done. If _name is not emplt and that 'm' has NOT the same name an exception is thrown.

References _desc_name, _name, MEDCoupling::MEDCouplingMesh::getDescription(), and MEDCoupling::MEDCouplingMesh::getName().

Referenced by MEDCoupling::MEDFileCMesh::setMesh(), and MEDCoupling::MEDFileCurveLinearMesh::setMesh().

virtual void MEDCoupling::MEDFileMesh::synchronizeTinyInfoOnLeaves ( ) const
protectedpure virtual
void MEDFileMesh::getFamilyRepr ( std::ostream &  oss) const
protected
void MEDFileMesh::appendFamilyEntries ( const DataArrayInt famIds,
const std::vector< std::vector< int > > &  fidsOfGrps,
const std::vector< std::string > &  grpNames 
)
protectedvirtual

This method append into '_families' attribute the families whose ids are in 'famIds'. Warning 'famIds' are expected to be ids not in '_families'. Groups information are given in parameters in order to give to families representative names. For the moment, the two last input parameters are not taken into account.

References _families, _groups, MEDCoupling::DataArrayTemplate< T >::begin(), and MEDCoupling::DataArrayTemplate< T >::end().

Referenced by setGroupsAtLevel().

virtual void MEDCoupling::MEDFileMesh::changeFamilyIdArr ( int  oldId,
int  newId 
)
protectedpure virtual

Implemented in MEDCoupling::MEDFileStructuredMesh.

Referenced by changeFamilyId().

virtual std::list< MCAuto<DataArrayInt> > MEDCoupling::MEDFileMesh::getAllNonNullFamilyIds ( ) const
protectedpure virtual
virtual void MEDCoupling::MEDFileMesh::loadLL ( med_idt  fid,
const std::string &  mName,
int  dt,
int  it,
MEDFileMeshReadSelector *  mrs 
)
protectedpure virtual
void MEDFileMesh::loadLLWithAdditionalItems ( med_idt  fid,
const std::string &  mName,
int  dt,
int  it,
MEDFileMeshReadSelector *  mrs 
)
protected

References loadEquivalences(), loadJointsFromFile(), and loadLL().

Referenced by New().

void MEDFileMesh::TranslateFamilyIds ( int  offset,
DataArrayInt famArr,
std::vector< std::vector< int > > &  famIdsPerGrp 
)
staticprotected
void MEDFileMesh::ChangeAllGroupsContainingFamily ( std::map< std::string, std::vector< std::string > > &  groups,
const std::string &  familyNameToChange,
const std::vector< std::string > &  newFamiliesNames 
)
staticprotected
std::string MEDFileMesh::FindOrCreateAndGiveFamilyWithId ( std::map< std::string, int > &  families,
int  id,
bool &  created 
)
staticprotected

If it exists a family whose family id is equal to 'id' this method behaves as MEDFileMesh::getFamilyNameGivenId. In this case, 'this' internal states remains unchanged and 'created' out parameter will be set to false. If there is no family whose family id is equal to 'id' a family is created with a name different from those already existing. In this case 'created' will be returned with a value set to true, and internal state will be modified. This method will throws an exception if it is not possible to create a unique family name.

References CreateNameNotIn().

Referenced by addGroupUnderground(), and findOrCreateAndGiveFamilyWithId().

std::string MEDFileMesh::CreateNameNotIn ( const std::string &  nameTry,
const std::vector< std::string > &  namesToAvoid 
)
staticprotected

Warning no check is done on 'nameTry' in parameter. It should be non empty. This method returns a name close to 'nameTry' so that it is not already into 'namesToAvoid'. If this method fails to find such a name it will throw an exception.

Referenced by FindOrCreateAndGiveFamilyWithId(), and keepFamIdsOnlyOnLevs().

int MEDFileMesh::PutInThirdComponentOfCodeOffset ( std::vector< int > &  code,
int  strt 
)
staticprotected
void MEDFileMesh::writeJoints ( med_idt  fid) const
protected

Write joints in a file.

References _joints, and MEDCoupling::MCAuto< T >::isNotNull().

Referenced by writeLL().

void MEDFileMesh::loadJointsFromFile ( med_idt  fid,
MEDFileJoints *  toUseInstedOfReading = 0 
)
protected

Load joints in a file or use provided ones.

Load joints in a file or use provided ones

Parameters
[in]fid- MED file descriptor
[in]toUseInstedOfReading- optional joints to use instead of reading, Usually this joints are those just read by another iteration of namesake mesh, when this method is called by MEDFileMeshMultiTS::New()

References _joints, _name, and setJoints().

Referenced by loadLLWithAdditionalItems().

void MEDFileMesh::loadEquivalences ( med_idt  fid)
protected

References _equiv, and _name.

Referenced by loadLLWithAdditionalItems().

void MEDFileMesh::deepCpyEquivalences ( const MEDFileMesh other)
protected
bool MEDFileMesh::areEquivalencesEqual ( const MEDFileMesh other,
std::string &  what 
) const
protected

References _equiv.

Referenced by isEqual().

void MEDFileMesh::getEquivalencesRepr ( std::ostream &  oss) const
protected

References _equiv.

Referenced by MEDCoupling::MEDFileUMesh::simpleRepr().

Member Data Documentation

std::string MEDCoupling::MEDFileMesh::_dt_unit
protected
std::string MEDCoupling::MEDFileMesh::_univ_name
mutableprotected

this attribute do not impact the state of instance -> mutable

Referenced by getHeapMemorySizeWithoutChildren(), getUnivName(), and setUnivName().

bool MEDCoupling::MEDFileMesh::_univ_wr_status
protected
MEDCouplingAxisType MEDCoupling::MEDFileMesh::_axis_type
protected

Referenced by getAxisType(), and setAxisType().

MCAuto<MEDFileJoints> MEDCoupling::MEDFileMesh::_joints
protected
const char MEDFileMesh::DFT_FAM_NAME ="FAMILLE_ZERO"
static