Version: 5.1.6

multipr.Family Class Reference

#include <MULTIPR_Family.hxx>

Public Member Functions

 Family ()
 Builds an empty Family (default constructor).
 Family (const Family &pFamily)
 Copy constructor.
 ~Family ()
 Destructor.
void reset ()
 Resets this object in its state by default (empty).
med_int getId () const
 Returns the identifier (= number) of this Family.
void setId (med_int pId)
 Set the identifier of this family.
const char * getName () const
 Returns the name of this Family.
bool isFamilyOfNodes () const
 Returns true if this Family if a family of nodes, false if is a family of elements (=cells)).
void setIsFamilyOfNodes (bool pIsFamilyOfNodes)
 Sets whether this Family is a family of nodes or family of elements (= cells).
void insertElt (med_int pIndexElt, eMeshType pMeshIndex=eMED_POINT1)
 Inserts a new element (by its index) into this Family.
int getSize (eMeshType pMeshIndex=eMED_POINT1) const
 Returns the number of elements in this Family.
void buildGroups (std::vector< Group * > &pGroups, std::map< std::string, Group * > &pGroupNameToGroup) const
 Adds all the groups of this Family into the set of groups described by (pGroups, pGroupNameToGroup).
FamilyextractGroup (const char *pGroupName)
 Constructor.
const std::set< med_int > & getSetOfElt (eMeshType pMeshIndex) const
 Returns the set of all the elements referenced in this Family.
void readMED (med_idt pMEDfile, char *pMeshName, med_int pIndex)
 Reads a Family from a MED file.
void writeMED (med_idt pMEDfile, char *pMeshName)
 Writes this Family to a MED file.
void setPrintAll (bool pFlag)
 Sets the flag which control the stream operator <<.
Familyoperator= (const Family &)
 Flag to control the behaviour of the stream operator <<.
bool operator== (const Family &)

Data Fields

char mName [32+1]
med_int mId
 Name of the Family.
std::set< med_int > mElt [eMaxMedMesh]
 Set of all the elements (by their index in 1.
std::string mStrNameGroups
 A string with name of all groups which contain the Family.
std::vector< std::string > mNameGroups
 List of groups (by name) which contain the Family.
Attributs mAttributs
 All the attributed related to the Family.
bool mIsFamilyOfNodes
 Is it a family of nodes or a family of elements?
bool mFlagPrintAll

Friends

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

Constructor & Destructor Documentation

multipr.Family::Family (  ) 

Builds an empty Family (default constructor).

References multipr.Family.reset().

multipr.Family::Family ( const Family pFamily  ) 
multipr.Family::~Family (  ) 

Destructor.

Removes everything.

References multipr.Family.reset().


Member Function Documentation

void multipr.Family::reset (  ) 
med_int multipr.Family.getId ( void   )  const

Returns the identifier (= number) of this Family.

Returns:
the identifier of this Family.

References multipr.Family.mId.

void multipr.Family.setId ( med_int  pId  ) 

Set the identifier of this family.

Parameters:
pId The identifier.

References multipr.Family.mId.

const char* multipr.Family.getName (  )  const

Returns the name of this Family.

Returns:
the name of this Family.

References multipr.Family.mName.

bool multipr.Family.isFamilyOfNodes (  )  const

Returns true if this Family if a family of nodes, false if is a family of elements (=cells)).

Returns:
true iff this Family if a family of nodes.

References multipr.Family.mIsFamilyOfNodes.

void multipr.Family.setIsFamilyOfNodes ( bool  pIsFamilyOfNodes  ) 

Sets whether this Family is a family of nodes or family of elements (= cells).

Parameters:
pIsFamilyOfNodes flag.

References multipr.Family.mIsFamilyOfNodes.

void multipr.Family::insertElt ( med_int  pIndexElt,
eMeshType  pMeshIndex = eMED_POINT1 
)

Inserts a new element (by its index) into this Family.

Parameters:
pIndexElt index of the element to be added; must be >= 1.
pMeshIndex Index of the mesh (eMED_TETRA4 etc...). Default value when its a family of nodes.
Exceptions:
IllegalArgumentException if pIndexElt <= 0.

References multipr.Family.mElt.

int multipr.Family.getSize ( eMeshType  pMeshIndex = eMED_POINT1  )  const

Returns the number of elements in this Family.

Returns:
the number of elements in this Family.

References multipr.Family.mElt.

void multipr.Family::buildGroups ( std::vector< Group * > &  pGroups,
std::map< std::string, Group * > &  pGroupNameToGroup 
) const

Adds all the groups of this Family into the set of groups described by (pGroups, pGroupNameToGroup).

Parameters:
pGroups current list of groups.
pGroupNameToGroup table (map) to retrieve a Group* from its name.

References med_test1.begin, multipr.eMaxMedMesh, med_test1.group, multipr.Group.insertElt(), multipr.Family.isFamilyOfNodes(), Med_Gen_test.it, multipr.Family.mElt, multipr.Family.mNameGroups, NULL, multipr.Group.setIsGroupOfNodes(), and multipr.Group.setName().

Family * multipr.Family::extractGroup ( const char *  pGroupName  ) 

Constructor.

Returns a copy of this family restricted to the given group if pGroupName != NULL. Examples: 1. If current family have 3 groups "A", "B" and "C" and pGroupName="B", then the new family will only reference the group "B" 2. If current family have 3 groups "A", "B" and "C" and pGroupName="D", then the new family will reference groups "A", "B" and "C". WARNING: elements are not copied

Parameters:
pGroupName name of the group to keep.
Returns:
a copy of this family.

References multipr.Family.Family(), med_opsupp_test.family, multipr.Family.mAttributs, MED_TAILLE_LNOM, multipr.Family.mId, multipr.Family.mName, multipr.Family.mNameGroups, multipr.Family.mStrNameGroups, and NULL.

const std::set<med_int>& multipr.Family.getSetOfElt ( eMeshType  pMeshIndex  )  const

Returns the set of all the elements referenced in this Family.

Returns:
the set of all the elements referenced in this Family.

References multipr.Family.mElt.

void multipr.Family::readMED ( med_idt  pMEDfile,
char *  pMeshName,
med_int  pIndex 
)

Reads a Family from a MED file.

Parameters:
pMEDfile any valid MED file opened for reading.
pMeshName name of the mesh.
pIndex index of the family to be read (must be >= 1).
Exceptions:
IOException if any i/o error occurs.

References multipr.Family.mAttributs, multipr.Attributs.mDesc, MED_TAILLE_DESC, MED_TAILLE_LNOM, MED_TAILLE_NOM, med_2_1.MEDfamInfo(), multipr.Attributs.mId, multipr.Family.mId, multipr.Family.mName, multipr.Family.mNameGroups, multipr.Attributs.mNum, multipr.Family.mStrNameGroups, multipr.Attributs.mVal, NULL, multipr.Family.reset(), and testMEDMEM.ret.

void multipr.Family::writeMED ( med_idt  pMEDfile,
char *  pMeshName 
)

Writes this Family to a MED file.

WARNING: mesh must have been created and added to the MED file before.

Parameters:
pMEDfile any valid MED file opened for writing.
pPeshName name of the mesh.
Exceptions:
IOException if any i/o error occurs.

References multipr.Family.mAttributs, multipr.Attributs.mDesc, MED_TAILLE_NOM, med_2_1.MEDfamCr(), multipr.Attributs.mId, multipr.Family.mId, multipr.Family.mName, multipr.Family.mNameGroups, multipr.Attributs.mNum, multipr.Family.mStrNameGroups, multipr.Attributs.mVal, NULL, and testMEDMEM.ret.

void multipr.Family.setPrintAll ( bool  pFlag  ) 

Sets the flag which control the stream operator <<.

Parameters:
pFlag new flag value.

References multipr.Family.mFlagPrintAll.

Family& multipr.Family.operator= ( const Family  ) 

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

bool multipr.Family.operator== ( const Family  ) 

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  pOs,
Family pF 
) [friend]

Dumps any Family to the given output stream.

Parameters:
pOs any output stream.
pF any Family.
Returns:
the output stream pOs.

Field Documentation

Name of the Family.

Id: > 0 if family of nodes; < 0 if family of elements.

std::set<med_int> multipr.Family.mElt[eMaxMedMesh]

Set of all the elements (by their index in 1.

.*).

A string with name of all groups which contain the Family.

std::vector<std::string> multipr.Family.mNameGroups

List of groups (by name) which contain the Family.

All the attributed related to the Family.

Is it a family of nodes or a family of elements?