Version: 6.5.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ParaMEDMEM::MEDCouplingField Class Reference
Inheritance diagram for ParaMEDMEM::MEDCouplingField:
Inheritance graph
[legend]
Collaboration diagram for ParaMEDMEM::MEDCouplingField:
Collaboration graph
[legend]

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 ()
MEDCouplingGaussLocalization & getGaussLocalization (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)
- Public Member Functions inherited from ParaMEDMEM::RefCountObject
bool decrRef () const
void incrRef () const
- Public Member Functions inherited from ParaMEDMEM::TimeLabel
TimeLabeloperator= (const TimeLabel &other)
void declareAsNew () const
unsigned int getTimeOfThis () const

Protected Member Functions

void updateTime () const
 MEDCouplingField (TypeOfField type)
 MEDCouplingField (const MEDCouplingField &other)
 MEDCouplingField (MEDCouplingFieldDiscretization *type, NatureOfField nature=NoNature)
virtual ~MEDCouplingField ()
- Protected Member Functions inherited from ParaMEDMEM::RefCountObject
 RefCountObject ()
 RefCountObject (const RefCountObject &other)
virtual ~RefCountObject ()
- Protected Member Functions inherited from ParaMEDMEM::TimeLabel
 TimeLabel ()
virtual ~TimeLabel ()
void updateTimeWith (const TimeLabel &other) const

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 ( )
protectedvirtual

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 _mesh, _nature, _type, ParaMEDMEM::MEDCouplingMesh::areCompatibleForMerge(), and ParaMEDMEM::MEDCouplingFieldDiscretization::isEqual().

Referenced by ParaMEDMEM::MEDCouplingFieldDouble::areCompatibleForMerge().

bool MEDCouplingField::areStrictlyCompatible ( const MEDCouplingField other) const
virtual
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)

References _mesh, ParaMEDMEM::RefCountObject::decrRef(), ParaMEDMEM::RefCountObject::incrRef(), and ParaMEDMEM::TimeLabel::updateTimeWith().

Referenced by ParaMEDMEM::MEDCouplingFieldDouble::AddFields(), ParaMEDMEM::MEDCouplingUMesh::buildDirectionVectorField(), ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis(), ParaMEDMEM::MEDCouplingCMesh::buildOrthogonalField(), ParaMEDMEM::MEDCouplingUMesh::buildOrthogonalField(), ParaMEDMEM::MEDCouplingUMesh::buildPartOrthogonalField(), ParaMEDMEM::MEDCouplingFieldDouble::buildSubPart(), ParaMEDMEM::MEDCouplingFieldDouble::cloneWithMesh(), ParaMEDMEM::MEDCouplingFieldDouble::CrossProductFields(), ParaMEDMEM::MEDCouplingFieldDouble::determinant(), ParaMEDMEM::MEDCouplingFieldDouble::deviator(), ParaMEDMEM::MEDCouplingFieldDouble::DivideFields(), ParaMEDMEM::MEDCouplingFieldDouble::DotFields(), ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct(), ParaMEDMEM::MEDCouplingFieldDouble::eigenValues(), ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors(), ParaMEDMEM::MEDCouplingExtrudedMesh::getMeasureField(), ParaMEDMEM::MEDCouplingCMesh::getMeasureField(), ParaMEDMEM::MEDCouplingUMesh::getMeasureField(), ParaMEDMEM::MEDCouplingUMesh::getMeasureFieldOnNode(), ParaMEDMEM::MEDCouplingFieldDouble::inverse(), ParaMEDMEM::MEDCouplingFieldDouble::keepSelectedComponents(), ParaMEDMEM::MEDCouplingFieldDouble::magnitude(), ParaMEDMEM::MEDCouplingFieldDouble::MaxFields(), ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple(), ParaMEDMEM::MEDCouplingFieldDouble::MeldFields(), ParaMEDMEM::MEDCouplingFieldDouble::MergeFields(), ParaMEDMEM::MEDCouplingFieldDouble::MinFields(), ParaMEDMEM::MEDCouplingFieldDouble::MultiplyFields(), ParaMEDMEM::ParaFIELD::ParaFIELD(), ParaMEDMEM::MEDCouplingRemapper::reverseTransferField(), ParaMEDMEM::MEDCouplingFieldDouble::SubstractFields(), ParaMEDMEM::MEDCouplingFieldDouble::trace(), and ParaMEDMEM::MEDCouplingRemapper::transferField().

const ParaMEDMEM::MEDCouplingMesh* ParaMEDMEM::MEDCouplingField::getMesh ( ) const
void ParaMEDMEM::MEDCouplingField::setName ( const char *  name)
const char* ParaMEDMEM::MEDCouplingField::getDescription ( ) const
void ParaMEDMEM::MEDCouplingField::setDescription ( const char *  desc)
const char* ParaMEDMEM::MEDCouplingField::getName ( ) const
TypeOfField MEDCouplingField::getTypeOfField ( ) const
NatureOfField MEDCouplingField::getNature ( ) const

This method returns the nature of field. This information is very important during interpolation process using ParaMEDMEM::MEDCouplingRemapper or ParaMEDMEM::InterpKernelDEC. In other context than the two mentioned before this attribute of the field is not sensitive. This attribute is not store in MED file in MEDLoader. More information of the semantic, and the consequence of this attribute in the result of the interpolation, is available here.

References _nature.

Referenced by ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis(), ParaMEDMEM::MEDCouplingFieldDouble::determinant(), ParaMEDMEM::MEDCouplingFieldDouble::deviator(), ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct(), ParaMEDMEM::MEDCouplingFieldDouble::eigenValues(), ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors(), ParaMEDMEM::MEDCouplingFieldDouble::inverse(), ParaMEDMEM::MEDCouplingFieldDouble::magnitude(), ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple(), and ParaMEDMEM::MEDCouplingFieldDouble::trace().

void MEDCouplingField::setNature ( NatureOfField  nat) throw (INTERP_KERNEL::Exception)
virtual

This method set the nature of field in this.This information is very important during interpolation process using ParaMEDMEM::MEDCouplingRemapper or ParaMEDMEM::InterpKernelDEC. In other context than the two mentioned before this attribute of the field is not sensitive. This attribute is not store in MED file in MEDLoader. More information of the semantic, and the consequence of this attribute in the result of the interpolation, is available here.

Reimplemented in ParaMEDMEM::MEDCouplingFieldDouble.

Referenced by ParaMEDMEM::MEDCouplingFieldDouble::setNature().

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 _mesh, _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.

Referenced by ParaMEDMEM::MEDCouplingFieldDouble::getWeightedAverageValue().

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 _mesh, _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 _mesh, _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 _mesh, _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.
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.
void MEDCouplingField::clearGaussLocalizations ( )

This method resets all Gauss loalizations if any.

References _mesh, _type, and ParaMEDMEM::MEDCouplingFieldDiscretization::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.

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 _mesh, _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
protectedvirtual

This method should be called on high level classes as Field or Mesh to take into acount modifications done in aggregates objects.

Implements ParaMEDMEM::TimeLabel.

Reimplemented in ParaMEDMEM::MEDCouplingFieldDouble.

References _mesh, _type, and ParaMEDMEM::TimeLabel::updateTimeWith().

Member Data Documentation

std::string ParaMEDMEM::MEDCouplingField::_name
protected
std::string ParaMEDMEM::MEDCouplingField::_desc
protected
NatureOfField ParaMEDMEM::MEDCouplingField::_nature
protected
const MEDCouplingMesh* ParaMEDMEM::MEDCouplingField::_mesh
protected
MEDCouplingFieldDiscretization* ParaMEDMEM::MEDCouplingField::_type
protected

Referenced by ParaMEDMEM::MEDCouplingFieldDouble::advancedRepr(), ParaMEDMEM::MEDCouplingFieldDouble::applyFunc(), areCompatibleForMerge(), areStrictlyCompatible(), ParaMEDMEM::MEDCouplingFieldDouble::buildNewTimeReprFromThis(), buildSubMeshData(), ParaMEDMEM::MEDCouplingFieldDouble::checkCoherency(), clearGaussLocalizations(), ParaMEDMEM::MEDCouplingFieldDouble::determinant(), ParaMEDMEM::MEDCouplingFieldDouble::deviator(), ParaMEDMEM::MEDCouplingFieldDouble::doublyContractedProduct(), ParaMEDMEM::MEDCouplingFieldDouble::eigenValues(), ParaMEDMEM::MEDCouplingFieldDouble::eigenVectors(), ParaMEDMEM::MEDCouplingFieldTemplate::finishUnserialization(), ParaMEDMEM::MEDCouplingFieldDouble::finishUnserialization(), ParaMEDMEM::MEDCouplingFieldDouble::getIJK(), getLocalizationOfDiscr(), getNbOfGaussLocalization(), getNumberOfMeshPlacesExpected(), ParaMEDMEM::MEDCouplingFieldDouble::getNumberOfTuples(), getNumberOfTuplesExpected(), ParaMEDMEM::MEDCouplingFieldTemplate::getTinySerializationDbleInformation(), ParaMEDMEM::MEDCouplingFieldDouble::getTinySerializationDbleInformation(), ParaMEDMEM::MEDCouplingFieldTemplate::getTinySerializationIntInformation(), ParaMEDMEM::MEDCouplingFieldDouble::getTinySerializationIntInformation(), getTypeOfField(), ParaMEDMEM::MEDCouplingFieldDouble::inverse(), isEqual(), isEqualWithoutConsideringStr(), ParaMEDMEM::MEDCouplingFieldDouble::magnitude(), ParaMEDMEM::MEDCouplingFieldDouble::maxPerTuple(), ParaMEDMEM::MEDCouplingFieldTemplate::resizeForUnserialization(), ParaMEDMEM::MEDCouplingFieldDouble::resizeForUnserialization(), ParaMEDMEM::MEDCouplingFieldTemplate::serialize(), ParaMEDMEM::MEDCouplingFieldDouble::serialize(), ParaMEDMEM::MEDCouplingFieldTemplate::simpleRepr(), ParaMEDMEM::MEDCouplingFieldDouble::simpleRepr(), ParaMEDMEM::MEDCouplingFieldDouble::trace(), updateTime(), and ~MEDCouplingField().

Copyright © 2007-2012 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