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

Public Member Functions

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)
 
virtual void changeLocsRefsNamesGen (const std::vector< std::pair< std::vector< std::string >, std::string > > &mapOfModif)=0
 
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)
 
virtual void changePflsRefsNamesGen (const std::vector< std::pair< std::vector< std::string >, std::string > > &mapOfModif)=0
 
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
 
virtual std::vector< std::string > getLocsReallyUsed () const =0
 
virtual std::vector< std::string > getLocsReallyUsedMulti () const =0
 
int getNbOfGaussPtPerCell (int locId) const
 
std::vector< std::string > getPfls () const
 
virtual std::vector< std::string > getPflsReallyUsed () const =0
 
virtual std::vector< std::string > getPflsReallyUsedMulti () const =0
 
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 ()
 

Protected Member Functions

MEDFileFieldGlobs * contentNotNull ()
 
const MEDFileFieldGlobs * contentNotNull () const
 

Protected Attributes

MCAuto< MEDFileFieldGlobs > _globals
 

Constructor & Destructor Documentation

MEDFileFieldGlobsReal::MEDFileFieldGlobsReal ( med_idt  fid)

Creates a MEDFileFieldGlobsReal on a given file name. Nothing is read here.

Parameters
[in]fname- the file name.
MEDFileFieldGlobsReal::MEDFileFieldGlobsReal ( )

Creates an empty MEDFileFieldGlobsReal.

MEDFileFieldGlobsReal::~MEDFileFieldGlobsReal ( )
virtual

Member Function Documentation

std::vector< const BigMemoryObject * > MEDFileFieldGlobsReal::getDirectChildrenWithNull ( ) const
void MEDFileFieldGlobsReal::simpleReprGlobs ( std::ostream &  oss) const

Returns a string describing profiles and Gauss points held in this.

Returns
std::string - the description string.

References _globals.

Referenced by MEDCoupling::MEDFileAnyTypeField1TS::simpleRepr(), MEDCoupling::MEDFileAnyTypeFieldMultiTS::simpleRepr(), and MEDCoupling::MEDFileFields::simpleRepr().

void MEDFileFieldGlobsReal::resetContent ( )

References _globals.

void MEDFileFieldGlobsReal::killStructureElementsInGlobs ( )

References contentNotNull().

void MEDFileFieldGlobsReal::shallowCpyOnlyUsedGlobs ( const MEDFileFieldGlobsReal other)
void MEDFileFieldGlobsReal::deepCpyOnlyUsedGlobs ( const MEDFileFieldGlobsReal other)

Copies deeply to ** only used ** by this, profiles and Gauss points from another MEDFileFieldGlobsReal.

Parameters
[in]other- the other MEDFileFieldGlobsReal to copy data from.

References _globals, getLocsReallyUsed(), and getPflsReallyUsed().

void MEDFileFieldGlobsReal::appendGlobs ( const MEDFileFieldGlobsReal other,
double  eps 
)

Adds profiles and Gauss points held by another MEDFileFieldGlobsReal to this one.

Parameters
[in]other- the MEDFileFieldGlobsReal to copy data from.
[in]eps- a precision used to compare Gauss points with same name held by this and other MEDFileFieldGlobsReal.
Exceptions
Ifthis and other hold profiles with equal names but different ids.
Ifthis and other hold different Gauss points with equal names.

References _globals.

Referenced by MEDCoupling::MEDFileAnyTypeFieldMultiTS::pushBackTimeStep(), MEDCoupling::MEDFileFields::pushField(), and MEDCoupling::MEDFileFields::setFieldAtPos().

void MEDFileFieldGlobsReal::checkGlobsCoherency ( ) const
void MEDFileFieldGlobsReal::checkGlobsPflsPartCoherency ( ) const
void MEDFileFieldGlobsReal::checkGlobsLocsPartCoherency ( ) const
virtual std::vector<std::string> MEDCoupling::MEDFileFieldGlobsReal::getPflsReallyUsed ( ) const
pure virtual
virtual std::vector<std::string> MEDCoupling::MEDFileFieldGlobsReal::getLocsReallyUsed ( ) const
pure virtual
virtual std::vector<std::string> MEDCoupling::MEDFileFieldGlobsReal::getPflsReallyUsedMulti ( ) const
pure virtual
virtual std::vector<std::string> MEDCoupling::MEDFileFieldGlobsReal::getLocsReallyUsedMulti ( ) const
pure virtual
virtual void MEDCoupling::MEDFileFieldGlobsReal::changePflsRefsNamesGen ( const std::vector< std::pair< std::vector< std::string >, std::string > > &  mapOfModif)
pure virtual
virtual void MEDCoupling::MEDFileFieldGlobsReal::changeLocsRefsNamesGen ( const std::vector< std::pair< std::vector< std::string >, std::string > > &  mapOfModif)
pure virtual
void MEDFileFieldGlobsReal::loadProfileInFile ( med_idt  fid,
int  id,
const std::string &  pflName 
)

References contentNotNull().

void MEDFileFieldGlobsReal::loadProfileInFile ( med_idt  fid,
int  id 
)

References contentNotNull().

void MEDFileFieldGlobsReal::loadAllGlobals ( med_idt  fid,
const MEDFileEntities *  entities = 0 
)

References contentNotNull().

void MEDFileFieldGlobsReal::writeGlobals ( med_idt  fid,
const MEDFileWritable &  opt 
) const
std::vector< std::string > MEDFileFieldGlobsReal::getPfls ( ) const

Returns names of all profiles. To get only used profiles call getPflsReallyUsed() or getPflsReallyUsedMulti().

Returns
std::vector<std::string> - a sequence of names of all profiles.

References contentNotNull().

std::vector< std::string > MEDFileFieldGlobsReal::getLocs ( ) const

Returns names of all localizations. To get only used localizations call getLocsReallyUsed() or getLocsReallyUsedMulti().

Returns
std::vector<std::string> - a sequence of names of all localizations.

References contentNotNull().

bool MEDFileFieldGlobsReal::existsPfl ( const std::string &  pflName) const

Checks if the profile with a given name exists.

Parameters
[in]pflName- the profile name of interest.
Returns
bool - true if the profile named pflName exists.

References contentNotNull().

Referenced by MEDCoupling::MEDFileAnyTypeField1TS::setProfileNameOnLeaf().

bool MEDFileFieldGlobsReal::existsLoc ( const std::string &  locName) const

Checks if the localization with a given name exists.

Parameters
[in]locName- the localization name of interest.
Returns
bool - true if the localization named locName exists.

References contentNotNull().

Referenced by MEDCoupling::MEDFileAnyTypeField1TS::setLocNameOnLeaf().

std::string MEDFileFieldGlobsReal::createNewNameOfPfl ( ) const

References contentNotNull().

Referenced by MEDCoupling::WriteField().

std::string MEDFileFieldGlobsReal::createNewNameOfLoc ( ) const

References contentNotNull().

std::vector< std::vector< int > > MEDFileFieldGlobsReal::whichAreEqualProfiles ( ) const

Finds equal profiles. Two profiles are considered equal if they contain the same ids in the same order.

Returns
std::vector< std::vector<int> > - a sequence of groups of equal profiles. Each item of this sequence is a vector containing ids of equal profiles.

References contentNotNull().

Referenced by zipPflsNames().

std::vector< std::vector< int > > MEDFileFieldGlobsReal::whichAreEqualLocs ( double  eps) const

Finds equal localizations.

Parameters
[in]eps- a precision used to compare real values of the localizations.
Returns
std::vector< std::vector<int> > - a sequence of groups of equal localizations. Each item of this sequence is a vector containing ids of equal localizations.

References contentNotNull().

Referenced by zipLocsNames().

void MEDFileFieldGlobsReal::changePflsNamesInStruct ( const std::vector< std::pair< std::vector< std::string >, std::string > > &  mapOfModif)

Renames the profiles. References to profiles (a reference is a profile name) are not changed.

Parameters
[in]mapOfModif- a sequence describing required renaming. Each element of this sequence is a pair whose
  • the first item is a vector of profile names to replace by the second item,
  • the second item is a profile name to replace every profile name of the first item.

References contentNotNull().

Referenced by changePflsNames().

void MEDFileFieldGlobsReal::changeLocsNamesInStruct ( const std::vector< std::pair< std::vector< std::string >, std::string > > &  mapOfModif)

Renames the localizations. References to localizations (a reference is a localization name) are not changed.

Parameters
[in]mapOfModif- a sequence describing required renaming. Each element of this sequence is a pair whose
  • the first item is a vector of localization names to replace by the second item,
  • the second item is a localization name to replace every localization name of the first item.

References contentNotNull().

Referenced by changeLocsNames().

void MEDFileFieldGlobsReal::changePflsNames ( const std::vector< std::pair< std::vector< std::string >, std::string > > &  mapOfModif)

Replaces references to some profiles (a reference is a profile name) by references to other profiles and, contrary to changePflsRefsNamesGen(), renames the profiles them-selves accordingly.
This method is a generalization of changePflName().

Parameters
[in]mapOfModif- a sequence describing required replacements. Each element of this sequence is a pair whose
  • the first item is a vector of profile names to replace by the second item,
  • the second item is a profile name to replace every profile of the first item.
See Also
changePflsRefsNamesGen()
changePflName()

References changePflsNamesInStruct(), and changePflsRefsNamesGen().

Referenced by changePflName().

void MEDFileFieldGlobsReal::changeLocsNames ( const std::vector< std::pair< std::vector< std::string >, std::string > > &  mapOfModif)

Replaces references to some localizations (a reference is a localization name) by references to other localizations and, contrary to changeLocsRefsNamesGen(), renames the localizations them-selves accordingly.
This method is a generalization of changeLocName().

Parameters
[in]mapOfModif- a sequence describing required replacements. Each element of this sequence is a pair whose
  • the first item is a vector of localization names to replace by the second item,
  • the second item is a localization name to replace every localization of the first item.
See Also
changeLocsRefsNamesGen()
changeLocName()

References changeLocsNamesInStruct(), and changeLocsRefsNamesGen().

Referenced by changeLocName().

void MEDFileFieldGlobsReal::changePflName ( const std::string &  oldName,
const std::string &  newName 
)

Renames the profile having a given name and updates references to this profile.

Parameters
[in]oldName- the name of the profile to rename.
[in]newName- a new name of the profile.
See Also
changePflsNames().

References changePflsNames().

void MEDFileFieldGlobsReal::changeLocName ( const std::string &  oldName,
const std::string &  newName 
)

Renames the localization having a given name and updates references to this localization.

Parameters
[in]oldName- the name of the localization to rename.
[in]newName- a new name of the localization.
See Also
changeLocsNames().

References changeLocsNames().

std::vector< std::pair< std::vector< std::string >, std::string > > MEDFileFieldGlobsReal::zipPflsNames ( )

Removes duplicated profiles. Returns a map used to update references to removed profiles via changePflsRefsNamesGen(). Equal profiles are found using whichAreEqualProfiles().

Returns
std::vector< std::pair<std::vector<std::string>, std::string > > - a sequence describing the performed replacements of profiles. Each element of this sequence is a pair whose
  • the first item is a vector of profile names replaced by the second item,
  • the second item is a profile name replacing every profile of the first item.

References changePflsRefsNamesGen(), MEDCoupling::DataArrayTemplate< T >::front(), MEDCoupling::DataArray::getName(), getProfileFromId(), killProfileIds(), and whichAreEqualProfiles().

std::vector< std::pair< std::vector< std::string >, std::string > > MEDFileFieldGlobsReal::zipLocsNames ( double  eps)

Removes duplicated localizations. Returns a map used to update references to removed localizations via changeLocsRefsNamesGen(). Equal localizations are found using whichAreEqualLocs().

Parameters
[in]eps- a precision used to compare real values of the localizations.
Returns
std::vector< std::pair<std::vector<std::string>, std::string > > - a sequence describing the performed replacements of localizations. Each element of this sequence is a pair whose
  • the first item is a vector of localization names replaced by the second item,
  • the second item is a localization name replacing every localization of the first item.

References changeLocsRefsNamesGen(), MEDCoupling::DataArrayTemplate< T >::front(), getLocalizationFromId(), MEDCoupling::MEDFileFieldLoc::getName(), killLocalizationIds(), and whichAreEqualLocs().

int MEDFileFieldGlobsReal::getNbOfGaussPtPerCell ( int  locId) const

Returns number of Gauss points per cell in a given localization.

Parameters
[in]locId- an id of the localization of interest.
Returns
int - the number of the Gauss points per cell.

References contentNotNull().

int MEDFileFieldGlobsReal::getLocalizationId ( const std::string &  loc) const

Returns an id of a localization by its name.

Parameters
[in]loc- the localization name of interest.
Returns
int - the id of the localization.
Exceptions
Ifthere is no a localization named loc.

References contentNotNull().

const MEDFileFieldLoc & MEDFileFieldGlobsReal::getLocalizationFromId ( int  locId) const

Returns a localization object by its id.

Parameters
[in]locId- the id of the localization of interest.
Returns
const MEDFileFieldLoc& - the localization object having the id locId.
Exceptions
Ifthere is no a localization with id locId.

References contentNotNull().

Referenced by zipLocsNames().

const MEDFileFieldLoc & MEDFileFieldGlobsReal::getLocalization ( const std::string &  locName) const

Returns a localization object by its name.

Parameters
[in]locName- the name of the localization of interest.
Returns
const MEDFileFieldLoc& - the localization object having the name locName.
Exceptions
Ifthere is no a localization named locName.

References contentNotNull().

Referenced by MEDCoupling::MEDFileAnyTypeField1TS::setLocNameOnLeaf().

MEDFileFieldLoc & MEDFileFieldGlobsReal::getLocalizationFromId ( int  locId)

Returns a localization object, apt for modification, by its id.

Parameters
[in]locId- the id of the localization of interest.
Returns
MEDFileFieldLoc& - a non-const reference to the localization object having the id locId.
Exceptions
Ifthere is no a localization with id locId.

References contentNotNull().

MEDFileFieldLoc & MEDFileFieldGlobsReal::getLocalization ( const std::string &  locName)

Returns a localization object, apt for modification, by its name.

Parameters
[in]locName- the name of the localization of interest.
Returns
MEDFileFieldLoc& - a non-const reference to the localization object having the name locName.
Exceptions
Ifthere is no a localization named locName.

References contentNotNull().

const DataArrayInt * MEDFileFieldGlobsReal::getProfile ( const std::string &  pflName) const

Returns a profile array by its name.

Parameters
[in]pflName- the name of the profile of interest.
Returns
const DataArrayInt * - the profile array having the name pflName.
Exceptions
Ifthere is no a profile named pflName.

References contentNotNull().

Referenced by MEDCoupling::MEDFileAnyTypeField1TS::setProfileNameOnLeaf(), MEDCoupling::MEDFileUMesh::whichAreNodesFetched(), and MEDCoupling::MEDFileStructuredMesh::whichAreNodesFetched().

const DataArrayInt * MEDFileFieldGlobsReal::getProfileFromId ( int  pflId) const

Returns a profile array by its id.

Parameters
[in]pflId- the id of the profile of interest.
Returns
const DataArrayInt * - the profile array having the id pflId.
Exceptions
Ifthere is no a profile with id pflId.

References contentNotNull().

Referenced by zipPflsNames().

DataArrayInt * MEDFileFieldGlobsReal::getProfile ( const std::string &  pflName)

Returns a profile array, apt for modification, by its name.

Parameters
[in]pflName- the name of the profile of interest.
Returns
DataArrayInt * - a non-const pointer to the profile array having the name pflName.
Exceptions
Ifthere is no a profile named pflName.

References contentNotNull().

DataArrayInt * MEDFileFieldGlobsReal::getProfileFromId ( int  pflId)

Returns a profile array, apt for modification, by its id.

Parameters
[in]pflId- the id of the profile of interest.
Returns
DataArrayInt * - a non-const pointer to the profile array having the id pflId.
Exceptions
Ifthere is no a profile with id pflId.

References contentNotNull().

void MEDFileFieldGlobsReal::killProfileIds ( const std::vector< int > &  pflIds)

Removes profiles given by their ids. No data is updated to track this removal.

Parameters
[in]pflIds- a sequence of ids of the profiles to remove.

References contentNotNull().

Referenced by zipPflsNames().

void MEDFileFieldGlobsReal::killLocalizationIds ( const std::vector< int > &  locIds)

Removes localizations given by their ids. No data is updated to track this removal.

Parameters
[in]locIds- a sequence of ids of the localizations to remove.

References contentNotNull().

Referenced by zipLocsNames().

void MEDFileFieldGlobsReal::appendProfile ( DataArrayInt pfl)

Stores a profile array.

Parameters
[in]pfl- the profile array to store.
Exceptions
Ifthe name of pfl is empty.
Ifa profile with the same name as that of pfl already exists but contains different ids.

References contentNotNull().

void MEDFileFieldGlobsReal::appendLoc ( const std::string &  locName,
INTERP_KERNEL::NormalizedCellType  geoType,
const std::vector< double > &  refCoo,
const std::vector< double > &  gsCoo,
const std::vector< double > &  w 
)

Adds a new localization of Gauss points.

Parameters
[in]locName- the name of the new localization.
[in]geoType- a geometrical type of the reference cell.
[in]refCoo- coordinates of points of the reference cell. Size of this vector must be nbOfNodesPerCell * dimOfType.
[in]gsCoo- coordinates of Gauss points on the reference cell. Size of this vector must be wg.size() * dimOfType.
[in]w- the weights of Gauss points.
Exceptions
IflocName is empty.
Ifa localization with the name locName already exists but is different form the new one.

References contentNotNull().

const MEDFileFieldGlobs * MEDFileFieldGlobsReal::contentNotNull ( ) const
protected

References _globals.

Member Data Documentation

MCAuto< MEDFileFieldGlobs > MEDCoupling::MEDFileFieldGlobsReal::_globals
protected