Version: 5.1.6

multipr.Field Class Reference

#include <MULTIPR_Field.hxx>

Public Member Functions

 Field ()
 Builds an empty field (default constructor).
 ~Field ()
 Destructor.
void reset ()
 Resets this object in its state by default (empty).
bool isEmpty () const
 Returns true iff this field is empty (no data).
bool isFieldOnNodes () const
 Returns true iff this field apply on nodes (otherwise, information are related to elements).
const char * getName () const
 Returns the name of this Field.
int getNumberOfTimeSteps () const
 Returns the number of time steps in this Field.
med_type_champ getType () const
 Returns the numeric type of information contained in this Field (e.g.
eMeshType getGeomIdx ()
 Get the internal index of geometry type (eMED_TETRA4, etc).
int getNumberOfComponents () const
 Returns the number of components of this Field.
const std::string & getStrComponent ()
 Return the component string.
const std::string & getStrUnit ()
 Return the unit string.
int getNumberOfGaussPointsByElement (int pTimeStepIt) const
 Returns the number of Gauss points for each element at the given time step.
const std::string & getNameGaussLoc (int pTimeStepIt) const
 Returns the name of the Gauss localization related to the given iteration.
const unsigned char * getValue (int pTimeStepIt, int pIndex) const
 Returns a pointer towards the first value of this Field for the given element at the given time step.
const std::string & getProfil (int pTimeStep) const
 Get the profile (if any) at the given time step.
FieldextractSubSet (const std::set< med_int > &pSetIndices) const
 Creates a subset of this Field restricted to a set of elements (NODES or CELLS).
void getSetOfGaussLoc (std::set< std::string > &pSetOfGaussLoc) const
 Adds the set of GaussLoc used by this Field into the given set.
Fieldmerge (Field *pField)
 Builds a new field by merging data of this and pField if they are compatible.
Fieldmerge (std::vector< Field * > pFields, int pFieldIt=-1)
void getMinMax (float &pMin, float &pMax)
 Get the minimum and maximum values of this field for all time steps.
void readMED (med_idt pMEDfile, med_int pIndex, char *pMeshName, med_geometrie_element pGeom=(med_geometrie_element) 0)
 Reads a field from a MED file.
void writeMED (med_idt pMEDfile, char *pMeshName, bool pCreateField=true)
 Writes this field to a MED file.
void setPrintAll (bool pFlag)
 Sets the flag which control the stream operator <<.
void writeMEDOptimized (std::vector< MeshDisPart * > *pParts, const char *pMeshName, GaussIndexList *pGaussList, int pGeomIdx, std::vector< med_int > &pFiles, std::map< std::string, Profil * > &pProfils)
 Read and write the fields for optimized domain split.
void readMEDtimeSteps (med_idt pMEDfile, med_int pNumberOfTimeSteps, char *pMeshName)
 Reads all the information related to its field and a given time step (by its index).
 Field (const Field &)
Fieldoperator= (const Field &)
bool operator== (const Field &)

Data Fields

char mName [32+1]
med_entite_maillage mEntity
med_geometrie_element mGeom
eMeshType mGeomIdx
med_type_champ mType
int mSizeOfType
med_int mNumComponents
std::string mStrComponent
std::string mStrUnit
std::vector< med_int > mNGauss
 For each time step, number of Gauss points in the field.
std::vector< med_float > mDT
 For each time step, value of time step.
std::vector< med_int > mNumDT
 For each time step, iteration number.
std::vector< std::string > mDTUnit
 For each time step, units.
std::vector< med_int > mNumO
 For each time step, order number.
std::vector< std::string > mGaussLoc
 For each time step, name of Gauss localization to be used (empty if none).
std::vector< std::string > mProfil
 For each time step, name of the profil to be used (empty if none).
std::vector< intmSizeOfData
 For each time step, sizeof data (mVal) in bytes.
std::vector< med_int > mNVal
 For each time step, number of values.
std::vector< unsigned char * > mVal
 For each time step, raw data; can be MED_FLOAT64, MED_INT32, etc.
bool mFlagPrintAll
 Flag to control the behaviour of the stream operator <<.

Friends

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

Constructor & Destructor Documentation

multipr.Field::Field (  ) 

Builds an empty field (default constructor).

References multipr.Field.reset().

multipr.Field::~Field (  ) 

Destructor.

Removes everything.

References multipr.Field.reset().

multipr.Field.Field ( const Field  ) 

Member Function Documentation

void multipr.Field::reset (  ) 
bool multipr.Field::isEmpty (  )  const

Returns true iff this field is empty (no data).

Returns:
true if this field is empty, false otherwise.

References multipr.Field.mNGauss.

bool multipr.Field.isFieldOnNodes (  )  const

Returns true iff this field apply on nodes (otherwise, information are related to elements).

Returns:
true iff this field apply on nodes.

References med_2_1.MED_NOEUD, and multipr.Field.mEntity.

const char* multipr.Field.getName (  )  const

Returns the name of this Field.

Returns:
the name of this Field.

References multipr.Field.mName.

int multipr.Field.getNumberOfTimeSteps (  )  const

Returns the number of time steps in this Field.

Returns:
the number of time steps in this Field.

References multipr.Field.mNGauss.

med_type_champ multipr.Field.getType (  )  const

Returns the numeric type of information contained in this Field (e.g.

MED_FLOAT64).

Returns:
the numeric type of this Field.

References multipr.Field.mType.

eMeshType multipr.Field.getGeomIdx (  ) 

Get the internal index of geometry type (eMED_TETRA4, etc).

Returns:
The index of the geometry type.

References multipr.Field.mGeomIdx.

int multipr.Field.getNumberOfComponents (  )  const

Returns the number of components of this Field.

Returns:
the number of components of this Field.

References multipr.Field.mNumComponents.

const std::string& multipr.Field.getStrComponent (  ) 

Return the component string.

Returns:
the component string.

References multipr.Field.mStrComponent.

const std::string& multipr.Field.getStrUnit (  ) 

Return the unit string.

Returns:
the unit string.

References multipr.Field.mStrUnit.

int multipr.Field::getNumberOfGaussPointsByElement ( int  pTimeStepIt  )  const

Returns the number of Gauss points for each element at the given time step.

Parameters:
pTimeStepIt iteration of the field; must be in [1..MAX_ITERATION].
Returns:
number of Gauss points in the elements of this Field at the given iteration.
Exceptions:
IndexOutOfBoundsException if pTimeStepIt not in [1..MAX_ITERATION].

References multipr.Field.mNGauss.

const string & multipr.Field::getNameGaussLoc ( int  pTimeStepIt  )  const

Returns the name of the Gauss localization related to the given iteration.

Parameters:
pTimeStepIt iteration of the field; must be in [1..MAX_ITERATION].
Returns:
the name of the Gauss localization related to the given iteration.
Exceptions:
IndexOutOfBoundsException if pTimeStepIt not in [1..MAX_ITERATION].

References multipr.Field.mGaussLoc, and multipr.Field.mNGauss.

const unsigned char * multipr.Field::getValue ( int  pTimeStepIt,
int  pIndex 
) const

Returns a pointer towards the first value of this Field for the given element at the given time step.

Parameters:
pTimeStepIt iteration of the field; must be in [1..MAX_ITERATION].
pIndex index of the element; must be >= 1.
Returns:
the value of this Field for the given element at the given time step.
Exceptions:
IndexOutOfBoundsException if pTimeStepIt or pIndex are invalid.

References multipr.Field.mNGauss, multipr.Field.mNumComponents, multipr.Field.mNVal, multipr.Field.mSizeOfType, multipr.Field.mVal, and testMEDMEM.ret.

const std::string & multipr.Field::getProfil ( int  pTimeStep  )  const

Get the profile (if any) at the given time step.

Parameters:
pTimeStep The time step.
Returns:
The name of the profile.
Exceptions:
IndexOutOfBoundsException if pTimeStep is invalid.

References multipr.Field.mProfil.

Field * multipr.Field::extractSubSet ( const std::set< med_int > &  pSetIndices  )  const

Creates a subset of this Field restricted to a set of elements (NODES or CELLS).

This method performs a projection of this Field on the given set of elements.

Parameters:
pSetIndices WARNING: indices start at 1.
Returns:
a new Field restricted to the given set of elements.

References multipr.Field.Field(), multipr.Field.mDT, multipr.Field.mDTUnit, MED_TAILLE_NOM, multipr.Field.mEntity, multipr.Field.mGaussLoc, multipr.Field.mGeom, multipr.Field.mName, multipr.Field.mNGauss, multipr.Field.mNumComponents, multipr.Field.mNumDT, multipr.Field.mNumO, multipr.Field.mNVal, multipr.Field.mProfil, multipr.Field.mSizeOfData, multipr.Field.mSizeOfType, multipr.Field.mStrComponent, multipr.Field.mStrUnit, multipr.Field.mType, and multipr.Field.mVal.

void multipr.Field::getSetOfGaussLoc ( std::set< std::string > &  pSetOfGaussLoc  )  const

Adds the set of GaussLoc used by this Field into the given set.

Parameters:
pSetOfGauss any set of Gauss localisation.

References testGaussLocalization.gaussLocName, and multipr.Field.mGaussLoc.

Field * multipr.Field::merge ( Field pField  ) 
Field * multipr.Field::merge ( std::vector< Field * >  pFields,
int  pFieldIt = -1 
)
void multipr.Field::getMinMax ( float &  pMin,
float &  pMax 
)

Get the minimum and maximum values of this field for all time steps.

Parameters:
pMin The mininum value to fill.
pMax The maxinum value to fill.

References med_2_1.MED_INT, MED_EN.MED_INT32, MED_EN.MED_INT64, multipr.Field.mNGauss, multipr.Field.mNumComponents, multipr.Field.mNVal, multipr.Field.mType, and multipr.Field.mVal.

void multipr.Field::readMED ( med_idt  pMEDfile,
med_int  pIndex,
char *  pMeshName,
med_geometrie_element  pGeom = (med_geometrie_element)0 
)

Reads a field from a MED file.

If the field is not related to the given mesh, the result is an empty field.

Parameters:
pMEDfile any valid MED file opened for reading.
pIndex index of the field to be read; must be >= 1.
pMeshName name of the mesh (a field is always related to a mesh).
pGeom Type of geometry (MED_TETRA4, etc).
Exceptions:
IOException if any i/o error occurs.

References multipr.CELL_TYPES, multipr.eMaxMedMesh, med_2_1.MED_INT, MED_EN.MED_INT32, MED_EN.MED_INT64, med_2_1.MED_MAILLE, med_2_1.MED_NOEUD, MED_TAILLE_NOM, MED_TAILLE_PNOM, med_2_1.MEDchampInfo(), med_2_1.MEDnChamp(), med_2_1.MEDnPasdetemps(), multipr.Field.mEntity, multipr.Field.mGeom, multipr.Field.mGeomIdx, multipr.Field.mName, multipr.Field.mNumComponents, multipr.Field.mSizeOfType, multipr.Field.mStrComponent, multipr.Field.mStrUnit, multipr.Field.mType, NULL, multipr.Field.readMEDtimeSteps(), multipr.Field.reset(), and testMEDMEM.ret.

void multipr.Field::writeMED ( med_idt  pMEDfile,
char *  pMeshName,
bool  pCreateField = true 
)

Writes this field to a MED file.

The field is linked to the given mesh. WARNING: all related Gauss info must have been added to the MED file before.

Parameters:
pMEDfile any valid MED file opened for writing.
pMeshName name of the mesh.
pCreateField set this to false to not create the field.
Exceptions:
IOException if any i/o error occurs.

References multipr.Field.mDT, multipr.Field.mDTUnit, MED_ALL, MED_EN.MED_FULL_INTERLACE, MED_TAILLE_NOM, med_2_1.MEDchampCr(), med_2_1.MEDchampEcr(), multipr.Field.mEntity, multipr.Field.mGaussLoc, multipr.Field.mGeom, multipr.Field.mName, multipr.Field.mNGauss, multipr.Field.mNumComponents, multipr.Field.mNumDT, multipr.Field.mNumO, multipr.Field.mNVal, multipr.Field.mProfil, multipr.Field.mStrComponent, multipr.Field.mStrUnit, multipr.Field.mType, multipr.Field.mVal, NULL, and testMEDMEM.ret.

void multipr.Field.setPrintAll ( bool  pFlag  ) 

Sets the flag which control the stream operator <<.

Parameters:
pFlag new flag value.

References multipr.Field.mFlagPrintAll.

void multipr.Field::writeMEDOptimized ( std::vector< MeshDisPart * > *  pParts,
const char *  pMeshName,
GaussIndexList pGaussList,
int  pGeomIdx,
std::vector< med_int > &  pFiles,
std::map< std::string, Profil * > &  pProfils 
)
void multipr.Field::readMEDtimeSteps ( med_idt  pMEDfile,
med_int  pNumberOfTimeSteps,
char *  pMeshName 
)
Field& multipr.Field.operator= ( const Field  ) 
bool multipr.Field.operator== ( const Field  ) 

Friends And Related Function Documentation

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

Dumps any Field to the given output stream.

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

Field Documentation

char multipr.Field.mName[32+1]
med_entite_maillage multipr.Field.mEntity
med_geometrie_element multipr.Field.mGeom
med_type_champ multipr.Field.mType
std::vector<med_int> multipr.Field.mNGauss

For each time step, number of Gauss points in the field.

std::vector<med_float> multipr.Field.mDT

For each time step, value of time step.

std::vector<med_int> multipr.Field.mNumDT

For each time step, iteration number.

std::vector<std::string> multipr.Field.mDTUnit

For each time step, units.

std::vector<med_int> multipr.Field.mNumO

For each time step, order number.

std::vector<std::string> multipr.Field.mGaussLoc

For each time step, name of Gauss localization to be used (empty if none).

std::vector<std::string> multipr.Field.mProfil

For each time step, name of the profil to be used (empty if none).

For each time step, sizeof data (mVal) in bytes.

std::vector<med_int> multipr.Field.mNVal

For each time step, number of values.

std::vector<unsigned char*> multipr.Field.mVal

For each time step, raw data; can be MED_FLOAT64, MED_INT32, etc.

see mType.

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