Version: 5.1.6

multipr.Mesh Class Reference

Assumes:

More...

#include <MULTIPR_Mesh.hxx>

Public Member Functions

 Mesh ()
 Builds an empty Mesh (default constructor).
 ~Mesh ()
 Destructor.
void reset ()
 Resets this object in its state by default (empty).
const char * getName () const
 Returns the name of this Mesh.
std::vector< Group * > * getGroups ()
 Returns the groups of this Mesh.
const NodesgetNodes () const
 Returns the nodes of this Mesh.
const ElementsgetElements (int pGeomIdx) const
 Returns the elements of this Mesh.
GaussIndexListeditGaussIndex ()
 Returns the gauss index of the splited meshes.
std::vector< std::string > getNameScalarFields () const
 Returns the name of all the scalar fields.
int getTimeStamps (const char *pFieldName) const
 Returns the number of iteration for a given field.
FieldgetFieldByName (const char *pFieldName, eMeshType pGeomType=eMaxMedMesh) const
 Returns a Field from its name; NULL if it does not exist.
void getFieldMinMax (const char *pFieldName, float &pMin, float &pMax) const
 Get the minimum and maximum value of the field.
GaussLocgetGaussLocByName (const char *pGaussLocName) const
 Returns a GaussLoc from its name; NULL if it does not exist.
int getNumberOfElements () const
 Returns the number of elements for all geometry type (TETRA4 AND HEXA8 AND etc).
int getNumberOfElements (eMeshType pGeomType) const
 Returns the number of elements for the specified geometry type.
void addProfile (Profil *pProfil)
 Add a profile to the mesh.
std::vector< Profil * > & getProfils ()
 Get the vector of profiles of this mesh.
ProfilgetProfil (const std::string pProfilName)
 Get the profile by its name.
MeshcreateFromSetOfElements (const std::set< med_int > *pSetOfElements, const char *pNewMeshName)
 Creates a Mesh from a subset of its elements (cells).
MeshcreateFromGroup (const Group *pGroup, const char *pNewMeshName)
 Creates a Mesh from one of its group.
MeshcreateFromFamily (const Family *pFamily, const char *pNewMeshName)
 Creates a Mesh from one of its family.
MeshmergePartial (std::vector< Mesh * > pMeshes, const char *pFieldName, int pFieldIt)
 Creates a Mesh by merging this one with the given one.
MeshDissplitGroupsOfElements ()
 Creates a distributed mesh (MeshDis) by creating a new mesh for each group of elements in this Mesh.
Meshdecimate (const char *pFilterName, const char *pArgv, const char *pNameNewMesh)
 Creates a new mesh by decimating this one.
void getAllPointsOfField (Field *pField, int pTimeStepIt, std::vector< PointOfField > &pPoints, eMeshType pGeomType)
 Gets all the points in a field.
float evalDefaultRadius (int pN) const
 Returns a default value for neighborhood radius.
void readSequentialMED (const char *pMEDfilename, const char *pMeshName, bool pReadFields=true)
 Reads a Mesh from a sequential MED file.
void readSequentialMED (const char *pMEDfilename, med_int pMeshNumber, bool pReadFields=true)
 Reads a Mesh from a sequential MED file.
void writeMED (const char *pMEDfilename)
 Writes this Mesh and all related things into a MED file.
void writeMED (const char *pMEDfilename, const char *pMeshName)
 Writes this Mesh and all related things into a MED file.
void setPrintAll (bool pFlag)
 Sets the flag which control the stream operator <<.
void _openMEDFile (const char *pMEDfilename, med_mode_acces pMEDModeAccess=MED_LECTURE)
 Opens a MED file for the given file name.
void _readSequentialMED (const char *pMeshName, bool pReadFields)
 Reads a Mesh from a sequential MED file.
void readGaussLoc ()
 Reads all Gauss localizations in the current MED file.
void readFamilies ()
 Reads families in the currentMED file and build groups.
void finalizeFamiliesAndGroups ()
 Finalizes the constructions of families and groups.
void readFields ()
 Reads fields related to this mesh in the current MED file.
 Mesh (const Mesh &)
Meshoperator= (const Mesh &)
bool operator== (const Mesh &)

Data Fields

char mMEDfilename [256]
 Name of the associated MED file.
med_idt mMEDfile
 MED file handle.
char mMeshName [32+1]
 Name of this mesh.
char mMeshUName [200+1]
 Universal name of this mesh.
char mMeshDesc [200+1]
 Description.
med_int mMeshDim
 Dimension.
med_maillage mMeshType
 Type of mesh (MED_NON_STRUCTURE or MED_STRUCTURE (=grid)).
med_float mMeshBBoxMin [3]
 Axis aligned bounding box of this mesh.
med_float mMeshBBoxMax [3]
NodesmNodes
 All the nodes used by this mesh.
ElementsmElements [eMaxMedMesh]
 All the TETRA10 elements used by this mesh.
std::vector< Family * > mFamilies
 Table of families used by this mesh.
std::map< med_int, Family * > mFamIdToFam
 Map to retrieve a Family from its id.
std::vector< Group * > mGroups
 Table of groups used by this mesh.
std::map< std::string, Group * > mGroupNameToGroup
 Map to retrieve a Group from its name.
std::vector< GaussLoc * > mGaussLoc
 Table of GaussLoc.
std::map< std::string, GaussLoc * > mGaussLocNameToGaussLoc
 Map to retrieve a Gauss info from its name.
std::vector< Field * > mFields
 Table of fields related to this mesh.
std::vector< Profil * > mProfils
 Table of profils.
bool mFlagPrintAll
 Flag to control the behaviour of the stream operator <<.
GaussIndexList mGaussIndex
 List of gauss points index for optimized domain split.

Friends

std::ostream & operator<< (std::ostream &pOs, Mesh &pM)
 Dumps any Mesh to the given output stream.

Detailed Description

Assumes:


Constructor & Destructor Documentation

multipr.Mesh::Mesh (  ) 

Builds an empty Mesh (default constructor).

References multipr.eMaxMedMesh, multipr.Mesh.mElements, multipr.Mesh.mNodes, NULL, and multipr.Mesh.reset().

multipr.Mesh::~Mesh (  ) 

Destructor.

Removes everything.

References multipr.Mesh.reset().

multipr.Mesh.Mesh ( const Mesh  ) 

Member Function Documentation

void multipr.Mesh::reset (  ) 
const char* multipr.Mesh.getName (  )  const

Returns the name of this Mesh.

Returns:
the name of this Mesh.

References multipr.Mesh.mMeshName.

std::vector<Group*>* multipr.Mesh.getGroups (  ) 

Returns the groups of this Mesh.

Returns:
the groups of this Mesh.

References multipr.Mesh.mGroups.

const Nodes* multipr.Mesh.getNodes (  )  const

Returns the nodes of this Mesh.

Returns:
the nodes of this Mesh.

References multipr.Mesh.mNodes.

const Elements* multipr.Mesh.getElements ( int  pGeomIdx  )  const

Returns the elements of this Mesh.

Parameters:
pGeomIdx The index of the geometry.
Returns:
the elements of this Mesh.

References multipr.Mesh.mElements.

GaussIndexList* multipr.Mesh.editGaussIndex (  ) 

Returns the gauss index of the splited meshes.

Only valid after a call to Mesh.splitGroupsOfElements().

Returns:
the elements of this Mesh.

References multipr.Mesh.mGaussIndex.

vector< string > multipr.Mesh::getNameScalarFields (  )  const

Returns the name of all the scalar fields.

Returns:
the name of all the scalar fields.

References multipr.Field.getName(), multipr.Field.getNumberOfComponents(), and multipr.Mesh.mFields.

int multipr.Mesh::getTimeStamps ( const char *  pFieldName  )  const

Returns the number of iteration for a given field.

Returns:
the number of iteration for a given field.

References multipr.Field.getName(), multipr.Field.getNumberOfTimeSteps(), and multipr.Mesh.mFields.

Field * multipr.Mesh::getFieldByName ( const char *  pFieldName,
eMeshType  pGeomType = eMaxMedMesh 
) const

Returns a Field from its name; NULL if it does not exist.

Parameters:
pFieldName name of the field to be retrieved.
pGeomType The type of the mesh.
Returns:
the Field pFieldName of it exists, NULL otherwise.
Exceptions:
NullArgumentException if pFieldName is NULL.

References multipr.Field.getGeomIdx(), multipr.Field.getName(), multipr.Field.isFieldOnNodes(), MED_TAILLE_NOM, multipr.Mesh.mFields, and NULL.

void multipr.Mesh::getFieldMinMax ( const char *  pFieldName,
float &  pMin,
float &  pMax 
) const

Get the minimum and maximum value of the field.

Parameters:
pFieldName The name of the field.
pMin The mininum value to fill.
pMax The maxinum value to fill.

References multipr.Field.getMinMax(), multipr.Field.getName(), MED_TAILLE_NOM, and multipr.Mesh.mFields.

GaussLoc * multipr.Mesh::getGaussLocByName ( const char *  pGaussLocName  )  const

Returns a GaussLoc from its name; NULL if it does not exist.

Parameters:
pGaussLocName name of the GaussLoc to be retrieved.
Returns:
the GaussLoc pGaussLocName if it exists, NULL otherwise.
Exceptions:
NullArgumentException if pGaussLocName is NULL.

References multipr.Mesh.mGaussLocNameToGaussLoc, and NULL.

int multipr.Mesh::getNumberOfElements (  )  const

Returns the number of elements for all geometry type (TETRA4 AND HEXA8 AND etc).

Returns:
the number of elements.

References multipr.eMaxMedMesh, multipr.Elements.getNumberOfElements(), and multipr.Mesh.mElements.

int multipr.Mesh::getNumberOfElements ( eMeshType  pGeomType  )  const

Returns the number of elements for the specified geometry type.

Parameters:
pGeomType The type of geometry (eMED_TETRA4 OR eMED_HEXA20 OR etc)
Returns:
the number of elements.

References multipr.Elements.getNumberOfElements(), and multipr.Mesh.mElements.

void multipr.Mesh.addProfile ( Profil pProfil  ) 

Add a profile to the mesh.

Parameters:
pProfil The profile to add.

References multipr.Mesh.mProfils.

std::vector<Profil*>& multipr.Mesh.getProfils (  ) 

Get the vector of profiles of this mesh.

Returns:
A vector of profiles (of this mesh...).

References multipr.Mesh.mProfils.

Profil * multipr.Mesh::getProfil ( const std::string  pProfilName  ) 

Get the profile by its name.

Parameters:
pProfilName The name of the profil to get.
Returns:
A Profil or NULL.

References Med_Gen_test.it, multipr.Mesh.mProfils, and NULL.

Mesh * multipr.Mesh::createFromSetOfElements ( const std::set< med_int > *  pSetOfElements,
const char *  pNewMeshName 
)
Mesh * multipr.Mesh::createFromGroup ( const Group pGroup,
const char *  pNewMeshName 
)

Creates a Mesh from one of its group.

Parameters:
pGroup any group of this Mesh.
pNewMeshName name of the new Mesh.
Returns:
a new Mesh which is a restriction of this Mesh to pGroup.
Exceptions:
NullArgumentException if pGroup or pNewMeshName is NULL.

References multipr.Profil.create(), multipr.eMaxMedMesh, multipr.Family.extractGroup(), multipr.Field.extractSubSet(), multipr.Nodes.extractSubSet(), multipr.Elements.extractSubSet(), multipr.Mesh.finalizeFamiliesAndGroups(), testGaussLocalization.gaussLoc, testGaussLocalization.gaussLocName, multipr.Nodes.getBBox(), multipr.Mesh.getGaussLocByName(), multipr.Field.getGeomIdx(), multipr.Profil.getGeomIdx(), multipr.GaussLoc.getName(), multipr.Group.getName(), multipr.Group.getSetOfElt(), multipr.Elements.getSetOfFamilies(), multipr.Nodes.getSetOfFamilies(), multipr.Field.getSetOfGaussLoc(), multipr.Elements.getSetOfNodes(), multipr.Field.isEmpty(), multipr.Field.isFieldOnNodes(), Med_Gen_test.it, MED_TAILLE_NOM, multipr.Mesh.mElements, multipr.Mesh.Mesh(), MED_test2.mesh, multipr.Mesh.mFamIdToFam, multipr.Mesh.mFamilies, multipr.Mesh.mFields, multipr.Mesh.mGaussIndex, multipr.Mesh.mGaussLoc, multipr.Mesh.mGaussLocNameToGaussLoc, multipr.Mesh.mMeshBBoxMax, multipr.Mesh.mMeshBBoxMin, multipr.Mesh.mMeshDesc, multipr.Mesh.mMeshDim, multipr.Mesh.mMeshName, multipr.Mesh.mMeshType, multipr.Mesh.mMeshUName, multipr.Mesh.mNodes, multipr.Mesh.mProfils, MULTIPR_LOG, NULL, multipr.OnNodes, multipr.Elements.remap(), and multipr.Profil.set().

Mesh * multipr.Mesh::createFromFamily ( const Family pFamily,
const char *  pNewMeshName 
)
Mesh * multipr.Mesh::mergePartial ( std::vector< Mesh * >  pMeshes,
const char *  pFieldName,
int  pFieldIt 
)

Creates a Mesh by merging this one with the given one.

Warning: not all the data are merged (e.g. bounding box if not computed and family/groups are partially filled). This method is intended to be used to build mesh for visualization (VISU integration). Merge is partial to improve speed.

Parameters:
pMesh any Mesh
Returns:
a new Mesh which is a the union of this and pMesh.
Exceptions:
NullArgumentException if pGroup or pNewMeshName is NULL.

References med_test1.begin, multipr.CELL_TYPES, multipr.eMaxMedMesh, med_opsupp_test.family, MED_test2.field, multipr.Family.getId(), multipr.GaussLoc.getName(), multipr.Nodes.getNumberOfNodes(), Med_Gen_test.it, multipr.Mesh.mElements, multipr.Field.merge(), multipr.Elements.mergePartial(), multipr.Nodes.mergePartial(), multipr.Mesh.Mesh(), MED_test2.mesh, multipr.Mesh.mFamIdToFam, multipr.Mesh.mFamilies, multipr.Mesh.mFields, multipr.Mesh.mGaussLoc, multipr.Mesh.mGaussLocNameToGaussLoc, multipr.Mesh.mMeshDesc, multipr.Mesh.mMeshDim, multipr.Mesh.mMeshName, multipr.Mesh.mMeshType, multipr.Mesh.mMeshUName, multipr.Mesh.mNodes, nodes, NULL, and test_NonCoincidentDEC.size.

MeshDis * multipr.Mesh::splitGroupsOfElements (  ) 
Mesh * multipr.Mesh::decimate ( const char *  pFilterName,
const char *  pArgv,
const char *  pNameNewMesh 
)

Creates a new mesh by decimating this one.

Parameters:
pFilterName name of the filter to be used for decimation (e.g. Filtre_GradientMoyen); should not be NULL.
pArgv all the arguments for filtering as a single string.
pNameNewMesh name of the new mesh.
Returns:
the decimated mesh.
Exceptions:
NullArgumentException if one of the arguments is NULL.
RuntimeException if any error occurs while decimating data.

References multipr.DecimationFilter.apply(), multipr.DecimationFilter.create(), and NULL.

void multipr.Mesh::getAllPointsOfField ( Field pField,
int  pTimeStepIt,
std::vector< PointOfField > &  pPoints,
eMeshType  pGeomType 
)
float multipr.Mesh::evalDefaultRadius ( int  pN  )  const

Returns a default value for neighborhood radius.

Return value is such that, for any point in the field, average number of neighbours is pN.

Parameters:
pN average number of neighbours.
Returns:
a default value for neighborhood radius; 1.0 if some error occurs.

References MEDCouplingCorbaSwigTestClt.f, multipr.Mesh.getNumberOfElements(), multipr.Field.getNumberOfGaussPointsByElement(), multipr.Field.getNumberOfTimeSteps(), multipr.Mesh.mFields, multipr.Mesh.mMeshBBoxMax, and multipr.Mesh.mMeshBBoxMin.

void multipr.Mesh::readSequentialMED ( const char *  pMEDfilename,
const char *  pMeshName,
bool  pReadFields = true 
)

Reads a Mesh from a sequential MED file.

Resets the object before.

Parameters:
pMEDfilename 
pMeshName 
pReadFields Set this to false to skip field.
Exceptions:
IOException if any i/o error occurs.

References multipr.Mesh._openMEDFile(), and multipr.Mesh._readSequentialMED().

void multipr.Mesh::readSequentialMED ( const char *  pMEDfilename,
med_int  pMeshNumber,
bool  pReadFields = true 
)

Reads a Mesh from a sequential MED file.

Resets the object before.

Parameters:
pMEDfilename 
pMeshNumber 
pReadFields Set this to false to skip field.
Exceptions:
IOException if any i/o error occurs.

References multipr.Mesh._openMEDFile(), multipr.Mesh._readSequentialMED(), MED_TAILLE_DESC, MED_TAILLE_NOM, med_2_1.MEDmaaInfo(), MEDnMaa(), med_field_anal.meshDim, Med_Gen_test.meshName, multipr.Mesh.mMEDfile, MULTIPR_LOG, batchmode_medcorba_test.nbMeshes, and testMEDMEM.ret.

void multipr.Mesh::writeMED ( const char *  pMEDfilename  ) 

Writes this Mesh and all related things into a MED file.

Parameters:
pMEDfilename 
Exceptions:
IOException if any i/o error occurs.

References multipr.Mesh.getName().

void multipr.Mesh::writeMED ( const char *  pMEDfilename,
const char *  pMeshName 
)
void multipr.Mesh.setPrintAll ( bool  pFlag  ) 

Sets the flag which control the stream operator <<.

Parameters:
pFlag new flag value.

References multipr.Mesh.mFlagPrintAll.

void multipr.Mesh::_openMEDFile ( const char *  pMEDfilename,
med_mode_acces  pMEDModeAccess = MED_LECTURE 
)

Opens a MED file for the given file name.

Parameters:
pMEDfilename 
pMEDModeAccess 
Exceptions:
IOException if any i/o error occurs.

References med_2_1.MEDformatConforme(), med_2_1.MEDouvrir(), med_2_1.MEDversionLire(), multipr.Mesh.mMEDfile, multipr.Mesh.mMEDfilename, MULTIPR_LOG, NULL, multipr.Mesh.reset(), and testMEDMEM.ret.

void multipr.Mesh::_readSequentialMED ( const char *  pMeshName,
bool  pReadFields 
)
void multipr.Mesh::readGaussLoc (  ) 
void multipr.Mesh::readFamilies (  ) 

Reads families in the currentMED file and build groups.

Exceptions:
IOException if an i/o error occurs.

References med_2_1.MEDnFam(), multipr.Mesh.mFamilies, multipr.Mesh.mMEDfile, multipr.Mesh.mMeshName, and multipr.Family.readMED().

void multipr.Mesh::finalizeFamiliesAndGroups (  ) 
void multipr.Mesh::readFields (  ) 
Mesh& multipr.Mesh.operator= ( const Mesh  ) 
bool multipr.Mesh.operator== ( const Mesh  ) 

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  pOs,
Mesh pM 
) [friend]

Dumps any Mesh to the given output stream.

Parameters:
pOs any output stream.
pM any Mesh.
Returns:
the output stream pOs.

Field Documentation

Name of the associated MED file.

MED file handle.

Name of this mesh.

Universal name of this mesh.

Description.

Dimension.

med_maillage multipr.Mesh.mMeshType

Type of mesh (MED_NON_STRUCTURE or MED_STRUCTURE (=grid)).

Axis aligned bounding box of this mesh.

All the nodes used by this mesh.

All the TETRA10 elements used by this mesh.

Table of families used by this mesh.

std::map<med_int, Family*> multipr.Mesh.mFamIdToFam

Map to retrieve a Family from its id.

std::vector<Group*> multipr.Mesh.mGroups

Table of groups used by this mesh.

std::map<std::string, Group*> multipr.Mesh.mGroupNameToGroup

Map to retrieve a Group from its name.

Table of GaussLoc.

Map to retrieve a Gauss info from its name.

std::vector<Field*> multipr.Mesh.mFields

Table of fields related to this mesh.

Number of fields = mFields.size().

Table of profils.

Flag to control the behaviour of the stream operator <<.

List of gauss points index for optimized domain split.