Version: 5.1.6

multipr.Profil Class Reference

#include <MULTIPR_Profil.hxx>

Public Member Functions

 Profil ()
 Builds an empty profil (default constructor).
 Profil (const Profil &pProfil)
 Copy constructor.
 ~Profil ()
 Destructor.
void reset ()
 Resets this object in its state by default (empty).
void create (const char *pName)
 Creates a profil from its name (reset before).
const char * getName () const
 Returns the name of this profil.
std::set< med_int > & getSet ()
 Get the complete set of elements of this profile.
void add (med_int pElt)
 Adds a new element to this profil.
bool find (med_int pElt)
 Find the given element in the profile.
void set (std::set< med_int > &pElt)
 Assign a set of element to this profile.
void filterSetOfElement (std::set< med_int > &pIn, std::set< med_int > &pOut)
 Select the elements of pIn contained in this profile.
void extractSetOfElement (const std::set< med_int > &pIn, std::set< med_int > &pOut)
 Extract a profil.
eProfilBinding getBinding ()
 Returns the association of the profile.
unsigned getGeomIdx ()
 Return the index of the geometry (if any) associated with this profile.
void readMED (med_idt pMEDfile, med_int pIndexProfil)
 Reads a Profil from a MED file.
void readProfilBinding (med_idt pMEDfile, char *pMeshName)
 Try to find in the MED file if this profile is associated to the nodes or the elements.
void writeMED (med_idt pMEDfile)
 Writes this profil to a MED file.
Profiloperator= (const Profil &)
bool operator== (const Profil &)

Data Fields

char mName [32+1]
 Name of the profil.
std::set< med_int > mTable
 Table of elements.
eProfilBinding mBinding
 Profil of nodes or elements.
unsigned mGeomIdx
 If this profile is on elements, the index of the geometry.

Friends

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

Constructor & Destructor Documentation

multipr.Profil::Profil (  ) 

Builds an empty profil (default constructor).

References multipr.Profil.reset().

multipr.Profil::Profil ( const Profil pProfil  ) 

Copy constructor.

Parameters:
pProfil The profil to copy.

References multipr.Profil.mBinding, multipr.Profil.mGeomIdx, multipr.Profil.mName, and multipr.Profil.mTable.

multipr.Profil::~Profil (  ) 

Destructor.

Removes everything.

References multipr.Profil.reset().


Member Function Documentation

void multipr.Profil::reset (  ) 

Resets this object in its state by default (empty).

Cleans memory.

References multipr.Profil.mBinding, multipr.Profil.mGeomIdx, multipr.Profil.mName, multipr.Profil.mTable, and multipr.Undef.

void multipr.Profil::create ( const char *  pName  ) 

Creates a profil from its name (reset before).

Parameters:
pName name of the profil to be created.
Exceptions:
NullArgumentException if pName is NULL.

References multipr.Profil.mName, NULL, and multipr.Profil.reset().

const char * multipr.Profil::getName (  )  const

Returns the name of this profil.

Returns:
the name of this profil.

References multipr.Profil.mName.

std::set< med_int>& multipr.Profil.getSet (  ) 

Get the complete set of elements of this profile.

Returns:
The set of elements.

References multipr.Profil.mTable.

void multipr.Profil::add ( med_int  pElt  ) 

Adds a new element to this profil.

Parameters:
pElt element to be added; must be >= 1.

References multipr.Profil.mTable.

bool multipr.Profil::find ( med_int  pElt  ) 

Find the given element in the profile.

Parameters:
pElt The index of the element.
Returns:
true if the element was found.

References multipr.Profil.mTable.

void multipr.Profil.set ( std::set< med_int > &  pElt  ) 

Assign a set of element to this profile.

Parameters:
pElt The set of element to assign.

References multipr.Profil.mTable.

void multipr.Profil::filterSetOfElement ( std::set< med_int > &  pIn,
std::set< med_int > &  pOut 
)

Select the elements of pIn contained in this profile.

The two parameters pIn and pOut MUST be different.

Parameters:
pIn Set of elements to filter.
pOut The result.
Exceptions:
IllegalStateException if pIn and pOut are not different.

References Med_Gen_test.it, and multipr.Profil.mTable.

void multipr.Profil::extractSetOfElement ( const std::set< med_int > &  pIn,
std::set< med_int > &  pOut 
)

Extract a profil.

The two parameters pIn and pOut MUST be different.

Parameters:
pIn Set of elements to extract.
pOut The result.
Exceptions:
IllegalStateException if pIn and pOut are not different.

References Med_Gen_test.it, and multipr.Profil.mTable.

eProfilBinding multipr.Profil.getBinding (  ) 

Returns the association of the profile.

Returns:
OnNodes or OnElements or Undef.

References multipr.Profil.mBinding.

unsigned multipr.Profil.getGeomIdx (  ) 

Return the index of the geometry (if any) associated with this profile.

If this profile is on nodes it will return 0. Since the geometry index starts at 0 use getBinding to know if its on elements.

Returns:
the index of the geometry.

References multipr.Profil.mGeomIdx.

void multipr.Profil::readMED ( med_idt  pMEDfile,
med_int  pIndexProfil 
)

Reads a Profil from a MED file.

Parameters:
pMEDfile any valid MED file opened for reading.
pIndexProfil index of the profil to be read; must be >= 1.
Exceptions:
IOException if any i/o error occurs.

References med_2_1.MEDprofilInfo(), med_2_1.MEDprofilLire(), multipr.Profil.mName, multipr.Profil.mTable, multipr.Profil.reset(), and testMEDMEM.ret.

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

Writes this profil to a MED file.

Parameters:
pMEDfile any valid MED file opened for writing.
Exceptions:
IOException if any i/o error occurs.

References Med_Gen_test.it, MED_TAILLE_NOM, med_2_1.MEDprofilEcr(), multipr.Profil.mName, multipr.Profil.mTable, and testMEDMEM.ret.

Profil& multipr.Profil.operator= ( const Profil  ) 
bool multipr.Profil.operator== ( const Profil  ) 

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  pOs,
Profil pP 
) [friend]

Dumps any Profil to the given output stream.

Parameters:
pOs any output stream.
pP any Profil.
Returns:
the output stream pOs.

Field Documentation

Name of the profil.

std::set<med_int> multipr.Profil.mTable

Table of elements.

Profil of nodes or elements.

If this profile is on elements, the index of the geometry.