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

Public Member Functions

MEDCoupling1SGTUMeshbuild1SGTSubLevelMesh () const
 
MEDCoupling1SGTUMeshbuild1SGTUnstructured () const
 
MEDCouplingFieldDoublebuildOrthogonalField () const
 
MEDCouplingMeshbuildPart (const int *start, const int *end) const
 
MEDCouplingMeshbuildPartAndReduceNodes (const int *start, const int *end, DataArrayInt *&arr) const
 
virtual MEDCouplingStructuredMeshbuildStructuredSubPart (const std::vector< std::pair< int, int > > &cellPart) const =0
 
MEDCouplingUMeshbuildUnstructured () const
 
DataArrayIntcheckTypeConsistencyAndContig (const std::vector< int > &code, const std::vector< const DataArrayInt * > &idsPerType) const
 
DataArrayIntcomputeEffectiveNbOfNodesPerCell () const
 
DataArrayIntcomputeNbOfFacesPerCell () const
 
DataArrayIntcomputeNbOfNodesPerCell () const
 
double computeSquareness () const
 
void copyTinyStringsFrom (const MEDCouplingMesh *other)
 
std::set
< INTERP_KERNEL::NormalizedCellType
getAllGeoTypes () const
 
std::vector< int > getCellGridStructure () const
 
int getCellIdFromPos (int i, int j, int k) const
 
std::vector< int > getDistributionOfTypes () const
 
std::size_t getHeapMemorySizeWithoutChildren () const
 
std::vector< int > getLocationFromCellId (int cellId) const
 
std::vector< int > getLocationFromNodeId (int nodeId) const
 
int getMeshDimension () const
 
virtual void getNodeGridStructure (int *res) const =0
 
virtual std::vector< int > getNodeGridStructure () const =0
 
int getNodeIdFromPos (int i, int j, int k) const
 
void getNodeIdsOfCell (int cellId, std::vector< int > &conn) const
 
int getNumberOfCells () const
 
int getNumberOfCellsOfSubLevelMesh () const
 
int getNumberOfCellsWithType (INTERP_KERNEL::NormalizedCellType type) const
 
int getNumberOfNodes () const
 
void getReverseNodalConnectivity (DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const
 
int getSpaceDimensionOnNodeStruct () const
 
virtual void getSplitCellValues (int *res) const
 
virtual void getSplitNodeValues (int *res) const
 
INTERP_KERNEL::NormalizedCellType getTypeOfCell (int cellId) const
 
DataArrayIntgiveCellsWithType (INTERP_KERNEL::NormalizedCellType type) const
 
bool isEqualIfNotWhy (const MEDCouplingMesh *other, double prec, std::string &reason) const
 
DataArrayIntsimplexize (int policy)
 
void splitProfilePerType (const DataArrayInt *profile, std::vector< int > &code, std::vector< DataArrayInt * > &idsInPflPerType, std::vector< DataArrayInt * > &idsPerType) const
 
- Public Member Functions inherited from MEDCoupling::MEDCouplingMesh
virtual std::string advancedRepr () const =0
 
virtual bool areCompatibleForMerge (const MEDCouplingMesh *other) const
 
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 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 MEDCouplingMeshclone (bool recDeepCpy) const =0
 
virtual DataArrayDoublecomputeCellCenterOfMass () const =0
 
virtual DataArrayDoublecomputeIsoBarycenterOfNodesPerCell () const =0
 
virtual void copyTinyInfoFrom (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 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 MEDCouplingFieldDoublegetMeasureField (bool isAbs) const =0
 
virtual MEDCouplingFieldDoublegetMeasureFieldOnNode (bool isAbs) const =0
 
std::string getName () const
 
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 std::string getVTKFileExtension () const =0
 
std::string getVTKFileNameOf (const std::string &fileName) const
 
virtual bool isEqual (const MEDCouplingMesh *other, double prec) 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 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 void ApplyGhostOnCompactFrmt (std::vector< std::pair< int, int > > &partBeforeFact, int ghostSize)
 
static bool AreRangesIntersect (const std::vector< std::pair< int, int > > &r1, const std::vector< std::pair< int, int > > &r2)
 
static void AssignPartOfFieldOfDoubleUsing (const std::vector< int > &st, DataArrayDouble *fieldOfDbl, const std::vector< std::pair< int, int > > &partCompactFormat, const DataArrayDouble *other)
 
static DataArrayIntBuild1GTNodalConnectivity (const int *nodeStBg, const int *nodeStEnd)
 
static DataArrayIntBuild1GTNodalConnectivityOfSubLevelMesh (const int *nodeStBg, const int *nodeStEnd)
 
static DataArrayIntBuildExplicitIdsFrom (const std::vector< int > &st, const std::vector< std::pair< int, int > > &partCompactFormat)
 
static void ChangeReferenceFromGlobalOfCompactFrmt (const std::vector< std::pair< int, int > > &bigInAbs, const std::vector< std::pair< int, int > > &partOfBigInAbs, std::vector< std::pair< int, int > > &partOfBigRelativeToBig, bool check=true)
 
static void ChangeReferenceToGlobalOfCompactFrmt (const std::vector< std::pair< int, int > > &bigInAbs, const std::vector< std::pair< int, int > > &partOfBigRelativeToBig, std::vector< std::pair< int, int > > &partOfBigInAbs, bool check=true)
 
static DataArrayIntComputeCornersGhost (const std::vector< int > &st, int ghostLev)
 
static std::vector
< std::vector< int > > 
ComputeSignaturePerAxisOf (const std::vector< int > &st, const std::vector< bool > &crit)
 
static int DeduceNumberOfGivenRangeInCompactFrmt (const std::vector< std::pair< int, int > > &partCompactFormat)
 
static int DeduceNumberOfGivenStructure (const std::vector< int > &st)
 
static void ExtractFieldOfBoolFrom (const std::vector< int > &st, const std::vector< bool > &fieldOfBool, const std::vector< std::pair< int, int > > &partCompactFormat, std::vector< bool > &fieldOut)
 
static DataArrayDoubleExtractFieldOfDoubleFrom (const std::vector< int > &st, const DataArrayDouble *fieldOfDbl, const std::vector< std::pair< int, int > > &partCompactFormat)
 
static int FindMinimalPartOf (int minPatchLgth, const std::vector< int > &st, const std::vector< bool > &crit, std::vector< bool > &reducedCrit, std::vector< std::pair< int, int > > &partCompactFormat)
 
static void FindTheWidestAxisOfGivenRangeInCompactFrmt (const std::vector< std::pair< int, int > > &partCompactFormat, int &axisId, int &sizeOfRange)
 
static std::vector< int > FindTranslationFrom (const std::vector< std::pair< int, int > > &startingFrom, const std::vector< std::pair< int, int > > &goingTo)
 
static std::vector< std::pair
< int, int > > 
GetCompactFrmtFromDimensions (const std::vector< int > &dims)
 
static std::vector< int > GetDimensionsFromCompactFrmt (const std::vector< std::pair< int, int > > &partCompactFormat)
 
static
INTERP_KERNEL::NormalizedCellType 
GetGeoTypeGivenMeshDimension (int meshDim)
 
static void GetPosFromId (int eltId, int meshDim, const int *split, int *res)
 
static std::vector< int > GetSplitVectFromStruct (const std::vector< int > &strct)
 
static std::vector< std::pair
< int, int > > 
IntersectRanges (const std::vector< std::pair< int, int > > &r1, const std::vector< std::pair< int, int > > &r2)
 
static bool IsPartStructured (const int *startIds, const int *stopIds, const std::vector< int > &st, std::vector< std::pair< int, int > > &partCompactFormat)
 
static void MultiplyPartOf (const std::vector< int > &st, const std::vector< std::pair< int, int > > &part, double factor, DataArrayDouble *da)
 
static void MultiplyPartOfByGhost (const std::vector< int > &st, const std::vector< std::pair< int, int > > &part, int ghostSize, double factor, DataArrayDouble *da)
 
static void PutInGhostFormat (int ghostSize, const std::vector< int > &st, const std::vector< std::pair< int, int > > &part, std::vector< int > &stWithGhost, std::vector< std::pair< int, int > > &partWithGhost)
 
static void SwitchOnIdsFrom (const std::vector< int > &st, const std::vector< std::pair< int, int > > &partCompactFormat, std::vector< bool > &vectToSwitchOn)
 
static std::vector< std::pair
< int, int > > 
TranslateCompactFrmt (const std::vector< std::pair< int, int > > &part, const std::vector< int > &translation)
 
- Static Public Member Functions inherited from MEDCoupling::MEDCouplingMesh
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

 MEDCouplingStructuredMesh ()
 
 MEDCouplingStructuredMesh (const MEDCouplingStructuredMesh &other, bool deepCopy)
 
 ~MEDCouplingStructuredMesh ()
 
- Protected Member Functions inherited from MEDCoupling::MEDCouplingMesh
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 ()
 

Static Protected Member Functions

static int ZipNodeStructure (const int *nodeStBg, const int *nodeStEnd, int zipNodeSt[3])
 

Constructor & Destructor Documentation

MEDCouplingStructuredMesh::MEDCouplingStructuredMesh ( )
protected
MEDCouplingStructuredMesh::MEDCouplingStructuredMesh ( const MEDCouplingStructuredMesh other,
bool  deepCopy 
)
protected
MEDCouplingStructuredMesh::~MEDCouplingStructuredMesh ( )
protected

Member Function Documentation

std::set< INTERP_KERNEL::NormalizedCellType > MEDCouplingStructuredMesh::getAllGeoTypes ( ) const
virtual
int MEDCouplingStructuredMesh::getNumberOfCellsWithType ( INTERP_KERNEL::NormalizedCellType  type) const
virtual
DataArrayInt * MEDCouplingStructuredMesh::computeEffectiveNbOfNodesPerCell ( ) const
virtual

This method computes effective number of nodes per cell. That is to say nodes appearing several times in nodal connectivity of a cell, will be counted only once here whereas it will be counted several times in MEDCouplingMesh::computeNbOfNodesPerCell method. Here for structured mesh it returns exactly as MEDCouplingStructuredMesh::computeNbOfNodesPerCell does.

Returns
DataArrayInt * - new object to be deallocated by the caller.

Implements MEDCoupling::MEDCouplingMesh.

References computeNbOfNodesPerCell().

std::vector< int > MEDCouplingStructuredMesh::getLocationFromCellId ( int  cellId) const

This method returns for a cell which id is cellId the location (locX,locY,locZ) of this cell in this.

Parameters
[in]cellId
Returns
- A vector of size this->getMeshDimension()
Exceptions
ifcellId not in [ 0, this->getNumberOfCells() )

References getCellGridStructure(), getMeshDimension(), GetPosFromId(), and GetSplitVectFromStruct().

std::vector< int > MEDCouplingStructuredMesh::getLocationFromNodeId ( int  nodeId) const

This method returns for a node which id is nodeId the location (locX,locY,locZ) of this node in this.

Parameters
[in]nodeId
Returns
- A vector of size this->getSpaceDimension()
Exceptions
ifcellId not in [ 0, this->getNumberOfNodes() )

References getNodeGridStructure(), GetPosFromId(), MEDCoupling::MEDCouplingMesh::getSpaceDimension(), and GetSplitVectFromStruct().

void MEDCouplingStructuredMesh::getNodeIdsOfCell ( int  cellId,
std::vector< int > &  conn 
) const
virtual
void MEDCouplingStructuredMesh::copyTinyStringsFrom ( const MEDCouplingMesh other)
virtual

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

Exceptions
ifother and this have not same mesh type.

Reimplemented from MEDCoupling::MEDCouplingMesh.

References MEDCoupling::MEDCouplingMesh::copyTinyStringsFrom().

Referenced by MEDCoupling::MEDCouplingCurveLinearMesh::copyTinyStringsFrom(), MEDCoupling::MEDCouplingCMesh::copyTinyStringsFrom(), and MEDCoupling::MEDCouplingIMesh::copyTinyStringsFrom().

bool MEDCouplingStructuredMesh::isEqualIfNotWhy ( const MEDCouplingMesh other,
double  prec,
std::string &  reason 
) const
virtual
std::vector< int > MEDCouplingStructuredMesh::getDistributionOfTypes ( ) const
virtual
DataArrayInt * MEDCouplingStructuredMesh::checkTypeConsistencyAndContig ( const std::vector< int > &  code,
const std::vector< const DataArrayInt * > &  idsPerType 
) const
virtual

This method tries to minimize at most the number of deep copy. So if idsPerType is not empty it can be returned directly (without copy, but with ref count incremented) in return.

See MEDCouplingUMesh::checkTypeConsistencyAndContig for more information

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::DataArrayInt::checkAllIdsInRange(), getNumberOfCells(), MEDCoupling::DataArray::getNumberOfComponents(), getTypeOfCell(), and MEDCoupling::RefCountObjectOnly::incrRef().

void MEDCouplingStructuredMesh::splitProfilePerType ( const DataArrayInt profile,
std::vector< int > &  code,
std::vector< DataArrayInt * > &  idsInPflPerType,
std::vector< DataArrayInt * > &  idsPerType 
) const
virtual

This method is the opposite of MEDCouplingUMesh::checkTypeConsistencyAndContig method. Given a list of cells in profile it returns a list of sub-profiles sorted by geo type. The result is put in the array idsPerType. In the returned parameter code, foreach i code[3*i+2] refers (if different from -1) to a location into the idsPerType. This method has 1 input profile and 3 outputs code idsInPflPerType and idsPerType.

Parameters
[out]codeis a vector of size 3*n where n is the number of different geometric type in this reduced to the profile profile. code has exactly the same semantic than in MEDCouplingUMesh::checkTypeConsistencyAndContig method.
[out]idsInPflPerTypeis a vector of size of different geometric type in the subpart defined by profile of this ( equal to code.size()/3). For each i, idsInPflPerType[i] stores the tuple ids in profile that correspond to the geometric type code[3*i+0]
[out]idsPerTypeis a vector of size of different sub profiles needed to be defined to represent the profile profile for a given geometric type. This vector can be empty in case of all geometric type cells are fully covered in ascending in the given input profile.
Warning
for performance reasons no deep copy will be performed, if profile can been used as this in output parameters idsInPflPerType and idsPerType.
Exceptions
ifprofile has not exactly one component. It throws too, if profile contains some values not in [0,getNumberOfCells()) or if this is not fully defined

Example1:

  • Before this has 3 cells profile contains [0,1,2]
  • After code contains [NORM_...,nbCells,-1], idsInPflPerType [[0,1,2]] and idsPerType is empty

Example2:

  • Before this has 3 cells profile contains [1,2]
  • After code contains [NORM_...,nbCells,0], idsInPflPerType [[0,1]] and idsPerType is [[1,2]]

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::DataArrayInt::checkAllIdsInRange(), MEDCoupling::DataArrayInt::deepCopy(), getNumberOfCells(), MEDCoupling::DataArray::getNumberOfComponents(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), getTypeOfCell(), MEDCoupling::DataArrayTemplate< T >::isAllocated(), MEDCoupling::DataArrayInt::isIota(), and MEDCoupling::DataArrayInt::Range().

MEDCoupling1SGTUMesh * MEDCouplingStructuredMesh::build1SGTUnstructured ( ) const

Creates a new unstructured mesh (MEDCoupling1SGTUMesh) from this structured one.

In the returned mesh, the nodes are ordered with the first axis varying first: (X0,Y0), (X1,Y0), ... (X0,Y1), (X1,Y1), ... and the cells are ordered with the same logic, i.e. in (i,j) notation: (0,0), (1,0), (2,0), ... (0,1), (1,1), ...

Returns
MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthis->getMeshDimension() is not among [1,2,3].

References Build1GTNodalConnectivity(), MEDCoupling::MEDCouplingMesh::copyTinyInfoFrom(), MEDCoupling::MEDCouplingMesh::getCoordinatesAndOwner(), GetGeoTypeGivenMeshDimension(), getMeshDimension(), MEDCoupling::MEDCouplingMesh::getName(), getNodeGridStructure(), getSpaceDimensionOnNodeStruct(), MEDCoupling::MEDCoupling1SGTUMesh::New(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingPointSet::setCoords(), and MEDCoupling::MEDCoupling1SGTUMesh::setNodalConnectivity().

Referenced by buildUnstructured().

MEDCouplingUMesh * MEDCouplingStructuredMesh::buildUnstructured ( ) const
virtual

Creates a new unstructured mesh (MEDCouplingUMesh) from this structured one.

In the returned mesh, the nodes are ordered with the first axis varying first: (X0,Y0), (X1,Y0), ... (X0,Y1), (X1,Y1), ... and the cells are ordered with the same logic, i.e. in (i,j) notation: (0,0), (1,0), (2,0), ... (0,1), (1,1), ...

Returns
MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthis->getMeshDimension() is not among [1,2,3].

Implements MEDCoupling::MEDCouplingMesh.

References build1SGTUnstructured(), and MEDCoupling::MEDCoupling1SGTUMesh::buildUnstructured().

Referenced by MEDCoupling::MEDCouplingUMesh::Build1DMeshFromCoords(), buildPart(), buildPartAndReduceNodes(), and MEDCoupling::MEDCoupling1SGTUMesh::structurizeMe().

MEDCouplingMesh * MEDCouplingStructuredMesh::buildPart ( const int *  start,
const int *  end 
) const
virtual

Creates a new MEDCouplingUMesh containing a part of cells of this mesh. The cells to include to the result mesh are specified by an array of cell ids.

Parameters
[in]start- an array of cell ids to include to the result mesh.
[in]end- specifies the end of the array start, so that the last value of start is end[ -1 ].
Returns
MEDCouplingMesh * - a new instance of MEDCouplingUMesh. The caller is to delete this mesh using decrRef() as it is no more needed.

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::MEDCouplingPointSet::buildPart(), and buildUnstructured().

DataArrayInt * MEDCouplingStructuredMesh::simplexize ( int  policy)
virtual
MEDCouplingFieldDouble * MEDCouplingStructuredMesh::buildOrthogonalField ( ) const
virtual
void MEDCouplingStructuredMesh::getReverseNodalConnectivity ( DataArrayInt revNodal,
DataArrayInt revNodalIndx 
) const
virtual
MEDCoupling1SGTUMesh * MEDCouplingStructuredMesh::build1SGTSubLevelMesh ( ) const
int MEDCouplingStructuredMesh::getCellIdFromPos ( int  i,
int  j,
int  k 
) const

Returns a cell id by its (i,j,k) index. The cell is located between the i-th and ( i + 1 )-th nodes along X axis etc.

Parameters
[in]i- a index of node coordinates array along X axis.
[in]j- a index of node coordinates array along Y axis.
[in]k- a index of node coordinates array along Z axis.
Returns
int - a cell id in this mesh.

References getMeshDimension(), and getSplitCellValues().

Referenced by MEDCoupling::MEDCouplingFieldDiscretizationP0::getValueOnPos().

int MEDCouplingStructuredMesh::getNodeIdFromPos ( int  i,
int  j,
int  k 
) const

Returns a node id by its (i,j,k) index.

Parameters
[in]i- a index of node coordinates array along X axis.
[in]j- a index of node coordinates array along Y axis.
[in]k- a index of node coordinates array along Z axis.
Returns
int - a node id in this mesh.

References MEDCoupling::MEDCouplingMesh::getSpaceDimension(), and getSplitNodeValues().

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

int MEDCouplingStructuredMesh::getSpaceDimensionOnNodeStruct ( ) const

This method returns the space dimension by only considering the node grid structure. For cartesian mesh the returned value is equal to those returned by getSpaceDimension. But for curvelinear is could be different !

References getNodeGridStructure().

Referenced by build1SGTUnstructured().

virtual void MEDCoupling::MEDCouplingStructuredMesh::getNodeGridStructure ( int *  res) const
pure virtual
double MEDCouplingStructuredMesh::computeSquareness ( ) const

This method returns the squareness of this (quadrature). this is expected to be with a mesh dimension equal to 2 or 3.

References getCellGridStructure().

virtual MEDCouplingStructuredMesh* MEDCoupling::MEDCouplingStructuredMesh::buildStructuredSubPart ( const std::vector< std::pair< int, int > > &  cellPart) const
pure virtual
std::vector< int > MEDCouplingStructuredMesh::GetSplitVectFromStruct ( const std::vector< int > &  strct)
static

Given a struct strct it returns a split vector [1,strct[0],strct[0]*strct[1]...] This decomposition allows to quickly find i,j,k given a global id.

Referenced by getLocationFromCellId(), getLocationFromNodeId(), getSplitCellValues(), and getSplitNodeValues().

bool MEDCouplingStructuredMesh::IsPartStructured ( const int *  startIds,
const int *  stopIds,
const std::vector< int > &  st,
std::vector< std::pair< int, int > > &  partCompactFormat 
)
static

This method states if given part ids [ startIds, stopIds) and a structure st returns if it can be considered as a structured dataset. If true is returned partCompactFormat will contain the information to build the corresponding part.

See Also
MEDCouplingStructuredMesh::BuildExplicitIdsFrom, MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt

References GetPosFromId().

Referenced by buildPartAndReduceNodes().

std::vector< int > MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt ( const std::vector< std::pair< int, int > > &  partCompactFormat)
static
std::vector< std::pair< int, int > > MEDCouplingStructuredMesh::GetCompactFrmtFromDimensions ( const std::vector< int > &  dims)
static
std::vector< std::pair< int, int > > MEDCouplingStructuredMesh::IntersectRanges ( const std::vector< std::pair< int, int > > &  r1,
const std::vector< std::pair< int, int > > &  r2 
)
static

This method returns the intersection zone of two ranges (in compact format) r1 and r2. This method will throw exception if on one axis the intersection is empty.

See Also
AreRangesIntersect
bool MEDCouplingStructuredMesh::AreRangesIntersect ( const std::vector< std::pair< int, int > > &  r1,
const std::vector< std::pair< int, int > > &  r2 
)
static

This method states if r1 and r2 do overlap of not. If yes you can call IntersectRanges to know the intersection area.

See Also
IntersectRanges
void MEDCouplingStructuredMesh::SwitchOnIdsFrom ( const std::vector< int > &  st,
const std::vector< std::pair< int, int > > &  partCompactFormat,
std::vector< bool > &  vectToSwitchOn 
)
static

This method is close to BuildExplicitIdsFrom except that instead of returning a DataArrayInt instance containing explicit ids it enable elems in the vector of booleans (for performance reasons). As it is method for performance, this method is not available in python.

Parameters
[in]stThe entity structure.
[in]partCompactFormatThe compact subpart to be enabled.
[in,out]vectToSwitchOnVector which fetched items are enabled.
See Also
MEDCouplingStructuredMesh::BuildExplicitIdsFrom, ExtractFieldOfBoolFrom

References DeduceNumberOfGivenStructure(), and GetDimensionsFromCompactFrmt().

Referenced by MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildCellFieldOnRecurseWithoutOverlapWithoutGhost(), and MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured().

void MEDCouplingStructuredMesh::ExtractFieldOfBoolFrom ( const std::vector< int > &  st,
const std::vector< bool > &  fieldOfBool,
const std::vector< std::pair< int, int > > &  partCompactFormat,
std::vector< bool > &  fieldOut 
)
static

Obviously this method is NOT wrapped in python. This method is close to SwitchOnIdsFrom except that here, a sub field fieldOut is built starting from the input field fieldOfBool having the structure st. The extraction is defined by partCompactFormat.

Parameters
[in]stThe entity structure.
[in]fieldOfBoolfield of booleans having the size equal to MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(st).
[in]partCompactFormatThe compact subpart to be enabled.
[out]fieldOutthe result of the extraction.
See Also
MEDCouplingStructuredMesh::BuildExplicitIdsFrom, SwitchOnIdsFrom, ExtractFieldOfDoubleFrom

References DeduceNumberOfGivenStructure(), and GetDimensionsFromCompactFrmt().

Referenced by FindMinimalPartOf().

DataArrayDouble * MEDCouplingStructuredMesh::ExtractFieldOfDoubleFrom ( const std::vector< int > &  st,
const DataArrayDouble fieldOfDbl,
const std::vector< std::pair< int, int > > &  partCompactFormat 
)
static

This method is close to SwitchOnIdsFrom except that here, a sub field fieldOut is built starting from the input field fieldOfDbl having the structure st. The extraction is defined by partCompactFormat.

Parameters
[in]stThe entity structure.
[in]fieldOfDblfield of doubles having a number of tuples equal to MEDCouplingStructuredMesh::DeduceNumberOfGivenStructure(st).
[in]partCompactFormatThe compact subpart to be enabled.
Returns
DataArrayDouble * -the result of the extraction.
See Also
MEDCouplingStructuredMesh::BuildExplicitIdsFrom, SwitchOnIdsFrom, ExtractFieldOfBoolFrom

References MEDCoupling::DataArrayTemplate< T >::begin(), DeduceNumberOfGivenStructure(), GetDimensionsFromCompactFrmt(), MEDCoupling::DataArray::getNumberOfComponents(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::isAllocated(), and MEDCoupling::DataArrayDouble::New().

Referenced by MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom().

void MEDCouplingStructuredMesh::AssignPartOfFieldOfDoubleUsing ( const std::vector< int > &  st,
DataArrayDouble fieldOfDbl,
const std::vector< std::pair< int, int > > &  partCompactFormat,
const DataArrayDouble other 
)
static

This method assign a part of values in fieldOfDbl using entirely values of other.

Parameters
[in]st- the structure of fieldOfDbl.
[in,out]fieldOfDbl- the array that will be partially filled using other.
[in]partCompactFormat- the specification of the part.
[in]other- the array that will be used to fill fieldOfDbl.

References MEDCoupling::MEDCouplingIMesh::CondenseFineToCoarse().

void MEDCouplingStructuredMesh::ChangeReferenceFromGlobalOfCompactFrmt ( const std::vector< std::pair< int, int > > &  bigInAbs,
const std::vector< std::pair< int, int > > &  partOfBigInAbs,
std::vector< std::pair< int, int > > &  partOfBigRelativeToBig,
bool  check = true 
)
static

This method changes the reference of a part of structured mesh partOfBigInAbs define in absolute reference to a new reference bigInAbs. So this method only performs a translation by doing partOfBigRelativeToBig = partOfBigInAbs - bigInAbs This method also checks (if check=true) that partOfBigInAbs is included in bigInAbs. This method is useful to extract a part from a field lying on a big mesh.

See Also
ChangeReferenceToGlobalOfCompactFrmt, BuildExplicitIdsFrom, SwitchOnIdsFrom, ExtractFieldOfBoolFrom, ExtractFieldOfDoubleFrom
void MEDCouplingStructuredMesh::ChangeReferenceToGlobalOfCompactFrmt ( const std::vector< std::pair< int, int > > &  bigInAbs,
const std::vector< std::pair< int, int > > &  partOfBigRelativeToBig,
std::vector< std::pair< int, int > > &  partOfBigInAbs,
bool  check = true 
)
static
std::vector< std::pair< int, int > > MEDCouplingStructuredMesh::TranslateCompactFrmt ( const std::vector< std::pair< int, int > > &  part,
const std::vector< int > &  translation 
)
static

This method performs a translation (defined by translation) of part and returns the result of translated part.

See Also
FindTranslationFrom
std::vector< int > MEDCouplingStructuredMesh::FindTranslationFrom ( const std::vector< std::pair< int, int > > &  startingFrom,
const std::vector< std::pair< int, int > > &  goingTo 
)
static
DataArrayInt * MEDCouplingStructuredMesh::BuildExplicitIdsFrom ( const std::vector< int > &  st,
const std::vector< std::pair< int, int > > &  partCompactFormat 
)
static
void MEDCouplingStructuredMesh::MultiplyPartOf ( const std::vector< int > &  st,
const std::vector< std::pair< int, int > > &  part,
double  factor,
DataArrayDouble da 
)
static

This method multiplies by factor values in tuples located by part in da.

Parameters
[in]st- the structure of grid ( without considering ghost cells).
[in]part- the part in the structure ( without considering ghost cells) contained in grid whose structure is defined by st.
[in]factor- the factor, the tuples in da will be multiply by.
[in,out]da- The DataArray in wich only tuples specified by part will be modified.
See Also
BuildExplicitIdsFrom

References DeduceNumberOfGivenStructure(), MEDCoupling::DataArray::getNumberOfComponents(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::getPointer(), and MEDCoupling::DataArrayTemplate< T >::isAllocated().

Referenced by MEDCoupling::MEDCouplingCartesianAMRMeshGen::fillCellFieldComingFromPatch(), and MultiplyPartOfByGhost().

void MEDCouplingStructuredMesh::MultiplyPartOfByGhost ( const std::vector< int > &  st,
const std::vector< std::pair< int, int > > &  part,
int  ghostSize,
double  factor,
DataArrayDouble da 
)
static

This method multiplies by factor values in tuples located by part in da.

Parameters
[in]st- the structure of grid ( without considering ghost cells).
[in]part- the part in the structure ( without considering ghost cells) contained in grid whose structure is defined by st.
[in]ghostSize- ghostSize must be >= 0.
[in]factor- the factor, the tuples in da will be multiply by.
[in,out]da- The DataArray in wich only tuples specified by part will be modified.
See Also
MultiplyPartOf, PutInGhostFormat

References MultiplyPartOf(), and PutInGhostFormat().

Referenced by MEDCoupling::MEDCouplingCartesianAMRMeshGen::fillCellFieldComingFromPatchGhost().

void MEDCouplingStructuredMesh::PutInGhostFormat ( int  ghostSize,
const std::vector< int > &  st,
const std::vector< std::pair< int, int > > &  part,
std::vector< int > &  stWithGhost,
std::vector< std::pair< int, int > > &  partWithGhost 
)
static

This method multiplies by factor values in tuples located by part in da.

Parameters
[in]st- the structure of grid ( without considering ghost cells).
[in]part- the part in the structure ( without considering ghost cells) contained in grid whose structure is defined by st.
[in]ghostSize- ghostSize must be >= 0.
[out]stWithGhost- the structure considering ghost cells.
[out]partWithGhost- the part considering the ghost cells.
See Also
MultiplyPartOf, PutInGhostFormat

References ApplyGhostOnCompactFrmt().

Referenced by MultiplyPartOfByGhost().

void MEDCouplingStructuredMesh::ApplyGhostOnCompactFrmt ( std::vector< std::pair< int, int > > &  partBeforeFact,
int  ghostSize 
)
static
Parameters
[in,out]partBeforeFact- the part of a image mesh in compact format that will be put in ghost reference.
[in]ghostSize- the ghost size of zone for all axis.

Referenced by MEDCoupling::MEDCouplingAMRAttribute::buildCellFieldOnWithoutGhost(), MEDCoupling::MEDCouplingCartesianAMRMeshGen::extractGhostFrom(), PutInGhostFormat(), and MEDCoupling::MEDCouplingAMRAttribute::writeVTHB().

DataArrayInt * MEDCouplingStructuredMesh::Build1GTNodalConnectivity ( const int *  nodeStBg,
const int *  nodeStEnd 
)
static
Returns
DataArrayInt * - newly allocated instance of nodal connectivity compatible for MEDCoupling1SGTMesh instance

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayInt::New(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::DataArrayTemplate< T >::setIJ(), and ZipNodeStructure().

Referenced by build1SGTUnstructured().

DataArrayInt * MEDCouplingStructuredMesh::Build1GTNodalConnectivityOfSubLevelMesh ( const int *  nodeStBg,
const int *  nodeStEnd 
)
static

Referenced by build1SGTSubLevelMesh().

DataArrayInt * MEDCouplingStructuredMesh::ComputeCornersGhost ( const std::vector< int > &  st,
int  ghostLev 
)
static

This method returns the list of ids sorted ascendingly of entities that are in the corner in ghost zone. The ids are returned in a newly created DataArrayInt having a single component.

Parameters
[in]st- The structure without ghost cells.
[in]ghostLev- The size of the ghost zone (>=0)
Returns
DataArrayInt * - The DataArray containing all the ids the caller is to deallocate.

References MEDCoupling::DataArrayInt::New().

int MEDCouplingStructuredMesh::DeduceNumberOfGivenRangeInCompactFrmt ( const std::vector< std::pair< int, int > > &  partCompactFormat)
static

This method retrieves the number of entities (it can be cells or nodes) given a range in compact standard format used in methods like BuildExplicitIdsFrom,IsPartStructured.

See Also
BuildExplicitIdsFrom,IsPartStructured

Referenced by MEDCoupling::MEDCouplingIMesh::CondenseFineToCoarse(), and MEDCoupling::MEDCouplingIMesh::SpreadCoarseToFine().

void MEDCouplingStructuredMesh::FindTheWidestAxisOfGivenRangeInCompactFrmt ( const std::vector< std::pair< int, int > > &  partCompactFormat,
int &  axisId,
int &  sizeOfRange 
)
static
int MEDCouplingStructuredMesh::FindMinimalPartOf ( int  minPatchLgth,
const std::vector< int > &  st,
const std::vector< bool > &  crit,
std::vector< bool > &  reducedCrit,
std::vector< std::pair< int, int > > &  partCompactFormat 
)
static

This method is NOT wrapped in python because it has no sense in python (for performance reasons). This method starts from a structured mesh with structure st on which a boolean field crit is set. This method find for such minimalist information of mesh and field which is the part of the mesh, given by the range per axis in output parameter partCompactFormat that contains all the True in crit. The returned vector of boolean is the field reduced to that part. So the number of True is equal in st and in returned vector of boolean.

Parameters
[in]minPatchLgth- minimum length that the patch may have for all directions.
[in]st- The structure per axis of the structured mesh considered.
[in]crit- The field of boolean (for performance reasons) lying on the mesh defined by st.
[out]partCompactFormat- The minimal part of st containing all the true of crit.
[out]reducedCrit- The reduction of criterion on partCompactFormat.
Returns
- The number of True in st (that is equal to those in reducedCrit)

References DeduceNumberOfGivenStructure(), ExtractFieldOfBoolFrom(), and GetDimensionsFromCompactFrmt().

Referenced by MEDCoupling::MEDCouplingCartesianAMRMeshGen::createPatchesFromCriterion().

std::vector< std::vector< int > > MEDCouplingStructuredMesh::ComputeSignaturePerAxisOf ( const std::vector< int > &  st,
const std::vector< bool > &  crit 
)
static

This method is NOT wrapped in python. This method considers crit input parameter as a matrix having dimensions specified by st. This method returns for each axis the signature, that is to say the number of elems equal to true in crit along this axis.

int MEDCouplingStructuredMesh::ZipNodeStructure ( const int *  nodeStBg,
const int *  nodeStEnd,
int  zipNodeSt[3] 
)
staticprotected

This method computes given the nodal structure defined by [ nodeStBg , nodeStEnd ) the zipped form. std::distance( nodeStBg, nodeStEnd ) is equal to the space dimension. The returned value is equal to the meshDimension (or the zipped spaceDimension).

Parameters
[out]zipNodeSt- The zipped node strucutre
Returns
int - the

Referenced by Build1GTNodalConnectivity().