Version: 6.3.1
Public Member Functions | Protected Member Functions | Protected Attributes

ParaMEDMEM.MEDCouplingField Class Reference

#include <MEDCouplingField.hxx>

Inheritance diagram for ParaMEDMEM.MEDCouplingField:
Inheritance graph

Public Member Functions

virtual void checkCoherency () const =0 throw (INTERP_KERNEL::Exception)
virtual bool areCompatibleForMerge (const MEDCouplingField *other) const
virtual bool areStrictlyCompatible (const MEDCouplingField *other) const
virtual bool isEqual (const MEDCouplingField *other, double meshPrec, double valsPrec) const
virtual bool isEqualWithoutConsideringStr (const MEDCouplingField *other, double meshPrec, double valsPrec) const
void setMesh (const ParaMEDMEM::MEDCouplingMesh *mesh)
const ParaMEDMEM::MEDCouplingMeshgetMesh () const
void setName (const char *name)
const char * getDescription () const
void setDescription (const char *desc)
const char * getName () const
TypeOfField getTypeOfField () const
NatureOfField getNature () const
virtual void setNature (NatureOfField nat) throw (INTERP_KERNEL::Exception)
DataArrayDoublegetLocalizationOfDiscr () const throw (INTERP_KERNEL::Exception)
MEDCouplingFieldDoublebuildMeasureField (bool isAbs) const throw (INTERP_KERNEL::Exception)
MEDCouplingMeshbuildSubMeshData (const int *start, const int *end, DataArrayInt *&di) const
MEDCouplingFieldDiscretizationgetDiscretization () const
int getNumberOfTuplesExpected () const throw (INTERP_KERNEL::Exception)
int getNumberOfMeshPlacesExpected () const throw (INTERP_KERNEL::Exception)
void setGaussLocalizationOnType (INTERP_KERNEL::NormalizedCellType type, const std::vector< double > &refCoo, const std::vector< double > &gsCoo, const std::vector< double > &wg) throw (INTERP_KERNEL::Exception)
void setGaussLocalizationOnCells (const int *begin, const int *end, const std::vector< double > &refCoo, const std::vector< double > &gsCoo, const std::vector< double > &wg) throw (INTERP_KERNEL::Exception)
void clearGaussLocalizations ()
MEDCouplingGaussLocalizationgetGaussLocalization (int locId) throw (INTERP_KERNEL::Exception)
int getGaussLocalizationIdOfOneType (INTERP_KERNEL::NormalizedCellType type) const throw (INTERP_KERNEL::Exception)
int getNbOfGaussLocalization () const throw (INTERP_KERNEL::Exception)
int getGaussLocalizationIdOfOneCell (int cellId) const throw (INTERP_KERNEL::Exception)
void getCellIdsHavingGaussLocalization (int locId, std::vector< int > &cellIds) const throw (INTERP_KERNEL::Exception)
const
MEDCouplingGaussLocalization
getGaussLocalization (int locId) const throw (INTERP_KERNEL::Exception)

Protected Member Functions

void updateTime () const
 MEDCouplingField (TypeOfField type)
 MEDCouplingField (const MEDCouplingField &other)
 MEDCouplingField (MEDCouplingFieldDiscretization *type, NatureOfField nature=NoNature)
virtual ~MEDCouplingField ()

Protected Attributes

std::string _name
std::string _desc
NatureOfField _nature
const MEDCouplingMesh_mesh
MEDCouplingFieldDiscretization_type

Constructor & Destructor Documentation

MEDCouplingField::MEDCouplingField ( TypeOfField  type) [protected]
MEDCouplingField::MEDCouplingField ( const MEDCouplingField other) [protected]
MEDCouplingField::MEDCouplingField ( MEDCouplingFieldDiscretization type,
NatureOfField  nature = NoNature 
) [protected]
MEDCouplingField::~MEDCouplingField ( ) [protected, virtual]

Member Function Documentation

virtual void ParaMEDMEM.MEDCouplingField.checkCoherency ( ) const throw (INTERP_KERNEL::Exception) [pure virtual]
bool MEDCouplingField::areCompatibleForMerge ( const MEDCouplingField other) const [virtual]

This method states if 'this' and 'other' are compatibles each other before performing any treatment. This method is good for methods like : mergeFields. This method is not very demanding compared to areStrictlyCompatible that is better for operation on fields.

Reimplemented in ParaMEDMEM.MEDCouplingFieldDouble.

References ParaMEDMEM.MEDCouplingField._mesh, ParaMEDMEM.MEDCouplingField._nature, ParaMEDMEM.MEDCouplingField._type, ParaMEDMEM.MEDCouplingMesh.areCompatibleForMerge(), and ParaMEDMEM.MEDCouplingFieldDiscretization.isEqual().

bool MEDCouplingField::areStrictlyCompatible ( const MEDCouplingField other) const [virtual]

This method is more strict than MEDCouplingField.areCompatibleForMerge method. This method is used for operation on fields to operate a first check before attempting operation.

Reimplemented in ParaMEDMEM.MEDCouplingFieldDouble.

References ParaMEDMEM.MEDCouplingField._mesh, ParaMEDMEM.MEDCouplingField._nature, ParaMEDMEM.MEDCouplingField._type, and ParaMEDMEM.MEDCouplingFieldDiscretization.isEqual().

bool MEDCouplingField::isEqual ( const MEDCouplingField other,
double  meshPrec,
double  valsPrec 
) const [virtual]
bool MEDCouplingField::isEqualWithoutConsideringStr ( const MEDCouplingField other,
double  meshPrec,
double  valsPrec 
) const [virtual]
void MEDCouplingField::setMesh ( const ParaMEDMEM::MEDCouplingMesh mesh)
const ParaMEDMEM::MEDCouplingMesh* ParaMEDMEM.MEDCouplingField.getMesh ( ) const
void ParaMEDMEM.MEDCouplingField.setName ( const char *  name)

References medClient_test.name.

const char* ParaMEDMEM.MEDCouplingField.getDescription ( ) const
void ParaMEDMEM.MEDCouplingField.setDescription ( const char *  desc)

References medClient_test.desc.

const char* ParaMEDMEM.MEDCouplingField.getName ( ) const
TypeOfField MEDCouplingField::getTypeOfField ( ) const
NatureOfField ParaMEDMEM.MEDCouplingField.getNature ( ) const
void MEDCouplingField::setNature ( NatureOfField  nat) throw (INTERP_KERNEL::Exception) [virtual]
DataArrayDouble * MEDCouplingField::getLocalizationOfDiscr ( ) const throw (INTERP_KERNEL::Exception)

This method returns is case of success an instance of DataArrayDouble the user is in reponsability to deal with. If 'this->_mesh' is not set an exception will be thrown. For a field on node the array of coords will be returned. For a field on cell a ParaMEDMEM.DataArrayDouble instance containing the barycenter of cells will be returned. And for a field on gauss point the explicit position of gauss points.

References ParaMEDMEM.MEDCouplingField._mesh, ParaMEDMEM.MEDCouplingField._type, and ParaMEDMEM.MEDCouplingFieldDiscretization.getLocalizationOfDiscValues().

MEDCouplingFieldDouble * MEDCouplingField::buildMeasureField ( bool  isAbs) const throw (INTERP_KERNEL::Exception)

This method retrieves the measure field of 'this'. If no '_mesh' is defined an exception will be thrown. Warning the retrieved field life cycle is the responsability of caller.

MEDCouplingMesh * MEDCouplingField::buildSubMeshData ( const int start,
const int end,
DataArrayInt *&  di 
) const

This method returns a submesh of 'mesh' instance constituting cell ids contained in array defined as an interval [start;end).

Parameters:
diis an array returned that specifies entity ids (nodes, cells ids...) in mesh 'mesh' of entity in returned submesh.

References ParaMEDMEM.MEDCouplingField._mesh, ParaMEDMEM.MEDCouplingField._type, and ParaMEDMEM.MEDCouplingFieldDiscretization.buildSubMeshData().

MEDCouplingFieldDiscretization* ParaMEDMEM.MEDCouplingField.getDiscretization ( ) const
int MEDCouplingField::getNumberOfTuplesExpected ( ) const throw (INTERP_KERNEL::Exception)

This method returns number of tuples expected regarding its discretization and its _mesh attribute. This method expected a not null _mesh instance. If null, an exception will be thrown.

References ParaMEDMEM.MEDCouplingField._mesh, ParaMEDMEM.MEDCouplingField._type, and ParaMEDMEM.MEDCouplingFieldDiscretization.getNumberOfTuples().

int MEDCouplingField::getNumberOfMeshPlacesExpected ( ) const throw (INTERP_KERNEL::Exception)

This method returns number of mesh placed expected regarding its discretization and its _mesh attribute. This method expected a not null _mesh instance. If null, an exception will be thrown.

References ParaMEDMEM.MEDCouplingField._mesh, ParaMEDMEM.MEDCouplingField._type, and ParaMEDMEM.MEDCouplingFieldDiscretization.getNumberOfMeshPlaces().

void MEDCouplingField::setGaussLocalizationOnType ( INTERP_KERNEL::NormalizedCellType  type,
const std::vector< double > &  refCoo,
const std::vector< double > &  gsCoo,
const std::vector< double > &  wg 
) throw (INTERP_KERNEL::Exception)

This method sets gauss localization by geometric type.

Parameters:
typegeometric type on which the gauss localization will be set.
refCoois the reference coordinates of the specified element. Its size has to be equal to nbOfNodesPerCell*dimOfType
gsCooare the coordinates of Gauss points in reference element specified by 'refCoo'. Its size must be equal to wg.size()*dimOfType
wgare the weights on Gauss points. The size of this array is used to determine the number of Gauss point in the element.
Exceptions:
whensize of 'RefCoo' is not valid regarding 'type' parameter, it throws too when the mesh is not set before or if it is not a field on Gauss points.

References testGaussLocalization.gsCoo, testGaussLocalization.refCoo, and medClient_test.type.

void MEDCouplingField::setGaussLocalizationOnCells ( const int begin,
const int end,
const std::vector< double > &  refCoo,
const std::vector< double > &  gsCoo,
const std::vector< double > &  wg 
) throw (INTERP_KERNEL::Exception)

This method sets on ids defined by [begin;end) their gauss localization. This method checks the coherency of cells ids in [begin;end) and 'refCoo' size. If an incoherence appears an exception will be thrown and no seting will be performed. An exception is thrown too if [begin,end) has a size lesser than 1.

Parameters:
refCoois the reference coordinates of the specified element. Its size has to be equal to nbOfNodesPerCell*dimOfType
gsCooare the coordinates of Gauss points in reference element specified by 'refCoo'. Its size must be equal to wg.size()*dimOfType
wgare the weights on Gauss points. The size of this array is used to determine the number of Gauss point in the element.
Exceptions:
whensize of 'RefCoo' is not valid regarding cells in [begin,end) parameters, it throws too when the mesh is not set before or if it is not a field on Gauss points.

References med_test1.begin, med_test1.end, testGaussLocalization.gsCoo, and testGaussLocalization.refCoo.

void MEDCouplingField::clearGaussLocalizations ( )
MEDCouplingGaussLocalization & MEDCouplingField::getGaussLocalization ( int  locId) throw (INTERP_KERNEL::Exception)

This method returns reference to the Gauss localization object corresponding to 'locId' id. This method throws an exception if there is no mesh, invalid FieldDescription (different from Gauss) and if 'locId' is invalid because out of range given by MEDCouplingField.getNbOfGaussLocalization method. Warning this method is not const, so the returned object could be modified without any problem.

int MEDCouplingField::getGaussLocalizationIdOfOneType ( INTERP_KERNEL::NormalizedCellType  type) const throw (INTERP_KERNEL::Exception)

This method returns reference to the Gauss localization object corresponding to 'locId' id. This method throws an exception if there is no mesh, invalid FieldDescription (different from Gauss) and if several localization ids have been found for a type.

References medClient_test.type.

int MEDCouplingField::getNbOfGaussLocalization ( ) const throw (INTERP_KERNEL::Exception)

This method returns number of Gauss localization available. Implicitely all ids in [0,getNbOfGaussLocalization()) is a valid Gauss localisation id. This method throws an exception if there is no mesh, invalid FieldDescription (different from Gauss)

References ParaMEDMEM.MEDCouplingField._mesh, ParaMEDMEM.MEDCouplingField._type, and ParaMEDMEM.MEDCouplingFieldDiscretization.getNbOfGaussLocalization().

int MEDCouplingField::getGaussLocalizationIdOfOneCell ( int  cellId) const throw (INTERP_KERNEL::Exception)

This method returns an id of Gauss localization in [0,getNbOfGaussLocalization()) that corresponds to the localization of the cell specified by its cellId. This methods throws an exception if there is no mesh, invalid FieldDescription (different from Gauss) or if at the cell with id 'cellId' in this->_mesh no Gauss localization has been set.

void MEDCouplingField::getCellIdsHavingGaussLocalization ( int  locId,
std::vector< int > &  cellIds 
) const throw (INTERP_KERNEL::Exception)

This method returns all cellIds that share the same Gauss localization given by 'locId' parameter (in range [0,getNbOfGaussLocalization()) ). If no cells fit the Gauss localization given by 'locId' cellIds will be returned empty.

Parameters:
locIdinput that specifies the id of Gauss localization.
cellIdsoutput parameter, that will contain the result if this method succeds. This parameter is systematically cleared when called.
Exceptions:
ifthere is no mesh, invalid FieldDescription (different from Gauss) or if locId not in [0,getNbOfGaussLocalization())
const MEDCouplingGaussLocalization & MEDCouplingField::getGaussLocalization ( int  locId) const throw (INTERP_KERNEL::Exception)

This method returns reference to the Gauss localization object corresponding to 'locId' id. This method throws an exception if there is no mesh, invalid FieldDescription (different from Gauss) and if 'locId' is invalid because out of range given by MEDCouplingField.getNbOfGaussLocalization method. Warning this method is const.

void MEDCouplingField::updateTime ( ) const [protected, virtual]

Field Documentation

std::string ParaMEDMEM.MEDCouplingField._name [protected]
std::string ParaMEDMEM.MEDCouplingField._desc [protected]
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS