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

Public Member Functions

MEDCouplingMeshdeepCpy () const
MEDCouplingUMeshclone (bool recDeepCpy) const
void updateTime () const
MEDCouplingMeshType getType () const
bool isEqual (const MEDCouplingMesh *other, double prec) const
bool isEqualWithoutConsideringStr (const MEDCouplingMesh *other, double prec) const
void checkDeepEquivalWith (const MEDCouplingMesh *other, int cellCompPol, double prec, DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const throw (INTERP_KERNEL::Exception)
void checkDeepEquivalOnSameNodesWith (const MEDCouplingMesh *other, int cellCompPol, double prec, DataArrayInt *&cellCor) const throw (INTERP_KERNEL::Exception)
void checkFastEquivalWith (const MEDCouplingMesh *other, double prec) const throw (INTERP_KERNEL::Exception)
void checkCoherency () const throw (INTERP_KERNEL::Exception)
void checkCoherency1 (double eps=1e-12) const throw (INTERP_KERNEL::Exception)
void checkCoherency2 (double eps=1e-12) const throw (INTERP_KERNEL::Exception)
void setMeshDimension (int meshDim)
void allocateCells (int nbOfCells)
void insertNextCell (INTERP_KERNEL::NormalizedCellType type, int size, const int *nodalConnOfCell) throw (INTERP_KERNEL::Exception)
void finishInsertingCells ()
MEDCouplingUMeshCellIteratorcellIterator ()
MEDCouplingUMeshCellByTypeEntrycellsByType () throw (INTERP_KERNEL::Exception)
const std::set
< INTERP_KERNEL::NormalizedCellType > & 
getAllTypes () const
std::set
< INTERP_KERNEL::NormalizedCellType
getAllGeoTypes () const
std::set
< INTERP_KERNEL::NormalizedCellType
getTypesOfPart (const int *begin, const int *end) const throw (INTERP_KERNEL::Exception)
void setConnectivity (DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true)
const DataArrayIntgetNodalConnectivity () const
const DataArrayIntgetNodalConnectivityIndex () const
DataArrayIntgetNodalConnectivity ()
DataArrayIntgetNodalConnectivityIndex ()
INTERP_KERNEL::NormalizedCellType getTypeOfCell (int cellId) const
int getNumberOfCellsWithType (INTERP_KERNEL::NormalizedCellType type) const
void getNodeIdsOfCell (int cellId, std::vector< int > &conn) const
DataArrayIntgetCellIdsFullyIncludedInNodeIds (const int *partBg, const int *partEnd) const
std::string simpleRepr () const
std::string advancedRepr () const
std::string reprConnectivityOfThis () const
MEDCouplingUMeshbuildSetInstanceFromThis (int spaceDim) const throw (INTERP_KERNEL::Exception)
int getNumberOfNodesInCell (int cellId) const
int getNumberOfCells () const
int getMeshDimension () const
int getMeshLength () const
void computeTypes ()
void getTinySerializationInformation (std::vector< double > &tinyInfoD, std::vector< int > &tinyInfo, std::vector< std::string > &littleStrings) const
bool isEmptyMesh (const std::vector< int > &tinyInfo) const
void resizeForUnserialization (const std::vector< int > &tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector< std::string > &littleStrings) const
void serialize (DataArrayInt *&a1, DataArrayDouble *&a2) const
void unserialization (const std::vector< double > &tinyInfoD, const std::vector< int > &tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector< std::string > &littleStrings)
std::string getVTKDataSetType () const throw (INTERP_KERNEL::Exception)
void writeVTKLL (std::ostream &ofs, const std::string &cellData, const std::string &pointData) const throw (INTERP_KERNEL::Exception)
bool areCellsEqual (int cell1, int cell2, int compType) const
bool areCellsEqual0 (int cell1, int cell2) const
bool areCellsEqual1 (int cell1, int cell2) const
bool areCellsEqual2 (int cell1, int cell2) const
bool areCellsFrom2MeshEqual (const MEDCouplingUMesh *other, int cellId, double prec) const
void convertToPolyTypes (const int *cellIdsToConvertBg, const int *cellIdsToConvertEnd)
void convertAllToPoly ()
void convertExtrudedPolyhedra () throw (INTERP_KERNEL::Exception)
void unPolyze ()
DataArrayIntgetNodeIdsInUse (int &nbrOfNodesInUse) const throw (INTERP_KERNEL::Exception)
DataArrayIntzipCoordsTraducer () throw (INTERP_KERNEL::Exception)
DataArrayIntzipConnectivityTraducer (int compType) throw (INTERP_KERNEL::Exception)
bool areCellsIncludedIn (const MEDCouplingUMesh *other, int compType, DataArrayInt *&arr) const throw (INTERP_KERNEL::Exception)
void getReverseNodalConnectivity (DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const throw (INTERP_KERNEL::Exception)
MEDCouplingUMeshbuildDescendingConnectivity (DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw (INTERP_KERNEL::Exception)
MEDCouplingUMeshbuildDescendingConnectivity2 (DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const throw (INTERP_KERNEL::Exception)
void computeNeighborsOfCells (DataArrayInt *&neighbors, DataArrayInt *&neighborsIdx) const throw (INTERP_KERNEL::Exception)
DataArrayIntmergeNodes (double precision, bool &areNodesMerged, int &newNbOfNodes)
DataArrayIntmergeNodes2 (double precision, bool &areNodesMerged, int &newNbOfNodes)
void tryToShareSameCoordsPermute (const MEDCouplingPointSet &other, double epsilon) throw (INTERP_KERNEL::Exception)
MEDCouplingPointSetbuildPartOfMySelf (const int *begin, const int *end, bool keepCoords) const
MEDCouplingPointSetbuildPartOfMySelfNode (const int *begin, const int *end, bool fullyIn) const
DataArrayIntgetCellIdsLyingOnNodes (const int *begin, const int *end, bool fullyIn) const
MEDCouplingPointSetbuildFacePartOfMySelfNode (const int *begin, const int *end, bool fullyIn) const
MEDCouplingUMeshbuildUnstructured () const throw (INTERP_KERNEL::Exception)
void findBoundaryNodes (std::vector< int > &nodes) const
MEDCouplingPointSetbuildBoundaryMesh (bool keepCoords) const
DataArrayIntfindCellsIdsOnBoundary () const throw (INTERP_KERNEL::Exception)
void renumberNodes (const int *newNodeNumbers, int newNbOfNodes)
void renumberNodes2 (const int *newNodeNumbers, int newNbOfNodes)
void renumberNodesInConn (const int *newNodeNumbersO2N)
void shiftNodeNumbersInConn (int delta) throw (INTERP_KERNEL::Exception)
void renumberCells (const int *old2NewBg, bool check) throw (INTERP_KERNEL::Exception)
void getCellsInBoundingBox (const double *bbox, double eps, std::vector< int > &elems) const
void getCellsInBoundingBox (const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps, std::vector< int > &elems)
MEDCouplingFieldDoublegetMeasureField (bool isAbs) const
DataArrayDoublegetPartMeasureField (bool isAbs, const int *begin, const int *end) const
MEDCouplingFieldDoublegetMeasureFieldOnNode (bool isAbs) const
MEDCouplingFieldDoublebuildOrthogonalField () const
MEDCouplingFieldDoublebuildPartOrthogonalField (const int *begin, const int *end) const
MEDCouplingFieldDoublebuildDirectionVectorField () const
MEDCouplingUMeshbuildSlice3D (const double *origin, const double *vec, double eps, DataArrayInt *&cellIds) const throw (INTERP_KERNEL::Exception)
MEDCouplingUMeshbuildSlice3DSurf (const double *origin, const double *vec, double eps, DataArrayInt *&cellIds) const throw (INTERP_KERNEL::Exception)
DataArrayIntgetCellIdsCrossingPlane (const double *origin, const double *vec, double eps) const throw (INTERP_KERNEL::Exception)
bool isContiguous1D () const throw (INTERP_KERNEL::Exception)
void project1D (const double *pt, const double *v, double eps, double *res) const
int getCellContainingPoint (const double *pos, double eps) const
void getCellsContainingPoint (const double *pos, double eps, std::vector< int > &elts) const
void getCellsContainingPoints (const double *pos, int nbOfPoints, double eps, std::vector< int > &elts, std::vector< int > &eltsIndex) const
void checkButterflyCells (std::vector< int > &cells, double eps=1e-12) const
void findAndCorrectBadOriented3DExtrudedCells (std::vector< int > &cells) throw (INTERP_KERNEL::Exception)
void getBoundingBoxForBBTree (std::vector< double > &bbox) const
MEDCouplingUMeshbuildExtrudedMesh (const MEDCouplingUMesh *mesh1D, int policy)
bool isFullyQuadratic () const
bool isPresenceOfQuadratic () const
void convertQuadraticCellsToLinear () throw (INTERP_KERNEL::Exception)
void tessellate2D (double eps) throw (INTERP_KERNEL::Exception)
void tessellate2DCurve (double eps) throw (INTERP_KERNEL::Exception)
DataArrayIntsimplexize (int policy) throw (INTERP_KERNEL::Exception)
bool areOnlySimplexCells () const throw (INTERP_KERNEL::Exception)
void convertDegeneratedCells () throw (INTERP_KERNEL::Exception)
void are2DCellsNotCorrectlyOriented (const double *vec, bool polyOnly, std::vector< int > &cells) const throw (INTERP_KERNEL::Exception)
void orientCorrectly2DCells (const double *vec, bool polyOnly) throw (INTERP_KERNEL::Exception)
void arePolyhedronsNotCorrectlyOriented (std::vector< int > &cells) const throw (INTERP_KERNEL::Exception)
void orientCorrectlyPolyhedrons () throw (INTERP_KERNEL::Exception)
void getFastAveragePlaneOfThis (double *vec, double *pos) const throw (INTERP_KERNEL::Exception)
MEDCouplingFieldDoublegetEdgeRatioField () const throw (INTERP_KERNEL::Exception)
MEDCouplingFieldDoublegetAspectRatioField () const throw (INTERP_KERNEL::Exception)
MEDCouplingFieldDoublegetWarpField () const throw (INTERP_KERNEL::Exception)
MEDCouplingFieldDoublegetSkewField () const throw (INTERP_KERNEL::Exception)
std::vector< int > getDistributionOfTypes () const throw (INTERP_KERNEL::Exception)
DataArrayIntcheckTypeConsistencyAndContig (const std::vector< int > &code, const std::vector< const DataArrayInt * > &idsPerType) const throw (INTERP_KERNEL::Exception)
void splitProfilePerType (const DataArrayInt *profile, std::vector< int > &code, std::vector< DataArrayInt * > &idsInPflPerType, std::vector< DataArrayInt * > &idsPerType) const throw (INTERP_KERNEL::Exception)
MEDCouplingUMeshemulateMEDMEMBDC (const MEDCouplingUMesh *nM1LevMesh, DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *&revDesc, DataArrayInt *&revDescIndx, DataArrayInt *&nM1LevMeshIds, DataArrayInt *&meshnM1Old2New) const throw (INTERP_KERNEL::Exception)
DataArrayIntsortCellsInMEDFileFrmt () throw (INTERP_KERNEL::Exception)
bool checkConsecutiveCellTypes () const
bool checkConsecutiveCellTypesAndOrder (const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd) const
DataArrayIntgetLevArrPerCellTypes (const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd, DataArrayInt *&nbPerType) const throw (INTERP_KERNEL::Exception)
DataArrayIntgetRenumArrForConsecutiveCellTypesSpec (const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd) const throw (INTERP_KERNEL::Exception)
DataArrayIntrearrange2ConsecutiveCellTypes ()
std::vector< MEDCouplingUMesh * > splitByType () const
DataArrayIntkeepCellIdsByType (INTERP_KERNEL::NormalizedCellType type, const int *begin, const int *end) const throw (INTERP_KERNEL::Exception)
DataArrayIntconvertCellArrayPerGeoType (const DataArrayInt *da) const throw (INTERP_KERNEL::Exception)
MEDCouplingUMeshkeepSpecifiedCells (INTERP_KERNEL::NormalizedCellType type, const int *idsPerGeoTypeBg, const int *idsPerGeoTypeEnd) const
std::vector< bool > getQuadraticStatus () const throw (INTERP_KERNEL::Exception)
MEDCouplingMeshmergeMyselfWith (const MEDCouplingMesh *other) const
DataArrayDoublegetBarycenterAndOwner () const
DataArrayDoublegetPartBarycenterAndOwner (const int *begin, const int *end) const
- Public Member Functions inherited from ParaMEDMEM::MEDCouplingPointSet
int getNumberOfNodes () const
int getSpaceDimension () const
void setCoords (const DataArrayDouble *coords)
const DataArrayDoublegetCoords () const
DataArrayDoublegetCoords ()
DataArrayDoublegetCoordinatesAndOwner () const
void copyTinyStringsFrom (const MEDCouplingMesh *other) throw (INTERP_KERNEL::Exception)
bool areCoordsEqual (const MEDCouplingPointSet &other, double prec) const
bool areCoordsEqualWithoutConsideringStr (const MEDCouplingPointSet &other, double prec) const
void getCoordinatesOfNode (int nodeId, std::vector< double > &coo) const throw (INTERP_KERNEL::Exception)
DataArrayIntbuildPermArrayForMergeNode (double precision, int limitNodeId, bool &areNodesMerged, int &newNbOfNodes) const
std::vector< int > getNodeIdsNearPoint (const double *pos, double eps) const throw (INTERP_KERNEL::Exception)
void getNodeIdsNearPoints (const double *pos, int nbOfNodes, double eps, std::vector< int > &c, std::vector< int > &cI) const throw (INTERP_KERNEL::Exception)
void findCommonNodes (double prec, int limitNodeId, DataArrayInt *&comm, DataArrayInt *&commIndex) const
DataArrayIntbuildNewNumberingFromCommonNodesFormat (const DataArrayInt *comm, const DataArrayInt *commIndex, int &newNbOfNodes) const
void getBoundingBox (double *bbox) const throw (INTERP_KERNEL::Exception)
void zipCoords ()
double getCaracteristicDimension () const
void rotate (const double *center, const double *vector, double angle)
void translate (const double *vector)
void scale (const double *point, double factor)
void changeSpaceDimension (int newSpaceDim, double dftVal=0.) throw (INTERP_KERNEL::Exception)
void tryToShareSameCoords (const MEDCouplingPointSet &other, double epsilon) throw (INTERP_KERNEL::Exception)
void findNodesOnPlane (const double *pt, const double *vec, double eps, std::vector< int > &nodes) const throw (INTERP_KERNEL::Exception)
void findNodesOnLine (const double *pt, const double *vec, double eps, std::vector< int > &nodes) const throw (INTERP_KERNEL::Exception)
MEDCouplingMeshbuildPart (const int *start, const int *end) const
MEDCouplingMeshbuildPartAndReduceNodes (const int *start, const int *end, DataArrayInt *&arr) const
- Public Member Functions inherited from ParaMEDMEM::MEDCouplingMesh
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
bool isStructured () const
virtual void copyTinyInfoFrom (const MEDCouplingMesh *other) throw (INTERP_KERNEL::Exception)
void checkGeoEquivalWith (const MEDCouplingMesh *other, int levOfCheck, double prec, DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const throw (INTERP_KERNEL::Exception)
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 bool areCompatibleForMerge (const MEDCouplingMesh *other) const
void writeVTK (const char *fileName) const throw (INTERP_KERNEL::Exception)
- Public Member Functions inherited from ParaMEDMEM::RefCountObject
bool decrRef () const
void incrRef () const
- Public Member Functions inherited from ParaMEDMEM::TimeLabel
TimeLabeloperator= (const TimeLabel &other)
void declareAsNew () const
unsigned int getTimeOfThis () const

Static Public Member Functions

static MEDCouplingUMeshNew ()
static MEDCouplingUMeshNew (const char *meshName, int meshDim)
static MEDCouplingUMeshBuild0DMeshFromCoords (DataArrayDouble *da) throw (INTERP_KERNEL::Exception)
static MEDCouplingUMeshMergeUMeshes (const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw (INTERP_KERNEL::Exception)
static MEDCouplingUMeshMergeUMeshes (std::vector< const MEDCouplingUMesh * > &a) throw (INTERP_KERNEL::Exception)
static MEDCouplingUMeshMergeUMeshesOnSameCoords (const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2) throw (INTERP_KERNEL::Exception)
static MEDCouplingUMeshMergeUMeshesOnSameCoords (const std::vector< const MEDCouplingUMesh * > &meshes)
static MEDCouplingUMeshFuseUMeshesOnSameCoords (const std::vector< const MEDCouplingUMesh * > &meshes, int compType, std::vector< DataArrayInt * > &corr)
static void PutUMeshesOnSameAggregatedCoords (const std::vector< MEDCouplingUMesh * > &meshes) throw (INTERP_KERNEL::Exception)
static void MergeNodesOnUMeshesSharingSameCoords (const std::vector< MEDCouplingUMesh * > &meshes, double eps) throw (INTERP_KERNEL::Exception)
static bool IsPolygonWellOriented (bool isQuadratic, const double *vec, const int *begin, const int *end, const double *coords)
static bool IsPolyhedronWellOriented (const int *begin, const int *end, const double *coords)
static void TryToCorrectPolyhedronOrientation (int *begin, int *end, const double *coords) throw (INTERP_KERNEL::Exception)
- Static Public Member Functions inherited from ParaMEDMEM::MEDCouplingPointSet
static DataArrayDoubleMergeNodesArray (const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2) throw (INTERP_KERNEL::Exception)
static DataArrayDoubleMergeNodesArray (const std::vector< const MEDCouplingPointSet * > &ms) throw (INTERP_KERNEL::Exception)
static MEDCouplingPointSetBuildInstanceFromMeshType (MEDCouplingMeshType type)
static void Rotate2DAlg (const double *center, double angle, int nbNodes, double *coords)
static void Rotate3DAlg (const double *center, const double *vect, double angle, int nbNodes, double *coords)
- Static Public Member Functions inherited from ParaMEDMEM::MEDCouplingMesh
static MEDCouplingMeshMergeMeshes (const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2) throw (INTERP_KERNEL::Exception)
static MEDCouplingMeshMergeMeshes (std::vector< const MEDCouplingMesh * > &meshes) throw (INTERP_KERNEL::Exception)

Static Public Attributes

static double EPS_FOR_POLYH_ORIENTATION = 1.e-14

Additional Inherited Members

- Protected Member Functions inherited from ParaMEDMEM::MEDCouplingPointSet
 MEDCouplingPointSet ()
 MEDCouplingPointSet (const MEDCouplingPointSet &other, bool deepCopy)
 ~MEDCouplingPointSet ()
virtual void checkFullyDefined () const =0 throw (INTERP_KERNEL::Exception)
void rotate2D (const double *center, double angle)
void rotate3D (const double *center, const double *vect, double angle)
void project2DCellOnXY (const int *startConn, const int *endConn, std::vector< double > &res) const
template<int SPACEDIM>
void findNodeIdsNearPointAlg (std::vector< double > &bbox, const double *pos, int nbNodes, double eps, std::vector< int > &c, std::vector< int > &cI) const
- Static Protected Member Functions inherited from ParaMEDMEM::MEDCouplingPointSet
static bool intersectsBoundingBox (const double *bb1, const double *bb2, int dim, double eps)
static bool intersectsBoundingBox (const INTERP_KERNEL::DirectedBoundingBox &bb1, const double *bb2, int dim, double eps)
static bool isButterfly2DCell (const std::vector< double > &res, bool isQuad, double eps)
- Protected Attributes inherited from ParaMEDMEM::MEDCouplingPointSet
DataArrayDouble_coords

Member Function Documentation

MEDCouplingUMesh * MEDCouplingUMesh::New ( )
static
MEDCouplingUMesh * MEDCouplingUMesh::New ( const char *  meshName,
int  meshDim 
)
static
MEDCouplingMesh * MEDCouplingUMesh::deepCpy ( ) const
virtual
MEDCouplingUMesh * MEDCouplingUMesh::clone ( bool  recDeepCpy) const

Referenced by deepCpy().

void MEDCouplingUMesh::updateTime ( ) const
virtual

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

Reimplemented from ParaMEDMEM::MEDCouplingPointSet.

References ParaMEDMEM::TimeLabel::updateTimeWith().

Referenced by buildExtrudedMesh(), finishInsertingCells(), orientCorrectlyPolyhedrons(), and renumberNodesInConn().

MEDCouplingMeshType ParaMEDMEM::MEDCouplingUMesh::getType ( ) const
virtual
bool MEDCouplingUMesh::isEqual ( const MEDCouplingMesh other,
double  prec 
) const
virtual

This method is a method that compares 'this' and 'other'. This method compares all attributes, even names and component names.

Reimplemented from ParaMEDMEM::MEDCouplingPointSet.

References ParaMEDMEM::MEDCouplingPointSet::isEqual(), and ParaMEDMEM::DataArrayInt::isEqual().

Referenced by ParaMEDMEM::MEDCouplingExtrudedMesh::isEqual().

bool MEDCouplingUMesh::isEqualWithoutConsideringStr ( const MEDCouplingMesh other,
double  prec 
) const
virtual
void MEDCouplingUMesh::checkDeepEquivalWith ( const MEDCouplingMesh other,
int  cellCompPol,
double  prec,
DataArrayInt *&  cellCor,
DataArrayInt *&  nodeCor 
) const throw (INTERP_KERNEL::Exception)
virtual

This method looks if 'this' and 'other' are geometrically equivalent that is to say if each cell in 'other' correspond to one cell and only one in 'this' is found regarding 'prec' parameter and 'cellCompPol' parameter.

In case of success cellCor and nodeCor are informed both.

Parameters
cellCompPolvalues are described in MEDCouplingUMesh::zipConnectivityTraducer method.
cellCoroutput array giving the correspondance of cells from 'other' to 'this'.
nodeCoroutput array giving the correspondance of nodes from 'other' to 'this'.

Implements ParaMEDMEM::MEDCouplingMesh.

References ParaMEDMEM::MEDCouplingMesh::checkFastEquivalWith(), getNumberOfCells(), and ParaMEDMEM::DataArrayInt::New().

void MEDCouplingUMesh::checkDeepEquivalOnSameNodesWith ( const MEDCouplingMesh other,
int  cellCompPol,
double  prec,
DataArrayInt *&  cellCor 
) const throw (INTERP_KERNEL::Exception)
virtual

This method looks if 'this' and 'other' are geometrically equivalent that is to say if each cell in 'other' correspond to one cell and only one in 'this' is found regarding 'prec' parameter and 'cellCompPol' parameter. The difference with MEDCouplingUMesh::checkDeepEquivalWith method is that coordinates of 'this' and 'other' are expected to be the same. If not an exception will be thrown. This method is close to MEDCouplingUMesh::areCellsIncludedIn except that this method throws exception !

In case of success cellCor are informed both.

Parameters
cellCompPolvalues are described in MEDCouplingUMesh::zipConnectivityTraducer method.
cellCoroutput array giving the correspondance of cells from 'other' to 'this'.

Implements ParaMEDMEM::MEDCouplingMesh.

References ParaMEDMEM::MEDCouplingPointSet::_coords, ParaMEDMEM::MEDCouplingMesh::checkFastEquivalWith(), getNumberOfCells(), and ParaMEDMEM::DataArrayInt::New().

void MEDCouplingUMesh::checkFastEquivalWith ( const MEDCouplingMesh other,
double  prec 
) const throw (INTERP_KERNEL::Exception)
virtual

This method checks fastly that 'this' and 'other' are equal.

Reimplemented from ParaMEDMEM::MEDCouplingMesh.

References ParaMEDMEM::MEDCouplingMesh::checkFastEquivalWith().

void MEDCouplingUMesh::checkCoherency ( ) const throw (INTERP_KERNEL::Exception)
virtual

This method checks that this is correctly designed. For example le coordinates are set, nodal connectivity. When this method returns without throwing any exception, 'this' is expected to be writable, exchangeable and to be available for most of algorithm. When a mesh has been constructed from scratch it is a good habits to call this method to check that all is in order in 'this'.

Implements ParaMEDMEM::MEDCouplingMesh.

References ParaMEDMEM::DataArray::getInfoOnComponent(), and ParaMEDMEM::DataArray::getNumberOfComponents().

Referenced by getAspectRatioField(), getEdgeRatioField(), getSkewField(), and getWarpField().

void MEDCouplingUMesh::checkCoherency1 ( double  eps = 1e-12) const throw (INTERP_KERNEL::Exception)
virtual

This method performs deeper checking in 'this' than MEDCouplingUMesh::checkCoherency does. So this method is more time-consuming. This method checks that nodal connectivity points to valid node ids. No geometrical aspects are checked here. These aspects are done in MEDCouplingUMesh::checkCoherency2.

Implements ParaMEDMEM::MEDCouplingMesh.

References INTERP_KERNEL::NORM_POLYHED.

void MEDCouplingUMesh::checkCoherency2 ( double  eps = 1e-12) const throw (INTERP_KERNEL::Exception)
virtual
void MEDCouplingUMesh::setMeshDimension ( int  meshDim)
void MEDCouplingUMesh::allocateCells ( int  nbOfCells)
void MEDCouplingUMesh::insertNextCell ( INTERP_KERNEL::NormalizedCellType  type,
int  size,
const int *  nodalConnOfCell 
) throw (INTERP_KERNEL::Exception)

Appends a cell in connectivity array.

Parameters
typetype of cell to add.
sizenumber of nodes constituting this cell.
nodalConnOfCellthe connectivity of the cell to add.
void MEDCouplingUMesh::finishInsertingCells ( )

Method to be called to cloture the insertion of cells using this->insertNextCell.

References ParaMEDMEM::TimeLabel::declareAsNew(), ParaMEDMEM::DataArrayInt::getConstPointer(), ParaMEDMEM::DataArrayInt::reAlloc(), and updateTime().

MEDCouplingUMeshCellIterator * MEDCouplingUMesh::cellIterator ( )

Entry point for iteration over cells of this. Warning the returned cell iterator should be deallocated. Useful for python users.

MEDCouplingUMeshCellByTypeEntry * MEDCouplingUMesh::cellsByType ( ) throw (INTERP_KERNEL::Exception)

Entry point for iteration over cells groups geo types per geotypes. Warning the returned cell iterator should be deallocated. If 'this' is not so that that cells are grouped by geo types this method will throw an exception. In this case MEDCouplingUMesh::sortCellsInMEDFileFrmt or MEDCouplingUMesh::rearrange2ConsecutiveCellTypes methods for example can be called before invoking this method. Useful for python users.

References checkConsecutiveCellTypes().

const std::set<INTERP_KERNEL::NormalizedCellType>& ParaMEDMEM::MEDCouplingUMesh::getAllTypes ( ) const
std::set< INTERP_KERNEL::NormalizedCellType > MEDCouplingUMesh::getAllGeoTypes ( ) const
virtual
std::set< INTERP_KERNEL::NormalizedCellType > MEDCouplingUMesh::getTypesOfPart ( const int *  begin,
const int *  end 
) const throw (INTERP_KERNEL::Exception)

This method is equivalent to MEDCouplingUMesh::getAllTypes excecpt that it returns only types of submesh which cell ids are in [begin,end). This method avoids to compute explicitely submesh to get its types.

void MEDCouplingUMesh::setConnectivity ( DataArrayInt conn,
DataArrayInt connIndex,
bool  isComputingTypes = true 
)

Method reserved for advanced users having prepared their connectivity before. Arrays 'conn' and 'connIndex' will be aggregated without any copy and their counter will be incremented.

References computeTypes(), ParaMEDMEM::TimeLabel::declareAsNew(), and ParaMEDMEM::DataArrayInt::SetArrayIn().

Referenced by convertQuadraticCellsToLinear(), ParaMEDMEM::MEDCouplingCMesh::fill1DUnstructuredMesh(), ParaMEDMEM::MEDCouplingCMesh::fill2DUnstructuredMesh(), ParaMEDMEM::MEDCouplingCMesh::fill3DUnstructuredMesh(), MergeUMeshesOnSameCoords(), and unserialization().

const DataArrayInt* ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity ( ) const
const DataArrayInt* ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex ( ) const
DataArrayInt* ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivity ( )
DataArrayInt* ParaMEDMEM::MEDCouplingUMesh::getNodalConnectivityIndex ( )
INTERP_KERNEL::NormalizedCellType MEDCouplingUMesh::getTypeOfCell ( int  cellId) const
virtual
int MEDCouplingUMesh::getNumberOfCellsWithType ( INTERP_KERNEL::NormalizedCellType  type) const
virtual

Returns nb of cells having the geometric type 'type'.

Implements ParaMEDMEM::MEDCouplingMesh.

References ParaMEDMEM::DataArrayInt::getConstPointer(), and getNumberOfCells().

void MEDCouplingUMesh::getNodeIdsOfCell ( int  cellId,
std::vector< int > &  conn 
) const
virtual

Appends the nodal connectivity in 'conn' of cell with id 'cellId'. All elements added in conn can be used by MEDCouplingUMesh::getCoordinatesOfNode method. That is to say -1 separator is omitted in returned conn.

Implements ParaMEDMEM::MEDCouplingMesh.

References ParaMEDMEM::DataArrayInt::getConstPointer().

Referenced by areCellsFrom2MeshEqual(), buildDirectionVectorField(), and ParaMEDMEM::MEDCouplingExtrudedMesh::getNodeIdsOfCell().

DataArrayInt * MEDCouplingUMesh::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 from ParaMEDMEM::MEDCouplingMesh.

References ParaMEDMEM::DataArrayInt::alloc(), ParaMEDMEM::DataArrayInt::getPointer(), and New().

std::string MEDCouplingUMesh::simpleRepr ( ) const
virtual
std::string MEDCouplingUMesh::advancedRepr ( ) const
virtual
std::string MEDCouplingUMesh::reprConnectivityOfThis ( ) const
MEDCouplingUMesh * MEDCouplingUMesh::buildSetInstanceFromThis ( int  spaceDim) const throw (INTERP_KERNEL::Exception)

This method builds a newly allocated instance (with the same name than 'this') that the caller has the responsability to deal with. This method returns an instance with all arrays allocated (connectivity, connectivity index, coordinates) but with length of these arrays set to 0. It allows to define an "empty" mesh (with nor cells nor nodes but compliant with some algos).

This method expects that 'this' has a mesh dimension set and higher or equal to 0. If not an exception will be thrown. This method analyzes the 3 arrays of 'this'. For each the following behaviour is done : if the array is null a newly one is created with number of tuples set to 0, if not the array is taken as this in the returned instance.

References New(), ParaMEDMEM::DataArrayDouble::New(), and ParaMEDMEM::DataArrayInt::New().

int MEDCouplingUMesh::getNumberOfNodesInCell ( int  cellId) const
int MEDCouplingUMesh::getNumberOfCells ( ) const
virtual

Implements ParaMEDMEM::MEDCouplingMesh.

References ParaMEDMEM::DataArray::getNumberOfTuples().

Referenced by ParaMEDMEM::MEDCouplingExtrudedMesh::advancedRepr(), areOnlySimplexCells(), buildBoundaryMesh(), buildDirectionVectorField(), buildOrthogonalField(), checkButterflyCells(), checkConsecutiveCellTypes(), checkConsecutiveCellTypesAndOrder(), checkDeepEquivalOnSameNodesWith(), checkDeepEquivalWith(), convertAllToPoly(), convertDegeneratedCells(), convertExtrudedPolyhedra(), convertQuadraticCellsToLinear(), convertToPolyTypes(), findBoundaryNodes(), getAspectRatioField(), getBarycenterAndOwner(), getBoundingBoxForBBTree(), getCellsInBoundingBox(), getDistributionOfTypes(), getEdgeRatioField(), ParaMEDMEM::MEDCouplingExtrudedMesh::getMeasureField(), getMeasureField(), ParaMEDMEM::MEDCouplingExtrudedMesh::getNodeIdsOfCell(), ParaMEDMEM::MEDCouplingExtrudedMesh::getNumberOfCells(), ParaMEDMEM::MEDCouplingExtrudedMesh::getNumberOfCellsWithType(), getNumberOfCellsWithType(), getQuadraticStatus(), getSkewField(), getTinySerializationInformation(), ParaMEDMEM::MEDCouplingExtrudedMesh::getTypeOfCell(), getWarpField(), isContiguous1D(), isFullyQuadratic(), isPresenceOfQuadratic(), keepSpecifiedCells(), ParaMEDMEM::MEDCouplingUMeshCellByTypeIterator::MEDCouplingUMeshCellByTypeIterator(), ParaMEDMEM::MEDCouplingUMeshCellIterator::MEDCouplingUMeshCellIterator(), orientCorrectlyPolyhedrons(), project1D(), rearrange2ConsecutiveCellTypes(), renumberNodesInConn(), serialize(), ParaMEDMEM::MEDCouplingExtrudedMesh::simpleRepr(), simpleRepr(), splitByType(), and unPolyze().

int MEDCouplingUMesh::getMeshDimension ( ) const
virtual
int MEDCouplingUMesh::getMeshLength ( ) const

This method is for test reason. Normally the integer returned is not useable by user.

References ParaMEDMEM::DataArray::getNbOfElems().

Referenced by convertDegeneratedCells(), convertQuadraticCellsToLinear(), getTinySerializationInformation(), serialize(), and unPolyze().

void MEDCouplingUMesh::computeTypes ( )
void MEDCouplingUMesh::getTinySerializationInformation ( std::vector< double > &  tinyInfoD,
std::vector< int > &  tinyInfo,
std::vector< std::string > &  littleStrings 
) const
virtual

size of returned tinyInfo must be always the same.

First step of serialization process. Used by ParaMEDMEM and MEDCouplingCorba to transfert data between process.

Reimplemented from ParaMEDMEM::MEDCouplingPointSet.

References getMeshDimension(), getMeshLength(), and getNumberOfCells().

Referenced by ParaMEDMEM::MEDCouplingExtrudedMesh::getTinySerializationInformation().

bool MEDCouplingUMesh::isEmptyMesh ( const std::vector< int > &  tinyInfo) const
virtual

First step of unserialization process.

Implements ParaMEDMEM::MEDCouplingPointSet.

void MEDCouplingUMesh::resizeForUnserialization ( const std::vector< int > &  tinyInfo,
DataArrayInt a1,
DataArrayDouble a2,
std::vector< std::string > &  littleStrings 
) const
virtual

Second step of serialization process.

Parameters
tinyInfomust be equal to the result given by getTinySerializationInformation method.

Reimplemented from ParaMEDMEM::MEDCouplingPointSet.

References ParaMEDMEM::DataArrayInt::alloc().

Referenced by ParaMEDMEM::MEDCouplingExtrudedMesh::unserialization().

void MEDCouplingUMesh::serialize ( DataArrayInt *&  a1,
DataArrayDouble *&  a2 
) const
virtual
void MEDCouplingUMesh::unserialization ( const std::vector< double > &  tinyInfoD,
const std::vector< int > &  tinyInfo,
const DataArrayInt a1,
DataArrayDouble a2,
const std::vector< std::string > &  littleStrings 
)
virtual

Second and final unserialization process.

Parameters
tinyInfomust be equal to the result given by getTinySerializationInformation method.

Reimplemented from ParaMEDMEM::MEDCouplingPointSet.

References ParaMEDMEM::DataArrayInt::alloc(), ParaMEDMEM::RefCountObject::decrRef(), ParaMEDMEM::DataArrayInt::getConstPointer(), ParaMEDMEM::DataArrayInt::getPointer(), New(), setConnectivity(), and setMeshDimension().

Referenced by ParaMEDMEM::MEDCouplingExtrudedMesh::unserialization().

std::string MEDCouplingUMesh::getVTKDataSetType ( ) const throw (INTERP_KERNEL::Exception)
virtual
void MEDCouplingUMesh::writeVTKLL ( std::ostream &  ofs,
const std::string &  cellData,
const std::string &  pointData 
) const throw (INTERP_KERNEL::Exception)
virtual
bool MEDCouplingUMesh::areCellsEqual ( int  cell1,
int  cell2,
int  compType 
) const

This method stands if 'cell1' and 'cell2' are equals regarding 'compType' policy. The semantic of 'compType' is specified in MEDCouplingUMesh::zipConnectivityTraducer method.

References areCellsEqual0(), areCellsEqual1(), and areCellsEqual2().

bool MEDCouplingUMesh::areCellsEqual0 ( int  cell1,
int  cell2 
) const
bool MEDCouplingUMesh::areCellsEqual1 ( int  cell1,
int  cell2 
) const
bool MEDCouplingUMesh::areCellsEqual2 ( int  cell1,
int  cell2 
) const
bool MEDCouplingUMesh::areCellsFrom2MeshEqual ( const MEDCouplingUMesh other,
int  cellId,
double  prec 
) const

This method compares 2 cells coming from two unstructured meshes : 'this' and 'other'. This method compares 2 cells having the same id 'cellId' in 'this' and 'other'.

References ParaMEDMEM::MEDCouplingPointSet::getCoordinatesOfNode(), getNodeIdsOfCell(), and getTypeOfCell().

void MEDCouplingUMesh::convertToPolyTypes ( const int *  cellIdsToConvertBg,
const int *  cellIdsToConvertEnd 
)

This method convert cell with ids in ['cellIdsToConvertBg','cellIdsToConvertEnd') into 'this' into dynamic types without changing geometry. That is to say if 'this' is a 2D, mesh after the invocation of this method it will contain only polygons. If 'this' is a 3D mesh after the invocation of this method it will contain only polyhedra. If mesh dimension is not in [2,3] an exception is thrown. Of course pay attention that the resulting mesh is slower than previous one. If in ['cellIdsToConvertBg','cellIdsToConvertEnd') there is a cell id not in [0,'this->getNumberOfCells()') an exception will be thrown. In this case if meshDim==2 the mesh is still valid and only cells treated before throw will be converted into polygon. If mesh==3, after throw the mesh is unconsistent ! This method is above all designed to test more extensively algorithms able to deal with polygons/polyhedra.

References ParaMEDMEM::DataArrayInt::alloc(), computeTypes(), ParaMEDMEM::DataArrayInt::getConstPointer(), getMeshDimension(), ParaMEDMEM::DataArray::getNbOfElems(), getNumberOfCells(), ParaMEDMEM::DataArrayInt::getPointer(), INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_POLYHED, and INTERP_KERNEL::NORM_QPOLYG.

Referenced by convertAllToPoly().

void MEDCouplingUMesh::convertAllToPoly ( )

This method converts all cells into poly type if possible. This method is purely for userfriendliness. As this method can be costly in Memory, no optimization is done to avoid construction of useless vector.

References convertToPolyTypes(), and getNumberOfCells().

void MEDCouplingUMesh::convertExtrudedPolyhedra ( ) throw (INTERP_KERNEL::Exception)

This method expects that 'this' has a spacedim equal to 3 and a mesh dimension equal to 3 too, if not an exception will be thrown. This method work only on cells with type NORM_POLYHED, all other cells with different type, are remains unchanged. For such polyhedra, they are expected to have only 1 face (containing 2 faces in opposition), having 2*n number of nodes (n nodes on each 2 faces hidden in the single face of polyhedron). The first face is expected to be right oriented because all faces of this polyhedron will be deduced. When called 'this' is an invalid mesh on MED sense. This method will correct that for polyhedra. In case of presence of polyhedron that has not the extruded aspect (2 faces with the same number of nodes) an exception is thrown and 'this' remains unchanged. This method is usefull only for users that wants to build extruded unstructured mesh. This method is a convenient one that avoids boring polyhedra setting during insertNextCell process. In case of success, 'this' has be corrected contains the same number of cells and is valid in MED sense.

References ParaMEDMEM::RefCountObject::decrRef(), ParaMEDMEM::DataArrayInt::getConstPointer(), getMeshDimension(), getNumberOfCells(), ParaMEDMEM::MEDCouplingPointSet::getSpaceDimension(), ParaMEDMEM::RefCountObject::incrRef(), New(), and INTERP_KERNEL::NORM_POLYHED.

void MEDCouplingUMesh::unPolyze ( )

This method is the opposite of ParaMEDMEM::MEDCouplingUMesh::convertToPolyTypes method. The aim is to take all polygons or polyhedrons cell and to try to traduce them into classical cells.

References computeTypes(), getMeshDimension(), getMeshLength(), getNumberOfCells(), ParaMEDMEM::DataArrayInt::getPointer(), INTERP_KERNEL::NORM_ERROR, and ParaMEDMEM::DataArrayInt::reAlloc().

DataArrayInt * MEDCouplingUMesh::getNodeIdsInUse ( int &  nbrOfNodesInUse) const throw (INTERP_KERNEL::Exception)

Array returned is the correspondance in old to new format (that's why 'nbrOfNodesInUse' is returned too). The returned array is newly created and should be dealt by the caller. To retrieve the new to old format the user can use DataArrayInt::invertArrayO2N2N2O method. The size of returned array is the number of nodes of 'this'. -1 values in returned array means that the corresponding node never appear in any nodal connectivity of cells constituting 'this'.

Parameters
nbrOfNodesInUseout parameter that specifies how many of nodes in 'this' is really used in nodal connectivity.

References ParaMEDMEM::DataArrayInt::alloc(), ParaMEDMEM::DataArrayInt::getPointer(), and ParaMEDMEM::DataArrayInt::New().

Referenced by zipCoordsTraducer().

DataArrayInt * MEDCouplingUMesh::zipCoordsTraducer ( ) throw (INTERP_KERNEL::Exception)
virtual

Array returned is the correspondance in old to new format. The returned array is newly created and should be dealt by the caller. The maximum value stored in returned array is the number of nodes of 'this' minus 1 after call of this method. The size of returned array is the number of nodes of the old (previous to the call of this method) number of nodes. -1 values in returned array means that the corresponding old node is no more used.

Implements ParaMEDMEM::MEDCouplingPointSet.

References ParaMEDMEM::DataArrayInt::getConstPointer(), getNodeIdsInUse(), and renumberNodes().

DataArrayInt * MEDCouplingUMesh::zipConnectivityTraducer ( int  compType) throw (INTERP_KERNEL::Exception)

This method could potentially modify 'this'. This method merges cells if there are cells equal in 'this'. The comparison is specified by 'compType'. This method keeps the coordiantes of 'this'.

Parameters
compTypeinput specifying the technique used to compare cells each other.
  • 0 : exactly. A cell is detected to be the same if and only if the connectivity is exactly the same without permutation and types same too. This is the strongest policy.
  • 1 : permutation same orientation. cell1 and cell2 are considered equal if the connectivity of cell2 can be deduced by those of cell1 by direct permutation (with exactly the same orientation) and their type equal. For 1D mesh the policy 1 is equivalent to 0.
  • 2 : nodal. cell1 and cell2 are equal if and only if cell1 and cell2 have same type and have the same nodes constituting connectivity. This is the laziest policy. This policy can be used for users not sensitive to orientation of cell
Returns
the correspondance array old to new.

References ParaMEDMEM::DataArrayInt::alloc(), ParaMEDMEM::RefCountObject::decrRef(), ParaMEDMEM::DataArrayInt::getPointer(), and ParaMEDMEM::DataArrayInt::New().

Referenced by FuseUMeshesOnSameCoords().

bool MEDCouplingUMesh::areCellsIncludedIn ( const MEDCouplingUMesh other,
int  compType,
DataArrayInt *&  arr 
) const throw (INTERP_KERNEL::Exception)

This method makes the assumption that 'this' and 'other' share the same coords. If not an exception will be thrown ! This method tries to determine if 'other' is fully included in 'this'. To compute that, this method works with connectivity as MEDCouplingUMesh::zipConnectivityTraducer method does. This method is close to MEDCouplingUMesh::checkDeepEquivalOnSameNodesWith or MEDCouplingMesh::checkGeoEquivalWith with policy 20,21,or 22. The main difference is that this method is not expected to throw exception. This method has two outputs :

Parameters
compTypeis the comparison type. The possible values of this parameter are described in ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer method
arris an output parameter that returns a newly created instance. This array is of size 'other->getNumberOfCells()'.
Returns
If 'other' is fully included in 'this 'true is returned. If not false is returned.

Referenced by ParaMEDMEM::MEDFileUMesh::setGroupsOnSetMesh().

void MEDCouplingUMesh::getReverseNodalConnectivity ( DataArrayInt revNodal,
DataArrayInt revNodalIndx 
) const throw (INTERP_KERNEL::Exception)

WARNING this method do the assumption that connectivity lies on the coordinates set. For speed reasons no check of this will be done.

References ParaMEDMEM::CPP_DEALLOC.

Referenced by getMeasureFieldOnNode().

MEDCouplingUMesh * MEDCouplingUMesh::buildDescendingConnectivity ( DataArrayInt desc,
DataArrayInt descIndx,
DataArrayInt revDesc,
DataArrayInt revDescIndx 
) const throw (INTERP_KERNEL::Exception)

WARNING this method do the assumption that connectivity lies on the coordinates set. For speed reasons no check of this will be done. Given 'this' with spacedim equal to s and meshdim equal to p, this method returns a new allocated mesh lying on the same coordinates than 'this' and having a meshdim equal to p-1. The algorithm to compute this p-1 mesh is the following : For each cell in 'this' it splits into p-1 elements. If this p-1 element does not already exists it is appended to the returned mesh If this p-1 element already exists, it is not appended. This method returns or 4 arrays plus the returned mesh. 'desc' and 'descIndx' are the descending connectivity. These 2 arrays tell for each cell in 'this', to wich p-1 dimension cell in returned mesh it refers. For a cell with a cellid c in 'this' it is constituted of cells in [desc+descIndx[c],desc+descIndex[c+1])

Reversely 'revDesc' and 'revDescIndx' are the reverse descending connectivity. These 2 arrays tell for each cell in returned mesh, to wich cell in 'this' it refers. For a cell with a cellid d in returned p-1 mesh it is shared by the following cells in 'this' [revDesc+revDescIndx[d],revDesc+revDescIndx[d+1])

Referenced by buildBoundaryMesh(), buildFacePartOfMySelfNode(), findBoundaryNodes(), and findCellsIdsOnBoundary().

MEDCouplingUMesh * MEDCouplingUMesh::buildDescendingConnectivity2 ( DataArrayInt desc,
DataArrayInt descIndx,
DataArrayInt revDesc,
DataArrayInt revDescIndx 
) const throw (INTERP_KERNEL::Exception)

WARNING this method do the assumption that connectivity lies on the coordinates set. For speed reasons no check of this will be done. This method differs from MEDCouplingUMesh::buildDescendingConnectivity method in that 'desc' is in different format. This method is more precise because it returns in descending connectivity giving the direction. If value is positive the n-1 dim element is taken in the same direction, if it is in the opposite direction it is retrieved negative. So the problem is for elemt #0 in C convention. That's why this method is the only one that retrieves an array in relative "FORTRAN" mode.

void MEDCouplingUMesh::computeNeighborsOfCells ( DataArrayInt *&  neighbors,
DataArrayInt *&  neighborsIdx 
) const throw (INTERP_KERNEL::Exception)

WARNING this method do the assumption that connectivity lies on the coordinates set. For speed reasons no check of this will be done. This method calls MEDCouplingUMesh::buildDescendingConnectivity to compute the result. This method lists cell by cell in this which are its neighbors. To compute the result only connectivities are considered. The a cell with id 'cellId' its neighbors are neighbors[neighborsIdx[cellId]:neighborsIdx[cellId+1]].

Parameters
[out]neighborsis an array storing all the neighbors of all cells in this. This array is newly allocated and should be dealt by the caller. neighborsIdx 2nd output parameter allows to select the right part in this array. The number of tuples is equal to the last values in neighborsIdx.
[out]neighborsIdxis an array of size this->getNumberOfCells()+1 newly allocated and should be dealt by the caller. This arrays allow to use the first output parameter neighbors.

References ParaMEDMEM::DataArrayInt::New().

DataArrayInt * MEDCouplingUMesh::mergeNodes ( double  precision,
bool &  areNodesMerged,
int &  newNbOfNodes 
)
virtual
Parameters
areNodesMergedif at least two nodes have been merged.
Returns
old to new node correspondance.

Implements ParaMEDMEM::MEDCouplingPointSet.

References ParaMEDMEM::MEDCouplingPointSet::buildPermArrayForMergeNode(), ParaMEDMEM::DataArrayInt::getConstPointer(), and renumberNodes().

DataArrayInt * MEDCouplingUMesh::mergeNodes2 ( double  precision,
bool &  areNodesMerged,
int &  newNbOfNodes 
)
virtual
void MEDCouplingUMesh::tryToShareSameCoordsPermute ( const MEDCouplingPointSet other,
double  epsilon 
) throw (INTERP_KERNEL::Exception)
virtual

This method tries to use 'other' coords and use it for 'this'. If no exception was thrown after the call of this method : this->_coords==other->_coords. If an exception is thrown 'this' remains unchanged. Contrary to MEDCouplingUMesh::tryToShareSameCoords method this method makes a deeper analyze of coordinates (and so more expensive) than simple equality. Two nodes one in 'this' and other in 'other' are considered equal if the distance between the two is lower than epsilon.

Implements ParaMEDMEM::MEDCouplingPointSet.

MEDCouplingPointSet * MEDCouplingUMesh::buildPartOfMySelf ( const int *  begin,
const int *  end,
bool  keepCoords 
) const
virtual

build a sub part of 'this'. This sub part is defined by the cell ids contained in the array in [begin,end).

Parameters
beginbegin of array containing the cell ids to keep.
endend of array of cell ids to keep. WARNING end param is not included ! Idem STL standard definitions.
keepCoordsthat specifies if you want or not to keep coords as this or zip it (see ParaMEDMEM::MEDCouplingUMesh::zipCoords). If true zipCoords is NOT called, if false, zipCoords is called.

Implements ParaMEDMEM::MEDCouplingPointSet.

References getMeshDimension(), ParaMEDMEM::RefCountObject::incrRef(), and ParaMEDMEM::MEDCouplingPointSet::zipCoords().

Referenced by buildBoundaryMesh(), buildPartOfMySelfNode(), keepSpecifiedCells(), and splitByType().

MEDCouplingPointSet * MEDCouplingUMesh::buildPartOfMySelfNode ( const int *  begin,
const int *  end,
bool  fullyIn 
) const
virtual

Keeps from 'this' only cells which constituing point id are in the ids specified by ['begin','end'). The return newly allocated mesh will share the same coordinates as 'this'. Parameter 'fullyIn' specifies if a cell that has part of its nodes in ids array is kept or not. If 'fullyIn' is true only cells whose ids are fully contained in ['begin','end') tab will be kept.

Implements ParaMEDMEM::MEDCouplingPointSet.

References buildPartOfMySelf().

DataArrayInt * MEDCouplingUMesh::getCellIdsLyingOnNodes ( const int *  begin,
const int *  end,
bool  fullyIn 
) const
MEDCouplingPointSet * MEDCouplingUMesh::buildFacePartOfMySelfNode ( const int *  begin,
const int *  end,
bool  fullyIn 
) const
virtual

Contrary to MEDCouplingUMesh::buildPartOfMySelfNode method this method builds a mesh with a meshDimension equal to this->getMeshDimension()-1. The return newly allocated mesh will share the same coordinates as 'this'. Parameter 'fullyIn' specifies if a face that has part of its nodes in ids array is kept or not. If 'fullyIn' is true only faces whose ids are fully contained in ['begin','end') tab will be kept.

Implements ParaMEDMEM::MEDCouplingPointSet.

References buildDescendingConnectivity(), and New().

MEDCouplingUMesh * MEDCouplingUMesh::buildUnstructured ( ) const throw (INTERP_KERNEL::Exception)
virtual
void MEDCouplingUMesh::findBoundaryNodes ( std::vector< int > &  nodes) const
virtual
MEDCouplingPointSet * MEDCouplingUMesh::buildBoundaryMesh ( bool  keepCoords) const
virtual

This method returns a mesh with meshDim=this->getMeshDimension()-1. This returned mesh contains cells that are linked with one and only one cell of this.

Parameters
keepCoordsspecifies if ParaMEDMEM::MEDCouplingUMesh::zipCoords is called on returned mesh before being returned. If true zipCoords is NOT called, if false, zipCoords is called.
Returns
mesh with ref counter equal to 1.

Implements ParaMEDMEM::MEDCouplingPointSet.

References buildDescendingConnectivity(), buildPartOfMySelf(), ParaMEDMEM::RefCountObject::decrRef(), ParaMEDMEM::DataArrayInt::getConstPointer(), getNumberOfCells(), and New().

DataArrayInt * MEDCouplingUMesh::findCellsIdsOnBoundary ( ) const throw (INTERP_KERNEL::Exception)

This method returns a newly created DataArrayInt instance containing ids of cells located in boundary. A cell is detected to be on boundary if it contains one or more than one face having only one father. This method makes the assumption that 'this' is fully defined (coords,connectivity). If not an exception will be thrown.

References ParaMEDMEM::DataArrayInt::alloc(), buildDescendingConnectivity(), ParaMEDMEM::RefCountObject::decrRef(), ParaMEDMEM::DataArrayInt::deltaShiftIndex(), ParaMEDMEM::DataArrayInt::getConstPointer(), ParaMEDMEM::DataArrayInt::getIdsEqual(), ParaMEDMEM::DataArrayInt::getIJ(), ParaMEDMEM::DataArray::getNumberOfTuples(), ParaMEDMEM::DataArrayInt::getPointer(), New(), and ParaMEDMEM::DataArray::setName().

void MEDCouplingUMesh::renumberNodes ( const int *  newNodeNumbers,
int  newNbOfNodes 
)
virtual

Reimplemented from ParaMEDMEM::MEDCouplingPointSet.

References renumberNodesInConn().

Referenced by mergeNodes(), and zipCoordsTraducer().

void MEDCouplingUMesh::renumberNodes2 ( const int *  newNodeNumbers,
int  newNbOfNodes 
)
virtual

Reimplemented from ParaMEDMEM::MEDCouplingPointSet.

References renumberNodesInConn().

Referenced by mergeNodes2().

void MEDCouplingUMesh::renumberNodesInConn ( const int *  newNodeNumbersO2N)

This method renumbers nodes in connectivity only without any reference to coords. This method performs no check on the fact that new coordinate ids are valid. Use it with care ! This method is an generalization of shiftNodeNumbersInConn method.

Parameters
[in]newNodeNumbersin old2New convention

References ParaMEDMEM::TimeLabel::declareAsNew(), ParaMEDMEM::DataArrayInt::getConstPointer(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), ParaMEDMEM::DataArrayInt::getPointer(), and updateTime().

Referenced by renumberNodes(), and renumberNodes2().

void MEDCouplingUMesh::shiftNodeNumbersInConn ( int  delta) throw (INTERP_KERNEL::Exception)

This method renumbers nodes in connectivity only without any reference to coords. This method performs no check on the fact that new coordinate ids are valid. Use it with care ! This method is an specialization of renumberNodesInConn method.

Parameters
[in]deltaspecifies the shift size applied to nodeId in nodal connectivity in this.
void MEDCouplingUMesh::renumberCells ( const int *  old2NewBg,
bool  check 
) throw (INTERP_KERNEL::Exception)
virtual

This method renumbers cells of 'this' using the array specified by [old2NewBg;old2NewBg+getNumberOfCells())

Contrary to MEDCouplingPointSet::renumberNodes, this method makes a permutation without any fuse of cell. After the call of this method the number of cells remains the same as before.

If 'check' equals true the method will check that any elements in [old2NewBg;old2NewEnd) is unique ; if not an INTERP_KERNEL::Exception will be thrown. When 'check' equals true [old2NewBg;old2NewEnd) is not expected to be strictly in [0;this->getNumberOfCells()).

If 'check' equals false the method will not check the content of [old2NewBg;old2NewEnd). To avoid any throw of SIGSEGV when 'check' equals false, the elements in [old2NewBg;old2NewEnd) should be unique and should be contained in[0;this->getNumberOfCells()).

Implements ParaMEDMEM::MEDCouplingMesh.

References ParaMEDMEM::DataArrayInt::alloc(), ParaMEDMEM::DataArrayInt::CheckAndPreparePermutation(), ParaMEDMEM::DataArray::copyStringInfoFrom(), ParaMEDMEM::RefCountObject::decrRef(), ParaMEDMEM::DataArrayInt::getPointer(), and ParaMEDMEM::DataArrayInt::New().

Referenced by ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh(), MEDLoader::ReadUMeshFromFamilies(), MEDLoader::ReadUMeshFromFile(), MEDLoader::ReadUMeshFromGroups(), rearrange2ConsecutiveCellTypes(), and sortCellsInMEDFileFrmt().

void MEDCouplingUMesh::getCellsInBoundingBox ( const double *  bbox,
double  eps,
std::vector< int > &  elems 
) const
virtual

Given a boundary box 'bbox' returns elements 'elems' contained in this 'bbox'. Warning 'elems' is incremented during the call so if elems is not empty before call returned elements will be added in 'elems' parameter.

Implements ParaMEDMEM::MEDCouplingPointSet.

References ParaMEDMEM::DataArrayDouble::getConstPointer(), ParaMEDMEM::DataArrayInt::getConstPointer(), ParaMEDMEM::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), ParaMEDMEM::MEDCouplingPointSet::getSpaceDimension(), and ParaMEDMEM::MEDCouplingPointSet::intersectsBoundingBox().

void MEDCouplingUMesh::getCellsInBoundingBox ( const INTERP_KERNEL::DirectedBoundingBox &  bbox,
double  eps,
std::vector< int > &  elems 
)
virtual

Given a boundary box 'bbox' returns elements 'elems' contained in this 'bbox' or touching 'bbox' (within 'eps' distance). Warning 'elems' is incremented during the call so if elems is not empty before call returned elements will be added in 'elems' parameter.

Implements ParaMEDMEM::MEDCouplingPointSet.

References ParaMEDMEM::DataArrayDouble::getConstPointer(), ParaMEDMEM::DataArrayInt::getConstPointer(), ParaMEDMEM::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), ParaMEDMEM::MEDCouplingPointSet::getSpaceDimension(), and ParaMEDMEM::MEDCouplingPointSet::intersectsBoundingBox().

MEDCouplingFieldDouble * MEDCouplingUMesh::getMeasureField ( bool  isAbs) const
virtual
DataArrayDouble * MEDCouplingUMesh::getPartMeasureField ( bool  isAbs,
const int *  begin,
const int *  end 
) const
MEDCouplingFieldDouble * MEDCouplingUMesh::getMeasureFieldOnNode ( bool  isAbs) const
virtual
MEDCouplingFieldDouble * MEDCouplingUMesh::buildOrthogonalField ( ) const
virtual
MEDCouplingFieldDouble * MEDCouplingUMesh::buildPartOrthogonalField ( const int *  begin,
const int *  end 
) const
MEDCouplingFieldDouble * MEDCouplingUMesh::buildDirectionVectorField ( ) const
MEDCouplingUMesh * MEDCouplingUMesh::buildSlice3D ( const double *  origin,
const double *  vec,
double  eps,
DataArrayInt *&  cellIds 
) const throw (INTERP_KERNEL::Exception)

This method expects that 'this' is fully defined and has a spaceDim==3 and a meshDim==3. If it is not the case an exception will be thrown. This method returns 2 objects :

  • a newly created mesh instance containing the result of the slice lying on different coords than 'this' and with a meshdim == 2
  • a newly created dataarray having number of tuples equal to the number of cells in returned mesh that tells for each 2D cell in returned mesh the 3D cell id is 'this' it comes from. This method works only for linear meshes (non quadratic). If plane crosses within 'eps' a face in 'this' shared by more than 1 cell, 2 output faces will be generated. The 2 faces having the same geometry than intersecting face. Only 'cellIds' parameter can distinguish the 2.
    Parameters
    originis the origin of the plane. It should be an array of length 3.
    vecis the direction vector of the plane. It should be an array of length 3. Norm of 'vec' should be > 1e-6.
    epsis the precision. It is used by called method MEDCouplingUMesh::getCellIdsCrossingPlane for the first 3D cell selection (in absolute). 'eps' is also used to state if new points should be created or already existing points are reused. 'eps' is also used to tells if plane overlaps a face, edge or nodes (in absolute).

References ParaMEDMEM::MEDCouplingPointSet::findNodesOnPlane(), New(), and ParaMEDMEM::DataArrayInt::New().

MEDCouplingUMesh * MEDCouplingUMesh::buildSlice3DSurf ( const double *  origin,
const double *  vec,
double  eps,
DataArrayInt *&  cellIds 
) const throw (INTERP_KERNEL::Exception)

This method expects that 'this' is fully defined and has a spaceDim==3 and a meshDim==2. If it is not the case an exception will be thrown. This method returns 2 objects :

  • a newly created mesh instance containing the result of the slice lying on different coords than 'this' and with a meshdim == 1
  • a newly created dataarray having number of tuples equal to the number of cells in returned mesh that tells for each 2D cell in returned mesh the 3DSurf cell id is 'this' it comes from. This method works only for linear meshes (non quadratic). If plane crosses within 'eps' a face in 'this' shared by more than 1 cell, 2 output faces will be generated. The 2 faces having the same geometry than intersecting face. Only 'cellIds' parameter can distinguish the 2.
    Parameters
    originis the origin of the plane. It should be an array of length 3.
    vecis the direction vector of the plane. It should be an array of length 3. Norm of 'vec' should be > 1e-6.
    epsis the precision. It is used by called method MEDCouplingUMesh::getCellIdsCrossingPlane for the first 3DSurf cell selection (in absolute). 'eps' is also used to state if new points should be created or already existing points are reused. 'eps' is also used to tells if plane overlaps a face, edge or nodes (in absolute).

References ParaMEDMEM::MEDCouplingPointSet::findNodesOnPlane(), New(), ParaMEDMEM::DataArrayInt::New(), and INTERP_KERNEL::NORM_SEG2.

DataArrayInt * MEDCouplingUMesh::getCellIdsCrossingPlane ( const double *  origin,
const double *  vec,
double  eps 
) const throw (INTERP_KERNEL::Exception)

This method expects that 'this' is fully defined and has a spaceDim==3. If it is not the case an exception will be thrown. This method returns a newly created dataarray containing cellsids in 'this' that potentially crosses the plane specified by 'origin' and 'vec'.

Parameters
originis the origin of the plane. It should be an array of length 3.
vecis the direction vector of the plane. It should be an array of length 3. Norm of 'vec' should be > 1e-6.

References ParaMEDMEM::DataArrayInt::New(), and ParaMEDMEM::MEDCouplingPointSet::Rotate3DAlg().

bool MEDCouplingUMesh::isContiguous1D ( ) const throw (INTERP_KERNEL::Exception)

This method checks that 'this' is a contiguous mesh. The user is expected to call this method on a mesh with meshdim==1. If not an exception will thrown. If this is an empty mesh with no cell an exception will be thrown too. No consideration of coordinate is done by this method. A 1D mesh is said contiguous if : a cell i with nodal connectivity (k,p) the cell i+1 the nodal connectivity should be (p,m) If not false is returned. In case that false is returned a call to ParaMEDMEM::MEDCouplingUMesh::mergeNodes could be usefull.

References ParaMEDMEM::DataArrayInt::getConstPointer(), getMeshDimension(), and getNumberOfCells().

Referenced by buildExtrudedMesh().

void MEDCouplingUMesh::project1D ( const double *  pt,
const double *  v,
double  eps,
double *  res 
) const

This method is only callable on mesh with meshdim == 1 containing only SEG2 and spaceDim==3. This method projects this on the 3D line defined by (pt,v). This methods first checks that all SEG2 are along v vector.

Parameters
ptreference point of the line
vnormalized director vector of the line
epsmax precision before throwing an exception
resoutput of size this->getNumberOfCells

References buildDirectionVectorField(), ParaMEDMEM::RefCountObject::decrRef(), ParaMEDMEM::MEDCouplingFieldDouble::getArray(), ParaMEDMEM::DataArrayDouble::getConstPointer(), ParaMEDMEM::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNumberOfCells(), ParaMEDMEM::MEDCouplingPointSet::getNumberOfNodes(), ParaMEDMEM::MEDCouplingPointSet::getSpaceDimension(), and INTERP_KERNEL::NORM_SEG2.

int MEDCouplingUMesh::getCellContainingPoint ( const double *  pos,
double  eps 
) const
virtual

Returns a cell if any that contains the point located on 'pos' with precison eps. If 'pos' is outside 'this' -1 is returned. If several cells contain this point the cell with the smallest id is returned. Warning this method is good if the caller intends to evaluate only one point. But if more than one point is requested on 'this' it is better to use MEDCouplingUMesh::getCellsContainingPoints method because in this case, the acceleration structure will be computed only once.

Implements ParaMEDMEM::MEDCouplingMesh.

References getCellsContainingPoint().

void MEDCouplingUMesh::getCellsContainingPoint ( const double *  pos,
double  eps,
std::vector< int > &  elts 
) const
virtual

Returns all cellIds in 'elts' of point 'pos' with eps accuracy. Warning this method is good if the caller intends to evaluate only one point. But if more than one point is requested on 'this' it is better to use MEDCouplingUMesh::getCellsContainingPoints method because in this case, the acceleration structure will be computed only once.

Reimplemented from ParaMEDMEM::MEDCouplingMesh.

References getCellsContainingPoints().

Referenced by getCellContainingPoint().

void MEDCouplingUMesh::getCellsContainingPoints ( const double *  pos,
int  nbOfPoints,
double  eps,
std::vector< int > &  elts,
std::vector< int > &  eltsIndex 
) const
virtual

This method is an extension of MEDCouplingUMesh::getCellContainingPoint and MEDCouplingUMesh::getCellsContainingPoint. This method performs 'nbOfPoints' time the getCellsContainingPoint request. This method is recommended rather than the 2 others in case of multi points searching. This method returns 2 arrays 'elts' and 'eltsIndex'. 'eltsIndex' is of size 'nbOfPoints+1' and 'elts' is of size 'eltsIndex[nbOfPoints-1]'. For point j in [0,nbOfPoints), (eltsIndex[j+1]-eltsIndex[j]) cells contain this point. These cells are : [elts.begin()+eltsIndex[j],elts.begin():eltsIndex[j+1]).

Parameters
posinput parameter that points to an array of size 'getSpaceDim()*nbOfPoints' points stored in full interlace mode : X0,Y0,Z0,X1,Y1,Z1...

Reimplemented from ParaMEDMEM::MEDCouplingMesh.

References ParaMEDMEM::MEDCouplingPointSet::_coords, ParaMEDMEM::DataArrayDouble::getConstPointer(), getMeshDimension(), and ParaMEDMEM::MEDCouplingPointSet::getSpaceDimension().

Referenced by getCellsContainingPoint().

void MEDCouplingUMesh::checkButterflyCells ( std::vector< int > &  cells,
double  eps = 1e-12 
) const

This method is only available for a mesh with meshDim==2 and spaceDim==2||spaceDim==3. This method returns a vector 'cells' where all detected butterfly cells have been added to cells. A 2D cell is considered to be butterfly if it exists at least one pair of distinct edges of it that intersect each other anywhere excepted their extremities. An INTERP_KERNEL::NORM_NORI3 could not be butterfly.

References ParaMEDMEM::DataArrayInt::getConstPointer(), getMeshDimension(), getNumberOfCells(), ParaMEDMEM::MEDCouplingPointSet::getSpaceDimension(), ParaMEDMEM::MEDCouplingPointSet::isButterfly2DCell(), and ParaMEDMEM::MEDCouplingPointSet::project2DCellOnXY().

void MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells ( std::vector< int > &  cells) throw (INTERP_KERNEL::Exception)

This method is expected to be applied on a mesh with spaceDim==3 and meshDim==3. If not an exception will be thrown. This method analyzes only linear extruded 3D cells (NORM_HEXA8,NORM_PENTA6,NORM_HEXGP12...) If some extruded cells does not fulfill the MED norm for extruded cells (first face of 3D cell should be oriented to the exterior of the 3D cell). Some viewers are very careful of that (SMESH), but ParaVis ignore that.

void MEDCouplingUMesh::getBoundingBoxForBBTree ( std::vector< double > &  bbox) const

This method aggregate the bbox of each cell and put it into bbox parameter.

Parameters
bboxout parameter of size 2*spacedim*nbOfcells.

References ParaMEDMEM::MEDCouplingPointSet::_coords, ParaMEDMEM::DataArrayDouble::getConstPointer(), ParaMEDMEM::DataArrayInt::getConstPointer(), getNumberOfCells(), and ParaMEDMEM::MEDCouplingPointSet::getSpaceDimension().

MEDCouplingUMesh * MEDCouplingUMesh::buildExtrudedMesh ( const MEDCouplingUMesh mesh1D,
int  policy 
)

This method is NOT const because it can modify 'this'. 'this' is expected to be an unstructured mesh with meshDim==2 and spaceDim==3. If not an exception will be thrown.

Parameters
mesh1Dis an unstructured mesh with MeshDim==1 and spaceDim==3. If not an exception will be thrown.
policyspecifies the type of extrusion chosen. 0 for translation (most simple), 1 for translation and rotation around point of 'mesh1D'.
Returns
an unstructured mesh with meshDim==3 and spaceDim==3. The returned mesh has the same coords than 'this'.

References ParaMEDMEM::RefCountObject::decrRef(), getMeshDimension(), ParaMEDMEM::MEDCouplingPointSet::getNumberOfNodes(), ParaMEDMEM::MEDCouplingPointSet::getSpaceDimension(), isContiguous1D(), isFullyQuadratic(), isPresenceOfQuadratic(), ParaMEDMEM::MEDCouplingPointSet::setCoords(), updateTime(), and ParaMEDMEM::MEDCouplingPointSet::zipCoords().

Referenced by ParaMEDMEM::MEDCouplingExtrudedMesh::build3DUnstructuredMesh().

bool MEDCouplingUMesh::isFullyQuadratic ( ) const

This method returns if 'this' is constituted by only quadratic cells.

References getNumberOfCells(), and getTypeOfCell().

Referenced by buildExtrudedMesh().

bool MEDCouplingUMesh::isPresenceOfQuadratic ( ) const

This method returns if there is at least one quadratic cell.

References getNumberOfCells(), and getTypeOfCell().

Referenced by buildExtrudedMesh().

void MEDCouplingUMesh::convertQuadraticCellsToLinear ( ) throw (INTERP_KERNEL::Exception)

This method convert quadratic cells to linear cells if any was found. If no such cells exists 'this' remains unchanged.

References ParaMEDMEM::DataArrayInt::getConstPointer(), getMeshLength(), getNumberOfCells(), getTypeOfCell(), New(), and setConnectivity().

void MEDCouplingUMesh::tessellate2D ( double  eps) throw (INTERP_KERNEL::Exception)

This method tessallates 'this' so that the number of cells remains the same. This method works only for meshes with spaceDim equal to 2 and meshDim equal to 2. If no cells are quadratic in 'this' (INTERP_KERNEL::NORM_QUAD8, INTERP_KERNEL::NORM_TRI6, INTERP_KERNEL::NORM_QPOLYG ) this method will remain unchanged.

WARNING this method can lead to a uge amount of nodes if eps is very low.

Parameters
epsspecifies the maximal angle (in radian) between 2 subedges of polylinized edge constituting the input polygon.

References ParaMEDMEM::DataArrayInt::New().

void MEDCouplingUMesh::tessellate2DCurve ( double  eps) throw (INTERP_KERNEL::Exception)

This method tessallates 'this' so that the number of cells remains the same. This method works only for meshes with spaceDim equal to 2 and meshDim equal to 1. If no cells are quadratic in 'this' (INTERP_KERNEL::NORM_QUAD8, INTERP_KERNEL::NORM_TRI6, INTERP_KERNEL::NORM_QPOLYG ) this method will remain unchanged.

WARNING this method can lead to a uge amount of nodes if eps is very low.

Parameters
epsspecifies the maximal angle (in radian) between 2 subedges of polylinized edge constituting the input polygon.

References INTERP_KERNEL::EdgeArcCircle::BuildFromNodes(), ParaMEDMEM::DataArrayDouble::New(), ParaMEDMEM::DataArrayInt::New(), ParaMEDMEM::DataArrayDouble::SetArrayIn(), ParaMEDMEM::DataArrayInt::SetArrayIn(), and INTERP_KERNEL::EdgeArcCircle::tesselate().

DataArrayInt * MEDCouplingUMesh::simplexize ( int  policy) throw (INTERP_KERNEL::Exception)
virtual

This methods modify this by converting each cells into simplex cell, that is too say triangle for meshdim==2 or tetra for meshdim==3. This cut into simplex is performed following the parameter 'policy'. This method so typically increases the number of cells of this. This method returns new2old array that specifies a each cell of 'this' after the call what was its id it comes.

The semantic of 'policy' parameter :

  • 1 only QUAD4. For QUAD4 the cut is done along 0-2 diagonal for QUAD4
  • 2 only QUAD4. For QUAD4 the cut is done along 1-3 diagonal for QUAD4

Implements ParaMEDMEM::MEDCouplingMesh.

bool MEDCouplingUMesh::areOnlySimplexCells ( ) const throw (INTERP_KERNEL::Exception)
void MEDCouplingUMesh::convertDegeneratedCells ( ) throw (INTERP_KERNEL::Exception)

This method converts all degenerated cells to simpler cells. For example a NORM_QUAD4 cell consituted from 2 same node id in its nodal connectivity will be transform to a NORM_TRI3 cell. This method works only on linear cells. This method works on nodes ids, that is to say a call to ParaMEDMEM::MEDCouplingUMesh::mergeNodes method could be usefull before calling this method in case of presence of several pair of nodes located on same position. This method throws an exception if 'this' is not fully defined (connectivity). This method throws an exception too if a "too" degenerated cell is detected. For example a NORM_TRI3 with 3 times the same node id.

References computeTypes(), getMeshDimension(), getMeshLength(), getNumberOfCells(), ParaMEDMEM::DataArrayInt::getPointer(), and ParaMEDMEM::DataArrayInt::reAlloc().

void MEDCouplingUMesh::are2DCellsNotCorrectlyOriented ( const double *  vec,
bool  polyOnly,
std::vector< int > &  cells 
) const throw (INTERP_KERNEL::Exception)

This method checks that all or only polygons (depending 'polyOnly' parameter) 2D cells are correctly oriented relative to 'vec' vector. The 'vec' vector has to have a non nul norm. If not 'cells' parameter will be appended with cellIds of incorrect cells.

Exceptions
when'this' is not a mesh with meshdim==2 and spacedim==3

References INTERP_KERNEL::NORM_POLYGON, and INTERP_KERNEL::NORM_QPOLYG.

void MEDCouplingUMesh::orientCorrectly2DCells ( const double *  vec,
bool  polyOnly 
) throw (INTERP_KERNEL::Exception)

This method orient correctly (if needed) all or only polygons (depending 'polyOnly' parameter) 2D cells are correctly oriented relative to 'vec' vector. The 'vec' vector has to have a non nul norm.

Exceptions
when'this' is not a mesh with meshdim==2 and spacedim==3

References INTERP_KERNEL::NORM_POLYGON, and INTERP_KERNEL::NORM_QPOLYG.

void MEDCouplingUMesh::arePolyhedronsNotCorrectlyOriented ( std::vector< int > &  cells) const throw (INTERP_KERNEL::Exception)

This method checks that all polyhedrons cells have correctly oriented faces. If not, 'cells' parameter will be appended with cellIds of incorrect cells.

Exceptions
when'this' is not a mesh with meshdim==3 and spacedim==3

References INTERP_KERNEL::NORM_POLYHED.

void MEDCouplingUMesh::orientCorrectlyPolyhedrons ( ) throw (INTERP_KERNEL::Exception)
void MEDCouplingUMesh::getFastAveragePlaneOfThis ( double *  vec,
double *  pos 
) const throw (INTERP_KERNEL::Exception)

This method has a sense for meshes with spaceDim==3 and meshDim==2. If it is not the case an exception will be thrown. This method is fast because the first cell of 'this' is used to compute the plane.

Parameters
vecoutput of size at least 3 used to store the normal vector (with norm equal to Area ) of searched plane.
posoutput of size at least 3 used to store a point owned of searched plane.
MEDCouplingFieldDouble * MEDCouplingUMesh::getEdgeRatioField ( ) const throw (INTERP_KERNEL::Exception)

The returned newly created field has to be managed by the caller. This method returns a field on cell with no time lying on 'this'. The meshdimension and spacedimension of this are expected to be both in [2,3]. If not an exception will be thrown. This method for the moment only deals with NORM_TRI3, NORM_QUAD4 and NORM_TETRA4 geometric types. If a cell has an another type an exception will be thrown.

References ParaMEDMEM::MEDCouplingPointSet::_coords, ParaMEDMEM::DataArrayDouble::alloc(), checkCoherency(), ParaMEDMEM::RefCountObject::decrRef(), ParaMEDMEM::DataArrayDouble::getConstPointer(), ParaMEDMEM::DataArrayInt::getConstPointer(), getMeshDimension(), getNumberOfCells(), ParaMEDMEM::DataArrayDouble::getPointer(), ParaMEDMEM::MEDCouplingPointSet::getSpaceDimension(), New(), ParaMEDMEM::NO_TIME, INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TETRA4, INTERP_KERNEL::NORM_TRI3, and ParaMEDMEM::ON_CELLS.

MEDCouplingFieldDouble * MEDCouplingUMesh::getAspectRatioField ( ) const throw (INTERP_KERNEL::Exception)

The returned newly created field has to be managed by the caller. This method returns a field on cell with no time lying on 'this'. The meshdimension and spacedimension of this are expected to be both in [2,3]. If not an exception will be thrown. This method for the moment only deals with NORM_TRI3, NORM_QUAD4 and NORM_TETRA4 geometric types. If a cell has an another type an exception will be thrown.

References ParaMEDMEM::MEDCouplingPointSet::_coords, ParaMEDMEM::DataArrayDouble::alloc(), checkCoherency(), ParaMEDMEM::RefCountObject::decrRef(), ParaMEDMEM::DataArrayDouble::getConstPointer(), ParaMEDMEM::DataArrayInt::getConstPointer(), getMeshDimension(), getNumberOfCells(), ParaMEDMEM::DataArrayDouble::getPointer(), ParaMEDMEM::MEDCouplingPointSet::getSpaceDimension(), New(), ParaMEDMEM::NO_TIME, INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TETRA4, INTERP_KERNEL::NORM_TRI3, and ParaMEDMEM::ON_CELLS.

MEDCouplingFieldDouble * MEDCouplingUMesh::getWarpField ( ) const throw (INTERP_KERNEL::Exception)

The returned newly created field has to be managed by the caller. This method returns a field on cell with no time lying on 'this'. The meshdimension must be equal to 2 and the spacedimension must be equal to 3. If not an exception will be thrown. This method for the moment only deals with NORM_QUAD4 geometric type. If a cell has an another type an exception will be thrown.

References ParaMEDMEM::MEDCouplingPointSet::_coords, ParaMEDMEM::DataArrayDouble::alloc(), checkCoherency(), ParaMEDMEM::RefCountObject::decrRef(), ParaMEDMEM::DataArrayDouble::getConstPointer(), ParaMEDMEM::DataArrayInt::getConstPointer(), getMeshDimension(), getNumberOfCells(), ParaMEDMEM::DataArrayDouble::getPointer(), ParaMEDMEM::MEDCouplingPointSet::getSpaceDimension(), New(), ParaMEDMEM::NO_TIME, INTERP_KERNEL::NORM_QUAD4, and ParaMEDMEM::ON_CELLS.

MEDCouplingFieldDouble * MEDCouplingUMesh::getSkewField ( ) const throw (INTERP_KERNEL::Exception)

The returned newly created field has to be managed by the caller. This method returns a field on cell with no time lying on 'this'. The meshdimension must be equal to 2 and the spacedimension must be equal to 3. If not an exception will be thrown. This method for the moment only deals with NORM_QUAD4 geometric type. If a cell has an another type an exception will be thrown.

References ParaMEDMEM::MEDCouplingPointSet::_coords, ParaMEDMEM::DataArrayDouble::alloc(), checkCoherency(), ParaMEDMEM::RefCountObject::decrRef(), ParaMEDMEM::DataArrayDouble::getConstPointer(), ParaMEDMEM::DataArrayInt::getConstPointer(), getMeshDimension(), getNumberOfCells(), ParaMEDMEM::DataArrayDouble::getPointer(), ParaMEDMEM::MEDCouplingPointSet::getSpaceDimension(), New(), ParaMEDMEM::NO_TIME, INTERP_KERNEL::NORM_QUAD4, and ParaMEDMEM::ON_CELLS.

std::vector< int > MEDCouplingUMesh::getDistributionOfTypes ( ) const throw (INTERP_KERNEL::Exception)
virtual

This method expects that 'this' is sorted by types. If not an exception will be thrown. This method returns in the same format as code (see MEDCouplingUMesh::checkTypeConsistencyAndContig or MEDCouplingUMesh::splitProfilePerType) how 'this' is composed in cell types. The returned array is of size 3*n where n is the number of different types present in 'this'. For every k in [0,n] ret[3*k+2]==0 because it has no sense here. This parameter is kept only for compatibility with other methode listed above.

Implements ParaMEDMEM::MEDCouplingMesh.

References getAllTypes(), ParaMEDMEM::DataArrayInt::getConstPointer(), and getNumberOfCells().

DataArrayInt * MEDCouplingUMesh::checkTypeConsistencyAndContig ( const std::vector< int > &  code,
const std::vector< const DataArrayInt * > &  idsPerType 
) const throw (INTERP_KERNEL::Exception)
virtual

This method is used to check that this has contiguous cell type in same order than described in 'code'. only for types cell, type node is not managed. Format of 'code' is the following. 'code' should be of size 3*n and non empty. If not an exception is thrown. foreach k in [0,n) on 3*k pos represent the geometric type and 3*k+1 number of elements of type 3*k. 3*k+2 refers if different from -1 the pos in 'idsPerType' to get the corresponding array. If 2 or more same geometric type is in 'code' and exception is thrown too.

This method firstly checks If it exists k so that 3*k geometric type is not in geometric types of this an exception will be thrown. If it exists k so that 3*k geometric type exists but the number of consecutive cell types does not match, an exception is thrown too.

If all geometric types in 'code' are exactly those in 'this' null pointer is returned. If it exists a geometric type in 'this' not in 'code' no exception is thrown and a DataArrayInt instance is returned that the user has the responsability to deallocate.

Implements ParaMEDMEM::MEDCouplingMesh.

References ParaMEDMEM::DataArrayInt::alloc(), ParaMEDMEM::DataArrayInt::getPointer(), and ParaMEDMEM::DataArrayInt::New().

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

This method makes the hypothesis that 'this' is sorted by type. If not an exception will be thrown. This method is the opposite of MEDCouplingUMesh::checkTypeConsistencyAndContig method. Given a list of cells in 'profile' it returns a list of profiles sorted by geo type. This method has 1 input 'profile' and 2 outputs 'code' and 'idsPerType'.

Exceptions
if'profile' has not exactly one component. It throws too, if 'profile' contains some values not in [0,getNumberOfCells()) or if 'this' is not fully defined

Implements ParaMEDMEM::MEDCouplingMesh.

References ParaMEDMEM::DataArrayInt::getIdsEqual(), ParaMEDMEM::DataArray::getNumberOfTuples(), ParaMEDMEM::RefCountObject::incrRef(), and ParaMEDMEM::DataArrayInt::splitByValueRange().

MEDCouplingUMesh * MEDCouplingUMesh::emulateMEDMEMBDC ( const MEDCouplingUMesh nM1LevMesh,
DataArrayInt desc,
DataArrayInt descIndx,
DataArrayInt *&  revDesc,
DataArrayInt *&  revDescIndx,
DataArrayInt *&  nM1LevMeshIds,
DataArrayInt *&  meshnM1Old2New 
) const throw (INTERP_KERNEL::Exception)

This method is here too emulate the MEDMEM behaviour on BDC (buildDescendingConnectivity). Hoping this method becomes deprecated very soon. This method make the assumption that 'this' and 'nM1LevMesh' mesh lyies on same coords (same pointer) as MED and MEDMEM does. The following equality should be verified 'nM1LevMesh->getMeshDimension()==this->getMeshDimension()-1' This method returns 5+2 elements. 'desc', 'descIndx', 'revDesc', 'revDescIndx' and 'meshnM1' behaves exactly as ParaMEDMEM::MEDCouplingUMesh::buildDescendingConnectivity except the content as described after. The returned array specifies the n-1 mesh reordered by type as MEDMEM does. 'nM1LevMeshIds' contains the ids in returned 'meshnM1'. Finally 'meshnM1Old2New' contains numbering old2new that is to say the cell #k in coarse 'nM1LevMesh' will have the number ret[k] in returned mesh 'nM1LevMesh' MEDMEM reordered.

References ParaMEDMEM::RefCountObject::decrRef(), ParaMEDMEM::DataArrayInt::getMaxValue(), ParaMEDMEM::RefCountObject::incrRef(), New(), and ParaMEDMEM::DataArrayInt::New().

DataArrayInt * MEDCouplingUMesh::sortCellsInMEDFileFrmt ( ) throw (INTERP_KERNEL::Exception)

This method sorts cell in this so that cells are sorted by cell type specified by MEDMEM and so for MED file. It avoids to deal with renum in MEDLoader so it is usefull for MED file R/W with multi types. This method returns a newly allocated array old2New. This method expects that connectivity of this is set. If not an exception will be thrown. Coordinates are not taken into account.

References getRenumArrForConsecutiveCellTypesSpec(), INTERP_KERNEL::NORM_HEXA20, INTERP_KERNEL::NORM_HEXA8, INTERP_KERNEL::NORM_HEXGP12, INTERP_KERNEL::NORM_PENTA15, INTERP_KERNEL::NORM_PENTA6, INTERP_KERNEL::NORM_POINT1, INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_POLYHED, INTERP_KERNEL::NORM_PYRA13, INTERP_KERNEL::NORM_PYRA5, INTERP_KERNEL::NORM_QPOLYG, INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_QUAD8, INTERP_KERNEL::NORM_SEG2, INTERP_KERNEL::NORM_SEG3, INTERP_KERNEL::NORM_TETRA10, INTERP_KERNEL::NORM_TETRA4, INTERP_KERNEL::NORM_TRI3, INTERP_KERNEL::NORM_TRI6, and renumberCells().

bool MEDCouplingUMesh::checkConsecutiveCellTypes ( ) const

This methods checks that cells are sorted by their types. This method makes asumption (no check) that connectivity is correctly set before calling.

References ParaMEDMEM::DataArrayInt::getConstPointer(), and getNumberOfCells().

Referenced by cellsByType().

bool MEDCouplingUMesh::checkConsecutiveCellTypesAndOrder ( const INTERP_KERNEL::NormalizedCellType orderBg,
const INTERP_KERNEL::NormalizedCellType orderEnd 
) const

This method performs the same job as checkConsecutiveCellTypes except that the order of types sequence is analyzed to check that the order is specified in array defined by [orderBg,orderEnd).

References ParaMEDMEM::DataArrayInt::getConstPointer(), and getNumberOfCells().

DataArrayInt * MEDCouplingUMesh::getLevArrPerCellTypes ( const INTERP_KERNEL::NormalizedCellType orderBg,
const INTERP_KERNEL::NormalizedCellType orderEnd,
DataArrayInt *&  nbPerType 
) const throw (INTERP_KERNEL::Exception)

This method returns 2 newly allocated DataArrayInt instances. The first is an array of size 'this->getNumberOfCells()' with one component, that tells for each cell the pos of its type in the array on type given in input parameter. The 2nd output parameter is an array with the same number of tuples than input type array and with one component. This 2nd output array gives type by type the number of occurence of type in 'this'.

References ParaMEDMEM::DataArrayDouble::getPointer(), and ParaMEDMEM::DataArrayInt::New().

DataArrayInt * MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec ( const INTERP_KERNEL::NormalizedCellType orderBg,
const INTERP_KERNEL::NormalizedCellType orderEnd 
) const throw (INTERP_KERNEL::Exception)

This method is similar to method MEDCouplingUMesh::rearrange2ConsecutiveCellTypes except that the type order is specfied by [orderBg,orderEnd) (as MEDCouplingUMesh::checkConsecutiveCellTypesAndOrder method) and that this method is const and performs NO permutation in 'this'. This method returns an array of size getNumberOfCells() that gives a renumber array old2New that can be used as input of MEDCouplingMesh::renumberCells. The mesh after this call to MEDCouplingMesh::renumberCells will pass the test of MEDCouplingUMesh::checkConsecutiveCellTypesAndOrder with the same inputs. The returned array minimizes the permutations that is to say the order of cells inside same geometric type remains the same.

References ParaMEDMEM::RefCountObject::decrRef().

Referenced by sortCellsInMEDFileFrmt().

DataArrayInt * MEDCouplingUMesh::rearrange2ConsecutiveCellTypes ( )

This method reorganize the cells of 'this' so that the cells with same geometric types are put together. The number of cells remains unchanged after the call of this method. This method tries to minimizes the number of needed permutations. So, this method behaves not exactly as MEDCouplingUMesh::sortCellsInMEDFileFrmt.

Returns
the array giving the correspondance old to new.

References ParaMEDMEM::DataArrayInt::alloc(), computeTypes(), ParaMEDMEM::DataArrayInt::getConstPointer(), getNumberOfCells(), ParaMEDMEM::DataArrayInt::getPointer(), New(), and renumberCells().

std::vector< MEDCouplingUMesh * > MEDCouplingUMesh::splitByType ( ) const

This method splits 'this' into as mush as untructured meshes that consecutive set of same type cells. So this method has typically a sense if MEDCouplingUMesh::checkConsecutiveCellTypes has a sense. This method makes asumption that connectivity is correctly set before calling.

References buildPartOfMySelf(), ParaMEDMEM::DataArrayInt::getConstPointer(), and getNumberOfCells().

DataArrayInt * MEDCouplingUMesh::keepCellIdsByType ( INTERP_KERNEL::NormalizedCellType  type,
const int *  begin,
const int *  end 
) const throw (INTERP_KERNEL::Exception)

This method returns a newly created DataArrayInt instance. This method retrieves cell ids in [begin,end) that have the type 'type'.

References ParaMEDMEM::DataArrayInt::alloc(), ParaMEDMEM::DataArrayInt::getPointer(), and ParaMEDMEM::DataArrayInt::New().

DataArrayInt * MEDCouplingUMesh::convertCellArrayPerGeoType ( const DataArrayInt da) const throw (INTERP_KERNEL::Exception)

This method makes the assumption that da->getNumberOfTuples()<this->getNumberOfCells(). This method makes the assumption that ids contained in 'da' are in [0:getNumberOfCells())

References ParaMEDMEM::DataArrayInt::alloc(), ParaMEDMEM::DataArray::copyStringInfoFrom(), ParaMEDMEM::DataArrayInt::getPointer(), and ParaMEDMEM::DataArrayInt::New().

MEDCouplingUMesh * MEDCouplingUMesh::keepSpecifiedCells ( INTERP_KERNEL::NormalizedCellType  type,
const int *  idsPerGeoTypeBg,
const int *  idsPerGeoTypeEnd 
) const

This method reduced number of cells of this by keeping cells whose type is different from 'type' and if type=='type' cells whose ids is in 'idsPerGeoType' array. This method conserves coords and name of mesh.

References buildPartOfMySelf(), ParaMEDMEM::RefCountObject::decrRef(), getNumberOfCells(), and getTypeOfCell().

std::vector< bool > MEDCouplingUMesh::getQuadraticStatus ( ) const throw (INTERP_KERNEL::Exception)

This method returns a vector of size 'this->getNumberOfCells()'. This method retrieves for each cell in 'this' if it is linear (false) or quadratic(true).

References ParaMEDMEM::DataArrayInt::getConstPointer(), getNodalConnectivity(), getNodalConnectivityIndex(), and getNumberOfCells().

MEDCouplingMesh * MEDCouplingUMesh::mergeMyselfWith ( const MEDCouplingMesh other) const
virtual

Returns a newly created mesh (with ref count ==1) that contains merge of 'this' and 'other'.

Implements ParaMEDMEM::MEDCouplingMesh.

References ParaMEDMEM::MEDCouplingMesh::getType(), MergeUMeshes(), and ParaMEDMEM::UNSTRUCTURED.

DataArrayDouble * MEDCouplingUMesh::getBarycenterAndOwner ( ) const
virtual
DataArrayDouble * MEDCouplingUMesh::getPartBarycenterAndOwner ( const int *  begin,
const int *  end 
) const

This method is similar to MEDCouplingUMesh::getBarycenterAndOwner except that it works on subPart of 'this' without building explicitely it. The input part is defined by an array [begin,end). All ids contained in this array should be less than this->getNumberOfCells(). No check of that will be done !

References ParaMEDMEM::MEDCouplingPointSet::_coords, ParaMEDMEM::DataArrayDouble::alloc(), ParaMEDMEM::DataArrayDouble::getConstPointer(), ParaMEDMEM::DataArrayInt::getConstPointer(), ParaMEDMEM::DataArrayDouble::getPointer(), ParaMEDMEM::MEDCouplingPointSet::getSpaceDimension(), and New().

Referenced by buildPartOrthogonalField().

MEDCouplingUMesh * MEDCouplingUMesh::Build0DMeshFromCoords ( DataArrayDouble da) throw (INTERP_KERNEL::Exception)
static

This method expects as input a DataArrayDouble non nul instance 'da' that should be allocated. If not an exception is thrown.

References New(), ParaMEDMEM::DataArrayInt::New(), INTERP_KERNEL::NORM_POINT1, and ParaMEDMEM::MEDCouplingPointSet::setCoords().

MEDCouplingUMesh * MEDCouplingUMesh::MergeUMeshes ( const MEDCouplingUMesh mesh1,
const MEDCouplingUMesh mesh2 
) throw (INTERP_KERNEL::Exception)
static

Returns a newly created mesh (with ref count ==1) that contains merge of 'mesh1' and 'other'. The coords of 'mesh2' are added at the end of coords of 'mesh1'.

Referenced by ParaMEDMEM::MEDCouplingFieldDouble::MergeFields(), ParaMEDMEM::MEDCouplingMesh::MergeMeshes(), and mergeMyselfWith().

MEDCouplingUMesh * MEDCouplingUMesh::MergeUMeshes ( std::vector< const MEDCouplingUMesh * > &  a) throw (INTERP_KERNEL::Exception)
static

This method returns in case of success a mesh constitued from union of all meshes in 'a'. There should be no presence of null pointer into 'a'. If any an INTERP_KERNEL::Exception will be thrown. The returned mesh will contain aggregation of nodes in 'a' (in the same order) and aggregation of cells in meshes in 'a' (in the same order too).

References ParaMEDMEM::MEDCouplingPointSet::getCoords(), and ParaMEDMEM::DataArray::getNumberOfComponents().

MEDCouplingUMesh * MEDCouplingUMesh::MergeUMeshesOnSameCoords ( const MEDCouplingUMesh mesh1,
const MEDCouplingUMesh mesh2 
) throw (INTERP_KERNEL::Exception)
static

Idem MergeUMeshes except that 'meshes' are expected to lyie on the same coords and 'meshes' have the same meshdim. 'meshes' must be a non empty vector.

Referenced by FuseUMeshesOnSameCoords().

MEDCouplingUMesh * MEDCouplingUMesh::MergeUMeshesOnSameCoords ( const std::vector< const MEDCouplingUMesh * > &  meshes)
static

Idem MergeUMeshes except that 'meshes' are expected to lyie on the same coords and 'meshes' have the same meshdim. 'meshes' must be a non empty vector.

References ParaMEDMEM::DataArrayInt::alloc(), ParaMEDMEM::DataArrayDouble::begin(), ParaMEDMEM::RefCountObject::decrRef(), ParaMEDMEM::DataArrayInt::getPointer(), New(), setConnectivity(), ParaMEDMEM::MEDCouplingPointSet::setCoords(), setMeshDimension(), and ParaMEDMEM::MEDCouplingMesh::setName().

MEDCouplingUMesh * MEDCouplingUMesh::FuseUMeshesOnSameCoords ( const std::vector< const MEDCouplingUMesh * > &  meshes,
int  compType,
std::vector< DataArrayInt * > &  corr 
)
static

This method fuses meshes 'meshes' and returns the fused mesh and the correspondances arrays for each mesh in 'meshes' in returned mesh. If a same cell is detected in several meshes in 'meshes', this cell will appear only once in returned mesh (see ParaMEDMEM::MEDCouplingUMesh::zipConnectivityTraducer for more details)

Parameters
meshesinput non empty vector containing meshes having same coordiantes array and same mesh dimension.
compTypesee MEDCouplingUMesh::zipConnectivityTraducer
corroutput vector with same size as 'meshes' parameter. corr[i] is the correspondance array of mesh meshes[i] in returned mesh. The arrays contained in 'corr' parameter are returned with refcounter set to one. To avoid memory leaks the caller have to deal with each instances of DataArrayInt contained in 'corr' parameter.
Returns
The mesh lying on the same coordinates than those in meshes. All cells in 'meshes' are in returned mesh with
Exceptions
ifmeshes is a empty vector or meshes are not lying on same coordinates or meshes not have the same dimension.

References ParaMEDMEM::DataArrayInt::alloc(), ParaMEDMEM::RefCountObject::decrRef(), ParaMEDMEM::DataArrayInt::getConstPointer(), ParaMEDMEM::MEDCouplingMesh::getName(), ParaMEDMEM::DataArrayInt::getPointer(), MergeUMeshesOnSameCoords(), New(), ParaMEDMEM::DataArray::setName(), and zipConnectivityTraducer().

Referenced by ParaMEDMEM::MEDFileUMesh::setGroupsFromScratch().

void MEDCouplingUMesh::PutUMeshesOnSameAggregatedCoords ( const std::vector< MEDCouplingUMesh * > &  meshes) throw (INTERP_KERNEL::Exception)
static

This method takes in input meshes meshes containing no null reference. If any an INTERP_KERNEL::Exception will be thrown. meshes should have a good coherency (connectivity and coordinates well defined). All mesh in meshes must have the same space dimension. If not an INTERP_KERNEL:Exception will be thrown. But mesh in meshes can have different mesh dimension each other.

This method performs nothing if size of meshes is in [0,1]. This method is particulary usefull in MEDLoader context to build a MEDFileUMesh instance that expects that underlying coordinates DataArrayDouble instance.

Parameters
[in,out]meshes: vector containing no null instance of MEDCouplingUMesh that in case of success of this method will be modified.

References ParaMEDMEM::DataArrayDouble::Aggregate().

void MEDCouplingUMesh::MergeNodesOnUMeshesSharingSameCoords ( const std::vector< MEDCouplingUMesh * > &  meshes,
double  eps 
) throw (INTERP_KERNEL::Exception)
static

This method takes in input meshes meshes containing no null reference. If any an INTERP_KERNEL::Exception will be thrown. meshes should have a good coherency (connectivity and coordinates well defined). All mesh in meshes must have the same space dimension. If not an INTERP_KERNEL:Exception will be thrown. But mesh in meshes can have different mesh dimension each other. If meshes share the same instance of DataArrayDouble as coordinates and that this instance is null, this method do nothing and no exception will be thrown.

This method performs nothing if size of meshes is empty. This method is particulary usefull in MEDLoader context to perform a treatment of a MEDFileUMesh instance on different levels. coordinates DataArrayDouble instance.

Parameters
[in,out]meshes:vector containing no null instance of MEDCouplingUMesh sharing the same DataArrayDouble instance of coordinates, that in case of success of this method will be modified.
[in]epsis the distance in absolute (that should be positive !), so that 2 or more points within a distance of eps will be merged into a single point.

References ParaMEDMEM::DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(), ParaMEDMEM::DataArrayDouble::findCommonTuples(), ParaMEDMEM::DataArray::getNumberOfTuples(), and ParaMEDMEM::DataArrayDouble::renumberAndReduce().

bool MEDCouplingUMesh::IsPolygonWellOriented ( bool  isQuadratic,
const double *  vec,
const int *  begin,
const int *  end,
const double *  coords 
)
static

This static operates only for coords in 3D. The polygon is specfied by its connectivity nodes in [begin,end).

bool MEDCouplingUMesh::IsPolyhedronWellOriented ( const int *  begin,
const int *  end,
const double *  coords 
)
static

The polyhedron is specfied by its connectivity nodes in [begin,end).

References EPS_FOR_POLYH_ORIENTATION.

Referenced by orientCorrectlyPolyhedrons().

void MEDCouplingUMesh::TryToCorrectPolyhedronOrientation ( int *  begin,
int *  end,
const double *  coords 
) throw (INTERP_KERNEL::Exception)
static

This method tries to obtain a well oriented polyhedron. If the algorithm fails, an exception will be thrown.

Referenced by orientCorrectlyPolyhedrons().

Member Data Documentation

double MEDCouplingUMesh::EPS_FOR_POLYH_ORIENTATION = 1.e-14
static
Copyright © 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS