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

Public Member Functions

virtual std::string advancedRepr () const =0
 
virtual bool areCompatibleForMerge (const MEDCouplingMesh *other) const
 
virtual MEDCouplingFieldDoublebuildOrthogonalField () 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 MEDCouplingMeshbuildPartRange (int beginCellIds, int endCellIds, int stepCellIds) const
 
virtual MEDCouplingMeshbuildPartRangeAndReduceNodes (int beginCellIds, int endCellIds, int stepCellIds, int &beginOut, int &endOut, int &stepOut, DataArrayInt *&arr) const
 
virtual MEDCouplingUMeshbuildUnstructured () const =0
 
virtual void checkConsistency (double eps=1e-12) const =0
 
virtual void checkConsistencyLight () const =0
 
virtual void checkDeepEquivalOnSameNodesWith (const MEDCouplingMesh *other, int cellCompPol, double prec, DataArrayInt *&cellCor) const =0
 
virtual void checkDeepEquivalWith (const MEDCouplingMesh *other, int cellCompPol, double prec, DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const =0
 
virtual void checkFastEquivalWith (const MEDCouplingMesh *other, double prec) const
 
void checkGeoEquivalWith (const MEDCouplingMesh *other, int levOfCheck, double prec, DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const
 
virtual DataArrayIntcheckTypeConsistencyAndContig (const std::vector< int > &code, const std::vector< const DataArrayInt * > &idsPerType) const =0
 
virtual MEDCouplingMeshclone (bool recDeepCpy) const =0
 
virtual DataArrayDoublecomputeCellCenterOfMass () const =0
 
virtual DataArrayIntcomputeEffectiveNbOfNodesPerCell () const =0
 
virtual DataArrayDoublecomputeIsoBarycenterOfNodesPerCell () const =0
 
virtual DataArrayIntcomputeNbOfFacesPerCell () const =0
 
virtual DataArrayIntcomputeNbOfNodesPerCell () const =0
 
virtual void copyTinyInfoFrom (const MEDCouplingMesh *other)
 
virtual void copyTinyStringsFrom (const MEDCouplingMesh *other)
 
virtual MEDCouplingMeshdeepCopy () const =0
 
virtual MEDCouplingFieldDoublefillFromAnalytic (TypeOfField t, int nbOfComp, FunctionToEvaluate func) const
 
virtual MEDCouplingFieldDoublefillFromAnalytic (TypeOfField t, int nbOfComp, const std::string &func) const
 
virtual MEDCouplingFieldDoublefillFromAnalyticCompo (TypeOfField t, int nbOfComp, const std::string &func) const
 
virtual MEDCouplingFieldDoublefillFromAnalyticNamedCompo (TypeOfField t, int nbOfComp, const std::vector< std::string > &varsOrder, const std::string &func) const
 
virtual std::set
< INTERP_KERNEL::NormalizedCellType
getAllGeoTypes () const =0
 
virtual void getBoundingBox (double *bbox) const =0
 
virtual int getCellContainingPoint (const double *pos, double eps) const =0
 
virtual DataArrayIntgetCellIdsFullyIncludedInNodeIds (const int *partBg, const int *partEnd) const
 
virtual void getCellsContainingPoint (const double *pos, double eps, std::vector< int > &elts) const =0
 
virtual void getCellsContainingPoints (const double *pos, int nbOfPoints, double eps, MCAuto< DataArrayInt > &elts, MCAuto< DataArrayInt > &eltsIndex) const
 
virtual DataArrayDoublegetCoordinatesAndOwner () const =0
 
virtual void getCoordinatesOfNode (int nodeId, std::vector< double > &coo) const =0
 
std::string getDescription () const
 
virtual const DataArrayDoublegetDirectAccessOfCoordsArrIfInStructure () const =0
 
virtual std::vector< int > getDistributionOfTypes () const =0
 
std::size_t getHeapMemorySizeWithoutChildren () const
 
virtual MEDCouplingFieldDoublegetMeasureField (bool isAbs) const =0
 
virtual MEDCouplingFieldDoublegetMeasureFieldOnNode (bool isAbs) const =0
 
virtual int getMeshDimension () const =0
 
std::string getName () const
 
virtual void getNodeIdsOfCell (int cellId, std::vector< int > &conn) const =0
 
virtual int getNumberOfCells () const =0
 
virtual int getNumberOfCellsWithType (INTERP_KERNEL::NormalizedCellType type) const =0
 
virtual int getNumberOfNodes () const =0
 
virtual void getReverseNodalConnectivity (DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const =0
 
virtual int getSpaceDimension () const =0
 
double getTime (int &iteration, int &order) const
 
std::string getTimeUnit () const
 
virtual void getTinySerializationInformation (std::vector< double > &tinyInfoD, std::vector< int > &tinyInfo, std::vector< std::string > &littleStrings) const =0
 
virtual MEDCouplingMeshType getType () const =0
 
virtual
INTERP_KERNEL::NormalizedCellType 
getTypeOfCell (int cellId) const =0
 
virtual std::string getVTKFileExtension () const =0
 
std::string getVTKFileNameOf (const std::string &fileName) const
 
virtual DataArrayIntgiveCellsWithType (INTERP_KERNEL::NormalizedCellType type) const =0
 
virtual bool isEqual (const MEDCouplingMesh *other, double prec) const
 
virtual bool isEqualIfNotWhy (const MEDCouplingMesh *other, double prec, std::string &reason) const
 
virtual bool isEqualWithoutConsideringStr (const MEDCouplingMesh *other, double prec) const =0
 
bool isStructured () const
 
virtual MEDCouplingMeshmergeMyselfWith (const MEDCouplingMesh *other) const =0
 
virtual void renumberCells (const int *old2NewBg, bool check=true)=0
 
virtual void reprQuickOverview (std::ostream &stream) const =0
 
virtual void resizeForUnserialization (const std::vector< int > &tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector< std::string > &littleStrings) const =0
 
virtual void rotate (const double *center, const double *vector, double angle)=0
 
virtual void scale (const double *point, double factor)=0
 
virtual void serialize (DataArrayInt *&a1, DataArrayDouble *&a2) const =0
 
void setDescription (const std::string &descr)
 
void setName (const std::string &name)
 
void setTime (double val, int iteration, int order)
 
void setTimeUnit (const std::string &unit)
 
virtual std::string simpleRepr () const =0
 
virtual DataArrayIntsimplexize (int policy)=0
 
virtual void splitProfilePerType (const DataArrayInt *profile, std::vector< int > &code, std::vector< DataArrayInt * > &idsInPflPerType, std::vector< DataArrayInt * > &idsPerType) const =0
 
virtual void translate (const double *vector)=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
 
std::string writeVTK (const std::string &fileName, bool isBinary=true) const
 
virtual void writeVTKLL (std::ostream &ofs, const std::string &cellData, const std::string &pointData, DataArrayByte *byteData) const =0
 
- Public Member Functions inherited from MEDCoupling::TimeLabel
void declareAsNew () const
 
std::size_t getTimeOfThis () const
 
TimeLabeloperator= (const TimeLabel &other)
 
virtual void updateTime () const =0
 

Static Public Member Functions

static
INTERP_KERNEL::NormalizedCellType 
GetCorrespondingPolyType (INTERP_KERNEL::NormalizedCellType type)
 
static int GetDimensionOfGeometricType (INTERP_KERNEL::NormalizedCellType type)
 
static int GetNumberOfNodesOfGeometricType (INTERP_KERNEL::NormalizedCellType type)
 
static const char * GetReprOfGeometricType (INTERP_KERNEL::NormalizedCellType type)
 
static bool IsLinearGeometricType (INTERP_KERNEL::NormalizedCellType type)
 
static bool IsStaticGeometricType (INTERP_KERNEL::NormalizedCellType type)
 
static MEDCouplingMeshMergeMeshes (const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2)
 
static MEDCouplingMeshMergeMeshes (std::vector< const MEDCouplingMesh * > &meshes)
 

Protected Member Functions

virtual std::string getVTKDataSetType () const =0
 
 MEDCouplingMesh ()
 
 MEDCouplingMesh (const MEDCouplingMesh &other)
 
virtual ~MEDCouplingMesh ()
 
- Protected Member Functions inherited from MEDCoupling::RefCountObject
 RefCountObject ()
 
 RefCountObject (const RefCountObject &other)
 
virtual ~RefCountObject ()
 
- Protected Member Functions inherited from MEDCoupling::RefCountObjectOnly
 RefCountObjectOnly ()
 
 RefCountObjectOnly (const RefCountObjectOnly &other)
 
virtual ~RefCountObjectOnly ()
 
- Protected Member Functions inherited from MEDCoupling::TimeLabel
void forceTimeOfThis (const TimeLabel &other) const
 
 TimeLabel ()
 
void updateTimeWith (const TimeLabel &other) const
 
virtual ~TimeLabel ()
 

Constructor & Destructor Documentation

MEDCouplingMesh::MEDCouplingMesh ( )
protected
MEDCouplingMesh::MEDCouplingMesh ( const MEDCouplingMesh other)
protected
virtual MEDCoupling::MEDCouplingMesh::~MEDCouplingMesh ( )
protectedvirtual

Member Function Documentation

std::string MEDCoupling::MEDCouplingMesh::getName ( ) const

Referenced by MEDCoupling::MEDFileAnyTypeField1TSWithoutSDA::addNewEntryIfNecessary(), MEDCoupling::MEDCouplingMappedExtrudedMesh::advancedRepr(), MEDCoupling::MEDCoupling1GTUMesh::AggregateOnSameCoordsToUMesh(), MEDCoupling::MEDCouplingUMesh::areCellsIncludedIn(), MEDCoupling::MEDCouplingUMesh::areCellsIncludedInPolicy7(), MEDCoupling::MEDCouplingIMesh::asSingleCell(), MEDCoupling::DisjointDEC::attachLocalField(), MEDCoupling::OverlapDEC::attachSourceLocalField(), MEDCoupling::OverlapDEC::attachTargetLocalField(), MEDCoupling::MEDCouplingStructuredMesh::build1SGTSubLevelMesh(), MEDCoupling::MEDCouplingStructuredMesh::build1SGTUnstructured(), MEDCoupling::MEDCouplingMappedExtrudedMesh::build3DUnstructuredMesh(), MEDCoupling::MEDCoupling1SGTUMesh::buildPartOfMySelfKeepCoords(), MEDCoupling::MEDCoupling1DGTUMesh::buildPartOfMySelfKeepCoords(), MEDCoupling::MEDCoupling1SGTUMesh::buildPartOfMySelfKeepCoordsSlice(), MEDCoupling::MEDCoupling1DGTUMesh::buildPartOfMySelfKeepCoordsSlice(), MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildPythonDumpOfThis(), MEDCoupling::MEDCouplingUMesh::buildSetInstanceFromThis(), MEDCoupling::MEDCoupling1SGTUMesh::buildSetInstanceFromThis(), MEDCoupling::MEDCoupling1DGTUMesh::buildSetInstanceFromThis(), MEDCoupling::MEDCouplingUMesh::buildSpreadZonesWithPoly(), MEDCoupling::MEDCoupling1SGTUMesh::buildUnstructured(), MEDCoupling::MEDCoupling1DGTUMesh::buildUnstructured(), MEDCoupling::MEDCouplingIMesh::buildWithGhost(), MEDCoupling::MEDCouplingFieldDiscretizationGauss::checkCoherencyBetween(), MEDCoupling::MEDCouplingUMesh::convertIntoSingleGeoTypeMesh(), MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear(), MEDCoupling::MEDFileAnyTypeField1TSWithoutSDA::copyTinyInfoFrom(), MEDCoupling::MEDFileAnyTypeFieldMultiTSWithoutSDA::copyTinyInfoFrom(), MEDCoupling::MEDCoupling1DGTUMesh::copyWithNodalConnectivityPacked(), MEDCoupling::MEDCouplingUMesh::cppRepr(), MEDCoupling::MEDFileMesh::dealWithTinyInfo(), MEDCoupling::MEDCoupling1SGTUMesh::explodeEachHexa8To6Quad4(), MEDCoupling::MEDCouplingUMesh::FuseUMeshesOnSameCoords(), MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes(), MEDCoupling::MEDFileAnyTypeField1TSWithoutSDA::getFieldOnMeshAtLevel(), MEDCoupling::MEDCouplingCMesh::getMeasureField(), MEDCoupling::MEDCouplingCurveLinearMesh::getMeasureField(), MEDCoupling::MEDCouplingIMesh::getMeasureField(), MEDCoupling::MEDCouplingMappedExtrudedMesh::getMeasureField(), MEDCoupling::MEDCouplingUMesh::getMeasureField(), MEDCoupling::MEDCouplingUMesh::getMeasureFieldOnNode(), MEDCoupling::MEDCouplingUMesh::getPartMeasureField(), MEDCoupling::MEDCouplingCurveLinearMesh::getTinySerializationInformation(), MEDCoupling::MEDCouplingCMesh::getTinySerializationInformation(), MEDCoupling::MEDCouplingIMesh::getTinySerializationInformation(), MEDCoupling::MEDCouplingMappedExtrudedMesh::getTinySerializationInformation(), MEDCoupling::MEDCouplingPointSet::getTinySerializationInformation(), MEDCoupling::MEDCoupling1SGTUMesh::getTinySerializationInformation(), MEDCoupling::MEDCoupling1DGTUMesh::getTinySerializationInformation(), MEDCoupling::MEDCoupling1SGTUMesh::New(), MEDCoupling::MEDCoupling1DGTUMesh::New(), MEDCoupling::MEDCouplingCurveLinearMesh::reprQuickOverview(), MEDCoupling::MEDCouplingCMesh::reprQuickOverview(), MEDCoupling::MEDCouplingUMesh::reprQuickOverview(), MEDCoupling::MEDCouplingIMesh::reprQuickOverview(), MEDCoupling::MEDCouplingMappedExtrudedMesh::reprQuickOverview(), MEDCoupling::MEDCoupling1SGTUMesh::reprQuickOverview(), MEDCoupling::MEDCoupling1DGTUMesh::reprQuickOverview(), MEDCoupling::MEDFileAnyTypeField1TSWithoutSDA::setFieldNoProfileSBT(), MEDCoupling::MEDFileUMesh::setMeshes(), MEDCoupling::MEDCouplingCurveLinearMesh::simpleRepr(), MEDCoupling::MEDCouplingCMesh::simpleRepr(), MEDCoupling::MEDCouplingMappedExtrudedMesh::simpleRepr(), MEDCoupling::MEDCouplingIMesh::simpleRepr(), MEDCoupling::MEDCouplingUMesh::simpleRepr(), MEDCoupling::MEDCoupling1SGTUMesh::simpleRepr(), MEDCoupling::MEDCoupling1DGTUMesh::simpleRepr(), MEDCoupling::MEDCouplingUMesh::tetrahedrize(), and MEDCoupling::WriteField().

bool MEDCouplingMesh::isStructured ( ) const

This method is only for ParaMEDMEM in ParaFIELD constructor.

References MEDCoupling::CARTESIAN, and getType().

Referenced by MEDCoupling::ParaMESH::isStructured().

bool MEDCouplingMesh::isEqual ( const MEDCouplingMesh other,
double  prec 
) const
virtual

Checks if this and another MEDCouplingMesh are fully equal.

Parameters
[in]other- an instance of MEDCouplingMesh to compare with this one.
[in]prec- precision value used to compare node coordinates.
Returns
bool - true if the two meshes are equal, false else.

References isEqualIfNotWhy().

Referenced by checkGeoEquivalWith(), MEDCoupling::MEDFileCMesh::isEqual(), and MEDCoupling::MEDFileCurveLinearMesh::isEqual().

virtual void MEDCoupling::MEDCouplingMesh::checkDeepEquivalWith ( const MEDCouplingMesh other,
int  cellCompPol,
double  prec,
DataArrayInt *&  cellCor,
DataArrayInt *&  nodeCor 
) const
pure virtual
virtual void MEDCoupling::MEDCouplingMesh::checkDeepEquivalOnSameNodesWith ( const MEDCouplingMesh other,
int  cellCompPol,
double  prec,
DataArrayInt *&  cellCor 
) const
pure virtual
void MEDCouplingMesh::checkFastEquivalWith ( const MEDCouplingMesh other,
double  prec 
) const
virtual
void MEDCouplingMesh::checkGeoEquivalWith ( const MEDCouplingMesh other,
int  levOfCheck,
double  prec,
DataArrayInt *&  cellCor,
DataArrayInt *&  nodeCor 
) const

This method checks geo equivalence between two meshes : this and other. If no exception is thrown 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.

In case of success cell other[i] is equal to the cell this[cellCor[i]]. In case of success node other->getCoords()[i] is equal to the node this->getCoords()[nodeCor[i]].

If cellCor is null (or Py_None) it means that for all #i cell in other is equal to cell # i in this.

If nodeCor is null (or Py_None) it means that for all #i node in other is equal to node # i in this.

So null (or Py_None) returned in cellCor and/or nodeCor means identity array. This is for optimization reason to avoid to build useless arrays for some levOfCheck (for example 0).

Warning a not null output does not mean that it is not identity !

Parameters
[in]other- the mesh to be compared with this.
[in]levOfCheck- input that specifies the level of check specified. The possible values are listed below.
[in]prec- input that specifies precision for double float data used for comparison in meshes.
[out]cellCor- output array not always informed (depending levOfCheck param) that gives the corresponding array for cells from other to this.
[out]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 (10+x) 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 (20+x), 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.

So the most strict level of check is 0 (equality). The least strict is 12. If the level of check 12 throws, the 2 meshes this and other are not similar enough to be compared. An interpolation using MEDCouplingRemapper class should be then used.

References checkDeepEquivalOnSameNodesWith(), checkDeepEquivalWith(), checkFastEquivalWith(), isEqual(), and isEqualWithoutConsideringStr().

Referenced by MEDCoupling::MEDCouplingFieldDouble::changeUnderlyingMesh().

virtual int MEDCoupling::MEDCouplingMesh::getNumberOfCells ( ) const
pure virtual

Implemented in MEDCoupling::MEDCoupling1DGTUMesh, MEDCoupling::MEDCoupling1SGTUMesh, MEDCoupling::MEDCouplingUMesh, MEDCoupling::MEDCouplingStructuredMesh, MEDCoupling::MEDCouplingCurveLinearMesh, and MEDCoupling::MEDCouplingMappedExtrudedMesh.

Referenced by MEDCoupling::MEDCouplingFieldDiscretizationPerCell::buildDiscrPerCellIfNecessary(), MEDCoupling::MEDCouplingPointSet::buildPartRange(), buildPartRange(), MEDCoupling::MEDCouplingFieldDiscretizationGaussNE::buildSubMeshDataRange(), MEDCoupling::MEDCouplingFieldDiscretizationP0::checkCoherencyBetween(), MEDCoupling::MEDCouplingFieldDiscretizationPerCell::checkCoherencyBetween(), MEDCoupling::MEDCouplingFieldDiscretizationGauss::checkCoherencyBetween(), MEDCoupling::MEDCouplingPointSet::checkDeepEquivalOnSameNodesWith(), MEDCoupling::MEDCouplingPointSet::checkDeepEquivalWith(), MEDCoupling::MEDCouplingPointSet::checkFastEquivalWith(), checkFastEquivalWith(), MEDCoupling::MEDCoupling1GTUMesh::checkTypeConsistencyAndContig(), MEDCoupling::MEDCouplingFieldDiscretizationGauss::computeTupleIdsToSelectFromCellIds(), MEDCoupling::ExplicitTopology::ExplicitTopology(), getCellIdsFullyIncludedInNodeIds(), MEDCoupling::MEDCoupling1GTUMesh::getDistributionOfTypes(), MEDCoupling::MEDFileAnyTypeField1TSWithoutSDA::getFieldOnMeshAtLevel(), MEDCoupling::MEDCoupling1GTUMesh::getNumberOfCellsWithType(), MEDCoupling::MEDCouplingFieldDiscretizationP0::getNumberOfMeshPlaces(), MEDCoupling::MEDCouplingFieldDiscretizationGauss::getNumberOfMeshPlaces(), MEDCoupling::MEDCouplingFieldDiscretizationGaussNE::getNumberOfMeshPlaces(), MEDCoupling::MEDCouplingFieldDiscretizationP0::getNumberOfTuples(), MEDCoupling::MEDCouplingFieldDiscretizationGaussNE::getNumberOfTuples(), MEDCoupling::MEDCouplingFieldDiscretizationP0::getOffsetArr(), MEDCoupling::MEDCouplingFieldDiscretizationGauss::getOffsetArr(), MEDCoupling::MEDCouplingFieldDiscretizationGaussNE::getOffsetArr(), MEDCoupling::MEDCoupling1GTUMesh::getTypeOfCell(), MEDCoupling::MEDCoupling1GTUMesh::giveCellsWithType(), MEDCoupling::MEDCouplingFieldDouble::nodeToCellDiscretization(), MEDCoupling::ParaMESH::ParaMESH(), MEDCoupling::MEDCouplingFieldDiscretizationP0::renumberArraysForCell(), MEDCoupling::MEDCouplingFieldDiscretizationGauss::renumberArraysForCell(), MEDCoupling::MEDCouplingFieldDiscretizationGaussNE::renumberArraysForCell(), MEDCoupling::MEDCouplingFieldDiscretizationGauss::setGaussLocalizationOnType(), MEDCoupling::MEDCouplingFieldDouble::simplexize(), MEDCoupling::MEDCoupling1GTUMesh::splitProfilePerType(), and MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer().

virtual DataArrayInt* MEDCoupling::MEDCouplingMesh::computeEffectiveNbOfNodesPerCell ( ) const
pure virtual
DataArrayInt * MEDCouplingMesh::getCellIdsFullyIncludedInNodeIds ( const int *  partBg,
const int *  partEnd 
) const
virtual

Finds cells whose all nodes are in a given array of node ids.

Parameters
[in]partBg- the array of node ids.
[in]partEnd- end of partBg, i.e. a pointer to a (last+1)-th element of partBg.
Returns
DataArrayInt * - a new instance of DataArrayInt holding ids of found cells. The caller is to delete this array using decrRef() as it is no more needed.

Reimplemented in MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::DataArrayTemplate< T >::alloc(), getNodeIdsOfCell(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), and MEDCoupling::DataArrayInt::New().

Referenced by MEDCoupling::MEDCouplingFieldDiscretizationOnNodes::computeMeshRestrictionFromTupleIds().

virtual void MEDCoupling::MEDCouplingMesh::getCoordinatesOfNode ( int  nodeId,
std::vector< double > &  coo 
) const
pure virtual
virtual const DataArrayDouble* MEDCoupling::MEDCouplingMesh::getDirectAccessOfCoordsArrIfInStructure ( ) const
pure virtual
virtual std::vector<int> MEDCoupling::MEDCouplingMesh::getDistributionOfTypes ( ) const
pure virtual
virtual DataArrayInt* MEDCoupling::MEDCouplingMesh::checkTypeConsistencyAndContig ( const std::vector< int > &  code,
const std::vector< const DataArrayInt * > &  idsPerType 
) const
pure virtual
virtual void MEDCoupling::MEDCouplingMesh::splitProfilePerType ( const DataArrayInt profile,
std::vector< int > &  code,
std::vector< DataArrayInt * > &  idsInPflPerType,
std::vector< DataArrayInt * > &  idsPerType 
) const
pure virtual
virtual void MEDCoupling::MEDCouplingMesh::getBoundingBox ( double *  bbox) const
pure virtual
virtual void MEDCoupling::MEDCouplingMesh::getCellsContainingPoint ( const double *  pos,
double  eps,
std::vector< int > &  elts 
) const
pure virtual
void MEDCouplingMesh::getCellsContainingPoints ( const double *  pos,
int  nbOfPoints,
double  eps,
MCAuto< DataArrayInt > &  elts,
MCAuto< DataArrayInt > &  eltsIndex 
) const
virtual

Finds cells in contact with several balls (i.e. points with precision). This method is an extension of getCellContainingPoint() and getCellsContainingPoint() for the case of multiple points.

Parameters
[in]pos- an array of coordinates of points in full interlace mode : X0,Y0,Z0,X1,Y1,Z1,... Size of the array must be this->getSpaceDimension() * nbOfPoints
[in]nbOfPoints- number of points to locate within this mesh.
[in]eps- radius of balls (i.e. the precision).
[out]elts- vector returning ids of found cells.
[out]eltsIndex- an array, of length nbOfPoints + 1, dividing cell ids in elts into groups each referring to one point. Its every element (except the last one) is an index pointing to the first id of a group of cells. For example cells in contact with the i-th point are described by following range of indices: [ eltsIndex[ i ], eltsIndex[ i+1 ] ) and the cell ids are elts[ eltsIndex[ i ]], elts[ eltsIndex[ i ] + 1 ], ... Number of cells in contact with the i-th point is eltsIndex[ i+1 ] - eltsIndex[ i ].

Here is a C++ example.
Here is a Python example.

Reimplemented in MEDCoupling::MEDCouplingUMesh.

References MEDCoupling::DataArrayTemplate< T >::alloc(), getCellsContainingPoint(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::getPointer(), getSpaceDimension(), MEDCoupling::DataArrayInt::insertAtTheEnd(), MEDCoupling::DataArrayInt::New(), and MEDCoupling::DataArrayTemplate< T >::setIJ().

Referenced by MEDCoupling::MEDCouplingFieldDiscretizationP0::getValueOnMulti(), and MEDCoupling::MEDCouplingFieldDiscretizationP1::getValueOnMulti().

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
ttype of field returned and specifies where the evaluation of func will be done.
nbOfCompnumber of components of returned field.
funcpointer to a function that should return false if the evaluation failed. (division by 0. for example)
Returns
field with counter = 1.

References MEDCoupling::MEDCouplingFieldDouble::fillFromAnalytic(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::ONE_TIME, MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingFieldDouble::synchronizeTimeWithSupport().

MEDCouplingFieldDouble * MEDCouplingMesh::fillFromAnalytic ( TypeOfField  t,
int  nbOfComp,
const std::string &  func 
) const
virtual

Creates a new MEDCouplingFieldDouble of a given type, one time, with given number of components, lying on this mesh, with contents got by applying a specified function to coordinates of field location points (defined by the given field type). For example, if t == MEDCoupling::ON_CELLS, the function is applied to cell barycenters.
For more info on supported expressions that can be used in the function, see Expressions supported. The function can include arbitrary named variables (e.g. "x","y" or "va44") to refer to components of point coordinates. Names of variables are sorted in alphabetical order to associate a variable name with a component. For example, in the expression "2*x+z", "x" stands for the component #0 and "z" stands for the component #1 (not #2)!
In a general case, a value resulting from the function evaluation is assigned to all components of the field. But there is a possibility to have its own expression for each component within one function. For this purpose, there are predefined variable names (IVec, JVec, KVec, LVec etc) each dedicated to a certain component (IVec, to the component #0 etc). A factor of such a variable is added to the corresponding component only.
For example, nbOfComp == 4, this->getSpaceDimension() == 3, coordinates of a point are (1.,3.,7.), then

  • "2*x + z" produces (5.,5.,5.,5.)
  • "2*x + 0*y + z" produces (9.,9.,9.,9.)
  • "2*x*IVec + (x+z)*LVec" produces (2.,0.,0.,4.)
  • "2*y*IVec + z*KVec + x" produces (7.,1.,1.,4.)
Parameters
[in]t- the field type. It defines, apart from other things, points to coordinates of which the function is applied to get field values.
[in]nbOfComp- the number of components in the result field.
[in]func- a string defining the expression which is evaluated to get field values.
Returns
MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthe nodal connectivity of cells is not defined.
Ifcomputing func fails.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingFieldDouble::fillFromAnalytic(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::ONE_TIME, MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingFieldDouble::synchronizeTimeWithSupport().

MEDCouplingFieldDouble * MEDCouplingMesh::fillFromAnalyticCompo ( TypeOfField  t,
int  nbOfComp,
const std::string &  func 
) const
virtual

Creates a new MEDCouplingFieldDouble of a given type, one time, with given number of components, lying on this mesh, with contents got by applying a specified function to coordinates of field location points (defined by the given field type). For example, if t == MEDCoupling::ON_CELLS, the function is applied to cell barycenters. This method differs from MEDCouplingMesh::fillFromAnalytic(TypeOfField t, int nbOfComp, const std::string& func) const "fillFromAnalytic()" by the way how variable names, used in the function, are associated with components of coordinates of field location points; here, a variable name corresponding to a component is retrieved from a corresponding node coordinates array (where it is set via DataArrayDouble::setInfoOnComponent()).
For more info on supported expressions that can be used in the function, see Expressions supported.
In a general case, a value resulting from the function evaluation is assigned to all components of a field value. But there is a possibility to have its own expression for each component within one function. For this purpose, there are predefined variable names (IVec, JVec, KVec, LVec etc) each dedicated to a certain component (IVec, to the component #0 etc). A factor of such a variable is added to the corresponding component only.
For example, nbOfComp == 4, this->getSpaceDimension() == 3, names of spatial components are "x", "y" and "z", coordinates of a point are (1.,3.,7.), then

  • "2*x + z" produces (9.,9.,9.,9.)
  • "2*x*IVec + (x+z)*LVec" produces (2.,0.,0.,8.)
  • "2*y*IVec + z*KVec + x" produces (7.,1.,1.,8.)
Parameters
[in]t- the field type. It defines, apart from other things, the points to coordinates of which the function is applied to get field values.
[in]nbOfComp- the number of components in the result field.
[in]func- a string defining the expression which is evaluated to get field values.
Returns
MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthe node coordinates are not defined.
Ifthe nodal connectivity of cells is not defined.
Ifcomputing func fails.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingFieldDouble::fillFromAnalyticCompo(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::ONE_TIME, MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingFieldDouble::synchronizeTimeWithSupport().

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

Creates a new MEDCouplingFieldDouble of a given type, one time, with given number of components, lying on this mesh, with contents got by applying a specified function to coordinates of field location points (defined by the given field type). For example, if t == MEDCoupling::ON_CELLS, the function is applied to cell barycenters. This method differs from fillFromAnalytic() by the way how variable names, used in the function, are associated with components of coordinates of field location points; here, a component index of a variable is defined by a rank of the variable within the input array varsOrder.
For more info on supported expressions that can be used in the function, see Expressions supported. In a general case, a value resulting from the function evaluation is assigned to all components of the field. But there is a possibility to have its own expression for each component within one function. For this purpose, there are predefined variable names (IVec, JVec, KVec, LVec etc) each dedicated to a certain component (IVec, to the component #0 etc). A factor of such a variable is added to the corresponding component only.
For example, nbOfComp == 4, this->getSpaceDimension() == 3, names of spatial components are given in varsOrder: ["x", "y","z"], coordinates of a point are (1.,3.,7.), then

  • "2*x + z" produces (9.,9.,9.,9.)
  • "2*x*IVec + (x+z)*LVec" produces (2.,0.,0.,8.)
  • "2*y*IVec + z*KVec + x" produces (7.,1.,1.,8.)
Parameters
[in]t- the field type. It defines, apart from other things, the points to coordinates of which the function is applied to get field values.
[in]nbOfComp- the number of components in the result field.
[in]varsOrder- the vector defining names of variables used to refer to components of coordinates of field location points. A variable named varsOrder[0] refers to the component #0 etc.
[in]func- a string defining the expression which is evaluated to get field values.
Returns
MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthe node coordinates are not defined.
Ifthe nodal connectivity of cells is not defined.
Ifcomputing func fails.

Here is a C++ example.
Here is a Python example.

References MEDCoupling::MEDCouplingFieldDouble::fillFromAnalyticNamedCompo(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::ONE_TIME, MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingFieldDouble::synchronizeTimeWithSupport().

virtual void MEDCoupling::MEDCouplingMesh::rotate ( const double *  center,
const double *  vector,
double  angle 
)
pure virtual
virtual void MEDCoupling::MEDCouplingMesh::translate ( const double *  vector)
pure virtual
virtual void MEDCoupling::MEDCouplingMesh::scale ( const double *  point,
double  factor 
)
pure virtual
virtual MEDCouplingMesh* MEDCoupling::MEDCouplingMesh::buildPartAndReduceNodes ( const int *  start,
const int *  end,
DataArrayInt *&  arr 
) const
pure virtual
MEDCouplingMesh * MEDCouplingMesh::buildPartRange ( int  beginCellIds,
int  endCellIds,
int  stepCellIds 
) const
virtual

This method is equivalent to MEDCouplingMesh::buildPart method except that here the cell ids are specified using slice beginCellIds endCellIds and stepCellIds. WARNING , there is a big difference compared to MEDCouplingMesh::buildPart method. If the input range is equal all cells in this, this is returned !

Returns
a new ref to be managed by the caller. Warning this ref can be equal to this if input slice is exactly equal to the whole cells in the same order.
See Also
MEDCouplingMesh::buildPart

Reimplemented in MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::DataArrayTemplate< T >::begin(), buildPart(), MEDCoupling::DataArrayTemplate< T >::end(), getNumberOfCells(), MEDCoupling::RefCountObjectOnly::incrRef(), and MEDCoupling::DataArrayInt::Range().

Referenced by MEDCoupling::MEDCouplingFieldDiscretizationP0::buildSubMeshDataRange(), MEDCoupling::MEDCouplingFieldDiscretizationGauss::buildSubMeshDataRange(), and MEDCoupling::MEDCouplingFieldDiscretizationGaussNE::buildSubMeshDataRange().

MEDCouplingMesh * MEDCouplingMesh::buildPartRangeAndReduceNodes ( int  beginCellIds,
int  endCellIds,
int  stepCellIds,
int &  beginOut,
int &  endOut,
int &  stepOut,
DataArrayInt *&  arr 
) const
virtual
virtual void MEDCoupling::MEDCouplingMesh::getReverseNodalConnectivity ( DataArrayInt revNodal,
DataArrayInt revNodalIndx 
) const
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 getMeshDimension(), and getSpaceDimension().

Referenced by MEDCoupling::MEDCouplingField::areCompatibleForMerge().

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

Creates a new MEDCouplingMesh by concatenating two given meshes, if possible. Cells and nodes of the first mesh precede cells and nodes of the second mesh within the result mesh. The meshes must be of the same mesh type, else, an exception is thrown. The method MergeMeshes(), accepting a vector of input meshes, has no such a limitation.

Parameters
[in]mesh1- the first mesh.
[in]mesh2- the second mesh.
Returns
MEDCouplingMesh * - the result mesh. It is a new instance of MEDCouplingMesh. The caller is to delete this mesh using decrRef() as it is no more needed.
Exceptions
Ifthe meshes are of different mesh type.

References mergeMyselfWith().

MEDCouplingMesh * MEDCouplingMesh::MergeMeshes ( std::vector< const MEDCouplingMesh * > &  meshes)
static

Creates a new MEDCouplingMesh by concatenating all given meshes, if possible. Cells and nodes of the i-th mesh precede cells and nodes of the (i+1)-th mesh within the result mesh. This method performs a systematic conversion to unstructured meshes before performing aggregation contrary to the other MergeMeshes() with two parameters that works only on the same type of meshes. So here it is possible to mix different type of meshes.

Parameters
[in]meshes- a vector of meshes to concatenate.
Returns
MEDCouplingMesh * - the result mesh. It is a new instance of MEDCouplingUMesh. The caller is to delete this mesh using decrRef() as it is no more needed.
Exceptions
Ifmeshes.size() == 0.
Ifsize[ i ] == NULL.
Ifthe coordinates is not set in none of the meshes.
Ifmeshes[ i ]->getMeshDimension() < 0.
Ifthe meshes are of different dimension (getMeshDimension()).

References MEDCoupling::MEDCouplingUMesh::buildUnstructured(), and MEDCoupling::MEDCouplingUMesh::MergeUMeshes().

bool MEDCouplingMesh::IsStaticGeometricType ( INTERP_KERNEL::NormalizedCellType  type)
static
Parameters
[in]typethe geometric type for which the status static/dynamic is asked.
Returns
true for static geometric type, false for dynamic geometric type.
Exceptions
iftype is equal to INTERP_KERNEL::NORM_ERROR or to an unexisting geometric type.
bool MEDCouplingMesh::IsLinearGeometricType ( INTERP_KERNEL::NormalizedCellType  type)
static
INTERP_KERNEL::NormalizedCellType MEDCouplingMesh::GetCorrespondingPolyType ( INTERP_KERNEL::NormalizedCellType  type)
static

For example if type is INTERP_KERNEL::NORM_TRI3 , INTERP_KERNEL::NORM_POLYGON is returned. If type is INTERP_KERNEL::NORM_HEXA8 , INTERP_KERNEL::NORM_POLYHED is returned.

Parameters
[in]typethe geometric type for which the corresponding dynamic type, is asked.
Returns
the corresponding dynamic type, able to store the input type.
Exceptions
iftype is equal to INTERP_KERNEL::NORM_ERROR or to an unexisting geometric type.
int MEDCouplingMesh::GetNumberOfNodesOfGeometricType ( INTERP_KERNEL::NormalizedCellType  type)
static
Parameters
[in]typethe geometric type for which the number of nodes consituting it, is asked.
Returns
number of nodes consituting the input geometric type type.
Exceptions
iftype is dynamic as INTERP_KERNEL::NORM_POLYHED , INTERP_KERNEL::NORM_POLYGON , INTERP_KERNEL::NORM_QPOLYG
iftype is equal to INTERP_KERNEL::NORM_ERROR or to an unexisting geometric type.
int MEDCouplingMesh::GetDimensionOfGeometricType ( INTERP_KERNEL::NormalizedCellType  type)
static
Parameters
[in]typethe geometric type for which the dimension is asked.
Returns
the dimension associated to the input geometric type type.
Exceptions
iftype is equal to INTERP_KERNEL::NORM_ERROR or to an unexisting geometric type.
const char * MEDCouplingMesh::GetReprOfGeometricType ( INTERP_KERNEL::NormalizedCellType  type)
static
Parameters
[in]typethe geometric type for which the representation is asked.
Returns
the string representation corresponding to the input geometric type type.
Exceptions
iftype is equal to INTERP_KERNEL::NORM_ERROR or to an unexisting geometric type.
virtual void MEDCoupling::MEDCouplingMesh::getTinySerializationInformation ( std::vector< double > &  tinyInfoD,
std::vector< int > &  tinyInfo,
std::vector< std::string > &  littleStrings 
) const
pure virtual
virtual void MEDCoupling::MEDCouplingMesh::resizeForUnserialization ( const std::vector< int > &  tinyInfo,
DataArrayInt a1,
DataArrayDouble a2,
std::vector< std::string > &  littleStrings 
) const
pure virtual
virtual void MEDCoupling::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
std::string MEDCouplingMesh::writeVTK ( const std::string &  fileName,
bool  isBinary = true 
) const

Writes this mesh into a VTK format file named as specified.

Parameters
[in]fileName- the name of the file to write in. If the extension is OK the fileName will be used directly. If extension is invalid or no extension the right extension will be appended.
Returns
- the real fileName
Exceptions
IffileName is not a writable file.
See Also
getVTKFileNameOf

References MEDCoupling::DataArrayTemplate< T >::alloc(), getVTKFileNameOf(), and MEDCoupling::DataArrayByte::New().

std::string MEDCouplingMesh::getVTKFileNameOf ( const std::string &  fileName) const

This method takes in input a file name fileName and considering the VTK extension of this (depending on the type of this) returns a right file name. If the input fileName has a valid extension the returned string is equal to fileName.

See Also
getVTKFileExtension

References getVTKFileExtension().

Referenced by writeVTK(), and MEDCoupling::MEDCouplingFieldDouble::WriteVTK().

virtual void MEDCoupling::MEDCouplingMesh::writeVTKLL ( std::ostream &  ofs,
const std::string &  cellData,
const std::string &  pointData,
DataArrayByte byteData 
) const
pure virtual
virtual std::string MEDCoupling::MEDCouplingMesh::getVTKDataSetType ( ) const
protectedpure virtual