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

Public Member Functions

void accept (MEDFileFieldVisitor &visitor) const
 
void aggregate (const MEDFileFields &other)
 
void blowUpSE (MEDFileMeshes *ms, const MEDFileStructureElements *ses)
 
MEDFileFieldsbuildSubPart (const int *startIds, const int *endIds) const
 
void changeLocsRefsNamesGen (const std::vector< std::pair< std::vector< std::string >, std::string > > &mapOfModif)
 
bool changeMeshNames (const std::vector< std::pair< std::string, std::string > > &modifTab)
 
void changePflsRefsNamesGen (const std::vector< std::pair< std::vector< std::string >, std::string > > &mapOfModif)
 
MEDFileFieldsdeepCopy () const
 
void destroyFieldAtPos (int i)
 
void destroyFieldsAtPos (const int *startIds, const int *endIds)
 
void destroyFieldsAtPos2 (int bg, int end, int step)
 
MEDFileFieldsextractPart (const std::map< int, MCAuto< DataArrayInt > > &extractDef, MEDFileMesh *mm) const
 
std::vector< std::pair< int,
int > > 
getCommonIterations (bool &areThereSomeForgottenTS) const
 
std::vector< const
BigMemoryObject * > 
getDirectChildrenWithNull () const
 
MEDFileAnyTypeFieldMultiTSgetFieldAtPos (int i) const
 
std::vector< std::string > getFieldsNames () const
 
MEDFileAnyTypeFieldMultiTSgetFieldWithName (const std::string &fieldName) const
 
std::size_t getHeapMemorySizeWithoutChildren () const
 
std::vector< std::string > getLocsReallyUsed () const
 
std::vector< std::string > getLocsReallyUsedMulti () const
 
std::vector< std::string > getMeshesNames () const
 
void getMeshSENames (std::vector< std::pair< std::string, std::string > > &ps) const
 
int getNumberOfFields () const
 
std::vector< std::string > getPflsReallyUsed () const
 
std::vector< std::string > getPflsReallyUsedMulti () const
 
int getPosFromFieldName (const std::string &fieldName) const
 
MEDFileFieldsIteratoriterator ()
 
void keepOnlyOnMeshSE (const std::string &meshName, const std::string &seName)
 
void keepOnlyStructureElements ()
 
void killStructureElements ()
 
void loadArrays ()
 
void loadArraysIfNecessary ()
 
MEDFileFieldspartOfThisLyingOnSpecifiedMeshName (const std::string &meshName) const
 
MCAuto< MEDFileFieldspartOfThisLyingOnSpecifiedMeshSEName (const std::string &meshName, const std::string &seName) const
 
MEDFileFieldspartOfThisLyingOnSpecifiedTimeSteps (const std::vector< std::pair< int, int > > &timeSteps) const
 
MEDFileFieldspartOfThisNotLyingOnSpecifiedTimeSteps (const std::vector< std::pair< int, int > > &timeSteps) const
 
MCAuto< MEDFileFieldspartOfThisOnStructureElements () const
 
bool presenceOfStructureElements () const
 
void pushField (MEDFileAnyTypeFieldMultiTS *field)
 
void pushFields (const std::vector< MEDFileAnyTypeFieldMultiTS * > &fields)
 
bool removeFieldsWithoutAnyTimeStep ()
 
bool renumberEntitiesLyingOnMesh (const std::string &meshName, const std::vector< int > &oldCode, const std::vector< int > &newCode, const DataArrayInt *renumO2N)
 
void resize (int newSize)
 
void setFieldAtPos (int i, MEDFileAnyTypeFieldMultiTS *field)
 
MEDFileFieldsshallowCpy () const
 
std::string simpleRepr () const
 
void simpleRepr (int bkOffset, std::ostream &oss) const
 
void unloadArrays ()
 
void unloadArraysWithoutDataLoss ()
 
void writeLL (med_idt fid) const
 
- Public Member Functions inherited from MEDCoupling::MEDFileFieldGlobsReal
void appendGlobs (const MEDFileFieldGlobsReal &other, double eps)
 
void appendLoc (const std::string &locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector< double > &refCoo, const std::vector< double > &gsCoo, const std::vector< double > &w)
 
void appendProfile (DataArrayInt *pfl)
 
void changeLocName (const std::string &oldName, const std::string &newName)
 
void changeLocsNames (const std::vector< std::pair< std::vector< std::string >, std::string > > &mapOfModif)
 
void changeLocsNamesInStruct (const std::vector< std::pair< std::vector< std::string >, std::string > > &mapOfModif)
 
void changePflName (const std::string &oldName, const std::string &newName)
 
void changePflsNames (const std::vector< std::pair< std::vector< std::string >, std::string > > &mapOfModif)
 
void changePflsNamesInStruct (const std::vector< std::pair< std::vector< std::string >, std::string > > &mapOfModif)
 
void checkGlobsCoherency () const
 
void checkGlobsLocsPartCoherency () const
 
void checkGlobsPflsPartCoherency () const
 
std::string createNewNameOfLoc () const
 
std::string createNewNameOfPfl () const
 
void deepCpyGlobs (const MEDFileFieldGlobsReal &other)
 
void deepCpyOnlyUsedGlobs (const MEDFileFieldGlobsReal &other)
 
bool existsLoc (const std::string &locName) const
 
bool existsPfl (const std::string &pflName) const
 
std::vector< const
BigMemoryObject * > 
getDirectChildrenWithNull () const
 
std::string getFileName () const
 
std::size_t getHeapMemorySizeWithoutChildren () const
 
const MEDFileFieldLocgetLocalization (const std::string &locName) const
 
MEDFileFieldLocgetLocalization (const std::string &locName)
 
const MEDFileFieldLocgetLocalizationFromId (int locId) const
 
MEDFileFieldLocgetLocalizationFromId (int locId)
 
int getLocalizationId (const std::string &loc) const
 
std::vector< std::string > getLocs () const
 
int getNbOfGaussPtPerCell (int locId) const
 
std::vector< std::string > getPfls () const
 
const DataArrayIntgetProfile (const std::string &pflName) const
 
DataArrayIntgetProfile (const std::string &pflName)
 
const DataArrayIntgetProfileFromId (int pflId) const
 
DataArrayIntgetProfileFromId (int pflId)
 
void killLocalizationIds (const std::vector< int > &locIds)
 
void killProfileIds (const std::vector< int > &pflIds)
 
void killStructureElementsInGlobs ()
 
void loadAllGlobals (med_idt fid, const MEDFileEntities *entities=0)
 
void loadGlobals (med_idt fid)
 
void loadProfileInFile (med_idt fid, int id, const std::string &pflName)
 
void loadProfileInFile (med_idt fid, int id)
 
 MEDFileFieldGlobsReal (med_idt fid)
 
 MEDFileFieldGlobsReal ()
 
void resetContent ()
 
void setFileName (const std::string &fileName)
 
void shallowCpyGlobs (const MEDFileFieldGlobsReal &other)
 
void shallowCpyOnlyUsedGlobs (const MEDFileFieldGlobsReal &other)
 
void simpleReprGlobs (std::ostream &oss) const
 
std::vector< std::vector< int > > whichAreEqualLocs (double eps) const
 
std::vector< std::vector< int > > whichAreEqualProfiles () const
 
void writeGlobals (med_idt fid, const MEDFileWritable &opt) const
 
std::vector< std::pair
< std::vector< std::string >
, std::string > > 
zipLocsNames (double eps)
 
std::vector< std::pair
< std::vector< std::string >
, std::string > > 
zipPflsNames ()
 
virtual ~MEDFileFieldGlobsReal ()
 

Static Public Member Functions

static MEDFileFieldsLoadPartOf (const std::string &fileName, bool loadAll=true, const MEDFileMeshes *ms=0)
 
static MEDFileFieldsLoadSpecificEntities (const std::string &fileName, const std::vector< std::pair< TypeOfField, INTERP_KERNEL::NormalizedCellType > > &entities, bool loadAll=true)
 
static MEDFileFieldsNew ()
 
static MEDFileFieldsNew (const std::string &fileName, bool loadAll=true)
 
static MEDFileFieldsNew (med_idt fid, bool loadAll=true)
 
static MEDFileFieldsNew (DataArrayByte *db)
 
static MEDFileFieldsNewAdv (const std::string &fileName, bool loadAll, const MEDFileEntities *entities)
 
static MEDFileFieldsNewAdv (med_idt fid, bool loadAll, const MEDFileEntities *entities)
 
static MEDFileFieldsNewWithDynGT (const std::string &fileName, const MEDFileStructureElements *se, bool loadAll=true)
 
static MEDFileFieldsNewWithDynGT (med_idt fid, const MEDFileStructureElements *se, bool loadAll=true)
 

Additional Inherited Members

- Protected Member Functions inherited from MEDCoupling::RefCountObject
 RefCountObject ()
 
 RefCountObject (const RefCountObject &other)
 
virtual ~RefCountObject ()
 
- Protected Member Functions inherited from MEDCoupling::MEDFileFieldGlobsReal
MEDFileFieldGlobs * contentNotNull ()
 
const MEDFileFieldGlobs * contentNotNull () const
 
- Protected Attributes inherited from MEDCoupling::MEDFileFieldGlobsReal
MCAuto< MEDFileFieldGlobs > _globals
 

Detailed Description

Use class.

Member Function Documentation

MEDFileFields * MEDFileFields::New ( const std::string &  fileName,
bool  loadAll = true 
)
static

References New().

MEDFileFields * MEDFileFields::New ( med_idt  fid,
bool  loadAll = true 
)
static
MEDFileFields * MEDFileFields::NewAdv ( const std::string &  fileName,
bool  loadAll,
const MEDFileEntities *  entities 
)
static
MEDFileFields * MEDFileFields::NewAdv ( med_idt  fid,
bool  loadAll,
const MEDFileEntities *  entities 
)
static
MEDFileFields * MEDFileFields::NewWithDynGT ( const std::string &  fileName,
const MEDFileStructureElements *  se,
bool  loadAll = true 
)
static
MEDFileFields * MEDFileFields::NewWithDynGT ( med_idt  fid,
const MEDFileStructureElements *  se,
bool  loadAll = true 
)
static
static MEDFileFields* MEDCoupling::MEDFileFields::New ( DataArrayByte db)
static
MEDFileFields * MEDFileFields::LoadPartOf ( const std::string &  fileName,
bool  loadAll = true,
const MEDFileMeshes ms = 0 
)
static
MEDFileFields * MEDFileFields::LoadSpecificEntities ( const std::string &  fileName,
const std::vector< std::pair< TypeOfField, INTERP_KERNEL::NormalizedCellType > > &  entities,
bool  loadAll = true 
)
static
std::size_t MEDFileFields::getHeapMemorySizeWithoutChildren ( ) const
virtual
std::vector< const BigMemoryObject * > MEDFileFields::getDirectChildrenWithNull ( ) const
virtual
MEDFileFields * MEDFileFields::shallowCpy ( ) const

Referenced by buildSubPart(), and deepCopy().

void MEDFileFields::loadArrays ( )

This method alloc the arrays and load potentially huge arrays contained in this field. This method should be called when a MEDFileAnyTypeFieldMultiTS::New constructor has been with false as the last parameter. This method can be also called to refresh or reinit values from a file.

Exceptions
Ifthe fileName is not set or points to a non readable MED file.

References MEDCoupling::MEDFileFieldGlobsReal::getFileName(), iterator(), and MEDCoupling::MEDFileAnyTypeFieldMultiTSWithoutSDA::loadBigArraysRecursively().

void MEDFileFields::loadArraysIfNecessary ( )

This method behaves as MEDFileFields::loadArrays does, the first call, if this was built using a file without loading big arrays. But once data loaded once, this method does nothing.

Exceptions
Ifthe fileName is not set or points to a non readable MED file.
See Also
MEDFileFields::loadArrays, MEDFileFields::unloadArrays

References MEDCoupling::MEDFileFieldGlobsReal::getFileName(), iterator(), and MEDCoupling::MEDFileAnyTypeFieldMultiTSWithoutSDA::loadBigArraysRecursivelyIfNecessary().

void MEDFileFields::unloadArrays ( )

This method releases potentially big data arrays and so returns to the same heap memory than status loaded with 'loadAll' parameter set to false. WARNING, this method does release arrays even if this does not come from a load of a MED file. So this method can lead to a loss of data. If you want to unload arrays safely call MEDFileFields::unloadArraysWithoutDataLoss instead.

See Also
MEDFileFields::loadArrays, MEDFileFields::loadArraysIfNecessary, MEDFileFields::unloadArraysWithoutDataLoss

References iterator(), and MEDCoupling::MEDFileAnyTypeFieldMultiTSWithoutSDA::unloadArrays().

Referenced by unloadArraysWithoutDataLoss().

void MEDFileFields::unloadArraysWithoutDataLoss ( )

This method potentially releases big data arrays if this is coming from a file. If this has been built from scratch this method will have no effect. This method is the symetrical method of MEDFileFields::loadArraysIfNecessary. This method is useful to reduce safely amount of heap memory necessary for this by using MED file as database.

See Also
MEDFileFields::loadArraysIfNecessary

References MEDCoupling::MEDFileFieldGlobsReal::getFileName(), and unloadArrays().

std::vector< std::pair< int, int > > MEDFileFields::getCommonIterations ( bool &  areThereSomeForgottenTS) const

This method scans for all fields in this which time steps ids are common. Time step are discriminated by the pair of integer (iteration,order) whatever the double time value. If all returned time steps are exactly those for all fields in this output parameter areThereSomeForgottenTS will be set to false. If areThereSomeForgottenTS is set to true, only the sorted intersection of time steps present for all fields in this will be returned.

Parameters
[out]areThereSomeForgottenTS- indicates to the caller if there is some time steps in this that are not present for all fields in this.
Returns
the sorted list of time steps (specified with a pair of integer iteration first and order second) present for all fields in this.
See Also
MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps, MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps
std::vector< std::string > MEDFileFields::getFieldsNames ( ) const
std::vector< std::string > MEDFileFields::getMeshesNames ( ) const
std::string MEDFileFields::simpleRepr ( ) const
void MEDFileFields::resize ( int  newSize)
void MEDFileFields::pushFields ( const std::vector< MEDFileAnyTypeFieldMultiTS * > &  fields)

References pushField().

int MEDFileFields::getPosFromFieldName ( const std::string &  fieldName) const
MEDFileAnyTypeFieldMultiTS * MEDFileFields::getFieldWithName ( const std::string &  fieldName) const
MEDFileFields * MEDFileFields::buildSubPart ( const int *  startIds,
const int *  endIds 
) const

Return a shallow copy of this reduced to the fields ids defined in [ startIds , endIds ). This method is accessible in python using getitem with a list in input.

Returns
a new object that the caller should deal with.

References MEDCoupling::MCAuto< T >::retn(), and shallowCpy().

bool MEDFileFields::removeFieldsWithoutAnyTimeStep ( )

This method removes, if any, fields in this having no time steps. If there is one or more than one such field in this true is returned and those fields will not be referenced anymore in this.

If false is returned this does not contain such fields. If false is returned this method can be considered as const.

References MEDCoupling::MEDFileAnyTypeFieldMultiTSWithoutSDA::getNumberOfTS().

MEDFileFields * MEDFileFields::partOfThisLyingOnSpecifiedMeshName ( const std::string &  meshName) const

This method returns a new object containing part of this fields lying on mesh name specified by the input parameter meshName. This method can be seen as a filter applied on this, that returns an object containing reduced the list of fields compared to those in this. The returned object is a new object but the object on which it lies are only shallow copied from this.

Parameters
[in]meshName- the name of the mesh on w
Returns
a new object that the caller should deal with.

References MEDCoupling::MEDFileFieldNameScope::getMeshName(), MEDCoupling::RefCountObjectOnly::incrRef(), New(), MEDCoupling::MCAuto< T >::retn(), and MEDCoupling::MEDFileFieldGlobsReal::shallowCpyOnlyUsedGlobs().

MEDFileFields * MEDFileFields::partOfThisLyingOnSpecifiedTimeSteps ( const std::vector< std::pair< int, int > > &  timeSteps) const

This method returns a new object containing part of this fields lying ** exactly ** on the time steps specified by input parameter timeSteps. Input time steps are specified using a pair of integer (iteration, order). This method can be seen as a filter applied on this, that returns an object containing the same number of fields than those in this, but for each multitimestep only the time steps in timeSteps are kept. Typically the input parameter timeSteps comes from the call of MEDFileFields::getCommonIterations.

The returned object points to shallow copy of elements in this.

Parameters
[in]timeSteps- the time steps given by a vector of pair of integers (iteration,order)
Exceptions
Ifthere is a field in this that is not defined on a time step in the input timeSteps.
See Also
MEDFileFields::getCommonIterations, MEDFileFields::partOfThisNotLyingOnSpecifiedTimeSteps

References New(), MEDCoupling::MEDFileAnyTypeFieldMultiTSWithoutSDA::partOfThisLyingOnSpecifiedTimeSteps(), MEDCoupling::MCAuto< T >::retn(), and MEDCoupling::MEDFileFieldGlobsReal::shallowCpyOnlyUsedGlobs().

bool MEDFileFields::presenceOfStructureElements ( ) const
void MEDFileFields::killStructureElements ( )
void MEDFileFields::keepOnlyStructureElements ( )
void MEDFileFields::keepOnlyOnMeshSE ( const std::string &  meshName,
const std::string &  seName 
)
void MEDFileFields::getMeshSENames ( std::vector< std::pair< std::string, std::string > > &  ps) const
void MEDFileFields::blowUpSE ( MEDFileMeshes ms,
const MEDFileStructureElements *  ses 
)
MCAuto< MEDFileFields > MEDFileFields::partOfThisOnStructureElements ( ) const
MCAuto< MEDFileFields > MEDFileFields::partOfThisLyingOnSpecifiedMeshSEName ( const std::string &  meshName,
const std::string &  seName 
) const

References deepCopy(), and keepOnlyOnMeshSE().

void MEDFileFields::aggregate ( const MEDFileFields other)
void MEDFileFields::destroyFieldAtPos ( int  i)

References destroyFieldsAtPos().

void MEDFileFields::destroyFieldsAtPos ( const int *  startIds,
const int *  endIds 
)

Referenced by destroyFieldAtPos().

void MEDFileFields::destroyFieldsAtPos2 ( int  bg,
int  end,
int  step 
)
bool MEDFileFields::changeMeshNames ( const std::vector< std::pair< std::string, std::string > > &  modifTab)
bool MEDFileFields::renumberEntitiesLyingOnMesh ( const std::string &  meshName,
const std::vector< int > &  oldCode,
const std::vector< int > &  newCode,
const DataArrayInt renumO2N 
)
Parameters
[in]meshNamethe name of the mesh that will be renumbered.
[in]oldCodeis of format returned by MEDCouplingUMesh::getDistributionOfTypes. And for each i oldCode[3*i+2] gives the position (MEDFileUMesh::PutInThirdComponentOfCodeOffset). This code corresponds to the distribution of types in the corresponding mesh.
[in]newCodeidem to param oldCode except that here the new distribution is given.
[in]renumO2Nthe old to new renumber array.
Returns
If true a renumbering has been performed. The structure in this has been modified. If false, nothing has been done: it is typically the case if meshName is not refered by any field in this.

References iterator(), and MEDCoupling::MEDFileAnyTypeFieldMultiTSWithoutSDA::renumberEntitiesLyingOnMesh().

Referenced by MEDCoupling::MEDFileData::unPolyzeMeshes().

void MEDFileFields::accept ( MEDFileFieldVisitor &  visitor) const
MEDFileFields * MEDFileFields::extractPart ( const std::map< int, MCAuto< DataArrayInt > > &  extractDef,
MEDFileMesh mm 
) const

Return an extraction of this using extractDef map to specify the extraction. The keys of extractDef is level relative to max ext of mm mesh.

Returns
A new object that the caller is responsible to deallocate.

References MEDCoupling::MEDFileAnyTypeFieldMultiTS::extractPart(), getFieldAtPos(), getNumberOfFields(), New(), pushField(), and MEDCoupling::MCAuto< T >::retn().

std::vector< std::string > MEDFileFields::getPflsReallyUsed ( ) const
virtual
std::vector< std::string > MEDFileFields::getLocsReallyUsed ( ) const
virtual
std::vector< std::string > MEDFileFields::getPflsReallyUsedMulti ( ) const
virtual
std::vector< std::string > MEDFileFields::getLocsReallyUsedMulti ( ) const
virtual
void MEDFileFields::changePflsRefsNamesGen ( const std::vector< std::pair< std::vector< std::string >, std::string > > &  mapOfModif)
virtual
void MEDFileFields::changeLocsRefsNamesGen ( const std::vector< std::pair< std::vector< std::string >, std::string > > &  mapOfModif)
virtual