Version: 5.1.6

ParaMEDMEM.MEDCouplingMesh Class Reference

#include <MEDCouplingMesh.hxx>

Inheritance diagram for ParaMEDMEM.MEDCouplingMesh:
Inheritance graph

Public Member Functions

void setName (const char *name)
const char * getName () const
void setDescription (const char *descr)
const char * getDescription () const
double getTime (int &iteration, int &order) const
void setTime (double val, int iteration, int order)
void setTimeUnit (const char *unit)
const char * getTimeUnit () const
virtual MEDCouplingMeshdeepCpy () const =0
virtual MEDCouplingMeshType getType () const =0
bool isStructured () const
virtual void copyTinyStringsFrom (const MEDCouplingMesh *other) throw (INTERP_KERNEL::Exception)
virtual void copyTinyInfoFrom (const MEDCouplingMesh *other) throw (INTERP_KERNEL::Exception)
virtual bool isEqual (const MEDCouplingMesh *other, double prec) const
virtual bool isEqualWithoutConsideringStr (const MEDCouplingMesh *other, double prec) const =0
virtual void checkDeepEquivalWith (const MEDCouplingMesh *other, int cellCompPol, double prec, DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const =0 throw (INTERP_KERNEL::Exception)
virtual void checkDeepEquivalOnSameNodesWith (const MEDCouplingMesh *other, int cellCompPol, double prec, DataArrayInt *&cellCor) const =0 throw (INTERP_KERNEL::Exception)
virtual void checkFastEquivalWith (const MEDCouplingMesh *other, double prec) const throw (INTERP_KERNEL::Exception)
void checkGeoEquivalWith (const MEDCouplingMesh *other, int levOfCheck, double prec, DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const throw (INTERP_KERNEL::Exception)
virtual void checkCoherency () const =0 throw (INTERP_KERNEL::Exception)
virtual void checkCoherency1 (double eps=1e-12) const =0 throw (INTERP_KERNEL::Exception)
virtual void checkCoherency2 (double eps=1e-12) const =0 throw (INTERP_KERNEL::Exception)
virtual int getNumberOfCells () const =0
virtual int getNumberOfNodes () const =0
virtual int getSpaceDimension () const =0
virtual int getMeshDimension () const =0
virtual DataArrayDoublegetCoordinatesAndOwner () const =0
virtual DataArrayDoublegetBarycenterAndOwner () const =0
virtual int getNumberOfCellsWithType (INTERP_KERNEL::NormalizedCellType type) const =0
virtual
INTERP_KERNEL::NormalizedCellType 
getTypeOfCell (int cellId) const =0
virtual std::set
< INTERP_KERNEL::NormalizedCellType
getAllGeoTypes () const =0
virtual void getNodeIdsOfCell (int cellId, std::vector< int > &conn) const =0
virtual DataArrayIntgetCellIdsFullyIncludedInNodeIds (const int *partBg, const int *partEnd) const
virtual void getCoordinatesOfNode (int nodeId, std::vector< double > &coo) const =0
virtual std::string simpleRepr () const =0
virtual std::string advancedRepr () const =0
virtual std::vector< intgetDistributionOfTypes () const =0 throw (INTERP_KERNEL::Exception)
virtual DataArrayIntcheckTypeConsistencyAndContig (const std::vector< int > &code, const std::vector< const DataArrayInt * > &idsPerType) const =0 throw (INTERP_KERNEL::Exception)
virtual void splitProfilePerType (const DataArrayInt *profile, std::vector< int > &code, std::vector< DataArrayInt * > &idsInPflPerType, std::vector< DataArrayInt * > &idsPerType) const =0 throw (INTERP_KERNEL::Exception)
virtual void getBoundingBox (double *bbox) const =0
virtual MEDCouplingFieldDoublegetMeasureField (bool isAbs) const =0
virtual MEDCouplingFieldDoublegetMeasureFieldOnNode (bool isAbs) const =0
virtual int getCellContainingPoint (const double *pos, double eps) const =0
virtual void getCellsContainingPoint (const double *pos, double eps, std::vector< int > &elts) const
virtual void getCellsContainingPoints (const double *pos, int nbOfPoints, double eps, std::vector< int > &elts, std::vector< int > &eltsIndex) const
virtual MEDCouplingFieldDoublefillFromAnalytic (TypeOfField t, int nbOfComp, FunctionToEvaluate func) const
virtual MEDCouplingFieldDoublefillFromAnalytic (TypeOfField t, int nbOfComp, const char *func) const
virtual MEDCouplingFieldDoublefillFromAnalytic2 (TypeOfField t, int nbOfComp, const char *func) const
virtual MEDCouplingFieldDoublefillFromAnalytic3 (TypeOfField t, int nbOfComp, const std::vector< std::string > &varsOrder, const char *func) const
virtual MEDCouplingFieldDoublebuildOrthogonalField () const =0
virtual void rotate (const double *center, const double *vector, double angle)=0
virtual void translate (const double *vector)=0
virtual void scale (const double *point, double factor)=0
virtual void renumberCells (const int *old2NewBg, bool check)=0 throw (INTERP_KERNEL::Exception)
virtual MEDCouplingMeshmergeMyselfWith (const MEDCouplingMesh *other) const =0
virtual MEDCouplingMeshbuildPart (const int *start, const int *end) const =0
virtual MEDCouplingMeshbuildPartAndReduceNodes (const int *start, const int *end, DataArrayInt *&arr) const =0
virtual MEDCouplingUMeshbuildUnstructured () const =0 throw (INTERP_KERNEL::Exception)
virtual DataArrayIntsimplexize (int policy)=0 throw (INTERP_KERNEL::Exception)
virtual bool areCompatibleForMerge (const MEDCouplingMesh *other) const
virtual void getTinySerializationInformation (std::vector< double > &tinyInfoD, std::vector< int > &tinyInfo, std::vector< std::string > &littleStrings) const =0
virtual void resizeForUnserialization (const std::vector< int > &tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector< std::string > &littleStrings) const =0
virtual void serialize (DataArrayInt *&a1, DataArrayDouble *&a2) const =0
virtual void unserialization (const std::vector< double > &tinyInfoD, const std::vector< int > &tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector< std::string > &littleStrings)=0
 MEDCouplingMesh ()
 MEDCouplingMesh (const MEDCouplingMesh &other)
virtual ~MEDCouplingMesh ()

Static Public Member Functions

static MEDCouplingMeshMergeMeshes (const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2)

Data Fields

std::string _name
std::string _description
double _time
int _iteration
int _order
std::string _time_unit

Constructor & Destructor Documentation

MEDCouplingMesh::MEDCouplingMesh (  ) 
MEDCouplingMesh::MEDCouplingMesh ( const MEDCouplingMesh other  ) 
virtual ParaMEDMEM.MEDCouplingMesh.~MEDCouplingMesh (  )  [virtual]

Member Function Documentation

void ParaMEDMEM.MEDCouplingMesh.setName ( const char *  name  ) 
const char* ParaMEDMEM.MEDCouplingMesh.getName (  )  const
void ParaMEDMEM.MEDCouplingMesh.setDescription ( const char *  descr  ) 
const char* ParaMEDMEM.MEDCouplingMesh.getDescription (  )  const
double ParaMEDMEM.MEDCouplingMesh.getTime ( int iteration,
int order 
) const
void ParaMEDMEM.MEDCouplingMesh.setTime ( double  val,
int  iteration,
int  order 
)
void ParaMEDMEM.MEDCouplingMesh.setTimeUnit ( const char *  unit  ) 
const char* ParaMEDMEM.MEDCouplingMesh.getTimeUnit (  )  const
virtual MEDCouplingMesh* ParaMEDMEM.MEDCouplingMesh.deepCpy (  )  const [pure virtual]
virtual MEDCouplingMeshType ParaMEDMEM.MEDCouplingMesh.getType (  )  const [pure virtual]
bool MEDCouplingMesh::isStructured (  )  const

This method is only for ParaMEDMEM in ParaFIELD constructor.

References ParaMEDMEM.CARTESIAN, and ParaMEDMEM.MEDCouplingMesh.getType().

void MEDCouplingMesh::copyTinyStringsFrom ( const MEDCouplingMesh other  )  throw (INTERP_KERNEL::Exception) [virtual]

This method copyies all tiny strings from other (name and components name).

Exceptions:
if other and this have not same mesh type.
void MEDCouplingMesh::copyTinyInfoFrom ( const MEDCouplingMesh other  )  throw (INTERP_KERNEL::Exception) [virtual]

This method copies all attributes that are NOT arrays in this. All tiny attributes not usefully for state of 'this' are ignored.

bool MEDCouplingMesh::isEqual ( const MEDCouplingMesh other,
double  prec 
) const [virtual]
virtual bool ParaMEDMEM.MEDCouplingMesh.isEqualWithoutConsideringStr ( const MEDCouplingMesh other,
double  prec 
) const [pure virtual]
virtual void ParaMEDMEM.MEDCouplingMesh.checkDeepEquivalWith ( const MEDCouplingMesh other,
int  cellCompPol,
double  prec,
DataArrayInt *&  cellCor,
DataArrayInt *&  nodeCor 
) const throw (INTERP_KERNEL::Exception) [pure virtual]
virtual void ParaMEDMEM.MEDCouplingMesh.checkDeepEquivalOnSameNodesWith ( const MEDCouplingMesh other,
int  cellCompPol,
double  prec,
DataArrayInt *&  cellCor 
) const throw (INTERP_KERNEL::Exception) [pure virtual]
void MEDCouplingMesh::checkFastEquivalWith ( const MEDCouplingMesh other,
double  prec 
) const throw (INTERP_KERNEL::Exception) [virtual]

This method checks fastly that 'this' and 'other' are equal. All common checks are done here.

void MEDCouplingMesh::checkGeoEquivalWith ( const MEDCouplingMesh other,
int  levOfCheck,
double  prec,
DataArrayInt *&  cellCor,
DataArrayInt *&  nodeCor 
) const throw (INTERP_KERNEL::Exception)

This method checks geo equivalence between two meshes : 'this' and 'other'. If no exception is throw 'this' and 'other' are geometrically equivalent regarding 'levOfCheck' level. This method is typically used to change the mesh of a field "safely" depending the 'levOfCheck' level considered.

Parameters:
levOfCheck input that specifies the level of check specified. The possible values are listed below.
prec input that specifies precision for double float data used for comparison in meshes.
cellCor output array not always informed (depending 'levOfCheck' param) that gives the corresponding array for cells from 'other' to 'this'.
nodeCor output array not always informed (depending 'levOfCheck' param) that gives the corresponding array for nodes from 'other' to 'this'.

Possible values for levOfCheck :

  • 0 for strict equality. This is the strongest level. 'cellCor' and 'nodeCor' params are never informed.
  • 10,11,12 for less strict equality. Two meshes are compared geometrically. In case of success 'cellCor' and 'nodeCor' are informed. Warning ! These equivalences are CPU/Mem costly. The 3 values correspond respectively to policy used for cell comparison (see MEDCouplingUMesh.zipConnectivityTraducer to have more details)
  • 20,21,22, for less strict equality. Two meshes are compared geometrically. The difference with the previous version is that nodes(coordinates) are expected to be the same between this and other. In case of success 'cellCor' is informed. Warning ! These equivalences are CPU/Mem costly. The 3 values correspond respectively to policy used for cell comparison (see MEDCouplingUMesh.zipConnectivityTraducer to have more details)
  • 1 for fast 'equality'. This is a lazy level. Just number of cells and number of nodes are considered here and 3 cells (begin,middle,end)
  • 2 for deep 'equality' as 0 option except that no control is done on all strings in mesh.
virtual void ParaMEDMEM.MEDCouplingMesh.checkCoherency (  )  const throw (INTERP_KERNEL::Exception) [pure virtual]
virtual void ParaMEDMEM.MEDCouplingMesh.checkCoherency1 ( double  eps = 1e-12  )  const throw (INTERP_KERNEL::Exception) [pure virtual]
virtual void ParaMEDMEM.MEDCouplingMesh.checkCoherency2 ( double  eps = 1e-12  )  const throw (INTERP_KERNEL::Exception) [pure virtual]
virtual int ParaMEDMEM.MEDCouplingMesh.getNumberOfCells (  )  const [pure virtual]
virtual int ParaMEDMEM.MEDCouplingMesh.getNumberOfNodes (  )  const [pure virtual]
virtual int ParaMEDMEM.MEDCouplingMesh.getSpaceDimension (  )  const [pure virtual]
virtual int ParaMEDMEM.MEDCouplingMesh.getMeshDimension (  )  const [pure virtual]
virtual DataArrayDouble* ParaMEDMEM.MEDCouplingMesh.getCoordinatesAndOwner (  )  const [pure virtual]
virtual DataArrayDouble* ParaMEDMEM.MEDCouplingMesh.getBarycenterAndOwner (  )  const [pure virtual]
virtual int ParaMEDMEM.MEDCouplingMesh.getNumberOfCellsWithType ( INTERP_KERNEL::NormalizedCellType  type  )  const [pure virtual]
virtual INTERP_KERNEL::NormalizedCellType ParaMEDMEM.MEDCouplingMesh.getTypeOfCell ( int  cellId  )  const [pure virtual]
virtual std::set<INTERP_KERNEL::NormalizedCellType> ParaMEDMEM.MEDCouplingMesh.getAllGeoTypes (  )  const [pure virtual]
virtual void ParaMEDMEM.MEDCouplingMesh.getNodeIdsOfCell ( int  cellId,
std::vector< int > &  conn 
) const [pure virtual]
DataArrayInt * MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds ( const int partBg,
const int partEnd 
) const [virtual]

Given a nodeIds range ['partBg','partEnd'), this method returns the set of cell ids in ascendant order whose connectivity of these cells are fully included in the range. As a consequence the returned set of cell ids does not always fit the nodes in ['partBg','partEnd') This method returns the corresponding cells in a newly created array that the caller has the responsability.

Reimplemented in ParaMEDMEM.MEDCouplingUMesh.

References ParaMEDMEM.DataArrayInt.alloc(), testRenumbering.conn, ParaMEDMEM.MEDCouplingMesh.getNodeIdsOfCell(), ParaMEDMEM.MEDCouplingMesh.getNumberOfCells(), ParaMEDMEM.DataArrayInt.getPointer(), ParaMEDMEM.DataArrayInt.New(), and testMEDMEM.ret.

virtual void ParaMEDMEM.MEDCouplingMesh.getCoordinatesOfNode ( int  nodeId,
std::vector< double > &  coo 
) const [pure virtual]
virtual std::string ParaMEDMEM.MEDCouplingMesh.simpleRepr (  )  const [pure virtual]
virtual std::string ParaMEDMEM.MEDCouplingMesh.advancedRepr (  )  const [pure virtual]
virtual std::vector<int> ParaMEDMEM.MEDCouplingMesh.getDistributionOfTypes (  )  const throw (INTERP_KERNEL::Exception) [pure virtual]
virtual DataArrayInt* ParaMEDMEM.MEDCouplingMesh.checkTypeConsistencyAndContig ( const std::vector< int > &  code,
const std::vector< const DataArrayInt * > &  idsPerType 
) const throw (INTERP_KERNEL::Exception) [pure virtual]
virtual void ParaMEDMEM.MEDCouplingMesh.splitProfilePerType ( const DataArrayInt profile,
std::vector< int > &  code,
std::vector< DataArrayInt * > &  idsInPflPerType,
std::vector< DataArrayInt * > &  idsPerType 
) const throw (INTERP_KERNEL::Exception) [pure virtual]
virtual void ParaMEDMEM.MEDCouplingMesh.getBoundingBox ( double bbox  )  const [pure virtual]
virtual MEDCouplingFieldDouble* ParaMEDMEM.MEDCouplingMesh.getMeasureField ( bool  isAbs  )  const [pure virtual]
virtual MEDCouplingFieldDouble* ParaMEDMEM.MEDCouplingMesh.getMeasureFieldOnNode ( bool  isAbs  )  const [pure virtual]
virtual int ParaMEDMEM.MEDCouplingMesh.getCellContainingPoint ( const double pos,
double  eps 
) const [pure virtual]
void MEDCouplingMesh::getCellsContainingPoint ( const double pos,
double  eps,
std::vector< int > &  elts 
) const [virtual]
void MEDCouplingMesh::getCellsContainingPoints ( const double pos,
int  nbOfPoints,
double  eps,
std::vector< int > &  elts,
std::vector< int > &  eltsIndex 
) const [virtual]
MEDCouplingFieldDouble * MEDCouplingMesh::fillFromAnalytic ( TypeOfField  t,
int  nbOfComp,
FunctionToEvaluate  func 
) const [virtual]

This method builds a field lying on 'this' with 'nbOfComp' components. 'func' is a pointer that points to a function that takes 2 arrays in parameter and returns a boolean. The first array is a in-param of size this->getSpaceDimension and the second an out param of size 'nbOfComp'. The return field will have type specified by 't'. 't' is also used to determine where values of field will be evaluate. Contrary to other fillFromAnalytic methods this method requests a C++ function pointer as input. The 'func' is a callback that takes as first parameter an input array of size 'this->getSpaceDimension()', the second parameter is a pointer on a valid zone of size at least equal to 'nbOfComp' values. And too finish the returned value is a boolean that is equal to False in case of invalid evaluation (log(0) for example...)

Parameters:
t type of field returned and specifies where the evaluation of func will be done.
nbOfComp number of components of returned field.
func pointer to a function that should return false if the evaluation failed. (division by 0. for example)
Returns:
field with counter = 1.

References ParaMEDMEM.MEDCouplingFieldDouble.New(), ParaMEDMEM.NO_TIME, and testMEDMEM.ret.

MEDCouplingFieldDouble * MEDCouplingMesh::fillFromAnalytic ( TypeOfField  t,
int  nbOfComp,
const char *  func 
) const [virtual]

This method builds a field lying on 'this' with 'nbOfComp' components. 'func' is a string that is the expression to evaluate. The return field will have type specified by 't'. 't' is also used to determine where values of field will be evaluate. This method is equivalent to those taking a C++ function pointer except that here the 'func' is informed by an interpretable input string.

The dynamic interpretor uses alphabetical order to assign the component id to the var name. For example :

  • "2*x+z" func : x stands for component #0 and z stands for component #1 NOT #2 !

Some var names are reserved and have special meaning. IVec stands for (1,0,0,...). JVec stands for (0,1,0...). KVec stands for (0,0,1,...)... These keywords allows too differentate the evaluation of output components each other.

If 'nbOfComp' equals to 4 for example and that 'this->getSpaceDimension()' equals to 3.

For the input tuple T = (1.,3.,7.) :

  • '2*x+z' will return (5.,5.,5.,5.)
  • '2*x+0*y+z' will return (9.,9.,9.,9.)
  • '2*x*IVec+(x+z)*LVec' will return (2.,0.,0.,4.)
  • '2*x*IVec+(y+z)*KVec' will return (2.,0.,10.,0.)
Parameters:
t type of field returned and specifies where the evaluation of func will be done.
nbOfComp number of components of returned field.
func expression.
Returns:
field with counter = 1.

References ParaMEDMEM.MEDCouplingFieldDouble.New(), ParaMEDMEM.NO_TIME, and testMEDMEM.ret.

MEDCouplingFieldDouble * MEDCouplingMesh::fillFromAnalytic2 ( TypeOfField  t,
int  nbOfComp,
const char *  func 
) const [virtual]

This method builds a field lying on 'this' with 'nbOfComp' components. 'func' is a string that is the expression to evaluate. The return field will have type specified by 't'. 't' is also used to determine where values of field will be evaluate. This method is different than MEDCouplingMesh.fillFromAnalytic, because the info on components are used here to determine vars pos in 'func'.

Parameters:
t type of field returned and specifies where the evaluation of func will be done.
nbOfComp number of components of returned field.
func expression.
Returns:
field with counter = 1.

References ParaMEDMEM.MEDCouplingFieldDouble.New(), ParaMEDMEM.NO_TIME, and testMEDMEM.ret.

MEDCouplingFieldDouble * MEDCouplingMesh::fillFromAnalytic3 ( TypeOfField  t,
int  nbOfComp,
const std::vector< std::string > &  varsOrder,
const char *  func 
) const [virtual]

This method builds a field lying on 'this' with 'nbOfComp' components. 'func' is a string that is the expression to evaluate. The return field will have type specified by 't'. 't' is also used to determine where values of field will be evaluate. This method is different than MEDCouplingMesh.fillFromAnalytic, because 'varsOrder' specifies the pos to assign of vars in 'func'.

Parameters:
t type of field returned and specifies where the evaluation of func will be done.
nbOfComp number of components of returned field.
func expression.
Returns:
field with counter = 1.

References ParaMEDMEM.MEDCouplingFieldDouble.New(), ParaMEDMEM.NO_TIME, and testMEDMEM.ret.

virtual MEDCouplingFieldDouble* ParaMEDMEM.MEDCouplingMesh.buildOrthogonalField (  )  const [pure virtual]
virtual void ParaMEDMEM.MEDCouplingMesh.rotate ( const double center,
const double vector,
double  angle 
) [pure virtual]
virtual void ParaMEDMEM.MEDCouplingMesh.translate ( const double vector  )  [pure virtual]
virtual void ParaMEDMEM.MEDCouplingMesh.scale ( const double point,
double  factor 
) [pure virtual]
virtual void ParaMEDMEM.MEDCouplingMesh.renumberCells ( const int old2NewBg,
bool  check 
) throw (INTERP_KERNEL::Exception) [pure virtual]
virtual MEDCouplingMesh* ParaMEDMEM.MEDCouplingMesh.mergeMyselfWith ( const MEDCouplingMesh other  )  const [pure virtual]
virtual MEDCouplingMesh* ParaMEDMEM.MEDCouplingMesh.buildPart ( const int start,
const int end 
) const [pure virtual]
virtual MEDCouplingMesh* ParaMEDMEM.MEDCouplingMesh.buildPartAndReduceNodes ( const int start,
const int end,
DataArrayInt *&  arr 
) const [pure virtual]
virtual MEDCouplingUMesh* ParaMEDMEM.MEDCouplingMesh.buildUnstructured (  )  const throw (INTERP_KERNEL::Exception) [pure virtual]
virtual DataArrayInt* ParaMEDMEM.MEDCouplingMesh.simplexize ( int  policy  )  throw (INTERP_KERNEL::Exception) [pure virtual]
bool MEDCouplingMesh::areCompatibleForMerge ( const MEDCouplingMesh other  )  const [virtual]

This method is very poor and looks only if 'this' and 'other' are candidate for merge of fields lying repectively on them.

References ParaMEDMEM.MEDCouplingMesh.getMeshDimension(), and ParaMEDMEM.MEDCouplingMesh.getSpaceDimension().

MEDCouplingMesh * MEDCouplingMesh::MergeMeshes ( const MEDCouplingMesh mesh1,
const MEDCouplingMesh mesh2 
) [static]

retruns a newly created mesh with counter=1 that is the union of mesh1 and mesh2 if possible. The cells of mesh2 will appear after cells of 'mesh1'. Idem for nodes.

References ParaMEDMEM.MEDCouplingMesh.mergeMyselfWith().

virtual void ParaMEDMEM.MEDCouplingMesh.getTinySerializationInformation ( std::vector< double > &  tinyInfoD,
std::vector< int > &  tinyInfo,
std::vector< std::string > &  littleStrings 
) const [pure virtual]
virtual void ParaMEDMEM.MEDCouplingMesh.resizeForUnserialization ( const std::vector< int > &  tinyInfo,
DataArrayInt a1,
DataArrayDouble a2,
std::vector< std::string > &  littleStrings 
) const [pure virtual]
virtual void ParaMEDMEM.MEDCouplingMesh.serialize ( DataArrayInt *&  a1,
DataArrayDouble *&  a2 
) const [pure virtual]
virtual void ParaMEDMEM.MEDCouplingMesh.unserialization ( const std::vector< double > &  tinyInfoD,
const std::vector< int > &  tinyInfo,
const DataArrayInt a1,
DataArrayDouble a2,
const std::vector< std::string > &  littleStrings 
) [pure virtual]

Field Documentation

Reimplemented from ParaMEDMEM.TimeLabel.