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

Public Member Functions

std::string advancedRepr () const
 
void allocateCells (int nbOfCells=0)
 
void are2DCellsNotCorrectlyOriented (const double *vec, bool polyOnly, std::vector< int > &cells) const
 
bool areCellsIncludedIn (const MEDCouplingUMesh *other, int compType, DataArrayInt *&arr) const
 
bool areCellsIncludedInPolicy7 (const MEDCouplingUMesh *other, DataArrayInt *&arr) const
 
bool areOnlySimplexCells () const
 
void arePolyhedronsNotCorrectlyOriented (std::vector< int > &cells) const
 
MEDCouplingUMeshbuildBoundaryMesh (bool keepCoords) const
 
MEDCouplingUMeshbuildDescendingConnectivity (DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const
 
MEDCouplingUMeshbuildDescendingConnectivity2 (DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const
 
MEDCouplingFieldDoublebuildDirectionVectorField () const
 
MEDCouplingUMeshbuildExtrudedMesh (const MEDCouplingUMesh *mesh1D, int policy)
 
MEDCouplingUMeshbuildFacePartOfMySelfNode (const int *begin, const int *end, bool fullyIn) const
 
MEDCouplingFieldDoublebuildOrthogonalField () const
 
MEDCouplingUMeshbuildPartOfMySelf (const int *begin, const int *end, bool keepCoords=true) const
 
MEDCouplingUMeshbuildPartOfMySelfSlice (int start, int end, int step, bool keepCoords=true) const
 
MEDCouplingFieldDoublebuildPartOrthogonalField (const int *begin, const int *end) const
 
MEDCouplingUMeshbuildSetInstanceFromThis (int spaceDim) const
 
MEDCouplingUMeshbuildSlice3D (const double *origin, const double *vec, double eps, DataArrayInt *&cellIds) const
 
MEDCouplingUMeshbuildSlice3DSurf (const double *origin, const double *vec, double eps, DataArrayInt *&cellIds) const
 
MEDCouplingUMeshbuildSpreadZonesWithPoly () const
 
DataArrayIntbuildUnionOf2DMesh () const
 
DataArrayIntbuildUnionOf3DMesh () const
 
MEDCouplingUMeshbuildUnstructured () const
 
MEDCouplingUMeshCellIteratorcellIterator ()
 
MEDCouplingUMeshCellByTypeEntrycellsByType ()
 
void changeOrientationOfCells ()
 
void checkButterflyCells (std::vector< int > &cells, double eps=1e-12) const
 
bool checkConsecutiveCellTypes () const
 
bool checkConsecutiveCellTypesAndOrder (const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd) const
 
bool checkConsecutiveCellTypesForMEDFileFrmt () const
 
void checkConsistency (double eps=1e-12) const
 
void checkConsistencyLight () const
 
void checkFastEquivalWith (const MEDCouplingMesh *other, double prec) const
 
DataArrayIntcheckTypeConsistencyAndContig (const std::vector< int > &code, const std::vector< const DataArrayInt * > &idsPerType) const
 
MCAuto< MEDCouplingUMeshclipSingle3DCellByPlane (const double origin[3], const double vec[3], double eps) const
 
MEDCouplingUMeshclone (bool recDeepCpy) const
 
DataArrayIntcolinearize2D (double eps)
 
DataArrayDoublecomputeCellCenterOfMass () const
 
void computeCellNeighborhoodFromNodesOne (const DataArrayInt *nodeNeigh, const DataArrayInt *nodeNeighI, MCAuto< DataArrayInt > &cellNeigh, MCAuto< DataArrayInt > &cellNeighIndex) const
 
MEDCouplingFieldDoublecomputeDiameterField () const
 
DataArrayIntcomputeEffectiveNbOfNodesPerCell () const
 
DataArrayIntcomputeFetchedNodeIds () const
 
DataArrayDoublecomputeIsoBarycenterOfNodesPerCell () const
 
DataArrayIntcomputeNbOfFacesPerCell () const
 
DataArrayIntcomputeNbOfNodesPerCell () const
 
void computeNeighborsOfCells (DataArrayInt *&neighbors, DataArrayInt *&neighborsIdx) const
 
void computeNeighborsOfNodes (DataArrayInt *&neighbors, DataArrayInt *&neighborsIdx) const
 
void computeNodeIdsAlg (std::vector< bool > &nodeIdsInUse) const
 
DataArrayDoublecomputePlaneEquationOf3DFaces () const
 
MEDCouplingUMeshcomputeSkin () const
 
void computeTypes ()
 
DataArrayIntconformize2D (double eps)
 
DataArrayIntconformize3D (double eps)
 
void convertAllToPoly ()
 
DataArrayIntconvertCellArrayPerGeoType (const DataArrayInt *da) const
 
void convertDegeneratedCells ()
 
void convertExtrudedPolyhedra ()
 
MEDCoupling1GTUMeshconvertIntoSingleGeoTypeMesh () const
 
DataArrayIntconvertLinearCellsToQuadratic (int conversionType=0)
 
void convertNodalConnectivityToDynamicGeoTypeMesh (DataArrayInt *&nodalConn, DataArrayInt *&nodalConnIndex) const
 
DataArrayIntconvertNodalConnectivityToStaticGeoTypeMesh () const
 
void convertQuadraticCellsToLinear ()
 
void convertToPolyTypes (const int *cellIdsToConvertBg, const int *cellIdsToConvertEnd)
 
DataArrayIntconvexEnvelop2D ()
 
std::string cppRepr () const
 
MEDCouplingUMeshdeepCopy () const
 
MEDCouplingUMeshdeepCopyConnectivityOnly () const
 
double distanceToPoint (const double *ptBg, const double *ptEnd, int &cellId) const
 
DataArrayDoubledistanceToPoints (const DataArrayDouble *pts, DataArrayInt *&cellIds) const
 
void duplicateNodes (const int *nodeIdsToDuplicateBg, const int *nodeIdsToDuplicateEnd)
 
void duplicateNodesInConn (const int *nodeIdsToDuplicateBg, const int *nodeIdsToDuplicateEnd, int offset)
 
MEDCouplingUMeshemulateMEDMEMBDC (const MEDCouplingUMesh *nM1LevMesh, DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *&revDesc, DataArrayInt *&revDescIndx, DataArrayInt *&nM1LevMeshIds, DataArrayInt *&meshnM1Old2New) const
 
MEDCouplingUMeshexplode3DMeshTo1D (DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const
 
MEDCouplingUMeshexplodeMeshIntoMicroEdges (DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *revDesc, DataArrayInt *revDescIndx) const
 
DataArrayIntfindAndCorrectBadOriented3DCells ()
 
DataArrayIntfindAndCorrectBadOriented3DExtrudedCells ()
 
DataArrayIntfindBoundaryNodes () const
 
void findCellIdsLyingOn (const MEDCouplingUMesh &otherDimM1OnSameCoords, DataArrayInt *&cellIdsRk0, DataArrayInt *&cellIdsRk1) const
 
DataArrayIntfindCellIdsOnBoundary () const
 
void findCommonCells (int compType, int startCellId, DataArrayInt *&commonCellsArr, DataArrayInt *&commonCellsIArr) const
 
void findNodesToDuplicate (const MEDCouplingUMesh &otherDimM1OnSameCoords, DataArrayInt *&nodeIdsToDuplicate, DataArrayInt *&cellIdsNeededToBeRenum, DataArrayInt *&cellIdsNotModified) const
 
void finishInsertingCells ()
 
MEDCouplingSkyLineArray * generateGraph () const
 
std::set
< INTERP_KERNEL::NormalizedCellType
getAllGeoTypes () const
 
std::vector
< INTERP_KERNEL::NormalizedCellType
getAllGeoTypesSorted () const
 
MEDCouplingFieldDoublegetAspectRatioField () const
 
DataArrayDoublegetBoundingBoxForBBTree (double arcDetEps=1e-12) const
 
DataArrayDoublegetBoundingBoxForBBTree1DQuadratic (double arcDetEps=1e-12) const
 
DataArrayDoublegetBoundingBoxForBBTree2DQuadratic (double arcDetEps=1e-12) const
 
DataArrayDoublegetBoundingBoxForBBTreeFast () const
 
int getCellContainingPoint (const double *pos, double eps) const
 
DataArrayIntgetCellIdsCrossingPlane (const double *origin, const double *vec, double eps) const
 
void getCellsContainingPoint (const double *pos, double eps, std::vector< int > &elts) const
 
void getCellsContainingPoints (const double *pos, int nbOfPoints, double eps, MCAuto< DataArrayInt > &elts, MCAuto< DataArrayInt > &eltsIndex) const
 
DataArrayIntgetCellsInBoundingBox (const double *bbox, double eps) const
 
DataArrayIntgetCellsInBoundingBox (const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps)
 
std::vector< const
BigMemoryObject * > 
getDirectChildrenWithNull () const
 
std::vector< int > getDistributionOfTypes () const
 
MEDCouplingFieldDoublegetEdgeRatioField () const
 
void getFastAveragePlaneOfThis (double *vec, double *pos) const
 
std::size_t getHeapMemorySizeWithoutChildren () const
 
DataArrayIntgetLevArrPerCellTypes (const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd, DataArrayInt *&nbPerType) const
 
MEDCouplingFieldDoublegetMeasureField (bool isAbs) const
 
MEDCouplingFieldDoublegetMeasureFieldOnNode (bool isAbs) const
 
int getMeshDimension () const
 
const DataArrayIntgetNodalConnectivity () const
 
DataArrayIntgetNodalConnectivity ()
 
int getNodalConnectivityArrayLen () const
 
const DataArrayIntgetNodalConnectivityIndex () const
 
DataArrayIntgetNodalConnectivityIndex ()
 
DataArrayIntgetNodeIdsInUse (int &nbrOfNodesInUse) const
 
void getNodeIdsOfCell (int cellId, std::vector< int > &conn) const
 
int getNumberOfCells () const
 
int getNumberOfCellsWithType (INTERP_KERNEL::NormalizedCellType type) const
 
int getNumberOfNodesInCell (int cellId) const
 
DataArrayDoublegetPartBarycenterAndOwner (const int *begin, const int *end) const
 
DataArrayDoublegetPartMeasureField (bool isAbs, const int *begin, const int *end) const
 
std::vector< bool > getQuadraticStatus () const
 
DataArrayIntgetRenumArrForConsecutiveCellTypesSpec (const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd) const
 
DataArrayIntgetRenumArrForMEDFileFrmt () const
 
void getReverseNodalConnectivity (DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const
 
MEDCouplingFieldDoublegetSkewField () const
 
void getTinySerializationInformation (std::vector< double > &tinyInfoD, std::vector< int > &tinyInfo, std::vector< std::string > &littleStrings) const
 
MEDCouplingMeshType getType () const
 
INTERP_KERNEL::NormalizedCellType getTypeOfCell (int cellId) const
 
std::set
< INTERP_KERNEL::NormalizedCellType
getTypesOfPart (const int *begin, const int *end) const
 
std::string getVTKDataSetType () const
 
std::string getVTKFileExtension () const
 
MEDCouplingFieldDoublegetWarpField () const
 
DataArrayIntgiveCellsWithType (INTERP_KERNEL::NormalizedCellType type) const
 
void insertNextCell (INTERP_KERNEL::NormalizedCellType type, int size, const int *nodalConnOfCell)
 
bool isContiguous1D () const
 
bool isEmptyMesh (const std::vector< int > &tinyInfo) const
 
bool isEqualIfNotWhy (const MEDCouplingMesh *other, double prec, std::string &reason) const
 
bool isEqualWithoutConsideringStr (const MEDCouplingMesh *other, double prec) const
 
bool isFullyQuadratic () const
 
bool isPresenceOfQuadratic () const
 
DataArrayIntkeepCellIdsByType (INTERP_KERNEL::NormalizedCellType type, const int *begin, const int *end) const
 
MEDCouplingUMeshkeepSpecifiedCells (INTERP_KERNEL::NormalizedCellType type, const int *idsPerGeoTypeBg, const int *idsPerGeoTypeEnd) const
 
MEDCouplingMeshmergeMyselfWith (const MEDCouplingMesh *other) const
 
MEDCouplingUMeshmergeMyselfWithOnSameCoords (const MEDCouplingPointSet *other) const
 
DataArrayIntorderConsecutiveCells1D () const
 
void orientCorrectly2DCells (const double *vec, bool polyOnly)
 
void orientCorrectlyPolyhedrons ()
 
std::vector< DataArrayInt * > partitionBySpreadZone () const
 
void project1D (const double *pt, const double *v, double eps, double *res) const
 
DataArrayIntrearrange2ConsecutiveCellTypes ()
 
void renumberCells (const int *old2NewBg, bool check=true)
 
void renumberNodesInConn (const INTERP_KERNEL::HashMap< int, int > &newNodeNumbersO2N)
 
void renumberNodesInConn (const int *newNodeNumbersO2N)
 
void renumberNodesWithOffsetInConn (int offset)
 
std::string reprConnectivityOfThis () const
 
void reprQuickOverview (std::ostream &stream) 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 setConnectivity (DataArrayInt *conn, DataArrayInt *connIndex, bool isComputingTypes=true)
 
void setMeshDimension (int meshDim)
 
void setPartOfMySelf (const int *cellIdsBg, const int *cellIdsEnd, const MEDCouplingUMesh &otherOnSameCoordsThanThis)
 
void setPartOfMySelfSlice (int start, int end, int step, const MEDCouplingUMesh &otherOnSameCoordsThanThis)
 
void shallowCopyConnectivityFrom (const MEDCouplingPointSet *other)
 
void shiftNodeNumbersInConn (int delta)
 
std::string simpleRepr () const
 
DataArrayIntsimplexize (int policy)
 
void simplifyPolyhedra (double eps)
 
DataArrayIntsortCellsInMEDFileFrmt ()
 
int split2DCells (const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *subNodesInSeg, const DataArrayInt *subNodesInSegI, const DataArrayInt *midOpt=0, const DataArrayInt *midOptI=0)
 
std::vector< MEDCouplingUMesh * > splitByType () const
 
void splitProfilePerType (const DataArrayInt *profile, std::vector< int > &code, std::vector< DataArrayInt * > &idsInPflPerType, std::vector< DataArrayInt * > &idsPerType) const
 
void tessellate2D (double eps)
 
MEDCoupling1SGTUMeshtetrahedrize (int policy, DataArrayInt *&n2oCells, int &nbOfAdditionalPoints) const
 
bool unPolyze ()
 
void unserialization (const std::vector< double > &tinyInfoD, const std::vector< int > &tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector< std::string > &littleStrings)
 
void updateTime () const
 
void writeVTKLL (std::ostream &ofs, const std::string &cellData, const std::string &pointData, DataArrayByte *byteData) const
 
DataArrayIntzipCoordsTraducer ()
 
- Public Member Functions inherited from MEDCoupling::MEDCouplingPointSet
virtual bool areAllNodesFetched () const
 
bool areCellsFrom2MeshEqual (const MEDCouplingPointSet *other, int cellId, double prec) const
 
bool areCoordsEqual (const MEDCouplingPointSet &other, double prec) const
 
bool areCoordsEqualIfNotWhy (const MEDCouplingPointSet &other, double prec, std::string &reason) const
 
bool areCoordsEqualWithoutConsideringStr (const MEDCouplingPointSet &other, double prec) const
 
DataArrayIntbuildNewNumberingFromCommonNodesFormat (const DataArrayInt *comm, const DataArrayInt *commIndex, int &newNbOfNodes) const
 
MEDCouplingMeshbuildPart (const int *start, const int *end) const
 
MEDCouplingMeshbuildPartAndReduceNodes (const int *start, const int *end, DataArrayInt *&arr) const
 
virtual MEDCouplingPointSetbuildPartOfMySelfNode (const int *start, const int *end, bool fullyIn) const
 
MEDCouplingMeshbuildPartRange (int beginCellIds, int endCellIds, int stepCellIds) const
 
MEDCouplingMeshbuildPartRangeAndReduceNodes (int beginCellIds, int endCellIds, int stepCellIds, int &beginOut, int &endOut, int &stepOut, DataArrayInt *&arr) const
 
DataArrayIntbuildPermArrayForMergeNode (double precision, int limitNodeId, bool &areNodesMerged, int &newNbOfNodes) const
 
void changeSpaceDimension (int newSpaceDim, double dftVal=0.)
 
void checkDeepEquivalOnSameNodesWith (const MEDCouplingMesh *other, int cellCompPol, double prec, DataArrayInt *&cellCor) const
 
void checkDeepEquivalWith (const MEDCouplingMesh *other, int cellCompPol, double prec, DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const
 
void copyTinyStringsFrom (const MEDCouplingMesh *other)
 
void duplicateNodesInCoords (const int *nodeIdsToDuplicateBg, const int *nodeIdsToDuplicateEnd)
 
void findCommonNodes (double prec, int limitNodeId, DataArrayInt *&comm, DataArrayInt *&commIndex) const
 
void findNodesOnLine (const double *pt, const double *vec, double eps, std::vector< int > &nodes) const
 
void findNodesOnPlane (const double *pt, const double *vec, double eps, std::vector< int > &nodes) const
 
void getBoundingBox (double *bbox) const
 
double getCaracteristicDimension () const
 
DataArrayIntgetCellIdsFullyIncludedInNodeIds (const int *partBg, const int *partEnd) const
 
DataArrayIntgetCellIdsLyingOnNodes (const int *begin, const int *end, bool fullyIn) const
 
DataArrayDoublegetCoordinatesAndOwner () const
 
void getCoordinatesOfNode (int nodeId, std::vector< double > &coo) const
 
const DataArrayDoublegetCoords () const
 
DataArrayDoublegetCoords ()
 
const DataArrayDoublegetDirectAccessOfCoordsArrIfInStructure () const
 
DataArrayIntgetNodeIdsNearPoint (const double *pos, double eps) const
 
void getNodeIdsNearPoints (const double *pos, int nbOfPoints, double eps, DataArrayInt *&c, DataArrayInt *&cI) const
 
int getNumberOfNodes () const
 
int getSpaceDimension () const
 
virtual DataArrayIntmergeNodes (double precision, bool &areNodesMerged, int &newNbOfNodes)
 
virtual DataArrayIntmergeNodesCenter (double precision, bool &areNodesMerged, int &newNbOfNodes)
 
void recenterForMaxPrecision (double eps)
 
virtual void renumberNodes (const int *newNodeNumbers, int newNbOfNodes)
 
virtual void renumberNodesCenter (const int *newNodeNumbers, int newNbOfNodes)
 
void rotate (const double *center, const double *vector, double angle)
 
void scale (const double *point, double factor)
 
void setCoords (const DataArrayDouble *coords)
 
void translate (const double *vector)
 
void tryToShareSameCoords (const MEDCouplingPointSet &other, double epsilon)
 
virtual void tryToShareSameCoordsPermute (const MEDCouplingPointSet &other, double epsilon)
 
virtual DataArrayIntzipConnectivityTraducer (int compType, int startCellId=0)
 
void zipCoords ()
 
- Public Member Functions inherited from MEDCoupling::MEDCouplingMesh
virtual bool areCompatibleForMerge (const MEDCouplingMesh *other) const
 
void checkGeoEquivalWith (const MEDCouplingMesh *other, int levOfCheck, double prec, DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const
 
virtual void copyTinyInfoFrom (const MEDCouplingMesh *other)
 
virtual MEDCouplingFieldDoublefillFromAnalytic (TypeOfField t, int nbOfComp, FunctionToEvaluate func) const
 
virtual MEDCouplingFieldDoublefillFromAnalytic (TypeOfField t, int nbOfComp, const std::string &func) const
 
virtual MEDCouplingFieldDoublefillFromAnalyticCompo (TypeOfField t, int nbOfComp, const std::string &func) const
 
virtual MEDCouplingFieldDoublefillFromAnalyticNamedCompo (TypeOfField t, int nbOfComp, const std::vector< std::string > &varsOrder, const std::string &func) const
 
std::string getDescription () const
 
std::string getName () const
 
double getTime (int &iteration, int &order) const
 
std::string getTimeUnit () const
 
std::string getVTKFileNameOf (const std::string &fileName) const
 
virtual bool isEqual (const MEDCouplingMesh *other, double prec) const
 
bool isStructured () const
 
void setDescription (const std::string &descr)
 
void setName (const std::string &name)
 
void setTime (double val, int iteration, int order)
 
void setTimeUnit (const std::string &unit)
 
std::string writeVTK (const std::string &fileName, bool isBinary=true) const
 
- Public Member Functions inherited from MEDCoupling::TimeLabel
void declareAsNew () const
 
std::size_t getTimeOfThis () const
 
TimeLabeloperator= (const TimeLabel &other)
 

Static Public Member Functions

static MEDCouplingUMeshAggregateSortedByTypeMeshesOnSameCoords (const std::vector< const MEDCouplingUMesh * > &ms, DataArrayInt *&szOfCellGrpOfSameType, DataArrayInt *&idInMsOfCellGrpOfSameType)
 
static int AreCellsEqual (const int *conn, const int *connI, int cell1, int cell2, int compType)
 
static int AreCellsEqualPolicy0 (const int *conn, const int *connI, int cell1, int cell2)
 
static int AreCellsEqualPolicy1 (const int *conn, const int *connI, int cell1, int cell2)
 
static int AreCellsEqualPolicy2 (const int *conn, const int *connI, int cell1, int cell2)
 
static int AreCellsEqualPolicy2NoType (const int *conn, const int *connI, int cell1, int cell2)
 
static int AreCellsEqualPolicy7 (const int *conn, const int *connI, int cell1, int cell2)
 
static MEDCouplingUMeshBuild0DMeshFromCoords (DataArrayDouble *da)
 
static MCAuto< MEDCouplingUMeshBuild1DMeshFromCoords (DataArrayDouble *da)
 
static bool BuildConvexEnvelopOf2DCellJarvis (const double *coords, const int *nodalConnBg, const int *nodalConnEnd, DataArrayInt *nodalConnecOut)
 
static void ComputeNeighborsOfCellsAdv (const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *revDesc, const DataArrayInt *revDescI, DataArrayInt *&neighbors, DataArrayInt *&neighborsIdx)
 
static DataArrayIntComputeSpreadZoneGradually (const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn)
 
static DataArrayIntComputeSpreadZoneGraduallyFromSeed (const int *seedBg, const int *seedEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, int nbOfDepthPeeling, int &nbOfDepthPeelingPerformed)
 
static void ComputeVecAndPtOfFace (double eps, const double *coords, const int *begin, const int *end, double *v, double *p)
 
static void CorrectExtrudedStaticCell (int *begin, int *end)
 
static void ExtractFromIndexedArrays (const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, DataArrayInt *&arrOut, DataArrayInt *&arrIndexOut)
 
static void ExtractFromIndexedArraysSlice (int idsOfSelectStart, int idsOfSelectStop, int idsOfSelectStep, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, DataArrayInt *&arrOut, DataArrayInt *&arrIndexOut)
 
static void FindCommonCellsAlg (int compType, int startCellId, const DataArrayInt *nodal, const DataArrayInt *nodalI, const DataArrayInt *revNodal, const DataArrayInt *revNodalI, DataArrayInt *&commonCellsArr, DataArrayInt *&commonCellsIArr)
 
static MEDCouplingUMeshFuseUMeshesOnSameCoords (const std::vector< const MEDCouplingUMesh * > &meshes, int compType, std::vector< DataArrayInt * > &corr)
 
static MEDCouplingUMeshIntersect2DMeshes (const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps, DataArrayInt *&cellNb1, DataArrayInt *&cellNb2)
 
static void Intersect2DMeshWith1DLine (const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps, MEDCouplingUMesh *&splitMesh2D, MEDCouplingUMesh *&splitMesh1D, DataArrayInt *&cellIdInMesh2D, DataArrayInt *&cellIdInMesh1D)
 
static bool Is3DExtrudedStaticCellWellOriented (const int *begin, const int *end, const double *coords)
 
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 bool IsPyra5WellOriented (const int *begin, const int *end, const double *coords)
 
static bool IsTetra4WellOriented (const int *begin, const int *end, const double *coords)
 
static void MergeNodesOnUMeshesSharingSameCoords (const std::vector< MEDCouplingUMesh * > &meshes, double eps)
 
static MEDCouplingUMeshMergeUMeshes (const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2)
 
static MEDCouplingUMeshMergeUMeshes (const std::vector< const MEDCouplingUMesh * > &a)
 
static MEDCouplingUMeshMergeUMeshesOnSameCoords (const MEDCouplingUMesh *mesh1, const MEDCouplingUMesh *mesh2)
 
static MEDCouplingUMeshMergeUMeshesOnSameCoords (const std::vector< const MEDCouplingUMesh * > &meshes)
 
static MEDCouplingUMeshNew ()
 
static MEDCouplingUMeshNew (const std::string &meshName, int meshDim)
 
static std::vector
< DataArrayInt * > 
PartitionBySpreadZone (const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn)
 
static void PutUMeshesOnSameAggregatedCoords (const std::vector< MEDCouplingUMesh * > &meshes)
 
static bool RemoveIdsFromIndexedArrays (const int *idsToRemoveBg, const int *idsToRemoveEnd, DataArrayInt *arr, DataArrayInt *arrIndx, int offsetForRemoval=0)
 
static void SetPartOfIndexedArrays (const int *idsOfSelectBg, const int *idsOfSelectEnd, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex, DataArrayInt *&arrOut, DataArrayInt *&arrIndexOut)
 
static void SetPartOfIndexedArraysSameIdx (const int *idsOfSelectBg, const int *idsOfSelectEnd, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn, const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex)
 
static void SetPartOfIndexedArraysSameIdxSlice (int start, int end, int step, DataArrayInt *arrInOut, const DataArrayInt *arrIndxIn, const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex)
 
static void SetPartOfIndexedArraysSlice (int start, int end, int step, const DataArrayInt *arrIn, const DataArrayInt *arrIndxIn, const DataArrayInt *srcArr, const DataArrayInt *srcArrIndex, DataArrayInt *&arrOut, DataArrayInt *&arrIndexOut)
 
static void SimplifyPolyhedronCell (double eps, const DataArrayDouble *coords, const int *begin, const int *end, DataArrayInt *res)
 
static void TryToCorrectPolyhedronOrientation (int *begin, int *end, const double *coords)
 
- Static Public Member Functions inherited from MEDCoupling::MEDCouplingPointSet
static MEDCouplingPointSetBuildInstanceFromMeshType (MEDCouplingMeshType type)
 
static DataArrayIntComputeNbOfInteractionsWithSrcCells (const MEDCouplingPointSet *srcMesh, const MEDCouplingPointSet *trgMesh, double eps)
 
static DataArrayDoubleMergeNodesArray (const MEDCouplingPointSet *m1, const MEDCouplingPointSet *m2)
 
static DataArrayDoubleMergeNodesArray (const std::vector< const MEDCouplingPointSet * > &ms)
 
- Static Public Member Functions inherited from MEDCoupling::MEDCouplingMesh
static
INTERP_KERNEL::NormalizedCellType 
GetCorrespondingPolyType (INTERP_KERNEL::NormalizedCellType type)
 
static int GetDimensionOfGeometricType (INTERP_KERNEL::NormalizedCellType type)
 
static int GetNumberOfNodesOfGeometricType (INTERP_KERNEL::NormalizedCellType type)
 
static const char * GetReprOfGeometricType (INTERP_KERNEL::NormalizedCellType type)
 
static bool IsLinearGeometricType (INTERP_KERNEL::NormalizedCellType type)
 
static bool IsStaticGeometricType (INTERP_KERNEL::NormalizedCellType type)
 
static MEDCouplingMeshMergeMeshes (const MEDCouplingMesh *mesh1, const MEDCouplingMesh *mesh2)
 
static MEDCouplingMeshMergeMeshes (std::vector< const MEDCouplingMesh * > &meshes)
 

Static Public Attributes

static double EPS_FOR_POLYH_ORIENTATION =1.e-14
 

Additional Inherited Members

- Protected Member Functions inherited from MEDCoupling::MEDCouplingPointSet
 MEDCouplingPointSet ()
 
 MEDCouplingPointSet (const MEDCouplingPointSet &other, bool deepCopy)
 
void project2DCellOnXY (const int *startConn, const int *endConn, std::vector< double > &res) const
 
void rotate2D (const double *center, double angle)
 
void rotate3D (const double *center, const double *vect, double angle)
 
 ~MEDCouplingPointSet ()
 
- Static Protected Member Functions inherited from MEDCoupling::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 MEDCoupling::MEDCouplingPointSet
DataArrayDouble_coords
 

Member Function Documentation

MEDCouplingUMesh * MEDCouplingUMesh::New ( const std::string &  meshName,
int  meshDim 
)
static
MEDCouplingUMesh * MEDCouplingUMesh::deepCopy ( ) const
virtual

Returns a new MEDCouplingUMesh which is a full copy of this one. No data is shared between this and the new mesh.

Returns
MEDCouplingUMesh * - a new instance of MEDCouplingMesh. The caller is to delete this mesh using decrRef() as it is no more needed.

Implements MEDCoupling::MEDCouplingMesh.

References clone().

Referenced by MEDCoupling::MEDFileUMesh::buildExtrudedMesh(), deepCopyConnectivityOnly(), MEDCoupling::MEDFileUMesh::linearToQuadratic(), MEDCoupling::MEDFileUMesh::New(), MEDCoupling::MEDFileUMesh::quadraticToLinear(), MEDCoupling::WriteUMesh(), and MEDCoupling::MEDCouplingFieldDouble::zipConnectivity().

MEDCouplingUMesh * MEDCouplingUMesh::clone ( bool  recDeepCpy) const
virtual

Returns a new MEDCouplingUMesh which is a copy of this one.

Parameters
[in]recDeepCpy- if true, the copy is deep, else all data arrays of this mesh are shared by the new mesh.
Returns
MEDCouplingUMesh * - a new instance of MEDCouplingMesh. The caller is to delete this mesh using decrRef() as it is no more needed.

Implements MEDCoupling::MEDCouplingMesh.

Referenced by MEDCoupling::MEDFileUMesh::buildExtrudedMesh(), MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear(), deepCopy(), deepCopyConnectivityOnly(), getCellIdsCrossingPlane(), MEDCoupling::MEDCouplingMappedExtrudedMesh::Project1DMeshes(), and MEDCoupling::ReadFieldsOnSameMesh().

MEDCouplingUMesh * MEDCouplingUMesh::deepCopyConnectivityOnly ( ) const
virtual

This method behaves mostly like MEDCouplingUMesh::deepCopy method, except that only nodal connectivity arrays are deeply copied. The coordinates are shared between this and the returned instance.

Returns
MEDCouplingUMesh * - A new object instance holding the copy of this (deep for connectivity, shallow for coordiantes)
See Also
MEDCouplingUMesh::deepCopy

Implements MEDCoupling::MEDCouplingPointSet.

References clone(), deepCopy(), getNodalConnectivity(), getNodalConnectivityIndex(), MEDCoupling::MCAuto< T >::retn(), and setConnectivity().

void MEDCouplingUMesh::shallowCopyConnectivityFrom ( const MEDCouplingPointSet other)
virtual
void MEDCouplingUMesh::updateTime ( ) const
virtual
std::size_t MEDCouplingUMesh::getHeapMemorySizeWithoutChildren ( ) const
virtual
std::vector< const BigMemoryObject * > MEDCouplingUMesh::getDirectChildrenWithNull ( ) const
virtual
MEDCouplingMeshType MEDCoupling::MEDCouplingUMesh::getType ( ) const
virtual
bool MEDCouplingUMesh::isEqualIfNotWhy ( const MEDCouplingMesh other,
double  prec,
std::string &  reason 
) const
virtual

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

Reimplemented from MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::MEDCouplingPointSet::isEqualIfNotWhy(), and MEDCoupling::DataArrayInt::isEqualIfNotWhy().

bool MEDCouplingUMesh::isEqualWithoutConsideringStr ( const MEDCouplingMesh other,
double  prec 
) const
virtual

Checks if data arrays of this mesh (node coordinates, nodal connectivity of cells, etc) of two meshes are same. Textual data like name etc. are not considered.

Parameters
[in]other- the mesh to compare with.
[in]prec- precision value used to compare node coordinates.
Returns
bool - true if the two meshes are same.

Reimplemented from MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::MEDCouplingPointSet::isEqualWithoutConsideringStr(), and MEDCoupling::DataArrayInt::isEqualWithoutConsideringStr().

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

Checks if this and other meshes are geometrically equivalent with high probability, else an exception is thrown. The meshes are considered equivalent if (1) meshes contain the same number of nodes and the same number of elements of the same types (2) three cells of the two meshes (first, last and middle) are based on coincident nodes (with a specified precision).

Parameters
[in]other- the mesh to compare with.
[in]prec- the precision used to compare nodes of the two meshes.
Exceptions
Ifthe two meshes do not match.

Reimplemented from MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::MEDCouplingPointSet::checkFastEquivalWith().

void MEDCouplingUMesh::checkConsistencyLight ( ) const
virtual

Checks if this mesh is well defined. If no exception is thrown by this method, then this mesh is most probably is writable, exchangeable and available for most of algorithms. When a mesh is constructed from scratch, it is a good habit to call this method to check that all is in order with this mesh.

Exceptions
Ifthe mesh dimension is not set.
Ifthe coordinates array is not set (if mesh dimension != -1 ).
Ifthis mesh contains elements of dimension different from the mesh dimension.
Ifthe connectivity data array has more than one component.
Ifthe connectivity data array has a named component.
Ifthe connectivity index data array has more than one component.
Ifthe connectivity index data array has a named component.

Reimplemented from MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::MEDCouplingPointSet::checkConsistencyLight(), MEDCoupling::DataArray::getInfoOnComponent(), and MEDCoupling::DataArray::getNumberOfComponents().

Referenced by MEDCoupling::MEDFileUMesh::buildExtrudedMesh(), checkConsistency(), colinearize2D(), computeCellNeighborhoodFromNodesOne(), computeDiameterField(), conformize2D(), conformize3D(), MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear(), getAspectRatioField(), getEdgeRatioField(), getSkewField(), getWarpField(), and MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell().

void MEDCouplingUMesh::checkConsistency ( double  eps = 1e-12) const
virtual

Checks if this mesh is well defined. If no exception is thrown by this method, then this mesh is most probably is writable, exchangeable and available for all algorithms.
In addition to the checks performed by checkConsistencyLight(), this method thoroughly checks the nodal connectivity.

Parameters
[in]eps- a not used parameter.
Exceptions
Ifthe mesh dimension is not set.
Ifthe coordinates array is not set (if mesh dimension != -1 ).
Ifthis mesh contains elements of dimension different from the mesh dimension.
Ifthe connectivity data array has more than one component.
Ifthe connectivity data array has a named component.
Ifthe connectivity index data array has more than one component.
Ifthe connectivity index data array has a named component.
Ifnumber of nodes defining an element does not correspond to the type of element.
Ifthe nodal connectivity includes an invalid node id.

Implements MEDCoupling::MEDCouplingMesh.

References checkConsistencyLight(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), and INTERP_KERNEL::NORM_POLYHED.

void MEDCouplingUMesh::setMeshDimension ( int  meshDim)

Sets dimension of this mesh. The mesh dimension in general depends on types of elements contained in the mesh. For more info on the mesh dimension see Unstructured mesh.

Parameters
[in]meshDim- a new mesh dimension.
Exceptions
IfmeshDim is invalid. A valid range is -1 <= meshDim <= 3.

References MEDCoupling::TimeLabel::declareAsNew().

Referenced by MergeUMeshesOnSameCoords(), New(), and unserialization().

void MEDCouplingUMesh::allocateCells ( int  nbOfCells = 0)

Allocates memory to store an estimation of the given number of cells. The closer is the estimation to the number of cells effectively inserted, the less will the library need to reallocate memory. If the number of cells to be inserted is not known simply put 0 to this parameter. If a nodal connectivity previouly existed before the call of this method, it will be reset.

Parameters
[in]nbOfCells- estimation of the number of cell this mesh will contain.

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

References MEDCoupling::TimeLabel::declareAsNew(), MEDCoupling::RefCountObjectOnly::decrRef(), MEDCoupling::DataArrayInt::New(), MEDCoupling::DataArrayTemplate< T >::pushBackSilent(), and MEDCoupling::DataArrayTemplate< T >::reserve().

Referenced by buildSpreadZonesWithPoly(), and SimplifyPolyhedronCell().

void MEDCouplingUMesh::insertNextCell ( INTERP_KERNEL::NormalizedCellType  type,
int  size,
const int *  nodalConnOfCell 
)

Appends a cell to the connectivity array. For deeper understanding what is happening see How MEDCouplingUMesh stores its nodal connectivity.

Parameters
[in]type- type of cell to add.
[in]size- number of nodes constituting this cell.
[in]nodalConnOfCell- the connectivity of the cell to add.

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

References MEDCoupling::DataArrayTemplate< T >::back(), MEDCoupling::DataArrayTemplate< T >::pushBackSilent(), and MEDCoupling::DataArrayInt::writeOnPlace().

Referenced by buildSpreadZonesWithPoly(), and SimplifyPolyhedronCell().

void MEDCouplingUMesh::finishInsertingCells ( )

Compacts data arrays to release unused memory. This method is to be called after finishing cell insertion using this->insertNextCell().

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

References MEDCoupling::TimeLabel::declareAsNew(), MEDCoupling::DataArrayTemplate< T >::pack(), and updateTime().

Referenced by buildSpreadZonesWithPoly(), and SimplifyPolyhedronCell().

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

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

std::set< INTERP_KERNEL::NormalizedCellType > MEDCouplingUMesh::getAllGeoTypes ( ) const
virtual

Returns a set of all cell types available in this mesh.

Returns
std::set<INTERP_KERNEL::NormalizedCellType> - the set of cell types.
Warning
this method does not throw any exception even if this is not defined.
See Also
MEDCouplingUMesh::getAllGeoTypesSorted

Implements MEDCoupling::MEDCouplingMesh.

Referenced by convertCellArrayPerGeoType(), getDistributionOfTypes(), MEDCoupling::MEDCoupling1GTUMesh::New(), MEDCoupling::MEDCoupling1SGTUMesh::New(), and MEDCoupling::MEDCoupling1DGTUMesh::New().

std::vector< INTERP_KERNEL::NormalizedCellType > MEDCouplingUMesh::getAllGeoTypesSorted ( ) const

This method returns the sorted list of geometric types in this. Sorted means in the same order than the cells in this. A single entry in return vector means the maximal chunk of consecutive cells in this having the same geometric type. So a same geometric type can appear more than once if the cells are not sorted per geometric type.

Exceptions
ifconnectivity in this is not correctly defined.
See Also
MEDCouplingMesh::getAllGeoTypes

References MEDCoupling::DataArrayTemplate< T >::begin(), getNodalConnectivityArrayLen(), and getNumberOfCells().

std::set< INTERP_KERNEL::NormalizedCellType > MEDCouplingUMesh::getTypesOfPart ( const int *  begin,
const int *  end 
) const

Returns types of cells of the specified part of this mesh. This method avoids computing sub-mesh explicitely to get its types.

Parameters
[in]begin- an array of cell ids of interest.
[in]end- the end of begin, i.e. a pointer to its (last+1)-th element.
Returns
std::set<INTERP_KERNEL::NormalizedCellType> - a set of enumeration items describing the cell types.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.
See Also
getAllGeoTypes()

References MEDCoupling::DataArrayTemplate< T >::getConstPointer().

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

Defines the nodal connectivity using given connectivity arrays in Indirect indexing format. Optionally updates a set of types of cells constituting this mesh. This method is for advanced users having prepared their connectivity before. For more info on using this method see Advanced building of an unstructured mesh from scratch.

Parameters
[in]conn- the nodal connectivity array.
[in]connIndex- the nodal connectivity index array.
[in]isComputingTypes- if true, the set of types constituting this mesh is updated.

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

Referenced by buildSetInstanceFromThis(), buildSlice3D(), buildSlice3DSurf(), MEDCoupling::MEDCoupling1SGTUMesh::buildUnstructured(), MEDCoupling::MEDCoupling1DGTUMesh::buildUnstructured(), clipSingle3DCellByPlane(), colinearize2D(), convertLinearCellsToQuadratic(), convertQuadraticCellsToLinear(), convertToPolyTypes(), convexEnvelop2D(), deepCopyConnectivityOnly(), emulateMEDMEMBDC(), Intersect2DMeshes(), MergeUMeshesOnSameCoords(), renumberCells(), setPartOfMySelf(), setPartOfMySelfSlice(), shallowCopyConnectivityFrom(), simplifyPolyhedra(), and unserialization().

DataArrayInt* MEDCoupling::MEDCouplingUMesh::getNodalConnectivity ( )
DataArrayInt* MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex ( )
INTERP_KERNEL::NormalizedCellType MEDCouplingUMesh::getTypeOfCell ( int  cellId) const
virtual

Returns a type of a cell by its id.

Parameters
[in]cellId- the id of the cell of interest.
Returns
INTERP_KERNEL::NormalizedCellType - enumeration item describing the cell type.
Exceptions
IfcellId is invalid. Valid range is [0, this->getNumberOfCells() ).

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::DataArrayTemplate< T >::getConstPointer(), and MEDCoupling::DataArrayTemplate< T >::getNbOfElems().

Referenced by convertQuadraticCellsToLinear(), isFullyQuadratic(), and isPresenceOfQuadratic().

DataArrayInt * MEDCouplingUMesh::giveCellsWithType ( INTERP_KERNEL::NormalizedCellType  type) const
virtual

This method returns a newly allocated array containing cell ids (ascendingly sorted) whose geometric type are equal to type. This method does not throw exception if geometric type type is not in this. This method throws an INTERP_KERNEL::Exception if meshdimension of this is not equal to those of type. The coordinates array is not considered here.

Parameters
[in]typethe geometric type
Returns
cell ids in this having geometric type type.

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArrayInt::New(), MEDCoupling::DataArrayTemplate< T >::pushBackSilent(), and MEDCoupling::MCAuto< T >::retn().

Referenced by computeDiameterField().

int MEDCouplingUMesh::getNumberOfCellsWithType ( INTERP_KERNEL::NormalizedCellType  type) const
virtual

Returns nb of cells having the geometric type type. No throw if no cells in this has the geometric type type.

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::DataArrayTemplate< T >::getConstPointer(), and getNumberOfCells().

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

Returns the nodal connectivity of a given cell. The separator of faces within polyhedron connectivity (-1) is not returned, thus all returned node ids can be used in getCoordinatesOfNode().

Parameters
[in]cellId- an id of the cell of interest.
[in,out]conn- a vector where the node ids are appended. It is not cleared before the appending.
Exceptions
IfcellId is invalid. Valid range is [0, this->getNumberOfCells() ).

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::DataArrayTemplate< T >::getConstPointer().

Referenced by buildDirectionVectorField(), and MEDCoupling::MEDCouplingMappedExtrudedMesh::Project1DMeshes().

std::string MEDCouplingUMesh::advancedRepr ( ) const
virtual
std::string MEDCouplingUMesh::cppRepr ( ) const

This method returns a C++ code that is a dump of this. This method will throw if this is not fully defined.

References MEDCoupling::MEDCouplingPointSet::_coords, getMeshDimension(), MEDCoupling::MEDCouplingMesh::getName(), MEDCoupling::DataArrayDouble::reprCppStream(), and MEDCoupling::DataArrayInt::reprCppStream().

std::string MEDCouplingUMesh::reprConnectivityOfThis ( ) const
MEDCouplingUMesh * MEDCouplingUMesh::buildSetInstanceFromThis ( int  spaceDim) const

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 MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::alloc(), getMeshDimension(), MEDCoupling::MEDCouplingMesh::getName(), MEDCoupling::RefCountObjectOnly::incrRef(), New(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::DataArrayInt::New(), MEDCoupling::MCAuto< T >::retn(), setConnectivity(), MEDCoupling::MEDCouplingPointSet::setCoords(), and MEDCoupling::DataArrayTemplate< T >::setIJ().

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

Returns a number of cells constituting this mesh.

Returns
int - the number of cells in this mesh.
Exceptions
Ifthe nodal connectivity of cells is not defined.

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples().

Referenced by are2DCellsNotCorrectlyOriented(), areCellsIncludedIn(), areCellsIncludedInPolicy7(), areOnlySimplexCells(), arePolyhedronsNotCorrectlyOriented(), buildBoundaryMesh(), buildDirectionVectorField(), MEDCoupling::MEDFileUMesh::buildExtrudedMesh(), buildOrthogonalField(), buildSlice3D(), buildSlice3DSurf(), buildUnionOf2DMesh(), buildUnionOf3DMesh(), changeOrientationOfCells(), checkButterflyCells(), checkConsecutiveCellTypes(), checkConsecutiveCellTypesAndOrder(), checkConsistency(), checkTypeConsistencyAndContig(), clipSingle3DCellByPlane(), colinearize2D(), computeCellCenterOfMass(), computeCellNeighborhoodFromNodesOne(), computeDiameterField(), computeEffectiveNbOfNodesPerCell(), computeIsoBarycenterOfNodesPerCell(), computeNbOfFacesPerCell(), computeNbOfNodesPerCell(), computeNodeIdsAlg(), computePlaneEquationOf3DFaces(), conformize2D(), conformize3D(), convertAllToPoly(), convertCellArrayPerGeoType(), convertDegeneratedCells(), convertExtrudedPolyhedra(), convertNodalConnectivityToDynamicGeoTypeMesh(), convertNodalConnectivityToStaticGeoTypeMesh(), convertQuadraticCellsToLinear(), convertToPolyTypes(), convexEnvelop2D(), distanceToPoints(), duplicateNodesInConn(), findAndCorrectBadOriented3DCells(), findAndCorrectBadOriented3DExtrudedCells(), findCellIdsOnBoundary(), findNodesToDuplicate(), generateGraph(), getAllGeoTypesSorted(), getAspectRatioField(), getBoundingBoxForBBTree1DQuadratic(), getBoundingBoxForBBTree2DQuadratic(), getBoundingBoxForBBTreeFast(), getCellsInBoundingBox(), getDistributionOfTypes(), getEdgeRatioField(), getLevArrPerCellTypes(), MEDCoupling::MEDCouplingFieldDiscretizationGaussNE::getLocalizationOfDiscValues(), getMeasureField(), getNodeIdsInUse(), getNumberOfCellsWithType(), getQuadraticStatus(), getReverseNodalConnectivity(), getSkewField(), getTinySerializationInformation(), getWarpField(), giveCellsWithType(), Intersect2DMeshWith1DLine(), isContiguous1D(), isFullyQuadratic(), isPresenceOfQuadratic(), MEDCoupling::MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell(), MEDCoupling::MEDCouplingUMeshCellByTypeIterator::MEDCouplingUMeshCellByTypeIterator(), MEDCoupling::MEDCouplingUMeshCellIterator::MEDCouplingUMeshCellIterator(), MEDCoupling::MEDCoupling1SGTUMesh::New(), MEDCoupling::MEDCoupling1DGTUMesh::New(), orderConsecutiveCells1D(), orientCorrectly2DCells(), orientCorrectlyPolyhedrons(), project1D(), rearrange2ConsecutiveCellTypes(), renumberCells(), renumberNodesInConn(), renumberNodesWithOffsetInConn(), serialize(), setPartOfMySelf(), setPartOfMySelfSlice(), shiftNodeNumbersInConn(), simpleRepr(), simplifyPolyhedra(), SimplifyPolyhedronCell(), splitByType(), splitProfilePerType(), tetrahedrize(), unPolyze(), MEDCoupling::WriteField(), and writeVTKLL().

int MEDCouplingUMesh::getMeshDimension ( ) const
virtual

Returns a dimension of this mesh, i.e. a dimension of cells constituting this mesh. For more info see Meshes.

Returns
int - the dimension of this mesh.
Exceptions
Ifthe mesh dimension is not defined using setMeshDimension().

Implements MEDCoupling::MEDCouplingMesh.

Referenced by MEDCoupling::InterpolationMatrix::addContribution(), are2DCellsNotCorrectlyOriented(), areOnlySimplexCells(), arePolyhedronsNotCorrectlyOriented(), buildDirectionVectorField(), buildExtrudedMesh(), MEDCoupling::MEDFileUMesh::buildExtrudedMesh(), buildOrthogonalField(), buildPartOfMySelf(), buildPartOfMySelfSlice(), buildPartOrthogonalField(), buildSetInstanceFromThis(), buildSlice3D(), buildSlice3DSurf(), buildSpreadZonesWithPoly(), buildUnionOf2DMesh(), buildUnionOf3DMesh(), changeOrientationOfCells(), checkButterflyCells(), checkConsistency(), clipSingle3DCellByPlane(), colinearize2D(), computeNeighborsOfNodes(), computePlaneEquationOf3DFaces(), conformize2D(), conformize3D(), convertDegeneratedCells(), convertExtrudedPolyhedra(), convertLinearCellsToQuadratic(), convertToPolyTypes(), convexEnvelop2D(), cppRepr(), distanceToPoint(), distanceToPoints(), emulateMEDMEMBDC(), explode3DMeshTo1D(), explodeMeshIntoMicroEdges(), findAndCorrectBadOriented3DCells(), findAndCorrectBadOriented3DExtrudedCells(), findCellIdsLyingOn(), findNodesToDuplicate(), generateGraph(), getAspectRatioField(), getBoundingBoxForBBTree(), getBoundingBoxForBBTree1DQuadratic(), getBoundingBoxForBBTree2DQuadratic(), getCellsContainingPoints(), getCellsInBoundingBox(), getEdgeRatioField(), getFastAveragePlaneOfThis(), getMeasureField(), getMeasureFieldOnNode(), getPartMeasureField(), getSkewField(), getTinySerializationInformation(), getWarpField(), giveCellsWithType(), Intersect2DMeshes(), Intersect2DMeshWith1DLine(), isContiguous1D(), MEDCoupling::MEDFileUMesh::linearToQuadratic(), orderConsecutiveCells1D(), orientCorrectly2DCells(), orientCorrectlyPolyhedrons(), project1D(), serialize(), MEDCoupling::MEDFileUMesh::setMeshes(), setPartOfMySelf(), setPartOfMySelfSlice(), simplifyPolyhedra(), split2DCells(), tessellate2D(), tetrahedrize(), and unPolyze().

int MEDCouplingUMesh::getNodalConnectivityArrayLen ( ) const

Returns a length of the nodal connectivity array. This method is for test reason. Normally the integer returned is not useable by user. For more info see How MEDCouplingUMesh stores its nodal connectivity.

Returns
int - the length of the nodal connectivity array.

References MEDCoupling::DataArrayTemplate< T >::getNbOfElems().

Referenced by convertDegeneratedCells(), convertQuadraticCellsToLinear(), getAllGeoTypesSorted(), getTinySerializationInformation(), MEDCoupling::MEDCoupling1DGTUMesh::New(), 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 MEDCoupling::MEDCouplingPointSet.

References getMeshDimension(), getNodalConnectivityArrayLen(), getNumberOfCells(), and MEDCoupling::MEDCouplingPointSet::getTinySerializationInformation().

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

First step of unserialization process.

Implements MEDCoupling::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.
a1
a2
littleStrings

Reimplemented from MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::DataArrayTemplate< T >::alloc(), and MEDCoupling::MEDCouplingPointSet::resizeForUnserialization().

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
std::string MEDCouplingUMesh::getVTKDataSetType ( ) const
virtual

Implements MEDCoupling::MEDCouplingMesh.

Referenced by writeVTKLL().

std::string MEDCouplingUMesh::getVTKFileExtension ( ) const
virtual
int MEDCouplingUMesh::AreCellsEqual ( const int *  conn,
const int *  connI,
int  cell1,
int  cell2,
int  compType 
)
static

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

References AreCellsEqualPolicy0(), AreCellsEqualPolicy1(), AreCellsEqualPolicy2(), AreCellsEqualPolicy2NoType(), and AreCellsEqualPolicy7().

int MEDCouplingUMesh::AreCellsEqualPolicy0 ( const int *  conn,
const int *  connI,
int  cell1,
int  cell2 
)
static

This method is the last step of the MEDCouplingPointSet::zipConnectivityTraducer with policy 0.

Referenced by AreCellsEqual().

int MEDCouplingUMesh::AreCellsEqualPolicy1 ( const int *  conn,
const int *  connI,
int  cell1,
int  cell2 
)
static

This method is the last step of the MEDCouplingPointSet::zipConnectivityTraducer with policy 1.

Referenced by AreCellsEqual().

int MEDCouplingUMesh::AreCellsEqualPolicy2 ( const int *  conn,
const int *  connI,
int  cell1,
int  cell2 
)
static

This method is the last step of the MEDCouplingPointSet::zipConnectivityTraducer with policy 2.

Referenced by AreCellsEqual().

int MEDCouplingUMesh::AreCellsEqualPolicy2NoType ( const int *  conn,
const int *  connI,
int  cell1,
int  cell2 
)
static

This method is less restrictive than AreCellsEqualPolicy2. Here the geometric type is absolutely not taken into account !

Referenced by AreCellsEqual().

int MEDCouplingUMesh::AreCellsEqualPolicy7 ( const int *  conn,
const int *  connI,
int  cell1,
int  cell2 
)
static

This method is the last step of the MEDCouplingPointSet::zipConnectivityTraducer with policy 7.

Referenced by AreCellsEqual().

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

Converts specified cells to either polygons (if this is a 2D mesh) or polyhedrons (if this is a 3D mesh). The cells to convert are specified by an array of cell ids. Pay attention that after conversion all algorithms work slower with this mesh than before conversion.
If an exception is thrown during the conversion due presence of invalid ids in the array of cells to convert, as a result this mesh contains some already converted elements. In this case the 2D mesh remains valid but 3D mesh becomes inconsistent!

Warning
This method can significantly modify the order of geometric types in this, hence, to write this mesh to the MED file, its cells must be sorted using sortCellsInMEDFileFrmt().
Parameters
[in]cellIdsToConvertBg- the array holding ids of cells to convert.
[in]cellIdsToConvertEnd- a pointer to the last-plus-one-th element of cellIdsToConvertBg.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is node defined.
Ifdimension of this mesh is not either 2 or 3.

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

References computeTypes(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::New(), INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_POLYHED, INTERP_KERNEL::NORM_QPOLYG, and setConnectivity().

Referenced by convertAllToPoly().

void MEDCouplingUMesh::convertAllToPoly ( )

Converts all cells to either polygons (if this is a 2D mesh) or polyhedrons (if this is a 3D mesh).

Warning
As this method is purely for user-friendliness and no optimization is done to avoid construction of a useless vector, this method can be costly in memory.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is node defined.
Ifdimension of this mesh is not either 2 or 3.

References convertToPolyTypes(), and getNumberOfCells().

void MEDCouplingUMesh::convertExtrudedPolyhedra ( )

Fixes nodal connectivity of invalid cells of type NORM_POLYHED. This method expects that all NORM_POLYHED cells have connectivity similar to that of prismatic volumes like NORM_HEXA8, NORM_PENTA6 etc., i.e. the first half of nodes describes a base facet of the volume and the second half of nodes describes an opposite facet having the same number of nodes as the base one. This method converts such connectivity to a valid polyhedral format where connectivity of each facet is explicitly described and connectivity of facets are separated by -1. If this mesh contains a NORM_POLYHED cell with a valid connectivity, or an invalid connectivity is not as expected, an exception is thrown and the mesh remains unchanged. Care of a correct orientation of the first facet of a polyhedron, else orientation of a corrected cell is reverse.
This method is useful to build an extruded unstructured mesh with polyhedrons as it releases the user from boring description of polyhedra connectivity in the valid format.

Exceptions
Ifthis->getMeshDimension() != 3.
Ifthis->getSpaceDimension() != 3.
Ifthe nodal connectivity of cells is not defined.
Ifthe coordinates array is not set.
Ifthis mesh contains polyhedrons with the valid connectivity.
Ifthis mesh contains polyhedrons with odd number of nodes.

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

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::RefCountObjectOnly::decrRef(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayInt::New(), INTERP_KERNEL::NORM_POLYHED, and MEDCoupling::MCAuto< T >::retn().

bool MEDCouplingUMesh::unPolyze ( )

Converts all polygons (if this is a 2D mesh) or polyhedrons (if this is a 3D mesh) to cells of classical types. This method is opposite to convertToPolyTypes().

Warning
Cells of the result mesh are not sorted by geometric type, hence, to write this mesh to the MED file, its cells must be sorted using sortCellsInMEDFileFrmt().
Cells (and most notably polyhedrons) must be correctly oriented for this to work properly. See orientCorrectlyPolyhedrons() and arePolyhedronsNotCorrectlyOriented().
Returns
true if at least one cell has been converted, false else. In the last case the nodal connectivity remains unchanged.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.
Ifthis->getMeshDimension() < 0.

References computeTypes(), getMeshDimension(), getNodalConnectivityArrayLen(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), INTERP_KERNEL::NORM_ERROR, INTERP_KERNEL::NORM_POLYL, INTERP_KERNEL::NORM_SEG2, and MEDCoupling::DataArrayTemplate< T >::reAlloc().

Referenced by MEDCoupling::MEDFileUMesh::unPolyze().

void MEDCouplingUMesh::simplifyPolyhedra ( double  eps)

This method expects that spaceDimension is equal to 3 and meshDimension equal to 3. This method performs operation only on polyhedrons in this. If no polyhedrons exists in this, this remains unchanged. This method allows to merge if any coplanar 3DSurf cells that may appear in some polyhedrons cells.

Parameters
[in]epsis a relative precision that allows to establish if some 3D plane are coplanar or not. This epsilon is used to recenter around origin to have maximal precision.

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayDouble::deepCopy(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayInt::insertAtTheEnd(), MEDCoupling::DataArrayInt::New(), INTERP_KERNEL::NORM_POLYHED, MEDCoupling::DataArrayDouble::recenterForMaxPrecision(), setConnectivity(), and SimplifyPolyhedronCell().

MEDCouplingUMesh * MEDCouplingUMesh::buildSpreadZonesWithPoly ( ) const

this is expected to be a mesh fully defined whose spaceDim==meshDim. It returns a new allocated mesh having the same mesh dimension and lying on same coordinates. The returned mesh contains as poly cells as number of contiguous zone (regarding connectivity). A spread contiguous zone is built using poly cells (polyhedra in 3D, polygons in 2D and polyline in 1D). The sum of measure field of returned mesh is equal to the sum of measure field of this.

Returns
a newly allocated mesh lying on the same coords than this with same meshdimension than this.

References allocateCells(), MEDCoupling::DataArrayTemplate< T >::begin(), buildPartOfMySelf(), buildUnionOf2DMesh(), buildUnionOf3DMesh(), finishInsertingCells(), MEDCoupling::MEDCouplingPointSet::getCoords(), MEDCoupling::DataArrayTemplate< T >::getIJSafe(), getMeshDimension(), MEDCoupling::MEDCouplingMesh::getName(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), insertNextCell(), New(), partitionBySpreadZone(), MEDCoupling::MCAuto< T >::retn(), and MEDCoupling::MEDCouplingPointSet::setCoords().

Referenced by SimplifyPolyhedronCell().

std::vector< DataArrayInt * > MEDCouplingUMesh::partitionBySpreadZone ( ) const

This method partitions this into contiguous zone. This method only needs a well defined connectivity. Coordinates are not considered here. This method returns a vector of newly allocated arrays that the caller has to deal with.

References computeNeighborsOfCells(), and PartitionBySpreadZone().

Referenced by buildSpreadZonesWithPoly().

DataArrayInt * MEDCouplingUMesh::computeFetchedNodeIds ( ) const
virtual

This method returns all node ids used in the connectivity of this. The data array returned has to be dealt by the caller. The returned node ids are sorted ascendingly. This method is close to MEDCouplingUMesh::getNodeIdsInUse except the format of the returned DataArrayInt instance.

Returns
a newly allocated DataArrayInt sorted ascendingly of fetched node ids.
See Also
MEDCouplingUMesh::getNodeIdsInUse, areAllNodesFetched

Implements MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayInt::BuildListOfSwitchedOn(), computeNodeIdsAlg(), and MEDCoupling::DataArrayTemplate< T >::end().

Referenced by MEDCoupling::MEDCouplingFieldDiscretizationOnNodes::computeMeshRestrictionFromTupleIds(), MEDCoupling::MEDCouplingFieldDiscretizationOnNodes::computeTupleIdsToSelectFromCellIds(), findBoundaryNodes(), findCellIdsLyingOn(), and findNodesToDuplicate().

DataArrayInt * MEDCouplingUMesh::getNodeIdsInUse ( int &  nbrOfNodesInUse) const
virtual

Finds nodes not used in any cell and returns an array giving a new id to every node by excluding the unused nodes, for which the array holds -1. The result array is a mapping in "Old to New" mode.

Parameters
[out]nbrOfNodesInUse- number of node ids present in the nodal connectivity.
Returns
DataArrayInt * - a new instance of DataArrayInt. Its length is this->getNumberOfNodes(). It holds for each node of this mesh either -1 if the node is unused or a new id else. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.
Ifthe nodal connectivity includes an invalid id.

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

See Also
computeFetchedNodeIds, computeNodeIdsAlg()

Implements MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::New(), and MEDCoupling::MCAuto< T >::retn().

void MEDCouplingUMesh::computeNodeIdsAlg ( std::vector< bool > &  nodeIdsInUse) const
virtual
DataArrayInt * MEDCouplingUMesh::computeNbOfNodesPerCell ( ) const
virtual

This method returns a newly allocated array containing this->getNumberOfCells() tuples and 1 component. For each cell in this the number of nodes constituting cell is computed. For each polyhedron cell, the sum of the number of nodes of each face constituting polyhedron cell is returned. So for pohyhedrons some nodes can be counted several times in the returned result.

Returns
a newly allocated array
See Also
MEDCouplingUMesh::computeEffectiveNbOfNodesPerCell

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::New(), INTERP_KERNEL::NORM_POLYHED, and MEDCoupling::MCAuto< T >::retn().

DataArrayInt * MEDCouplingUMesh::computeNbOfFacesPerCell ( ) const
virtual

This method returns a newly allocated array containing this->getNumberOfCells() tuples and 1 component. For each cell in this the number of faces constituting (entity of dimension this->getMeshDimension()-1) cell is computed.

Returns
a newly allocated array

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::New(), and MEDCoupling::MCAuto< T >::retn().

DataArrayInt * MEDCouplingUMesh::computeEffectiveNbOfNodesPerCell ( ) const
virtual

This method computes effective number of nodes per cell. That is to say nodes appearing several times in nodal connectivity of a cell, will be counted only once here whereas it will be counted several times in MEDCouplingUMesh::computeNbOfNodesPerCell method.

Returns
DataArrayInt * - new object to be deallocated by the caller.
See Also
MEDCouplingUMesh::computeNbOfNodesPerCell

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::New(), INTERP_KERNEL::NORM_POLYHED, and MEDCoupling::MCAuto< T >::retn().

DataArrayInt * MEDCouplingUMesh::zipCoordsTraducer ( )
virtual

Removes unused nodes (the node coordinates array is shorten) and returns an array mapping between new and old node ids in "Old to New" mode. -1 values in the returned array mean that the corresponding old node is no more used.

Returns
DataArrayInt * - a new instance of DataArrayInt of length this->getNumberOfNodes() before call of this method. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.
Ifthe nodal connectivity includes an invalid id.
See Also
areAllNodesFetched

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

Reimplemented from MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::MEDCouplingPointSet::zipCoordsTraducer().

Referenced by buildUnionOf2DMesh(), conformize3D(), MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear(), and SimplifyPolyhedronCell().

void MEDCouplingUMesh::findCommonCells ( int  compType,
int  startCellId,
DataArrayInt *&  commonCellsArr,
DataArrayInt *&  commonCellsIArr 
) const
virtual

This method find cells that are equal (regarding compType) in this. The comparison is specified by compType. This method keeps the coordiantes of this. This method is time consuming.

Parameters
[in]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
[in]startCellIdspecifies the cellId starting from which the equality computation will be carried out. By default it is 0, which it means that all cells in this will be scanned.
[out]commonCellsArrcommon cells ids (Indirect indexing)
[out]commonCellsIArrcommon cells ids (Indirect indexing)
Returns
the correspondance array old to new in a newly allocated array.

Implements MEDCoupling::MEDCouplingPointSet.

References FindCommonCellsAlg(), getReverseNodalConnectivity(), and MEDCoupling::DataArrayInt::New().

Referenced by areCellsIncludedInPolicy7(), and MEDCoupling::MEDCoupling1GTUMesh::findCommonCells().

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

Checks if this mesh includes all cells of an other mesh, and returns an array giving for each cell of the other an id of a cell in this mesh. A value larger than this->getNumberOfCells() in the returned array means that there is no corresponding cell in this mesh. It is expected that this and other meshes share the same node coordinates array, if it is not so an exception is thrown.

Parameters
[in]other- the mesh to compare with.
[in]compType- specifies a cell comparison technique. For meaning of its valid values [0,1,2], see zipConnectivityTraducer().
[out]arr- a new instance of DataArrayInt returning correspondence between cells of the two meshes. It contains other->getNumberOfCells() values. The caller is to delete this array using decrRef() as it is no more needed.
Returns
bool - true if all cells of other mesh are present in the this mesh.

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

See Also
checkDeepEquivalOnSameNodesWith()
checkGeoEquivalWith()

References MEDCoupling::DataArrayTemplate< T >::getMaxValue(), MEDCoupling::MEDCouplingMesh::getName(), getNumberOfCells(), MergeUMeshesOnSameCoords(), MEDCoupling::DataArray::setName(), MEDCoupling::DataArrayTemplate< T >::subArray(), and MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer().

Referenced by emulateMEDMEMBDC(), findCellIdsLyingOn(), MEDCoupling::MEDFileUMesh::setGroupsOnSetMesh(), and MEDCoupling::WriteField().

bool MEDCouplingUMesh::areCellsIncludedInPolicy7 ( const MEDCouplingUMesh other,
DataArrayInt *&  arr 
) const

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. The main difference is that this method is not expected to throw exception. This method has two outputs :

Parameters
otherother mesh
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.

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayInt::fillWithZero(), findCommonCells(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), MEDCoupling::MEDCouplingMesh::getName(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MergeUMeshesOnSameCoords(), MEDCoupling::DataArrayInt::New(), MEDCoupling::DataArrayInt::presenceOfValue(), MEDCoupling::MCAuto< T >::retn(), and MEDCoupling::DataArray::setName().

void MEDCouplingUMesh::getReverseNodalConnectivity ( DataArrayInt revNodal,
DataArrayInt revNodalIndx 
) const
virtual

Returns the reverse nodal connectivity. The reverse nodal connectivity enumerates cells each node belongs to.

Warning
For speed reasons, this method does not check if node ids in the nodal connectivity correspond to the size of node coordinates array.
Parameters
[in,out]revNodal- an array holding ids of cells sharing each node.
[in,out]revNodalIndx- an array, of length this->getNumberOfNodes() + 1, dividing cell ids in revNodal into groups each referring to one node. Its every element (except the last one) is an index pointing to the first id of a group of cells. For example cells sharing the node #1 are described by following range of indices: [ revNodalIndx[1], revNodalIndx[2] ) and the cell ids are revNodal[ revNodalIndx[1] ], revNodal[ revNodalIndx[1] + 1], ... Number of cells sharing the i-th node is revNodalIndx[ i+1 ] - revNodalIndx[ i ].
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.

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

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::C_DEALLOC, MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), and MEDCoupling::DataArrayTemplate< T >::useArray().

Referenced by computeNeighborsOfNodes(), findCommonCells(), generateGraph(), getMeasureFieldOnNode(), and MEDCoupling::MEDCouplingMappedExtrudedMesh::getReverseNodalConnectivity().

MEDCouplingUMesh * MEDCouplingUMesh::explode3DMeshTo1D ( DataArrayInt desc,
DataArrayInt descIndx,
DataArrayInt revDesc,
DataArrayInt revDescIndx 
) const

this has to have a mesh dimension equal to 3. If it is not the case an INTERP_KERNEL::Exception will be thrown. This behaves exactly as MEDCouplingUMesh::buildDescendingConnectivity does except that this method compute directly the transition from mesh dimension 3 to sub edges (dimension 1) in one shot. That is to say that this method is equivalent to 2 successive calls to MEDCouplingUMesh::buildDescendingConnectivity. This method returns 4 arrays and a mesh as MEDCouplingUMesh::buildDescendingConnectivity does.

See Also
MEDCouplingUMesh::buildDescendingConnectivity

References getMeshDimension().

Referenced by computeNeighborsOfNodes().

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

Creates a new MEDCouplingUMesh containing cells, of dimension one less than this->getMeshDimension(), that bound cells of this mesh. In addition arrays describing correspondence between cells of this and the result meshes are returned. The arrays desc and descIndx (Indirect indexing) describe the descending connectivity, i.e. enumerate cells of the result mesh bounding each cell of this mesh. The arrays revDesc and revDescIndx (Indirect indexing) describe the reverse descending connectivity, i.e. enumerate cells of this mesh bounded by each cell of the result mesh.

Warning
For speed reasons, this method does not check if node ids in the nodal connectivity correspond to the size of node coordinates array.
Cells of the result mesh are not sorted by geometric type, hence, to write this mesh to the MED file, its cells must be sorted using sortCellsInMEDFileFrmt().
Parameters
[in,out]desc- the array containing cell ids of the result mesh bounding each cell of this mesh.
[in,out]descIndx- the array, of length this->getNumberOfCells() + 1, dividing cell ids in desc into groups each referring to one cell of this mesh. Its every element (except the last one) is an index pointing to the first id of a group of cells. For example cells of the result mesh bounding the cell #1 of this mesh are described by following range of indices: [ descIndx[1], descIndx[2] ) and the cell ids are desc[ descIndx[1] ], desc[ descIndx[1] + 1], ... Number of cells of the result mesh sharing the i-th cell of this mesh is descIndx[ i+1 ] - descIndx[ i ].
[in,out]revDesc- the array containing cell ids of this mesh bounded by each cell of the result mesh.
[in,out]revDescIndx- the array, of length one more than number of cells in the result mesh, dividing cell ids in revDesc into groups each referring to one cell of the result mesh the same way as descIndx divides desc.
Returns
MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. The caller is to delete this mesh using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is node defined.
Ifdesc == NULL || descIndx == NULL || revDesc == NULL || revDescIndx == NULL.

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

See Also
buildDescendingConnectivity2()

Referenced by buildBoundaryMesh(), buildFacePartOfMySelfNode(), buildSlice3D(), buildSlice3DSurf(), clipSingle3DCellByPlane(), computeNeighborsOfCells(), computeNeighborsOfNodes(), computeSkin(), conformize2D(), conformize3D(), emulateMEDMEMBDC(), findCellIdsOnBoundary(), findNodesToDuplicate(), orderConsecutiveCells1D(), and SimplifyPolyhedronCell().

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

Creates a new MEDCouplingUMesh containing cells, of dimension one less than this->getMeshDimension(), that bound cells of this mesh. In addition arrays describing correspondence between cells of this and the result meshes are returned. The arrays desc and descIndx (Indirect indexing) describe the descending connectivity, i.e. enumerate cells of the result mesh bounding each cell of this mesh. This method differs from buildDescendingConnectivity() in that apart from cell ids, desc returns mutual orientation of cells in this and the result meshes. So a positive id means that order of nodes in corresponding cells of two meshes is same, and a negative id means a reverse order of nodes. Since a cell with id #0 can't be negative, the array desc returns ids in FORTRAN mode, i.e. cell ids are one-based. Arrays revDesc and revDescIndx (Indirect indexing) describe the reverse descending connectivity, i.e. enumerate cells of this mesh bounded by each cell of the result mesh.

Warning
For speed reasons, this method does not check if node ids in the nodal connectivity correspond to the size of node coordinates array.
Cells of the result mesh are not sorted by geometric type, hence, to write this mesh to the MED file, its cells must be sorted using sortCellsInMEDFileFrmt().
Parameters
[in,out]desc- the array containing cell ids of the result mesh bounding each cell of this mesh.
[in,out]descIndx- the array, of length this->getNumberOfCells() + 1, dividing cell ids in desc into groups each referring to one cell of this mesh. Its every element (except the last one) is an index pointing to the first id of a group of cells. For example cells of the result mesh bounding the cell #1 of this mesh are described by following range of indices: [ descIndx[1], descIndx[2] ) and the cell ids are desc[ descIndx[1] ], desc[ descIndx[1] + 1], ... Number of cells of the result mesh sharing the i-th cell of this mesh is descIndx[ i+1 ] - descIndx[ i ].
[in,out]revDesc- the array containing cell ids of this mesh bounded by each cell of the result mesh.
[in,out]revDescIndx- the array, of length one more than number of cells in the result mesh, dividing cell ids in revDesc into groups each referring to one cell of the result mesh the same way as descIndx divides desc.
Returns
MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. This result mesh shares the node coordinates array with this mesh. The caller is to delete this mesh using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is node defined.
Ifdesc == NULL || descIndx == NULL || revDesc == NULL || revDescIndx == NULL.

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

See Also
buildDescendingConnectivity()

Referenced by conformize3D(), and Intersect2DMeshWith1DLine().

MEDCouplingUMesh * MEDCouplingUMesh::explodeMeshIntoMicroEdges ( DataArrayInt desc,
DataArrayInt descIndx,
DataArrayInt revDesc,
DataArrayInt revDescIndx 
) const

This method computes the micro edges constituting each cell in this. Micro edge is an edge for non quadratic cells. Micro edge is an half edge for quadratic cells. This method works for both meshes with mesh dimenstion equal to 2 or 3. Dynamical cells are not supported (polygons, polyhedrons...)

See Also
explode3DMeshTo1D, buildDescendingConnectiviy

References getMeshDimension().

void MEDCouplingUMesh::computeNeighborsOfCells ( DataArrayInt *&  neighbors,
DataArrayInt *&  neighborsIndx 
) const

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 neighbor cells of cell having id 'cellId' are neighbors[neighborsIndx[cellId]:neighborsIndx[cellId+1]]. The format of return is hence Indirect indexing.

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. neighborsIndx 2nd output parameter allows to select the right part in this array (Indirect indexing). The number of tuples is equal to the last values in neighborsIndx.
[out]neighborsIndxis 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 (Indirect indexing).

References buildDescendingConnectivity(), ComputeNeighborsOfCellsAdv(), and MEDCoupling::DataArrayInt::New().

Referenced by partitionBySpreadZone().

void MEDCouplingUMesh::ComputeNeighborsOfCellsAdv ( const DataArrayInt desc,
const DataArrayInt descIndx,
const DataArrayInt revDesc,
const DataArrayInt revDescIndx,
DataArrayInt *&  neighbors,
DataArrayInt *&  neighborsIndx 
)
static

This method is called by MEDCouplingUMesh::computeNeighborsOfCells. This methods performs the algorithm of MEDCouplingUMesh::computeNeighborsOfCells. This method is useful for users that want to reduce along a criterion the set of neighbours cell. This is typically the case to extract a set a neighbours, excluding a set of meshdim-1 cells in input descending connectivity. Typically desc, descIndx, revDesc and revDescIndx (Indirect indexing) input params are the result of MEDCouplingUMesh::buildDescendingConnectivity. This method lists cell by cell in this which are its neighbors. To compute the result only connectivities are considered. The neighbor cells of cell having id 'cellId' are neighbors[neighborsIndx[cellId]:neighborsIndx[cellId+1]].

Parameters
[in]descdescending connectivity array.
[in]descIndxdescending connectivity index array used to walk through desc (Indirect indexing).
[in]revDescreverse descending connectivity array.
[in]revDescIndxreverse descending connectivity index array used to walk through revDesc (Indirect indexing).
[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. neighborsIndx 2nd output parameter allows to select the right part in this array. The number of tuples is equal to the last values in neighborsIndx.
[out]neighborsIndxis 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 MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::insertAtTheEnd(), MEDCoupling::DataArrayInt::New(), MEDCoupling::DataArrayTemplate< T >::reserve(), and MEDCoupling::MCAuto< T >::retn().

Referenced by computeNeighborsOfCells(), and findNodesToDuplicate().

void MEDCouplingUMesh::computeNeighborsOfNodes ( DataArrayInt *&  neighbors,
DataArrayInt *&  neighborsIdx 
) const

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 node by node in this which are its neighbors. To compute the result only connectivities are considered. The neighbor nodes of node having id 'nodeId' are neighbors[neighborsIndx[cellId]:neighborsIndx[cellId+1]].

Parameters
[out]neighborsis an array storing all the neighbors of all nodes in this. This array is newly allocated and should be dealt by the caller. neighborsIndx 2nd output parameter allows to select the right part in this array (Indirect indexing). The number of tuples is equal to the last values in neighborsIndx.
[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 MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), buildDescendingConnectivity(), explode3DMeshTo1D(), getMeshDimension(), getNodalConnectivity(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::DataArrayTemplate< T >::getPointer(), getReverseNodalConnectivity(), MEDCoupling::RefCountObjectOnly::incrRef(), MEDCoupling::DataArrayInt::New(), and MEDCoupling::MCAuto< T >::retn().

MEDCouplingUMesh * MEDCouplingUMesh::mergeMyselfWithOnSameCoords ( const MEDCouplingPointSet other) const
virtual
MEDCouplingUMesh * MEDCouplingUMesh::buildPartOfMySelf ( const int *  begin,
const int *  end,
bool  keepCoords = true 
) const
virtual

Creates a new MEDCouplingUMesh containing specified cells of this mesh. The result mesh shares or not the node coordinates array with this mesh depending on keepCoords parameter.

Warning
Cells of the result mesh can be not sorted by geometric type, hence, to write this mesh to the MED file, its cells must be sorted using sortCellsInMEDFileFrmt().
Parameters
[in]begin- an array of cell ids to include to the new mesh.
[in]end- a pointer to last-plus-one-th element of begin.
[in]keepCoords- if true, the result mesh shares the node coordinates array of this mesh, else "free" nodes are removed from the result mesh by calling zipCoords().
Returns
MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. The caller is to delete this mesh using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.
Ifany cell id in the array begin is not valid.

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

Reimplemented from MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::MEDCouplingPointSet::buildPartOfMySelf(), getMeshDimension(), and MEDCoupling::RefCountObjectOnly::incrRef().

Referenced by buildBoundaryMesh(), buildSlice3D(), buildSlice3DSurf(), buildSpreadZonesWithPoly(), MEDCoupling::MEDCouplingFieldDiscretizationOnNodes::computeMeshRestrictionFromTupleIds(), computeSkin(), MEDCoupling::MEDCouplingFieldDiscretizationOnNodes::computeTupleIdsToSelectFromCellIds(), conformize2D(), conformize3D(), MEDCoupling::MEDFileUMesh::deduceNodeSubPartFromCellSubPart(), MEDCoupling::MEDFileUMesh::extractPart(), findCellIdsLyingOn(), findNodesToDuplicate(), Intersect2DMeshWith1DLine(), keepSpecifiedCells(), SimplifyPolyhedronCell(), and splitByType().

MEDCouplingUMesh * MEDCouplingUMesh::buildPartOfMySelfSlice ( int  start,
int  end,
int  step,
bool  keepCoords = true 
) const
virtual

Build a sub part of this lying or not on the same coordinates than this (regarding value of keepCoords). By default coordinates are kept. This method is close to MEDCouplingUMesh::buildPartOfMySelf except that here input cellIds is not given explicitely but by a range python like.

Parameters
start
end
step
keepCoordsthat specifies if you want or not to keep coords as this or zip it (see MEDCoupling::MEDCouplingUMesh::zipCoords). If true zipCoords is NOT called, if false, zipCoords is called.
Returns
a newly allocated
Warning
This method modifies can generate an unstructured mesh whose cells are not sorted by geometric type order. In view of the MED file writing, a renumbering of cells of returned unstructured mesh (using MEDCouplingUMesh::sortCellsInMEDFileFrmt) should be necessary.

Reimplemented from MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfSlice(), getMeshDimension(), MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(), and MEDCoupling::RefCountObjectOnly::incrRef().

Referenced by conformize3D().

void MEDCouplingUMesh::setPartOfMySelf ( const int *  cellIdsBg,
const int *  cellIdsEnd,
const MEDCouplingUMesh otherOnSameCoordsThanThis 
)

This method operates only on nodal connectivity on this. Coordinates of this is completely ignored here.

This method allows to partially modify some cells in this (whose list is specified by [ cellIdsBg, cellIdsEnd ) ) with cells coming in otherOnSameCoordsThanThis. Size of [ cellIdsBg, cellIdsEnd ) ) must be equal to the number of cells of otherOnSameCoordsThanThis. The number of cells of this will remain the same with this method.

Parameters
[in]cellIdsBgbegin of cell ids (included) of cells in this to assign
[in]cellIdsEndend of cell ids (excluded) of cells in this to assign
[in]otherOnSameCoordsThanThisan another mesh with same meshdimension than this with exactly the same number of cells than cell ids list in [cellIdsBg, cellIdsEnd ). Coordinate pointer of this and those of otherOnSameCoordsThanThis must be the same

References computeTypes(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNumberOfCells(), setConnectivity(), SetPartOfIndexedArrays(), and SetPartOfIndexedArraysSameIdx().

Referenced by conformize2D().

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

Creates a new MEDCouplingUMesh containing cells, of dimension one less than this->getMeshDimension(), that bound some cells of this mesh. The cells of lower dimension to include to the result mesh are selected basing on specified node ids and the value of fullyIn parameter. If fullyIn ==true, a cell is copied if its all nodes are in the array begin of node ids. If fullyIn ==false, a cell is copied if any its node is in the array of node ids. The created mesh shares the node coordinates array with this mesh.

Parameters
[in]begin- the array of node ids.
[in]end- a pointer to the (last+1)-th element of begin.
[in]fullyIn- if true, then cells whose all nodes are in the array begin are added, else cells whose any node is in the array begin are added.
Returns
MEDCouplingUMesh * - new instance of MEDCouplingUMesh. The caller is to delete this mesh using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.
Ifany node id in begin is not valid.

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

Implements MEDCoupling::MEDCouplingPointSet.

References buildDescendingConnectivity(), MEDCoupling::MEDCouplingPointSet::buildPartOfMySelfNode(), and MEDCoupling::DataArrayInt::New().

Referenced by MEDCoupling::MEDCoupling1GTUMesh::buildFacePartOfMySelfNode().

MEDCouplingUMesh * MEDCouplingUMesh::buildUnstructured ( ) const
virtual
DataArrayInt * MEDCouplingUMesh::findBoundaryNodes ( ) const
virtual

Finds nodes lying on the boundary of this mesh.

Returns
DataArrayInt * - a new instance of DataArrayInt holding ids of found nodes. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is node defined.

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

Implements MEDCoupling::MEDCouplingPointSet.

References computeFetchedNodeIds(), and computeSkin().

Referenced by MEDCoupling::MEDCoupling1GTUMesh::findBoundaryNodes(), and findNodesToDuplicate().

MEDCouplingUMesh * MEDCouplingUMesh::buildBoundaryMesh ( bool  keepCoords) const
virtual

Creates a new MEDCouplingUMesh containing cells, of dimension one less than this->getMeshDimension(), which bound only one cell of this mesh.

Parameters
[in]keepCoords- if true, the result mesh shares the node coordinates array of this mesh, else "free" nodes are removed from the result mesh by calling zipCoords().
Returns
MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. The caller is to delete this mesh using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.

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

Implements MEDCoupling::MEDCouplingPointSet.

References buildDescendingConnectivity(), buildPartOfMySelf(), MEDCoupling::RefCountObjectOnly::decrRef(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getNumberOfCells(), and MEDCoupling::DataArrayInt::New().

Referenced by MEDCoupling::MEDCoupling1GTUMesh::buildBoundaryMesh().

DataArrayInt * MEDCouplingUMesh::findCellIdsOnBoundary ( ) const

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 MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), buildDescendingConnectivity(), MEDCoupling::RefCountObjectOnly::decrRef(), MEDCoupling::DataArrayInt::deltaShiftIndex(), MEDCoupling::DataArrayTemplate< T >::end(), MEDCoupling::DataArrayInt::findIdsEqual(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::New(), and MEDCoupling::DataArray::setName().

void MEDCouplingUMesh::findCellIdsLyingOn ( const MEDCouplingUMesh otherDimM1OnSameCoords,
DataArrayInt *&  cellIdsRk0,
DataArrayInt *&  cellIdsRk1 
) const

This method finds in this the cell ids that lie on mesh otherDimM1OnSameCoords. this and otherDimM1OnSameCoords have to lie on the same coordinate array pointer. The coherency of that coords array with connectivity of this and otherDimM1OnSameCoords is not important here because this method works only on connectivity. this->getMeshDimension() - 1 must be equal to otherDimM1OnSameCoords.getMeshDimension()

s0 is the cell ids set in this lying on at least one node in the fetched nodes in otherDimM1OnSameCoords. This method also returns the cells ids set s1 which contains the cell ids in this for which one of the dim-1 constituent equals a cell in otherDimM1OnSameCoords.

Exceptions
ifotherDimM1OnSameCoords is not part of constituent of this, or if coordinate pointer of this and otherDimM1OnSameCoords are not same, or if this->getMeshDimension()-1!=otherDimM1OnSameCoords.getMeshDimension()
Parameters
[in]otherDimM1OnSameCoords
[out]cellIdsRk0a newly allocated array containing the cell ids of s0 (which are cell ids of this) in the above algorithm.
[out]cellIdsRk1a newly allocated array containing the cell ids of s1 indexed into the cellIdsRk0 subset. To get the absolute ids of s1, simply invoke cellIdsRk1->transformWithIndArr(cellIdsRk0->begin(),cellIdsRk0->end());

References MEDCoupling::DataArrayTemplate< T >::alloc(), areCellsIncludedIn(), MEDCoupling::DataArrayTemplate< T >::begin(), buildPartOfMySelf(), computeFetchedNodeIds(), MEDCoupling::DataArrayTemplate< T >::end(), MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::New(), MEDCoupling::MCAuto< T >::retn(), and MEDCoupling::DataArrayTemplate< T >::sort().

MEDCouplingUMesh * MEDCouplingUMesh::computeSkin ( ) const

This method computes the skin of this. That is to say the consituting meshdim-1 mesh is built and only the boundary subpart is returned. This subpart of meshdim-1 mesh is built using meshdim-1 cells in it shared only one cell in this.

Returns
a newly allocated mesh lying on the same coordinates than this. The caller has to deal with returned mesh.

References MEDCoupling::DataArrayTemplate< T >::begin(), buildDescendingConnectivity(), buildPartOfMySelf(), MEDCoupling::DataArrayInt::deltaShiftIndex(), MEDCoupling::DataArrayTemplate< T >::end(), MEDCoupling::DataArrayInt::findIdsEqual(), and MEDCoupling::DataArrayInt::New().

Referenced by buildUnionOf2DMesh(), buildUnionOf3DMesh(), and findBoundaryNodes().

void MEDCouplingUMesh::findNodesToDuplicate ( const MEDCouplingUMesh otherDimM1OnSameCoords,
DataArrayInt *&  nodeIdsToDuplicate,
DataArrayInt *&  cellIdsNeededToBeRenum,
DataArrayInt *&  cellIdsNotModified 
) const

This method expects that this and otherDimM1OnSameCoords share the same coordinates array. otherDimM1OnSameCoords->getMeshDimension() is expected to be equal to this->getMeshDimension()-1. This method searches for nodes needed to be duplicated. These nodes are nodes fetched by otherDimM1OnSameCoords which are not part of the boundary of otherDimM1OnSameCoords. If a node is in the boundary of this and in the boundary of otherDimM1OnSameCoords this node is considerd as needed to be duplicated. When the set of node ids nodeIdsToDuplicate is computed, cell ids in this is searched so that their connectivity includes at least 1 node in nodeIdsToDuplicate.

Parameters
[in]otherDimM1OnSameCoordsa mesh lying on the same coords than this and with a mesh dimension equal to those of this minus 1. WARNING this input parameter is altered during the call.
[out]nodeIdsToDuplicatenode ids needed to be duplicated following the algorithm explain above.
[out]cellIdsNeededToBeRenumcell ids in this in which the renumber of nodes should be performed.
[out]cellIdsNotModifiedcell ids int this that lies on otherDimM1OnSameCoords mesh whose connectivity do not need to be modified as it is the case for cellIdsNeededToBeRenum.
Warning
This method modifies param otherDimM1OnSameCoords (for speed reasons).

References MEDCoupling::DataArrayInt::Aggregate(), buildDescendingConnectivity(), buildPartOfMySelf(), MEDCoupling::DataArrayInt::buildSubstraction(), computeFetchedNodeIds(), ComputeNeighborsOfCellsAdv(), ComputeSpreadZoneGraduallyFromSeed(), MEDCoupling::RefCountObjectOnly::decrRef(), findBoundaryNodes(), MEDCoupling::DataArrayInt::findIdsInRange(), MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArrayInt::New(), and RemoveIdsFromIndexedArrays().

void MEDCouplingUMesh::duplicateNodes ( const int *  nodeIdsToDuplicateBg,
const int *  nodeIdsToDuplicateEnd 
)

This method operates a modification of the connectivity and coords in this. Every time that a node id in [ nodeIdsToDuplicateBg, nodeIdsToDuplicateEnd ) will append in nodal connectivity of this its ids will be modified to id this->getNumberOfNodes()+std::distance(nodeIdsToDuplicateBg,std::find(nodeIdsToDuplicateBg,nodeIdsToDuplicateEnd,id)). More explicitely the renumber array in nodes is not explicitely given in old2new to avoid to build a big array of renumbering whereas typically few node ids needs to be renumbered. The node id nodeIdsToDuplicateBg[0] will have id this->getNumberOfNodes()+0, node id nodeIdsToDuplicateBg[1] will have id this->getNumberOfNodes()+1, node id nodeIdsToDuplicateBg[2] will have id this->getNumberOfNodes()+2...

As a consequence nodal connectivity array length will remain unchanged by this method, and nodal connectivity index array will remain unchanged by this method.

Parameters
[in]nodeIdsToDuplicateBgbegin of node ids (included) to be duplicated in connectivity only
[in]nodeIdsToDuplicateEndend of node ids (excluded) to be duplicated in connectivity only

References duplicateNodesInConn(), MEDCoupling::MEDCouplingPointSet::duplicateNodesInCoords(), and MEDCoupling::MEDCouplingPointSet::getNumberOfNodes().

void MEDCouplingUMesh::renumberNodesWithOffsetInConn ( int  offset)
virtual

This method renumbers only nodal connectivity in this. The renumbering is only an offset applied. So this method is a specialization of renumberNodesInConn. WARNING, this method does not check that the resulting node ids in the nodal connectivity is in a valid range !

Parameters
[in]offset- specifies the offset to be applied on each element of connectivity.
See Also
renumberNodesInConn

Implements MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::TimeLabel::declareAsNew(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), and updateTime().

void MEDCouplingUMesh::renumberNodesInConn ( const INTERP_KERNEL::HashMap< int, int > &  newNodeNumbersO2N)
virtual

Same than renumberNodesInConn(const int *) except that here the format of old-to-new traducer is using map instead of array. This method is dedicated for renumbering from a big set of nodes the a tiny set of nodes which is the case during extraction of a big mesh.

Implements MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::TimeLabel::declareAsNew(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), and updateTime().

Referenced by MEDCoupling::MEDFileUMesh::linearToQuadratic(), and MEDCoupling::MEDFileUMesh::quadraticToLinear().

void MEDCouplingUMesh::renumberNodesInConn ( const int *  newNodeNumbersO2N)
virtual

Changes ids of nodes within the nodal connectivity arrays according to a permutation array in "Old to New" mode. The node coordinates array is not changed by this method. This method is a generalization of shiftNodeNumbersInConn().

Warning
This method performs no check of validity of new ids. Use it with care !
Parameters
[in]newNodeNumbersO2N- a permutation array, of length this->getNumberOfNodes(), in "Old to New" mode. See Array indexing and numbering for more info on renumbering modes.
Exceptions
Ifthe nodal connectivity of cells is not defined.

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

Implements MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::TimeLabel::declareAsNew(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), and updateTime().

void MEDCouplingUMesh::shiftNodeNumbersInConn ( int  delta)

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.

References MEDCoupling::TimeLabel::declareAsNew(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), and updateTime().

void MEDCouplingUMesh::duplicateNodesInConn ( const int *  nodeIdsToDuplicateBg,
const int *  nodeIdsToDuplicateEnd,
int  offset 
)

This method operates a modification of the connectivity in this. Coordinates are NOT considered here and will remain unchanged by this method. this->_coords can ever been null for the needs of this method. Every time that a node id in [ nodeIdsToDuplicateBg, nodeIdsToDuplicateEnd ) will append in nodal connectivity of this its ids will be modified to id offset+std::distance(nodeIdsToDuplicateBg,std::find(nodeIdsToDuplicateBg,nodeIdsToDuplicateEnd,id)). More explicitely the renumber array in nodes is not explicitely given in old2new to avoid to build a big array of renumbering whereas typically few node ids needs to be renumbered. The node id nodeIdsToDuplicateBg[0] will have id offset+0, node id nodeIdsToDuplicateBg[1] will have id offset+1, node id nodeIdsToDuplicateBg[2] will have id offset+2...

As a consequence nodal connectivity array length will remain unchanged by this method, and nodal connectivity index array will remain unchanged by this method. As an another consequense after the call of this method this can be transiently non cohrent.

Parameters
[in]nodeIdsToDuplicateBgbegin of node ids (included) to be duplicated in connectivity only
[in]nodeIdsToDuplicateEndend of node ids (excluded) to be duplicated in connectivity only
[in]offsetthe offset applied to all node ids in connectivity that are in [ nodeIdsToDuplicateBg, nodeIdsToDuplicateEnd ).

References MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), and updateTime().

Referenced by MEDCoupling::MEDFileUMesh::buildInnerBoundaryAlongM1Group(), and duplicateNodes().

void MEDCouplingUMesh::renumberCells ( const int *  old2NewBg,
bool  check = true 
)
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()).

Parameters
[in]old2NewBgis expected to be a dynamically allocated pointer of size at least equal to this->getNumberOfCells()
check

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::C_DEALLOC, MEDCoupling::DataArrayInt::CheckAndPreparePermutation(), MEDCoupling::DataArray::copyStringInfoFrom(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getNumberOfCells(), MEDCoupling::DataArray::getNumberOfComponents(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::invertArrayO2N2N2O(), MEDCoupling::DataArrayInt::New(), setConnectivity(), and MEDCoupling::DataArrayTemplate< T >::useArray().

Referenced by emulateMEDMEMBDC(), rearrange2ConsecutiveCellTypes(), sortCellsInMEDFileFrmt(), and MEDCoupling::MEDFileUMesh::unPolyze().

DataArrayInt * MEDCouplingUMesh::getCellsInBoundingBox ( const double *  bbox,
double  eps 
) const
virtual

Finds cells whose bounding boxes intersect a given bounding box.

Parameters
[in]bbox- an array defining the bounding box via coordinates of its extremum points in "no interlace" mode, i.e. xMin, xMax, yMin, yMax, zMin, zMax (if in 3D).
[in]eps- a factor used to increase size of the bounding box of cell before comparing it with bbox. This factor is multiplied by the maximal extent of the bounding box of cell to produce an addition to this bounding box.
Returns
DataArrayInt * - a new instance of DataArrayInt holding ids for found cells. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.

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

Implements MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::MEDCouplingPointSet::intersectsBoundingBox(), MEDCoupling::DataArrayInt::New(), MEDCoupling::DataArrayTemplate< T >::pushBackSilent(), and MEDCoupling::MCAuto< T >::retn().

Referenced by getCellIdsCrossingPlane(), and MEDCoupling::MEDCoupling1GTUMesh::getCellsInBoundingBox().

DataArrayInt * MEDCouplingUMesh::getCellsInBoundingBox ( const INTERP_KERNEL::DirectedBoundingBox &  bbox,
double  eps 
)
virtual
MEDCouplingFieldDouble * MEDCouplingUMesh::getMeasureField ( bool  isAbs) const
virtual
DataArrayDouble * MEDCouplingUMesh::getPartMeasureField ( bool  isAbs,
const int *  begin,
const int *  end 
) const

Returns a new DataArrayDouble containing volumes of specified cells of this mesh.
For 1D cells, the returned array contains lengths.
For 2D cells, the returned array contains areas.
For 3D cells, the returned array contains volumes. This method avoids building explicitly a part of this mesh to perform the work.

Parameters
[in]isAbs- if true, the computed cell volume does not reflect cell orientation, i.e. the volume is always positive.
[in]begin- an array of cell ids of interest.
[in]end- the end of begin, i.e. a pointer to its (last+1)-th element.
Returns
DataArrayDouble * - a new instance of DataArrayDouble. The caller is to delete this array using decrRef() as it is no more needed.

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

See Also
getMeasureField()

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), MEDCoupling::MEDCouplingMesh::getName(), getNodalConnectivity(), getNodalConnectivityIndex(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::MCAuto< T >::retn(), and MEDCoupling::DataArray::setName().

MEDCouplingFieldDouble * MEDCouplingUMesh::getMeasureFieldOnNode ( bool  isAbs) const
virtual

Returns a new MEDCouplingFieldDouble containing volumes of cells of a dual mesh of this one. The returned field contains the dual cell volume for each corresponding node in this mesh. In other words, the field returns the getMeasureField() of the dual mesh in P1 sens of this.
For 1D cells, the returned field contains lengths.
For 2D cells, the returned field contains areas.
For 3D cells, the returned field contains volumes. This method is useful to check "P1*" conservative interpolators.

Parameters
[in]isAbs- if true, the computed cell volume does not reflect cell orientation, i.e. the volume is always positive.
Returns
MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble on nodes and one time. The caller is to delete this array using decrRef() as it is no more needed.

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::MEDCouplingFieldT< T >::getArray(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getMeasureField(), getMeshDimension(), MEDCoupling::MEDCouplingMesh::getName(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::DataArrayTemplate< T >::getPointer(), getReverseNodalConnectivity(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::DataArrayInt::New(), MEDCoupling::ON_NODES, MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingFieldT< T >::setArray(), and MEDCoupling::MEDCouplingField::setMesh().

Referenced by MEDCoupling::MEDCoupling1GTUMesh::getMeasureFieldOnNode().

MEDCouplingFieldDouble * MEDCouplingUMesh::buildOrthogonalField ( ) const
virtual

Returns a new MEDCouplingFieldDouble holding normal vectors to cells of this mesh. The returned normal vectors to each cell have a norm2 equal to 1. The computed vectors have this->getMeshDimension()+1 components and are normalized.
this can be either

  • a 2D mesh in 2D or 3D space or
  • an 1D mesh in 2D space.
Returns
MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble on cells and one time. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthe nodal connectivity of cells is not defined.
Ifthe coordinates array is not set.
Ifthe mesh dimension is not set.
Ifthe mesh and space dimension is not as specified above.

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::alloc(), computeCellCenterOfMass(), MEDCoupling::MEDCouplingFieldT< T >::getArray(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getMeasureField(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::ON_CELLS, MEDCoupling::ONE_TIME, MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingFieldT< T >::setArray(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingFieldDouble::synchronizeTimeWithSupport().

Referenced by MEDCoupling::MEDCoupling1GTUMesh::buildOrthogonalField(), clipSingle3DCellByPlane(), and conformize3D().

MEDCouplingFieldDouble * MEDCouplingUMesh::buildPartOrthogonalField ( const int *  begin,
const int *  end 
) const

Returns a new MEDCouplingFieldDouble holding normal vectors to specified cells of this mesh. The computed vectors have this->getMeshDimension()+1 components and are normalized.
this can be either

  • a 2D mesh in 2D or 3D space or
  • an 1D mesh in 2D space.

This method avoids building explicitly a part of this mesh to perform the work.

Parameters
[in]begin- an array of cell ids of interest.
[in]end- the end of begin, i.e. a pointer to its (last+1)-th element.
Returns
MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble on cells and one time. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthe nodal connectivity of cells is not defined.
Ifthe coordinates array is not set.
Ifthe mesh dimension is not set.
Ifthe mesh and space dimension is not as specified above.
See Also
buildOrthogonalField()

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

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getMeshDimension(), getPartBarycenterAndOwner(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::ON_CELLS, MEDCoupling::ONE_TIME, MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingFieldT< T >::setArray(), MEDCoupling::MEDCouplingField::setMesh(), and MEDCoupling::MEDCouplingFieldDouble::synchronizeTimeWithSupport().

MEDCouplingFieldDouble * MEDCouplingUMesh::buildDirectionVectorField ( ) const
MEDCouplingUMesh * MEDCouplingUMesh::buildSlice3D ( const double *  origin,
const double *  vec,
double  eps,
DataArrayInt *&  cellIds 
) const

Creates a 2D mesh by cutting this 3D mesh with a plane. In addition to the mesh, returns a new DataArrayInt, of length equal to the number of 2D cells in the result mesh, holding, for each cell in the result mesh, an id of a 3D cell it comes from. If a result face is shared by two 3D cells, then the face in included twice in the result mesh.

Parameters
[in]origin- 3 components of a point defining location of the plane.
[in]vec- 3 components of a vector normal to the plane. Vector magnitude must be greater than 1e-6.
[in]eps- half-thickness of the plane.
[out]cellIds- a new instance of DataArrayInt holding ids of 3D cells producing correspondent 2D cells. The caller is to delete this array using decrRef() as it is no more needed.
Returns
MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. This mesh does not share the node coordinates array with this mesh. The caller is to delete this mesh using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.
Ifthis->getMeshDimension() != 3 or this->getSpaceDimension() != 3.
Ifmagnitude of vec is less than 1e-6.
Ifthe plane does not intersect any 3D cell of this mesh.
Ifthis includes quadratic cells.

References MEDCoupling::DataArrayTemplate< T >::begin(), buildDescendingConnectivity(), buildPartOfMySelf(), MEDCoupling::DataArrayTemplate< T >::empty(), MEDCoupling::DataArrayTemplate< T >::end(), MEDCoupling::MEDCouplingPointSet::findNodesOnPlane(), getCellIdsCrossingPlane(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), New(), MEDCoupling::DataArrayInt::New(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::DataArrayInt::selectByTupleId(), setConnectivity(), and MEDCoupling::MEDCouplingPointSet::setCoords().

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

Creates an 1D mesh by cutting this 2D mesh in 3D space with a plane. In addition to the mesh, returns a new DataArrayInt, of length equal to the number of 1D cells in the result mesh, holding, for each cell in the result mesh, an id of a 2D cell it comes from. If a result segment is shared by two 2D cells, then the segment in included twice in the result mesh.

Parameters
[in]origin- 3 components of a point defining location of the plane.
[in]vec- 3 components of a vector normal to the plane. Vector magnitude must be greater than 1e-6.
[in]eps- half-thickness of the plane.
[out]cellIds- a new instance of DataArrayInt holding ids of faces producing correspondent segments. The caller is to delete this array using decrRef() as it is no more needed.
Returns
MEDCouplingUMesh * - a new instance of MEDCouplingUMesh. This is an 1D mesh in 3D space. This mesh does not share the node coordinates array with this mesh. The caller is to delete this mesh using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.
Ifthis->getMeshDimension() != 2 or this->getSpaceDimension() != 3.
Ifmagnitude of vec is less than 1e-6.
Ifthe plane does not intersect any 2D cell of this mesh.
Ifthis includes quadratic cells.

References MEDCoupling::DataArrayTemplate< T >::begin(), buildDescendingConnectivity(), buildPartOfMySelf(), MEDCoupling::DataArrayTemplate< T >::empty(), MEDCoupling::DataArrayTemplate< T >::end(), MEDCoupling::MEDCouplingPointSet::findNodesOnPlane(), getCellIdsCrossingPlane(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getMeshDimension(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), New(), MEDCoupling::DataArrayInt::New(), INTERP_KERNEL::NORM_SEG2, MEDCoupling::MCAuto< T >::retn(), MEDCoupling::DataArrayInt::selectByTupleId(), setConnectivity(), and MEDCoupling::MEDCouplingPointSet::setCoords().

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

Finds cells whose bounding boxes intersect a given plane.

Parameters
[in]origin- 3 components of a point defining location of the plane.
[in]vec- 3 components of a vector normal to the plane. Vector magnitude must be greater than 1e-6.
[in]eps- half-thickness of the plane.
Returns
DataArrayInt * - a new instance of DataArrayInt holding ids of the found cells. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.
Ifthis->getSpaceDimension() != 3.
Ifmagnitude of vec is less than 1e-6.
See Also
buildSlice3D()

References MEDCoupling::MEDCouplingPointSet::_coords, clone(), MEDCoupling::DataArrayDouble::deepCopy(), MEDCoupling::MEDCouplingPointSet::getBoundingBox(), getCellsInBoundingBox(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::MCAuto< T >::retn(), and MEDCoupling::DataArrayDouble::Rotate3DAlg().

Referenced by buildSlice3D(), and buildSlice3DSurf().

bool MEDCouplingUMesh::isContiguous1D ( ) const

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 MEDCoupling::MEDCouplingUMesh::mergeNodes could be usefull.

References MEDCoupling::DataArrayTemplate< T >::begin(), 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(), MEDCoupling::MEDCouplingFieldT< T >::getArray(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and INTERP_KERNEL::NORM_SEG2.

Referenced by MEDCoupling::MEDCouplingMappedExtrudedMesh::Project1DMeshes().

double MEDCouplingUMesh::distanceToPoint ( const double *  ptBg,
const double *  ptEnd,
int &  cellId 
) const

This method computes the distance from a point pt to this and the first cellId in this corresponding to the returned distance. this is expected to be a mesh so that its space dimension is equal to its mesh dimension + 1. Furthermore only mesh dimension 1 and 2 are supported for the moment. Distance from ptBg to ptEnd is expected to be equal to the space dimension. this is also expected to be fully defined (connectivity and coordinates).

WARNING, if there is some orphan nodes in this (nodes not fetched by any cells in this ( see MEDCouplingUMesh::zipCoords ) ) these nodes will ** not ** been taken into account in this method. Only cells and nodes lying on them are considered in the algorithm (even if one of these orphan nodes is closer than returned distance). A user that needs to consider orphan nodes should invoke DataArrayDouble::minimalDistanceTo method on the coordinates array of this.

So this method is more accurate (so, more costly) than simply searching for the closest point in this. If only this information is enough for you simply call getCoords()->distanceToTuple on this.

Parameters
[in]ptBgthe start pointer (included) of the coordinates of the point
[in]ptEndthe end pointer (not included) of the coordinates of the point
[out]cellIdthat corresponds to minimal distance. If the closer node is not linked to any cell in this -1 is returned.
Returns
the positive value of the distance.
Exceptions
ifdistance from ptBg to ptEnd is not equal to the space dimension. An exception is also thrown if mesh dimension of this is not equal to space dimension - 1.
See Also
DataArrayDouble::distanceToTuple, MEDCouplingUMesh::distanceToPoints

References MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::C_DEALLOC, distanceToPoints(), getMeshDimension(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), and MEDCoupling::DataArrayTemplate< T >::useArray().

DataArrayDouble * MEDCouplingUMesh::distanceToPoints ( const DataArrayDouble pts,
DataArrayInt *&  cellIds 
) const

This method computes the distance from each point of points serie pts (stored in a DataArrayDouble in which each tuple represents a point) to this and the first cellId in this corresponding to the returned distance. WARNING, if there is some orphan nodes in this (nodes not fetched by any cells in this ( see MEDCouplingUMesh::zipCoords ) ) these nodes will ** not ** been taken into account in this method. Only cells and nodes lying on them are considered in the algorithm (even if one of these orphan nodes is closer than returned distance). A user that needs to consider orphan nodes should invoke DataArrayDouble::minimalDistanceTo method on the coordinates array of this.

this is expected to be a mesh so that its space dimension is equal to its mesh dimension + 1. Furthermore only mesh dimension 1 and 2 are supported for the moment. Number of components of pts is expected to be equal to the space dimension. this is also expected to be fully defined (connectivity and coordinates).

So this method is more accurate (so, more costly) than simply searching for each point in pts the closest point in this. If only this information is enough for you simply call getCoords()->distanceToTuple on this.

Parameters
[in]ptsthe list of points in which each tuple represents a point
[out]cellIdsa newly allocated object that tells for each point in pts the first cell id in this that minimizes the distance.
Returns
a newly allocated object to be dealed by the caller that tells for each point in pts the distance to this.
Exceptions
ifnumber of components of pts is not equal to the space dimension.
ifmesh dimension of this is not equal to space dimension - 1.
See Also
DataArrayDouble::distanceToTuple, MEDCouplingUMesh::distanceToPoint

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayTemplate< T >::checkAllocated(), getBoundingBoxForBBTree(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArray::getNumberOfComponents(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::DataArrayInt::New(), and MEDCoupling::MCAuto< T >::retn().

Referenced by distanceToPoint().

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

Finds cells in contact with a ball (i.e. a point with precision). For speed reasons, the INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TRI6 and INTERP_KERNEL::NORM_QUAD8 cells are considered as convex cells to detect if a point is IN or OUT. If it is not the case, please change their types to INTERP_KERNEL::NORM_POLYGON or INTERP_KERNEL::NORM_QPOLYG before invoking this method.

Warning
This method is suitable if the caller intends to evaluate only one point, for more points getCellsContainingPoints() is recommended as it is faster.
Parameters
[in]pos- array of coordinates of the ball central point.
[in]eps- ball radius.
Returns
int - a smallest id of cells being in contact with the ball, -1 in case if there are no such cells.
Exceptions
Ifthe coordinates array is not set.
Ifthis->getMeshDimension() != this->getSpaceDimension().

Implements MEDCoupling::MEDCouplingMesh.

References getCellsContainingPoint().

Referenced by MEDCoupling::MEDCoupling1GTUMesh::getCellContainingPoint().

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

Finds cells in contact with a ball (i.e. a point with precision). For speed reasons, the INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TRI6 and INTERP_KERNEL::NORM_QUAD8 cells are considered as convex cells to detect if a point is IN or OUT. If it is not the case, please change their types to INTERP_KERNEL::NORM_POLYGON or INTERP_KERNEL::NORM_QPOLYG before invoking this method.

Warning
This method is suitable if the caller intends to evaluate only one point, for more points getCellsContainingPoints() is recommended as it is faster.
Parameters
[in]pos- array of coordinates of the ball central point.
[in]eps- ball radius.
[out]elts- vector returning ids of the found cells. It is cleared before inserting ids.
Exceptions
Ifthe coordinates array is not set.
Ifthis->getMeshDimension() != this->getSpaceDimension().

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

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayTemplate< T >::end(), and getCellsContainingPoints().

Referenced by getCellContainingPoint(), and MEDCoupling::MEDCoupling1GTUMesh::getCellsContainingPoint().

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

Finds cells in contact with several balls (i.e. points with precision). This method is an extension of getCellContainingPoint() and getCellsContainingPoint() for the case of multiple points. For speed reasons, the INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TRI6 and INTERP_KERNEL::NORM_QUAD8 cells are considered as convex cells to detect if a point is IN or OUT. If it is not the case, please change their types to INTERP_KERNEL::NORM_POLYGON or INTERP_KERNEL::NORM_QPOLYG before invoking this method.

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

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

Reimplemented from MEDCoupling::MEDCouplingMesh.

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getMeshDimension(), and MEDCoupling::MEDCouplingPointSet::getSpaceDimension().

Referenced by getCellsContainingPoint(), and Intersect2DMeshWith1DLine().

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

Finds butterfly cells in this mesh. A 2D cell is considered to be butterfly if at least two its edges intersect each other anywhere except their extremities. An INTERP_KERNEL::NORM_NORI3 cell can not be butterfly.

Parameters
[in,out]cells- a vector returning ids of the found cells. It is not cleared before filling in.
[in]eps- precision.
Exceptions
Ifthis->getMeshDimension() != 2.
Ifthis->getSpaceDimension() != 2 && this->getSpaceDimension() != 3.

References MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::MEDCouplingPointSet::isButterfly2DCell(), and MEDCoupling::MEDCouplingPointSet::project2DCellOnXY().

DataArrayInt * MEDCouplingUMesh::convexEnvelop2D ( )

This method is typically requested to unbutterfly 2D linear cells in this.

This method expects that space dimension is equal to 2 and mesh dimension is equal to 2 too. If it is not the case an INTERP_KERNEL::Exception will be thrown. This method works only for linear 2D cells. If there is any of non linear cells (INTERP_KERNEL::NORM_QUAD8 for example) an INTERP_KERNEL::Exception will be thrown too.

For each 2D linear cell in this, this method builds the convex envelop (or the convex hull) of the current cell. This convex envelop is computed using Jarvis march algorithm. The coordinates and the number of cells of this remain unchanged on invocation of this method. Only connectivity of some cells could be modified if those cells were not representing a convex envelop. If a cell already equals its convex envelop (regardless orientation) its connectivity will remain unchanged. If the computation leads to a modification of nodal connectivity of a cell its geometric type will be modified to INTERP_KERNEL::NORM_POLYGON.

Returns
a newly allocated array containing cellIds that have been modified if any. If no cells have been impacted by this method NULL is returned.
See Also
MEDCouplingUMesh::colinearize2D

References MEDCoupling::DataArrayTemplate< T >::alloc(), BuildConvexEnvelopOf2DCellJarvis(), MEDCoupling::DataArrayTemplate< T >::empty(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), MEDCoupling::MEDCouplingPointSet::getCoords(), MEDCoupling::DataArrayTemplate< T >::getIJ(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayInt::New(), MEDCoupling::DataArrayTemplate< T >::pushBackSilent(), MEDCoupling::MCAuto< T >::retn(), and setConnectivity().

DataArrayInt * MEDCouplingUMesh::findAndCorrectBadOriented3DExtrudedCells ( )

Finds and fixes incorrectly oriented linear extruded volumes (INTERP_KERNEL::NORM_HEXA8, INTERP_KERNEL::NORM_PENTA6, INTERP_KERNEL::NORM_HEXGP12 etc) to respect the MED convention according to which the first facet of the cell should be oriented to have the normal vector pointing out of cell.

Returns
DataArrayInt * - a new instance of DataArrayInt holding ids of fixed cells. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthis->getMeshDimension() != 3.
Ifthis->getSpaceDimension() != 3.
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.

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

See Also
MEDCouplingUMesh::findAndCorrectBadOriented3DCells

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), CorrectExtrudedStaticCell(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), Is3DExtrudedStaticCellWellOriented(), MEDCoupling::DataArrayInt::New(), MEDCoupling::DataArrayTemplate< T >::pushBackSilent(), and MEDCoupling::MCAuto< T >::retn().

DataArrayInt * MEDCouplingUMesh::findAndCorrectBadOriented3DCells ( )
DataArrayDouble * MEDCouplingUMesh::getBoundingBoxForBBTree ( double  arcDetEps = 1e-12) const
virtual

This method aggregate the bbox of each cell and put it into bbox parameter (xmin,xmax,ymin,ymax,zmin,zmax).

Parameters
[in]arcDetEps- a parameter specifying in case of 2D quadratic polygon cell the detection limit between linear and arc circle. (By default 1e-12) For all other cases this input parameter is ignored.
Returns
DataArrayDouble * - newly created object (to be managed by the caller) this number of cells tuples and 2*spacedim components.
Exceptions
Ifthis is not fully set (coordinates and connectivity).
Ifa cell in this has no valid nodeId.
See Also
MEDCouplingUMesh::getBoundingBoxForBBTreeFast, MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic

Implements MEDCoupling::MEDCouplingPointSet.

References getBoundingBoxForBBTree1DQuadratic(), getBoundingBoxForBBTree2DQuadratic(), getBoundingBoxForBBTreeFast(), getMeshDimension(), and MEDCoupling::MEDCouplingPointSet::getSpaceDimension().

Referenced by conformize2D(), conformize3D(), and distanceToPoints().

DataArrayDouble * MEDCouplingUMesh::getBoundingBoxForBBTreeFast ( ) const

This method aggregate the bbox of each cell only considering the nodes constituting each cell and put it into bbox parameter. So meshes having quadratic cells the computed bounding boxes can be invalid !

Returns
DataArrayDouble * - newly created object (to be managed by the caller) this number of cells tuples and 2*spacedim components.
Exceptions
Ifthis is not fully set (coordinates and connectivity).
Ifa cell in this has no valid nodeId.

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), and MEDCoupling::MCAuto< T >::retn().

Referenced by getBoundingBoxForBBTree().

DataArrayDouble * MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic ( double  arcDetEps = 1e-12) const

This method aggregates the bbox of each 2D cell in this considering the whole shape. This method is particularly useful for 2D meshes having quadratic cells because for this type of cells getBoundingBoxForBBTreeFast method may return invalid bounding boxes (since it just considers the two extremities of the arc of circle).

Parameters
[in]arcDetEps- a parameter specifying in case of 2D quadratic polygon cell the detection limit between linear and arc circle. (By default 1e-12)
Returns
DataArrayDouble * - newly created object (to be managed by the caller) this number of cells tuples and 2*spacedim components.
Exceptions
Ifthis is not fully defined.
Ifthis is not a mesh with meshDimension equal to 2.
Ifthis is not a mesh with spaceDimension equal to 2.
See Also
MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), INTERP_KERNEL::QuadraticPolygon::BuildArcCirclePolygon(), INTERP_KERNEL::QuadraticPolygon::BuildLinearPolygon(), INTERP_KERNEL::ComposedEdge::fillBounds(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), and MEDCoupling::MCAuto< T >::retn().

Referenced by getBoundingBoxForBBTree().

DataArrayDouble * MEDCouplingUMesh::getBoundingBoxForBBTree1DQuadratic ( double  arcDetEps = 1e-12) const

This method aggregates the bbox of each 1D cell in this considering the whole shape. This method is particularly useful for 2D meshes having quadratic cells because for this type of cells getBoundingBoxForBBTreeFast method may return invalid bounding boxes (since it just considers the two extremities of the arc of circle).

Parameters
[in]arcDetEps- a parameter specifying in case of 2D quadratic polygon cell the detection limit between linear and arc circle. (By default 1e-12)
Returns
DataArrayDouble * - newly created object (to be managed by the caller) this number of cells tuples and 2*spacedim components.
Exceptions
Ifthis is not fully defined.
Ifthis is not a mesh with meshDimension equal to 1.
Ifthis is not a mesh with spaceDimension equal to 2.
See Also
MEDCouplingUMesh::getBoundingBoxForBBTree2DQuadratic

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), INTERP_KERNEL::QuadraticPolygon::BuildArcCircleEdge(), INTERP_KERNEL::QuadraticPolygon::BuildLinearEdge(), INTERP_KERNEL::Edge::decrRef(), INTERP_KERNEL::Edge::getBounds(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), and MEDCoupling::MCAuto< T >::retn().

Referenced by getBoundingBoxForBBTree().

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 only (most simple): the cells of the 1D mesh represent the vectors along which the 2D mesh will be repeated to build each level
  • 1 for translation and rotation: the translation is done as above. For each level, an arc of circle is fitted on the 3 preceding points of the 1D mesh. The center of the arc is the center of rotation for each level, the rotation is done along an axis normal to the plane containing the arc, and finally the angle of rotation is defined by the first two points on the arc.
Returns
an unstructured mesh with meshDim==3 and spaceDim==3. The returned mesh has the same coords than this.

References getMeshDimension(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), isContiguous1D(), isFullyQuadratic(), isPresenceOfQuadratic(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingPointSet::setCoords(), and updateTime().

Referenced by MEDCoupling::MEDFileUMesh::buildExtrudedMesh().

bool MEDCouplingUMesh::isFullyQuadratic ( ) const

Checks if this mesh is constituted by only quadratic cells.

Returns
bool - true if there are only quadratic cells in this mesh.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.

References getNumberOfCells(), and getTypeOfCell().

Referenced by buildExtrudedMesh().

bool MEDCouplingUMesh::isPresenceOfQuadratic ( ) const

Checks if this mesh includes any quadratic cell.

Returns
bool - true if there is at least one quadratic cells in this mesh.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.

References getNumberOfCells(), and getTypeOfCell().

Referenced by buildExtrudedMesh().

void MEDCouplingUMesh::convertQuadraticCellsToLinear ( )

Converts all quadratic cells to linear ones. If there are no quadratic cells in this mesh, it remains unchanged.

Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), getNodalConnectivityArrayLen(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), getTypeOfCell(), MEDCoupling::DataArrayInt::New(), and setConnectivity().

Referenced by MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear(), and MEDCoupling::MEDFileUMesh::quadraticToLinear().

DataArrayInt * MEDCouplingUMesh::convertLinearCellsToQuadratic ( int  conversionType = 0)

This method converts all linear cell in this to quadratic one. Contrary to MEDCouplingUMesh::convertQuadraticCellsToLinear method, here it is needed to specify the target type of cells expected. For example INTERP_KERNEL::NORM_TRI3 can be converted to INTERP_KERNEL::NORM_TRI6 if conversionType is equal to 0 (the default) or to INTERP_KERNEL::NORM_TRI7 if conversionType is equal to 1. All non linear cells and polyhedron in this are let untouched. Contrary to MEDCouplingUMesh::convertQuadraticCellsToLinear method, the coordinates in this can be become bigger. All created nodes will be put at the end of the existing coordinates.

Parameters
[in]conversionTypespecifies the type of conversion expected. Only 0 (default) and 1 are supported presently. 0 those that creates the 'most' simple corresponding quadratic cells. 1 is those creating the 'most' complex.
Returns
a newly created DataArrayInt instance that the caller should deal with containing cell ids of converted cells.
Exceptions
ifthis is not fully defined. It throws too if conversionType is not in [0,1].
See Also
MEDCouplingUMesh::convertQuadraticCellsToLinear

References getMeshDimension(), MEDCoupling::MCAuto< T >::retn(), setConnectivity(), and MEDCoupling::MEDCouplingPointSet::setCoords().

Referenced by MEDCoupling::MEDFileUMesh::linearToQuadratic().

void MEDCouplingUMesh::tessellate2D ( double  eps)

Tessellates this 2D mesh by dividing not straight edges of quadratic faces, so that the number of cells remains the same. Quadratic faces are converted to polygons. This method works only for 2D meshes in 2D space. If no cells are quadratic (INTERP_KERNEL::NORM_QUAD8, INTERP_KERNEL::NORM_TRI6, INTERP_KERNEL::NORM_QPOLYG ), this mesh remains unchanged.

Warning
This method can lead to a huge amount of nodes if eps is very low.
Parameters
[in]eps- specifies the maximal angle (in radians) between 2 sub-edges of a polylinized edge constituting the input polygon.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.
Ifthis->getMeshDimension() != 2.
Ifthis->getSpaceDimension() != 2.

References getMeshDimension(), and MEDCoupling::MEDCouplingPointSet::getSpaceDimension().

MEDCoupling1SGTUMesh * MEDCouplingUMesh::tetrahedrize ( int  policy,
DataArrayInt *&  n2oCells,
int &  nbOfAdditionalPoints 
) const

This method expects that this a 3D mesh (spaceDim=3 and meshDim=3) with all coordinates and connectivities set. All cells in this are expected to be linear 3D cells. This method will split all 3D cells in this into INTERP_KERNEL::NORM_TETRA4 cells and put them in the returned mesh. It leads to an increase to number of cells. This method contrary to MEDCouplingUMesh::simplexize can append coordinates in this to perform its work. The nbOfAdditionalPoints returned value informs about it. If > 0, the coordinates array in returned mesh will have nbOfAdditionalPoints more tuples (nodes) than in this. Anyway, all the nodes in this (with the same order) will be in the returned mesh.

Parameters
[in]policy- the policy of splitting that must be in (PLANAR_FACE_5, PLANAR_FACE_6, GENERAL_24, GENERAL_48). The policy will be used only for INTERP_KERNEL::NORM_HEXA8 cells. For all other cells, the splitting policy will be ignored. See INTERP_KERNEL::SplittingPolicy for the images.
[out]nbOfAdditionalPoints- number of nodes added to this->_coords. If > 0 a new coordinates object will be constructed result of the aggregation of the old one and the new points added.
[out]n2oCells- A new instance of DataArrayInt holding, for each new cell, an id of old cell producing it. The caller is to delete this array using decrRef() as it is no more needed.
Returns
MEDCoupling1SGTUMesh * - the mesh containing only INTERP_KERNEL::NORM_TETRA4 cells.
Warning
This method operates on each cells in this independantly ! So it can leads to non conform mesh in returned value ! If you expect to have a conform mesh in output the policy PLANAR_FACE_6 should be used on a mesh sorted with MEDCoupling1SGTUMesh::sortHexa8EachOther.
Exceptions
Ifthis is not a 3D mesh (spaceDim==3 and meshDim==3).
Ifthis is not fully constituted with linear 3D cells.
See Also
MEDCouplingUMesh::simplexize, MEDCoupling1SGTUMesh::sortHexa8EachOther

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayDouble::Aggregate(), MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayInt::buildExplicitArrOfSliceOnScaledArr(), MEDCoupling::DataArrayInt::computeOffsetsFull(), MEDCoupling::DataArrayTemplate< T >::empty(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), MEDCoupling::MEDCouplingMesh::getName(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::insertAtTheEnd(), MEDCoupling::MEDCoupling1SGTUMesh::New(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::DataArrayInt::New(), INTERP_KERNEL::NORM_TETRA4, MEDCoupling::DataArrayTemplate< T >::rearrange(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingPointSet::setCoords(), and MEDCoupling::MEDCoupling1SGTUMesh::setNodalConnectivity().

DataArrayInt * MEDCouplingUMesh::simplexize ( int  policy)
virtual

Tessellates this 1D mesh in 2D space by dividing not straight quadratic edges.

Warning
This method can lead to a huge amount of nodes if eps is very low.
Parameters
[in]eps- specifies the maximal angle (in radian) between 2 sub-edges of a sub-divided edge.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.
Ifthis->getMeshDimension() != 1.
Ifthis->getSpaceDimension() != 2.

Divides every cell of this mesh into simplices (triangles in 2D and tetrahedra in 3D). In addition, returns an array mapping new cells to old ones.
This method typically increases the number of cells in this mesh but the number of nodes remains unchanged. That's why the 3D splitting policies INTERP_KERNEL::GENERAL_24 and INTERP_KERNEL::GENERAL_48 are not available here.

Parameters
[in]policy- specifies a pattern used for splitting. The semantic of policy is:
Returns
DataArrayInt * - a new instance of DataArrayInt holding, for each new cell, an id of old cell producing it. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifpolicy is 0 or 1 and this->getMeshDimension() != 2.
Ifpolicy is INTERP_KERNEL::PLANAR_FACE_5 or INTERP_KERNEL::PLANAR_FACE_6 and this->getMeshDimension() != 3.
Ifpolicy is not one of the four discussed above.
Ifthe nodal connectivity of cells is not defined.
See Also
MEDCouplingUMesh::tetrahedrize, MEDCoupling1SGTUMesh::sortHexa8EachOther

Implements MEDCoupling::MEDCouplingMesh.

References INTERP_KERNEL::PLANAR_FACE_5, and INTERP_KERNEL::PLANAR_FACE_6.

bool MEDCouplingUMesh::areOnlySimplexCells ( ) const

Checks if this mesh is constituted by simplex cells only. Simplex cells are:

This method is useful for users that need to use P1 field services as MEDCouplingFieldDouble::getValueOn(), MEDCouplingField::buildMeasureField() etc. All these methods need mesh support containing only simplex cells.

Returns
bool - true if there are only simplex cells in this mesh.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.
Ifthis->getMeshDimension() < 1.

References MEDCoupling::DataArrayTemplate< T >::begin(), getMeshDimension(), and getNumberOfCells().

void MEDCouplingUMesh::convertDegeneratedCells ( )

Converts degenerated 2D or 3D linear cells of this mesh into cells of simpler type. For example an INTERP_KERNEL::NORM_QUAD4 cell having only three unique nodes in its connectivity is transformed into an INTERP_KERNEL::NORM_TRI3 cell. This method does not perform geometrical checks and checks only nodal connectivity of cells, so it can be useful to call mergeNodes() before calling this method.

Exceptions
Ifthis->getMeshDimension() <= 1.
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.

References computeTypes(), getMeshDimension(), getNodalConnectivityArrayLen(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), and MEDCoupling::DataArrayTemplate< T >::reAlloc().

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

Finds incorrectly oriented cells of this 2D mesh in 3D space. A cell is considered to be oriented correctly if an angle between its normal vector and a given vector is less than PI / 2.

Parameters
[in]vec- 3 components of the vector specifying the correct orientation of cells.
[in]polyOnly- if true, only polygons are checked, else, all cells are checked.
[in,out]cells- a vector returning ids of incorrectly oriented cells. It is not cleared before filling in.
Exceptions
Ifthis->getMeshDimension() != 2.
Ifthis->getSpaceDimension() != 3.

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

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::begin(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), IsPolygonWellOriented(), INTERP_KERNEL::NORM_POLYGON, and INTERP_KERNEL::NORM_QPOLYG.

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

Reverse connectivity of 2D cells whose orientation is not correct. A cell is considered to be oriented correctly if an angle between its normal vector and a given vector is less than PI / 2.

Parameters
[in]vec- 3 components of the vector specifying the correct orientation of cells.
[in]polyOnly- if true, only polygons are checked, else, all cells are checked.
Exceptions
Ifthis->getMeshDimension() != 2.
Ifthis->getSpaceDimension() != 3.

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

See Also
changeOrientationOfCells

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::TimeLabel::declareAsNew(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), IsPolygonWellOriented(), INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_QPOLYG, and updateTime().

void MEDCouplingUMesh::changeOrientationOfCells ( )

This method change the orientation of cells in this without any consideration of coordinates. Only connectivity is impacted.

See Also
orientCorrectly2DCells

References MEDCoupling::DataArrayTemplate< T >::begin(), getMeshDimension(), getNumberOfCells(), and MEDCoupling::DataArrayTemplate< T >::getPointer().

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

Finds incorrectly oriented polyhedral cells, i.e. polyhedrons having correctly oriented facets. The normal vector of the facet should point out of the cell.

Parameters
[in,out]cells- a vector returning ids of incorrectly oriented cells. It is not cleared before filling in.
Exceptions
Ifthis->getMeshDimension() != 3.
Ifthis->getSpaceDimension() != 3.
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.

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

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::begin(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), IsPolyhedronWellOriented(), and INTERP_KERNEL::NORM_POLYHED.

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

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.

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::begin(), getMeshDimension(), and MEDCoupling::MEDCouplingPointSet::getSpaceDimension().

MEDCouplingFieldDouble * MEDCouplingUMesh::getEdgeRatioField ( ) const

Creates a new MEDCouplingFieldDouble holding Edge Ratio values of all cells. Currently cells of the following types are treated: INTERP_KERNEL::NORM_TRI3, INTERP_KERNEL::NORM_QUAD4 and INTERP_KERNEL::NORM_TETRA4. For a cell of other type an exception is thrown. Space dimension of a 2D mesh can be either 2 or 3. The Edge Ratio of a cell $t$ is: $\frac{|t|_\infty}{|t|_0}$, where $|t|_\infty$ and $|t|_0$ respectively denote the greatest and the smallest edge lengths of $t$.

Returns
MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble on cells and one time, lying on this mesh. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthis mesh contains elements of dimension different from the mesh dimension.
Ifthe connectivity data array has more than one component.
Ifthe connectivity data array has a named component.
Ifthe connectivity index data array has more than one component.
Ifthe connectivity index data array has a named component.
Ifthis->getMeshDimension() is neither 2 nor 3.
Ifthis->getSpaceDimension() is neither 2 nor 3.
Ifthis mesh includes cells of type different from the ones enumerated above.

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), checkConsistencyLight(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::DataArrayDouble::New(), INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TETRA4, INTERP_KERNEL::NORM_TRI3, MEDCoupling::ON_CELLS, MEDCoupling::ONE_TIME, MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingFieldT< T >::setArray(), MEDCoupling::MEDCouplingField::setMesh(), MEDCoupling::MEDCouplingField::setName(), and MEDCoupling::MEDCouplingFieldDouble::synchronizeTimeWithSupport().

MEDCouplingFieldDouble * MEDCouplingUMesh::getAspectRatioField ( ) const

Creates a new MEDCouplingFieldDouble holding Aspect Ratio values of all cells. Currently cells of the following types are treated: INTERP_KERNEL::NORM_TRI3, INTERP_KERNEL::NORM_QUAD4 and INTERP_KERNEL::NORM_TETRA4. For a cell of other type an exception is thrown. Space dimension of a 2D mesh can be either 2 or 3.

Returns
MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble on cells and one time, lying on this mesh. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthis mesh contains elements of dimension different from the mesh dimension.
Ifthe connectivity data array has more than one component.
Ifthe connectivity data array has a named component.
Ifthe connectivity index data array has more than one component.
Ifthe connectivity index data array has a named component.
Ifthis->getMeshDimension() is neither 2 nor 3.
Ifthis->getSpaceDimension() is neither 2 nor 3.
Ifthis mesh includes cells of type different from the ones enumerated above.

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), checkConsistencyLight(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::DataArrayDouble::New(), INTERP_KERNEL::NORM_QUAD4, INTERP_KERNEL::NORM_TETRA4, INTERP_KERNEL::NORM_TRI3, MEDCoupling::ON_CELLS, MEDCoupling::ONE_TIME, MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingFieldT< T >::setArray(), MEDCoupling::MEDCouplingField::setMesh(), MEDCoupling::MEDCouplingField::setName(), and MEDCoupling::MEDCouplingFieldDouble::synchronizeTimeWithSupport().

MEDCouplingFieldDouble * MEDCouplingUMesh::getWarpField ( ) const

Creates a new MEDCouplingFieldDouble holding Warping factor values of all cells of this 2D mesh in 3D space. It is a measure of the "planarity" of 2D cell in 3D space. Currently only cells of the following types are treated: INTERP_KERNEL::NORM_QUAD4. For a cell of other type an exception is thrown. The warp field is computed as follows: let (a,b,c,d) be the points of the quad. Defining $t=\vec{da}\times\vec{ab}$, $u=\vec{ab}\times\vec{bc}$ $v=\vec{bc}\times\vec{cd}$ $w=\vec{cd}\times\vec{da}$, the warp is defined as $W^3$ with

\[ W=min(\frac{t}{|t|}\cdot\frac{v}{|v|}, \frac{u}{|u|}\cdot\frac{w}{|w|}) \]

Returns
MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble on cells and one time, lying on this mesh. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthis mesh contains elements of dimension different from the mesh dimension.
Ifthe connectivity data array has more than one component.
Ifthe connectivity data array has a named component.
Ifthe connectivity index data array has more than one component.
Ifthe connectivity index data array has a named component.
Ifthis->getMeshDimension() != 2.
Ifthis->getSpaceDimension() != 3.
Ifthis mesh includes cells of type different from the ones enumerated above.

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), checkConsistencyLight(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::DataArrayDouble::New(), INTERP_KERNEL::NORM_QUAD4, MEDCoupling::ON_CELLS, MEDCoupling::ONE_TIME, MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingFieldT< T >::setArray(), MEDCoupling::MEDCouplingField::setMesh(), MEDCoupling::MEDCouplingField::setName(), and MEDCoupling::MEDCouplingFieldDouble::synchronizeTimeWithSupport().

MEDCouplingFieldDouble * MEDCouplingUMesh::getSkewField ( ) const

Creates a new MEDCouplingFieldDouble holding Skew factor values of all cells of this 2D mesh in 3D space. Currently cells of the following types are treated: INTERP_KERNEL::NORM_QUAD4. The skew is computed as follow for a quad with points (a,b,c,d): let $u=\vec{ab}+\vec{dc}$ and $v=\vec{ac}+\vec{bd}$ then the skew is computed as:

\[ s=\frac{u}{|u|}\cdot\frac{v}{|v|} \]

For a cell of other type an exception is thrown.

Returns
MEDCouplingFieldDouble * - a new instance of MEDCouplingFieldDouble on cells and one time, lying on this mesh. The caller is to delete this field using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthis mesh contains elements of dimension different from the mesh dimension.
Ifthe connectivity data array has more than one component.
Ifthe connectivity data array has a named component.
Ifthe connectivity index data array has more than one component.
Ifthe connectivity index data array has a named component.
Ifthis->getMeshDimension() != 2.
Ifthis->getSpaceDimension() != 3.
Ifthis mesh includes cells of type different from the ones enumerated above.

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), checkConsistencyLight(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::DataArrayDouble::New(), INTERP_KERNEL::NORM_QUAD4, MEDCoupling::ON_CELLS, MEDCoupling::ONE_TIME, MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingFieldT< T >::setArray(), MEDCoupling::MEDCouplingField::setMesh(), MEDCoupling::MEDCouplingField::setName(), and MEDCoupling::MEDCouplingFieldDouble::synchronizeTimeWithSupport().

std::vector< int > MEDCouplingUMesh::getDistributionOfTypes ( ) const
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]==-1 because it has no sense here. This parameter is kept only for compatibility with other methode listed above.

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::DataArrayTemplate< T >::begin(), getAllGeoTypes(), and getNumberOfCells().

Referenced by keepSpecifiedCells(), and MEDCoupling::MEDFileUMesh::unPolyze().

DataArrayInt * MEDCouplingUMesh::checkTypeConsistencyAndContig ( const std::vector< int > &  code,
const std::vector< const DataArrayInt * > &  idsPerType 
) const
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 MEDCoupling::MEDCouplingMesh.

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayTemplate< T >::checkAllocated(), checkConsecutiveCellTypesAndOrder(), MEDCoupling::DataArrayTemplate< T >::end(), getNumberOfCells(), MEDCoupling::DataArray::getNumberOfComponents(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::New(), and MEDCoupling::MCAuto< T >::retn().

void MEDCouplingUMesh::splitProfilePerType ( const DataArrayInt profile,
std::vector< int > &  code,
std::vector< DataArrayInt * > &  idsInPflPerType,
std::vector< DataArrayInt * > &  idsPerType 
) const
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 sub-profiles sorted by geo type. The result is put in the array idsPerType. In the returned parameter code, foreach i code[3*i+2] refers (if different from -1) to a location into the idsPerType. This method has 1 input profile and 3 outputs code idsInPflPerType and idsPerType.

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

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArray::copyStringInfoFrom(), MEDCoupling::DataArrayInt::findIdsEqual(), getNumberOfCells(), MEDCoupling::DataArray::getNumberOfComponents(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::RefCountObjectOnly::incrRef(), MEDCoupling::DataArrayInt::isIota(), and MEDCoupling::DataArrayInt::splitByValueRange().

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

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 MEDCoupling::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 MEDCoupling::MEDCouplingPointSet::_coords, areCellsIncludedIn(), MEDCoupling::DataArrayTemplate< T >::begin(), buildDescendingConnectivity(), MEDCoupling::RefCountObjectOnly::decrRef(), MEDCoupling::MEDCouplingPointSet::getCoords(), MEDCoupling::DataArrayTemplate< T >::getMaxValue(), getMeshDimension(), MEDCoupling::DataArrayTemplate< T >::getNbOfElems(), getNodalConnectivity(), getNodalConnectivityIndex(), MEDCoupling::RefCountObjectOnly::incrRef(), New(), MEDCoupling::DataArrayInt::New(), renumberCells(), setConnectivity(), sortCellsInMEDFileFrmt(), and MEDCoupling::DataArrayInt::transformWithIndArr().

DataArrayInt * MEDCouplingUMesh::sortCellsInMEDFileFrmt ( )

Permutes the nodal connectivity arrays so that the cells are sorted by type, which is necessary for writing the mesh to MED file. Additionally returns a permutation array in "Old to New" mode.

Returns
DataArrayInt * - a new instance of DataArrayInt. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthe nodal connectivity of cells is not defined.

References MEDCoupling::DataArrayTemplate< T >::begin(), getRenumArrForMEDFileFrmt(), renumberCells(), and MEDCoupling::MCAuto< T >::retn().

Referenced by MEDCoupling::MEDFileUMesh::Aggregate(), AggregateSortedByTypeMeshesOnSameCoords(), MEDCoupling::MEDFileUMesh::buildExtrudedMesh(), and emulateMEDMEMBDC().

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 MEDCoupling::DataArrayTemplate< T >::begin(), and getNumberOfCells().

Referenced by cellsByType().

bool MEDCouplingUMesh::checkConsecutiveCellTypesForMEDFileFrmt ( ) const

This method is a specialization of MEDCouplingUMesh::checkConsecutiveCellTypesAndOrder method that is called here. The geometric type order is specified by MED file.

See Also
MEDCouplingUMesh::checkConsecutiveCellTypesAndOrder

References checkConsecutiveCellTypesAndOrder().

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 ). If there is some geo types in this NOT in [ orderBg, orderEnd ) it is OK (return true) if contiguous. If there is some geo types in [ orderBg, orderEnd ) NOT in this it is OK too (return true) if contiguous.

References MEDCoupling::DataArrayTemplate< T >::begin(), and getNumberOfCells().

Referenced by checkConsecutiveCellTypesForMEDFileFrmt(), and checkTypeConsistencyAndContig().

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

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 MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayInt::fillWithZero(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::New(), and MEDCoupling::MCAuto< T >::retn().

Referenced by getRenumArrForConsecutiveCellTypesSpec(), and MEDCoupling::MEDFileUMesh::unPolyze().

DataArrayInt * MEDCouplingUMesh::getRenumArrForMEDFileFrmt ( ) const

This method behaves exactly as MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec but the order is those defined in MED file spec.

Returns
a new object containing the old to new correspondance.
See Also
MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec, MEDCouplingUMesh::sortCellsInMEDFileFrmt.

References getRenumArrForConsecutiveCellTypesSpec().

Referenced by sortCellsInMEDFileFrmt().

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

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 MEDCoupling::DataArrayInt::buildPermArrPerLevel(), MEDCoupling::RefCountObjectOnly::decrRef(), and getLevArrPerCellTypes().

Referenced by getRenumArrForMEDFileFrmt().

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 MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), computeTypes(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::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 MEDCoupling::DataArrayTemplate< T >::begin(), buildPartOfMySelf(), and getNumberOfCells().

MEDCoupling1GTUMesh * MEDCouplingUMesh::convertIntoSingleGeoTypeMesh ( ) const

This method performs the opposite operation than those in MEDCoupling1SGTUMesh::buildUnstructured. If this is a single geometric type unstructured mesh, it will be converted into a more compact data structure, MEDCoupling1GTUMesh instance. The returned instance will aggregate the same DataArrayDouble instance of coordinates than this.

Returns
a newly allocated instance, that the caller must manage.
Exceptions
Ifthis contains more than one geometric type.
Ifthe nodal connectivity of this is not fully defined.
Ifthe internal data is not coherent.

References convertNodalConnectivityToDynamicGeoTypeMesh(), convertNodalConnectivityToStaticGeoTypeMesh(), MEDCoupling::MEDCouplingPointSet::getCoords(), MEDCoupling::MEDCouplingMesh::getName(), MEDCoupling::MEDCoupling1GTUMesh::New(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::MEDCouplingPointSet::setCoords(), MEDCoupling::MEDCoupling1SGTUMesh::setNodalConnectivity(), and MEDCoupling::MEDCoupling1DGTUMesh::setNodalConnectivity().

void MEDCouplingUMesh::convertNodalConnectivityToDynamicGeoTypeMesh ( DataArrayInt *&  nodalConn,
DataArrayInt *&  nodalConnIndex 
) const

Convert the nodal connectivity of the mesh so that all the cells are of dynamic types (polygon or quadratic polygon). This returns the corresponding new nodal connectivity in Indirect indexing format.

Parameters
nodalConn
nodalConnI

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::New(), and MEDCoupling::MCAuto< T >::retn().

Referenced by convertIntoSingleGeoTypeMesh().

MEDCouplingUMesh * MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords ( const std::vector< const MEDCouplingUMesh * > &  ms,
DataArrayInt *&  szOfCellGrpOfSameType,
DataArrayInt *&  idInMsOfCellGrpOfSameType 
)
static

This method takes in input a vector of MEDCouplingUMesh instances lying on the same coordinates with same mesh dimensions. Each mesh in ms must be sorted by type with the same order (typically using MEDCouplingUMesh::sortCellsInMEDFileFrmt). This method is particulary useful for MED file interaction. It allows to aggregate several meshes and keeping the type sorting and the track of the permutation by chunk of same geotype cells to retrieve it. The traditional formats old2new and new2old are not used here to avoid the build of big permutation array.

Parameters
[in]msmeshes with same mesh dimension lying on the same coords and sorted by type following de the same geometric type order than those specified in MEDCouplingUMesh::sortCellsInMEDFileFrmt method.
[out]szOfCellGrpOfSameTypeis a newly allocated DataArrayInt instance whose number of tuples is equal to the number of chunks of same geotype in all meshes in ms. The accumulation of all values of this array is equal to the number of cells of returned mesh.
[out]idInMsOfCellGrpOfSameTypeis a newly allocated DataArrayInt instance having the same size than szOfCellGrpOfSameType. This output array gives for each chunck of same type the corresponding mesh id in ms.
Returns
A newly allocated unstructured mesh that is the result of the aggregation on same coords of all meshes in ms. This returned mesh is sorted by type following the geo cell types order of MEDCouplingUMesh::sortCellsInMEDFileFrmt method.

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayTemplate< T >::getIJ(), MergeUMeshesOnSameCoords(), MEDCoupling::DataArrayInt::New(), MEDCoupling::DataArrayTemplate< T >::pushBackSilent(), MEDCoupling::DataArrayTemplate< T >::renumber(), MEDCoupling::MCAuto< T >::retn(), and sortCellsInMEDFileFrmt().

Referenced by MEDCoupling::MEDFileUMesh::buildInnerBoundaryAlongM1Group().

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

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

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

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' This method works for mesh sorted by type. cells whose ids is in 'idsPerGeoType' array. This method conserves coords and name of mesh.

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), buildPartOfMySelf(), MEDCoupling::MEDCouplingMesh::copyTinyInfoFrom(), MEDCoupling::DataArrayTemplate< T >::end(), getDistributionOfTypes(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::New(), and MEDCoupling::MCAuto< T >::retn().

std::vector< bool > MEDCouplingUMesh::getQuadraticStatus ( ) const

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 MEDCoupling::DataArrayTemplate< T >::begin(), 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 MEDCoupling::MEDCouplingMesh.

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

DataArrayDouble * MEDCouplingUMesh::computeCellCenterOfMass ( ) const
virtual

Returns a new DataArrayDouble holding barycenters of all cells. The barycenter is computed by averaging coordinates of cell nodes, so this method is not a right choice for degnerated meshes (not well oriented, cells with measure close to zero).

Returns
DataArrayDouble * - a new instance of DataArrayDouble, of size this->getNumberOfCells() tuples per this->getSpaceDimension() components. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.
See Also
MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArray::copyStringInfoFrom(), MEDCoupling::MEDCouplingPointSet::getCoords(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), and MEDCoupling::MCAuto< T >::retn().

Referenced by buildOrthogonalField(), clipSingle3DCellByPlane(), MEDCoupling::MEDCoupling1GTUMesh::computeCellCenterOfMass(), and conformize3D().

DataArrayDouble * MEDCouplingUMesh::computeIsoBarycenterOfNodesPerCell ( ) const
virtual

This method computes for each cell in this, the location of the iso barycenter of nodes constituting the cell. Contrary to badly named MEDCouplingUMesh::computeCellCenterOfMass method that returns the center of inertia of the

Returns
a newly allocated DataArrayDouble instance that the caller has to deal with. The returned DataArrayDouble instance will have this->getNumberOfCells() tuples and this->getSpaceDimension() components.
See Also
MEDCouplingUMesh::computeCellCenterOfMass
Exceptions
Ifthis is not fully defined (coordinates and connectivity)
Ifthere is presence in nodal connectivity in this of node ids not in [0, this->getNumberOfNodes() )

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), INTERP_KERNEL::NORM_POLYHED, and MEDCoupling::MCAuto< T >::retn().

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

Returns a new DataArrayDouble holding barycenters of specified cells. The barycenter is computed by averaging coordinates of cell nodes. The cells to treat are specified via an array of cell ids.

Warning
Validity of the specified cell ids is not checked! Valid range is [ 0, this->getNumberOfCells() ).
Parameters
[in]begin- an array of cell ids of interest.
[in]end- the end of begin, i.e. a pointer to its (last+1)-th element.
Returns
DataArrayDouble * - a new instance of DataArrayDouble, of size ( end - begin ) tuples per this->getSpaceDimension() components. The caller is to delete this array using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.

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

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and MEDCoupling::DataArrayDouble::New().

Referenced by buildPartOrthogonalField().

DataArrayDouble * MEDCouplingUMesh::computePlaneEquationOf3DFaces ( ) const

Returns a DataArrayDouble instance giving for each cell in this the equation of plane given by "a*X+b*Y+c*Z+d=0". So the returned instance will have 4 components and this->getNumberOfCells() tuples. So this method expects that this has a spaceDimension equal to 3 and meshDimension equal to 2. The computation of the plane equation is done using each time the 3 first nodes of 2D cells. This method is useful to detect 2D cells in 3D space that are not coplanar.

Returns
DataArrayDouble * - a new instance of DataArrayDouble having 4 components and a number of tuples equal to number of cells in this.
Exceptions
IfspaceDim!=3 or meshDim!=2.
Ifconnectivity of this is invalid.
Ifconnectivity of a cell in this points to an invalid node.

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), and MEDCoupling::MCAuto< T >::retn().

DataArrayInt * MEDCouplingUMesh::conformize2D ( double  eps)

WARNING this method is potentially non const (if returned array is empty). WARNING this method lead to have a non geometric type sorted mesh (for MED file users) ! This method performs a conformization of this. So if a edge in this can be split into entire edges in this this method will suppress such edges to use sub edges in this. So this method does not add nodes in this if merged edges are both linear (INTERP_KERNEL::NORM_SEG2). In the other cases new nodes can be created. If any are created, they will be appended at the end of the coordinates object before the invokation of this method.

Whatever the returned value, this method does not alter the order of cells in this neither the orientation of cells. The modified cells, if any, are systematically declared as NORM_POLYGON or NORM_QPOLYG depending on the initial quadraticness of geometric type.

This method expects that this has a meshDim equal 2 and spaceDim equal to 2 too. This method expects that all nodes in this are not closer than eps. If it is not the case you can invoke MEDCouplingUMesh::mergeNodes before calling this method.

Parameters
[in]epsthe relative error to detect merged edges.
Returns
DataArrayInt * - The list of cellIds in this that have been subdivided. If empty, nothing changed in this (as if it were a const method). The array is a newly allocated array that the user is expected to deal with.
Exceptions
Ifthis is not coherent.
Ifthis has not spaceDim equal to 2.
Ifthis has not meshDim equal to 2.
See Also
MEDCouplingUMesh::mergeNodes, MEDCouplingUMesh::split2DCells

References MEDCoupling::DataArrayTemplate< T >::begin(), buildDescendingConnectivity(), buildPartOfMySelf(), checkConsistencyLight(), INTERP_KERNEL::Edge::decrRef(), ExtractFromIndexedArrays(), getBoundingBoxForBBTree(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), INTERP_KERNEL::QuadraticPolygon::intersectWith(), MEDCoupling::MEDCouplingPointSet::mergeNodes(), MEDCoupling::DataArrayInt::New(), INTERP_KERNEL::NORM_SEG3, MEDCoupling::DataArrayInt::PutIntoToSkylineFrmt(), MEDCoupling::MEDCouplingPointSet::setCoords(), setPartOfMySelf(), and INTERP_KERNEL::Edge::sortSubNodesAbs().

DataArrayInt * MEDCouplingUMesh::colinearize2D ( double  eps)

This non const method works on 2D mesh. This method scans every cell in this and look if each edge constituting this cell is not mergeable with neighbors edges of that cell. If yes, the cell is "repaired" to minimize at most its number of edges. So this method do not change the overall shape of cells in this (with eps precision). This method do not take care of shared edges between cells, so this method can lead to a non conform mesh (this). If a conform mesh is required you're expected to invoke MEDCouplingUMesh::mergeNodes and MEDCouplingUMesh::conformize2D right after this call. This method works on any 2D geometric types of cell (even static one). If a cell is touched its type becomes dynamic automaticaly. For 2D "repaired" quadratic cells new nodes for center of merged edges is are systematically created and appended at the end of the previously existing nodes.

If the returned array is empty it means that nothing has changed in this (as if it were a const method). If the array is not empty the connectivity of this is modified using new instance, idem for coordinates.

If this is constituted by only linear 2D cells, this method is close to the computation of the convex hull of each cells in this.

Returns
DataArrayInt * - The list of cellIds in this that have at least one edge colinearized.
Exceptions
Ifthis is not coherent.
Ifthis has not spaceDim equal to 2.
Ifthis has not meshDim equal to 2.
See Also
MEDCouplingUMesh::conformize2D, MEDCouplingUMesh::mergeNodes, MEDCouplingUMesh::convexEnvelop2D.

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayDouble::Aggregate(), MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), checkConsistencyLight(), MEDCoupling::DataArrayTemplate< T >::empty(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::DataArrayInt::New(), MEDCoupling::DataArrayTemplate< T >::pushBackSilent(), MEDCoupling::DataArrayTemplate< T >::rearrange(), MEDCoupling::MCAuto< T >::retn(), setConnectivity(), and MEDCoupling::MEDCouplingPointSet::setCoords().

DataArrayInt * MEDCouplingUMesh::conformize3D ( double  eps)

WARNING this method is potentially non const (if returned array is not empty). WARNING this method lead to have a non geometric type sorted mesh (for MED file users) ! This method performs a conformization of this.

Only polyhedron cells are supported. You can call convertAllToPoly()

This method expects that this has a meshDim equal 3 and spaceDim equal to 3 too. This method expects that all nodes in this are not closer than eps. If it is not the case you can invoke MEDCouplingUMesh::mergeNodes before calling this method.

Parameters
[in]epsthe relative error to detect merged edges.
Returns
DataArrayInt * - The list of cellIds in this that have been subdivided. If empty, nothing changed in this (as if it were a const method). The array is a newly allocated array that the user is expected to deal with.
Exceptions
Ifthis is not coherent.
Ifthis has not spaceDim equal to 3.
Ifthis has not meshDim equal to 3.
See Also
MEDCouplingUMesh::mergeNodes, MEDCouplingUMesh::conformize2D, MEDCouplingUMesh::convertAllToPoly()

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), buildDescendingConnectivity(), buildDescendingConnectivity2(), MEDCoupling::DataArrayInt::buildIntersection(), buildOrthogonalField(), buildPartOfMySelf(), buildPartOfMySelfSlice(), checkConsistencyLight(), computeCellCenterOfMass(), MEDCoupling::DataArrayInt::deepCopy(), MEDCoupling::DataArrayInt::deltaShiftIndex(), MEDCoupling::DataArrayTemplate< T >::end(), MEDCoupling::DataArrayTemplate< T >::fillWithValue(), MEDCoupling::DataArrayInt::findIdsEqual(), MEDCoupling::DataArrayDouble::findIdsInRange(), MEDCoupling::DataArrayInt::findIdsInRange(), MEDCoupling::MEDCouplingFieldT< T >::getArray(), getBoundingBoxForBBTree(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), MEDCoupling::MEDCouplingPointSet::getCoords(), MEDCoupling::DataArrayTemplate< T >::getIJ(), getMeasureField(), getMeshDimension(), MEDCoupling::DataArrayTemplate< T >::getNbOfElems(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::keepSelectedComponents(), MEDCoupling::DataArrayInt::New(), INTERP_KERNEL::NORM_POLYGON, INTERP_KERNEL::NORM_POLYHED, MEDCoupling::MCAuto< T >::retn(), MEDCoupling::DataArrayDouble::selectByTupleId(), MEDCoupling::MCAuto< T >::takeRef(), and zipCoordsTraducer().

int MEDCouplingUMesh::split2DCells ( const DataArrayInt desc,
const DataArrayInt descI,
const DataArrayInt subNodesInSeg,
const DataArrayInt subNodesInSegI,
const DataArrayInt midOpt = 0,
const DataArrayInt midOptI = 0 
)

This method split some of edges of 2D cells in this. The edges to be split are specified in subNodesInSeg and in subNodesInSegI using Indirect indexing storage mode. To do the work this method can optionally needs information about middle of subedges for quadratic cases if a minimal creation of new nodes is wanted. So this method try to reduce at most the number of new nodes. The only case that can lead this method to add nodes if a SEG3 is split without information of middle. WARNING : is returned value is different from 0 a call to MEDCouplingUMesh::mergeNodes is necessary to avoid to have a non conform mesh.

Returns
int - the number of new nodes created (in most of cases 0).
Exceptions
Ifthis is not coherent.
Ifthis has not spaceDim equal to 2.
Ifthis has not meshDim equal to 2.
Ifsome subcells needed to be split are orphan.
See Also
MEDCouplingUMesh::conformize2D

References MEDCoupling::DataArrayTemplate< T >::checkAllocated(), getMeshDimension(), and MEDCoupling::MEDCouplingPointSet::getSpaceDimension().

MEDCouplingUMesh * MEDCouplingUMesh::Build0DMeshFromCoords ( DataArrayDouble da)
static
MEDCouplingUMesh * MEDCouplingUMesh::MergeUMeshes ( const MEDCouplingUMesh mesh1,
const MEDCouplingUMesh mesh2 
)
static

Creates a new MEDCouplingUMesh by concatenating two given meshes of the same dimension. Cells and nodes of the first mesh precede cells and nodes of the second mesh within the result mesh.

Parameters
[in]mesh1- the first mesh.
[in]mesh2- the second mesh.
Returns
MEDCouplingUMesh * - the result mesh. It is a new instance of MEDCouplingUMesh. The caller is to delete this mesh using decrRef() as it is no more needed.
Exceptions
Ifmesh1 == NULL or mesh2 == NULL.
Ifthe coordinates array is not set in none of the meshes.
Ifmesh1->getMeshDimension() < 0 or mesh2->getMeshDimension() < 0.
Ifmesh1->getMeshDimension() != mesh2->getMeshDimension().

Referenced by MEDCoupling::MEDFileUMesh::Aggregate(), MEDCoupling::MEDCouplingCartesianAMRMeshGen::buildUnstructured(), MEDCoupling::MEDCouplingFieldDouble::MergeFields(), MEDCoupling::MEDCouplingMesh::MergeMeshes(), and mergeMyselfWith().

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

Creates a new MEDCouplingUMesh by concatenating all given meshes of the same dimension. Cells and nodes of the i-th mesh precede cells and nodes of the (i+1)-th mesh within the result mesh.

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

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

MEDCouplingUMesh * MEDCouplingUMesh::MergeUMeshesOnSameCoords ( const MEDCouplingUMesh mesh1,
const MEDCouplingUMesh mesh2 
)
static

Creates a new MEDCouplingUMesh by concatenating cells of two given meshes of same dimension and sharing the node coordinates array. All cells of the first mesh precede all cells of the second mesh within the result mesh.

Parameters
[in]mesh1- the first mesh.
[in]mesh2- the second mesh.
Returns
MEDCouplingUMesh * - the result mesh. It is a new instance of MEDCouplingUMesh. The caller is to delete this mesh using decrRef() as it is no more needed.
Exceptions
Ifmesh1 == NULL or mesh2 == NULL.
Ifthe meshes do not share the node coordinates array.
Ifmesh1->getMeshDimension() < 0 or mesh2->getMeshDimension() < 0.
Ifmesh1->getMeshDimension() != mesh2->getMeshDimension().

Referenced by AggregateSortedByTypeMeshesOnSameCoords(), areCellsIncludedIn(), areCellsIncludedInPolicy7(), MEDCoupling::MEDFileUMesh::buildExtrudedMesh(), MEDCoupling::MEDCouplingFieldDouble::convertQuadraticCellsToLinear(), FuseUMeshesOnSameCoords(), Intersect2DMeshWith1DLine(), and mergeMyselfWithOnSameCoords().

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

Creates a new MEDCouplingUMesh by concatenating cells of all given meshes of same dimension and sharing the node coordinates array. All cells of the i-th mesh precede all cells of the (i+1)-th mesh within the result mesh.

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

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::front(), MEDCoupling::DataArrayTemplate< T >::getPointer(), New(), MEDCoupling::DataArrayInt::New(), setConnectivity(), MEDCoupling::MEDCouplingPointSet::setCoords(), setMeshDimension(), and MEDCoupling::MEDCouplingMesh::setName().

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

Creates a new MEDCouplingUMesh by concatenating cells of all given meshes of same dimension and sharing the node coordinates array. Cells of the i-th mesh precede cells of the (i+1)-th mesh within the result mesh. Duplicates of cells are removed from this mesh and arrays mapping between new and old cell ids in "Old to New" mode are returned for each input mesh.

Parameters
[in]meshes- a vector of meshes (MEDCouplingUMesh) to concatenate.
[in]compType- specifies a cell comparison technique. For meaning of its valid values [0,1,2], see zipConnectivityTraducer().
[in,out]corr- an array of DataArrayInt, of the same size as meshes. The i-th array describes cell ids mapping for meshes[ i ] mesh. The caller is to delete each of the arrays using decrRef() as it is no more needed.
Returns
MEDCouplingUMesh * - the result mesh. It is a new instance of MEDCouplingUMesh. The caller is to delete this mesh using decrRef() as it is no more needed.
Exceptions
Ifmeshes.size() == 0.
Ifmeshes[ i ] == NULL.
Ifthe meshes do not share the node coordinates array.
Ifmeshes[ i ]->getMeshDimension() < 0.
Ifthe meshes are of different dimension (getMeshDimension()).
Ifthe nodal connectivity of cells of any of meshes is not defined.
Ifthe nodal connectivity any of meshes includes an invalid id.

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::MEDCouplingMesh::getName(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MergeUMeshesOnSameCoords(), MEDCoupling::DataArrayInt::New(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::DataArray::setName(), and MEDCoupling::MEDCouplingPointSet::zipConnectivityTraducer().

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

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

Makes all given meshes share the nodal connectivity array. The common connectivity array is created by concatenating the connectivity arrays of all given meshes. All the given meshes must be of the same space dimension but dimension of cells can differ. This method is particulary useful in MEDLoader context to build a MEDFileUMesh instance that expects that underlying MEDCouplingUMesh'es of different dimension share the same nodal connectivity array.

Parameters
[in,out]meshes- a vector of meshes to update.
Exceptions
Ifany of meshes is NULL.
Ifthe coordinates array is not set in any of meshes.
Ifthe nodal connectivity of cells is not defined in any of meshes.
Ifmeshes are of different space dimension.

References MEDCoupling::DataArrayDouble::Aggregate(), and MEDCoupling::MEDCouplingPointSet::setCoords().

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

Merges nodes coincident with a given precision within all given meshes that share the nodal connectivity array. The given meshes can be of different mesh dimension. This method is particulary useful in MEDLoader context to build a MEDFileUMesh instance that expects that underlying MEDCouplingUMesh'es of different dimension share the same nodal connectivity array.

Parameters
[in,out]meshes- a vector of meshes to update.
[in]eps- the precision used to detect coincident nodes (infinite norm).
Exceptions
Ifany of meshes is NULL.
Ifthe meshes do not share the same node coordinates array.
Ifthe nodal connectivity of cells is not defined in any of meshes.

References MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayInt::ConvertIndexArrayToO2N(), MEDCoupling::DataArrayTemplate< T >::end(), MEDCoupling::DataArrayDouble::findCommonTuples(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), and MEDCoupling::DataArrayTemplate< T >::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 ).

Referenced by are2DCellsNotCorrectlyOriented(), and orientCorrectly2DCells().

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 arePolyhedronsNotCorrectlyOriented(), findAndCorrectBadOriented3DCells(), and orientCorrectlyPolyhedrons().

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

The 3D extruded static cell (PENTA6,HEXA8,HEXAGP12...) its connectivity nodes in [ begin , end ).

Referenced by findAndCorrectBadOriented3DCells(), and findAndCorrectBadOriented3DExtrudedCells().

void MEDCouplingUMesh::CorrectExtrudedStaticCell ( int *  begin,
int *  end 
)
static
bool MEDCouplingUMesh::IsTetra4WellOriented ( const int *  begin,
const int *  end,
const double *  coords 
)
static
bool MEDCouplingUMesh::IsPyra5WellOriented ( const int *  begin,
const int *  end,
const double *  coords 
)
static
void MEDCouplingUMesh::SimplifyPolyhedronCell ( double  eps,
const DataArrayDouble coords,
const int *  begin,
const int *  end,
DataArrayInt res 
)
static

This method performs a simplyfication of a single polyedron cell. To do that each face of cell whose connectivity is defined by [ begin , end ) is compared with the others in order to find faces in the same plane (with approx of eps). If any, the cells are grouped together and projected to a 2D space.

Parameters
[in]epsis a relative precision that allows to establish if some 3D plane are coplanar or not.
[in]coordsthe coordinates with nb of components exactly equal to 3
[in]beginbegin of the nodal connectivity (geometric type included) of a single polyhedron cell
[in]endend of nodal connectivity of a single polyhedron cell (excluded)
[out]resthe result is put at the end of the vector without any alteration of the data.

References MEDCoupling::DataArrayTemplate< T >::alloc(), allocateCells(), MEDCoupling::DataArrayTemplate< T >::begin(), buildDescendingConnectivity(), buildPartOfMySelf(), buildSpreadZonesWithPoly(), MEDCoupling::MEDCouplingPointSet::changeSpaceDimension(), ComputeVecAndPtOfFace(), MEDCoupling::RefCountObjectOnly::decrRef(), MEDCoupling::DataArrayTemplate< T >::end(), MEDCoupling::DataArrayDouble::findCommonTuples(), finishInsertingCells(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::insertAtTheEnd(), insertNextCell(), MEDCoupling::DataArrayInt::invertArrayO2N2N2O(), New(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::DataArrayInt::New(), INTERP_KERNEL::NORM_POLYHED, MEDCoupling::DataArrayTemplate< T >::popBackSilent(), MEDCoupling::DataArrayTemplate< T >::pushBackSilent(), MEDCoupling::MEDCouplingPointSet::rotate(), INTERP_KERNEL::EdgeArcCircle::SafeAsin(), MEDCoupling::DataArrayDouble::selectByTupleId(), MEDCoupling::DataArrayInt::selectByTupleIdSafeSlice(), MEDCoupling::MEDCouplingPointSet::setCoords(), MEDCoupling::DataArrayInt::transformWithIndArr(), and zipCoordsTraducer().

Referenced by simplifyPolyhedra().

void MEDCouplingUMesh::ComputeVecAndPtOfFace ( double  eps,
const double *  coords,
const int *  begin,
const int *  end,
double *  v,
double *  p 
)
static

This method computes the normalized vector of the plane and the pos of the point belonging to the plane and the line defined by the vector going through origin. The plane is defined by its nodal connectivity [ begin, end ).

Parameters
[in]epsbelow that value the dot product of 2 vectors is considered as colinears
[in]coordscoordinates expected to have 3 components.
[in]beginstart of the nodal connectivity of the face.
[in]endend of the nodal connectivity (excluded) of the face.
[out]vthe normalized vector of size 3
[out]pthe pos of plane

Referenced by SimplifyPolyhedronCell().

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

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

References EPS_FOR_POLYH_ORIENTATION.

Referenced by findAndCorrectBadOriented3DCells(), and orientCorrectlyPolyhedrons().

MEDCouplingUMesh * MEDCouplingUMesh::Intersect2DMeshes ( const MEDCouplingUMesh m1,
const MEDCouplingUMesh m2,
double  eps,
DataArrayInt *&  cellNb1,
DataArrayInt *&  cellNb2 
)
static

Partitions the first given 2D mesh using the second given 2D mesh as a tool, and returns a result mesh constituted by polygons. Thus the final result contains all nodes from m1 plus new nodes. However it doesn't necessarily contains all nodes from m2. The meshes should be in 2D space. In addition, returns two arrays mapping cells of the result mesh to cells of the input meshes.

Parameters
[in]m1- the first input mesh which is a partitioned object. The mesh must be so that each point in the space covered by m1 must be covered exactly by one entity, no more. If it is not the case, some tools are available to heal the mesh (conformize2D, mergeNodes)
[in]m2- the second input mesh which is a partition tool. The mesh must be so that each point in the space covered by m2 must be covered exactly by one entity, no more. If it is not the case, some tools are available to heal the mesh (conformize2D, mergeNodes)
[in]eps- precision used to detect coincident mesh entities.
[out]cellNb1- a new instance of DataArrayInt holding for each result cell an id of the cell of m1 it comes from. The caller is to delete this array using decrRef() as it is no more needed.
[out]cellNb2- a new instance of DataArrayInt holding for each result cell an id of the cell of m2 it comes from. -1 value means that a result cell comes from a cell (or part of cell) of m1 not overlapped by any cell of m2. The caller is to delete this array using decrRef() as it is no more needed.
Returns
MEDCouplingUMesh * - the result 2D mesh which is a new instance of MEDCouplingUMesh. The caller is to delete this mesh using decrRef() as it is no more needed.
Exceptions
Ifthe coordinates array is not set in any of the meshes.
Ifthe nodal connectivity of cells is not defined in any of the meshes.
Ifany of the meshes is not a 2D mesh in 2D space.
See Also
conformize2D, mergeNodes

References MEDCoupling::DataArrayDouble::Aggregate(), MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::RefCountObjectOnly::decrRef(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), New(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::DataArrayInt::New(), MEDCoupling::MCAuto< T >::retn(), setConnectivity(), and MEDCoupling::MEDCouplingPointSet::setCoords().

void MEDCouplingUMesh::Intersect2DMeshWith1DLine ( const MEDCouplingUMesh mesh2D,
const MEDCouplingUMesh mesh1D,
double  eps,
MEDCouplingUMesh *&  splitMesh2D,
MEDCouplingUMesh *&  splitMesh1D,
DataArrayInt *&  cellIdInMesh2D,
DataArrayInt *&  cellIdInMesh1D 
)
static

Partitions the first given 2D mesh using the second given 1D mesh as a tool. Thus the final result contains the aggregation of nodes of mesh2D, then nodes of mesh1D, then new nodes that are the result of the intersection and finaly, in case of quadratic polygon the centers of edges new nodes. The meshes should be in 2D space. In addition, returns two arrays mapping cells of the resulting mesh to cells of the input.

Parameters
[in]mesh2D- the 2D mesh (spacedim=meshdim=2) to be intersected using mesh1D tool. The mesh must be so that each point in the space covered by mesh2D must be covered exactly by one entity, no more. If it is not the case, some tools are available to heal the mesh (conformize2D, mergeNodes)
[in]mesh1D- the 1D mesh (spacedim=2 meshdim=1) the is the tool that will be used to intersect mesh2D. mesh1D must be ordered consecutively. If it is not the case you can invoke orderConsecutiveCells1D on mesh1D.
[in]eps- precision used to perform intersections and localization operations.
[out]splitMesh2D- the result of the split of mesh2D mesh.
[out]splitMesh1D- the result of the split of mesh1D mesh.
[out]cellIdInMesh2D- the array that gives for each cell id i in splitMesh2D the id in mesh2D it comes from. So this array has a number of tuples equal to the number of cells of splitMesh2D and a number of component equal to 1.
[out]cellIdInMesh1D- the array of pair that gives for each cell id i in splitMesh1D the cell in splitMesh2D on the left for the 1st component and the cell in splitMesh2D on the right for the 2nt component. -1 means no cell. So this array has a number of tuples equal to the number of cells of splitMesh1D and a number of components equal to 2.
See Also
Intersect2DMeshes, orderConsecutiveCells1D, conformize2D, mergeNodes

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::back(), MEDCoupling::DataArrayTemplate< T >::begin(), buildDescendingConnectivity2(), buildPartOfMySelf(), MEDCoupling::DataArrayInt::buildSubstraction(), MEDCoupling::DataArrayInt::buildUnique(), MEDCoupling::C_DEALLOC, MEDCoupling::DataArrayInt::changeValue(), MEDCoupling::DataArrayInt::deepCopy(), MEDCoupling::DataArrayTemplate< T >::empty(), MEDCoupling::DataArrayTemplate< T >::end(), ExtractFromIndexedArrays(), MEDCoupling::DataArrayTemplate< T >::fillWithValue(), MEDCoupling::DataArrayInt::findIdsEqual(), MEDCoupling::DataArrayInt::findIdsStricltyNegative(), getCellsContainingPoints(), MEDCoupling::MEDCouplingPointSet::getCoords(), MEDCoupling::DataArrayTemplate< T >::getIJ(), MEDCoupling::DataArray::getInfoOnComponents(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MergeUMeshesOnSameCoords(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::DataArrayInt::New(), MEDCoupling::DataArrayTemplate< T >::pushBackSilent(), MEDCoupling::DataArrayTemplate< T >::pushBackValsSilent(), MEDCoupling::DataArrayTemplate< T >::rearrange(), MEDCoupling::MCAuto< T >::retn(), MEDCoupling::DataArrayInt::selectByTupleId(), MEDCoupling::MEDCouplingPointSet::setCoords(), MEDCoupling::DataArrayTemplate< T >::setIJ(), MEDCoupling::DataArray::setInfoOnComponents(), MEDCoupling::DataArrayTemplate< T >::setPartOfValues3(), MEDCoupling::DataArrayTemplate< T >::sort(), and MEDCoupling::DataArrayTemplate< T >::useArray().

bool MEDCouplingUMesh::BuildConvexEnvelopOf2DCellJarvis ( const double *  coords,
const int *  nodalConnBg,
const int *  nodalConnEnd,
DataArrayInt nodalConnecOut 
)
static

This method compute the convex hull of a single 2D cell. This method tries to conserve at maximum the given input connectivity. In particular, if the orientation of cell is not clockwise as in MED format norm. If definitely the result of Jarvis algorithm is not matchable with the input connectivity, the result will be copied into nodalConnecOut parameter and the geometric cell type set to INTERP_KERNEL::NORM_POLYGON. This method excepts that coords parameter is expected to be in dimension 2. [ nodalConnBg , nodalConnEnd ) is the nodal connectivity of the input cell (geometric cell type included at the position 0). If the meshdimension of the input cell is not equal to 2 an INTERP_KERNEL::Exception will be thrown.

Returns
false if the input connectivity represents already the convex hull, true if the input cell needs to be reordered.

References INTERP_KERNEL::EdgeArcCircle::GetAbsoluteAngle(), MEDCoupling::DataArrayInt::insertAtTheEnd(), INTERP_KERNEL::NORM_POLYGON, and MEDCoupling::DataArrayTemplate< T >::pushBackSilent().

Referenced by convexEnvelop2D().

bool MEDCouplingUMesh::RemoveIdsFromIndexedArrays ( const int *  idsToRemoveBg,
const int *  idsToRemoveEnd,
DataArrayInt arr,
DataArrayInt arrIndx,
int  offsetForRemoval = 0 
)
static

This method works on an input pair (arr, arrIndx) where arr indexes is in arrIndx. This method will not impact the size of inout parameter arrIndx but the size of arr will be modified in case of suppression.

Parameters
[in]idsToRemoveBgbegin of set of ids to remove in arr (included)
[in]idsToRemoveEndend of set of ids to remove in arr (excluded)
[in,out]arrarray in which the remove operation will be done.
[in,out]arrIndxarray in the remove operation will modify
[in]offsetForRemoval(by default 0) offset so that for each i in [0,arrIndx->getNumberOfTuples()-1) removal process will be performed in the following range [arr+arrIndx[i]+offsetForRemoval,arr+arr[i+1])
Returns
true if arr and arrIndx have been modified, false if not.

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), and MEDCoupling::DataArrayTemplate< T >::getPointer().

Referenced by findNodesToDuplicate().

void MEDCouplingUMesh::ExtractFromIndexedArrays ( const int *  idsOfSelectBg,
const int *  idsOfSelectEnd,
const DataArrayInt arrIn,
const DataArrayInt arrIndxIn,
DataArrayInt *&  arrOut,
DataArrayInt *&  arrIndexOut 
)
static

This method works on a pair input (arrIn, arrIndxIn) where arrIn indexes is in arrIndxIn (Indirect indexing). This method returns the result of the extraction ( specified by a set of ids in [idsOfSelectBg , idsOfSelectEnd ) ). The selection of extraction is done standardly in new2old format. This method returns indexed arrays (Indirect indexing) using 2 arrays (arrOut,arrIndexOut).

Parameters
[in]idsOfSelectBgbegin of set of ids of the input extraction (included)
[in]idsOfSelectEndend of set of ids of the input extraction (excluded)
[in]arrInarr origin array from which the extraction will be done.
[in]arrIndxInis the input index array allowing to walk into arrIn
[out]arrOutthe resulting array
[out]arrIndexOutthe index array of the resulting array arrOut
See Also
MEDCouplingUMesh::ExtractFromIndexedArraysSlice

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayTemplate< T >::checkAllocated(), MEDCoupling::DataArray::getNumberOfComponents(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::New(), and MEDCoupling::MCAuto< T >::retn().

Referenced by MEDCoupling::MEDCoupling1DGTUMesh::buildPartOfMySelfKeepCoords(), conformize2D(), and Intersect2DMeshWith1DLine().

void MEDCouplingUMesh::ExtractFromIndexedArraysSlice ( int  idsOfSelectStart,
int  idsOfSelectStop,
int  idsOfSelectStep,
const DataArrayInt arrIn,
const DataArrayInt arrIndxIn,
DataArrayInt *&  arrOut,
DataArrayInt *&  arrIndexOut 
)
static

This method works on a pair input (arrIn, arrIndxIn) where arrIn indexes is in arrIndxIn (Indirect indexing). This method returns the result of the extraction ( specified by a set of ids with a slice given by idsOfSelectStart, idsOfSelectStop and idsOfSelectStep ). The selection of extraction is done standardly in new2old format. This method returns indexed arrays (Indirect indexing) using 2 arrays (arrOut,arrIndexOut).

Parameters
[in]idsOfSelectStartbegin of set of ids of the input extraction (included)
[in]idsOfSelectStopend of set of ids of the input extraction (excluded)
[in]idsOfSelectStep
[in]arrInarr origin array from which the extraction will be done.
[in]arrIndxInis the input index array allowing to walk into arrIn
[out]arrOutthe resulting array
[out]arrIndexOutthe index array of the resulting array arrOut
See Also
MEDCouplingUMesh::ExtractFromIndexedArrays

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayTemplate< T >::checkAllocated(), MEDCoupling::DataArray::getNumberOfComponents(), MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::New(), and MEDCoupling::MCAuto< T >::retn().

Referenced by MEDCoupling::MEDCoupling1DGTUMesh::buildPartOfMySelfKeepCoordsSlice().

void MEDCouplingUMesh::SetPartOfIndexedArrays ( const int *  idsOfSelectBg,
const int *  idsOfSelectEnd,
const DataArrayInt arrIn,
const DataArrayInt arrIndxIn,
const DataArrayInt srcArr,
const DataArrayInt srcArrIndex,
DataArrayInt *&  arrOut,
DataArrayInt *&  arrIndexOut 
)
static

This method works on an input pair (arrIn, arrIndxIn) where arrIn indexes is in arrIndxIn. This method builds an output pair (arrOut,arrIndexOut) that is a copy from arrIn for all cell ids not in [ idsOfSelectBg , idsOfSelectEnd ) and for cellIds in [ idsOfSelectBg , idsOfSelectEnd ) a copy coming from the corresponding values in input pair (srcArr, srcArrIndex). This method is an generalization of MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx that performs the same thing but by without building explicitely a result output arrays.

Parameters
[in]idsOfSelectBgbegin of set of ids of the input extraction (included)
[in]idsOfSelectEndend of set of ids of the input extraction (excluded)
[in]arrInarr origin array from which the extraction will be done.
[in]arrIndxInis the input index array allowing to walk into arrIn
[in]srcArrinput array that will be used as source of copy for ids in [ idsOfSelectBg, idsOfSelectEnd )
[in]srcArrIndexindex array of srcArr
[out]arrOutthe resulting array
[out]arrIndexOutthe index array of the resulting array arrOut
See Also
MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::New(), and MEDCoupling::MCAuto< T >::retn().

Referenced by setPartOfMySelf().

void MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx ( const int *  idsOfSelectBg,
const int *  idsOfSelectEnd,
DataArrayInt arrInOut,
const DataArrayInt arrIndxIn,
const DataArrayInt srcArr,
const DataArrayInt srcArrIndex 
)
static

This method works on an input pair (arrIn, arrIndxIn) where arrIn indexes is in arrIndxIn. This method is an specialization of MEDCouplingUMesh::SetPartOfIndexedArrays in the case of assignement do not modify the index in arrIndxIn.

Parameters
[in]idsOfSelectBgbegin of set of ids of the input extraction (included)
[in]idsOfSelectEndend of set of ids of the input extraction (excluded)
[in,out]arrInOutarr origin array from which the extraction will be done.
[in]arrIndxInis the input index array allowing to walk into arrIn
[in]srcArrinput array that will be used as source of copy for ids in [ idsOfSelectBg , idsOfSelectEnd )
[in]srcArrIndexindex array of srcArr
See Also
MEDCouplingUMesh::SetPartOfIndexedArrays

References MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), and MEDCoupling::DataArrayTemplate< T >::getPointer().

Referenced by setPartOfMySelf().

void MEDCouplingUMesh::SetPartOfIndexedArraysSlice ( int  start,
int  end,
int  step,
const DataArrayInt arrIn,
const DataArrayInt arrIndxIn,
const DataArrayInt srcArr,
const DataArrayInt srcArrIndex,
DataArrayInt *&  arrOut,
DataArrayInt *&  arrIndexOut 
)
static

This method works on an input pair (arrIn, arrIndxIn) where arrIn indexes is in arrIndxIn. This method builds an output pair (arrOut,arrIndexOut) that is a copy from arrIn for all cell ids not in [ idsOfSelectBg , idsOfSelectEnd ) and for cellIds in [idsOfSelectBg, idsOfSelectEnd) a copy coming from the corresponding values in input pair (srcArr, srcArrIndex). This method is an generalization of MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx that performs the same thing but by without building explicitely a result output arrays.

Parameters
[in]startbegin of set of ids of the input extraction (included)
[in]endend of set of ids of the input extraction (excluded)
[in]stepstep of the set of ids in range mode.
[in]arrInarr origin array from which the extraction will be done.
[in]arrIndxInis the input index array allowing to walk into arrIn
[in]srcArrinput array that will be used as source of copy for ids in [idsOfSelectBg, idsOfSelectEnd)
[in]srcArrIndexindex array of srcArr
[out]arrOutthe resulting array
[out]arrIndexOutthe index array of the resulting array arrOut
See Also
MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx MEDCouplingUMesh::SetPartOfIndexedArrays

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArray::GetPosOfItemGivenBESRelativeNoThrow(), MEDCoupling::DataArrayInt::New(), and MEDCoupling::MCAuto< T >::retn().

Referenced by setPartOfMySelfSlice().

void MEDCouplingUMesh::SetPartOfIndexedArraysSameIdxSlice ( int  start,
int  end,
int  step,
DataArrayInt arrInOut,
const DataArrayInt arrIndxIn,
const DataArrayInt srcArr,
const DataArrayInt srcArrIndex 
)
static

This method works on an input pair (arrIn, arrIndxIn) where arrIn indexes is in arrIndxIn. This method is an specialization of MEDCouplingUMesh::SetPartOfIndexedArrays in the case of assignement do not modify the index in arrIndxIn.

Parameters
[in]startbegin of set of ids of the input extraction (included)
[in]endend of set of ids of the input extraction (excluded)
[in]stepstep of the set of ids in range mode.
[in,out]arrInOutarr origin array from which the extraction will be done.
[in]arrIndxInis the input index array allowing to walk into arrIn
[in]srcArrinput array that will be used as source of copy for ids in [idsOfSelectBg, idsOfSelectEnd)
[in]srcArrIndexindex array of srcArr
See Also
MEDCouplingUMesh::SetPartOfIndexedArraysSlice MEDCouplingUMesh::SetPartOfIndexedArraysSameIdx

References MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::DataArray::GetNumberOfItemGivenBESRelative(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), and MEDCoupling::DataArrayTemplate< T >::getPointer().

Referenced by setPartOfMySelfSlice().

std::vector< DataArrayInt * > MEDCouplingUMesh::PartitionBySpreadZone ( const DataArrayInt arrIn,
const DataArrayInt arrIndxIn 
)
static
DataArrayInt * MEDCouplingUMesh::ComputeSpreadZoneGradually ( const DataArrayInt arrIn,
const DataArrayInt arrIndxIn 
)
static

This method works on a pair input (arrIn, arrIndxIn) where arr indexes is in arrIndxIn. This method expects that these two input arrays come from the output of MEDCouplingUMesh::computeNeighborsOfCells method. This method start from id 0 that will be contained in output DataArrayInt. It searches then all neighbors of id0 looking at arrIn[arrIndxIn[0]:arrIndxIn[0+1]]. Then it is repeated recursively until either all ids are fetched or no more ids are reachable step by step. A negative value in arrIn means that it is ignored. This method is useful to see if a mesh is contiguous regarding its connectivity. If it is not the case the size of returned array is different from arrIndxIn->getNumberOfTuples()-1.

Parameters
[in]arrInarr origin array from which the extraction will be done.
[in]arrIndxInis the input index array allowing to walk into arrIn
Returns
a newly allocated DataArray that stores all ids fetched by the gradually spread process.
See Also
MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed, MEDCouplingUMesh::partitionBySpreadZone

References ComputeSpreadZoneGraduallyFromSeed().

DataArrayInt * MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed ( const int *  seedBg,
const int *  seedEnd,
const DataArrayInt arrIn,
const DataArrayInt arrIndxIn,
int  nbOfDepthPeeling,
int &  nbOfDepthPeelingPerformed 
)
static

This method works on a pair input (arrIn, arrIndxIn) where arr indexes is in arrIndxIn. This method expects that these two input arrays come from the output of MEDCouplingUMesh::computeNeighborsOfCells method. This method start from id 0 that will be contained in output DataArrayInt. It searches then all neighbors of id0 regarding arrIn[arrIndxIn[0]:arrIndxIn[0+1]]. Then it is repeated recursively until either all ids are fetched or no more ids are reachable step by step. A negative value in arrIn means that it is ignored. This method is useful to see if a mesh is contiguous regarding its connectivity. If it is not the case the size of returned array is different from arrIndxIn->getNumberOfTuples()-1.

Parameters
[in]seedBgthe begin pointer (included) of an array containing the seed of the search zone
[in]seedEndthe end pointer (not included) of an array containing the seed of the search zone
[in]arrInarr origin array from which the extraction will be done.
[in]arrIndxInis the input index array allowing to walk into arrIn
[in]nbOfDepthPeelingthe max number of peels requested in search. By default -1, that is to say, no limit.
[out]nbOfDepthPeelingPerformedthe number of peels effectively performed. May be different from nbOfDepthPeeling
Returns
a newly allocated DataArray that stores all ids fetched by the gradually spread process.
See Also
MEDCouplingUMesh::partitionBySpreadZone

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), and MEDCoupling::DataArrayInt::New().

Referenced by ComputeSpreadZoneGradually(), and findNodesToDuplicate().

DataArrayInt * MEDCouplingUMesh::buildUnionOf2DMesh ( ) const

This method makes the assumption spacedimension == meshdimension == 2. This method works only for linear cells.

Returns
a newly allocated array containing the connectivity of a polygon type enum included (NORM_POLYGON in pos#0)

References computeSkin(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and zipCoordsTraducer().

Referenced by buildSpreadZonesWithPoly().

DataArrayInt * MEDCouplingUMesh::buildUnionOf3DMesh ( ) const
DataArrayInt * MEDCouplingUMesh::orderConsecutiveCells1D ( ) const

Provides a renumbering of the cells of this (which has to be a piecewise connected 1D line), so that the segments of the line are indexed in consecutive order (i.e. cells i and i+1 are neighbors). This doesn't modify the mesh. This method only works using nodal connectivity consideration. Coordinates of nodes are ignored here. The caller is to deal with the resulting DataArrayInt.

Exceptions
Ifthe coordinate array is not set.
Ifthe nodal connectivity of the cells is not defined.
Ifm1 is not a mesh of dimension 2, or m1 is not a mesh of dimension 1
Ifm2 is not a (piecewise) line (i.e. if a point has more than 2 adjacent segments)
See Also
DataArrayInt::sortEachPairToMakeALinkedList

References MEDCoupling::DataArrayTemplate< T >::alloc(), MEDCoupling::DataArrayTemplate< T >::begin(), buildDescendingConnectivity(), MEDCoupling::DataArrayInt::deltaShiftIndex(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::DataArrayInt::New(), and MEDCoupling::MCAuto< T >::retn().

MEDCouplingSkyLineArray * MEDCouplingUMesh::generateGraph ( ) const

Creates a graph of cell neighbors.

Returns
MEDCouplingSkyLineArray * - an sky line array the user should delete. In the sky line array, graph arcs are stored in terms of (index,value) notation. For example
  • index: 0 3 5 6 6
  • value: 1 2 3 2 3 3 means 6 arcs (0,1), (0,2), (0,3), (1,2), (1,3), (2,3) Arcs are not doubled but reflexive (1,1) arcs are present for each cell

References MEDCoupling::DataArrayTemplate< T >::begin(), MEDCoupling::RefCountObjectOnly::decrRef(), getMeshDimension(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), getReverseNodalConnectivity(), and MEDCoupling::DataArrayInt::New().

Member Data Documentation

double MEDCouplingUMesh::EPS_FOR_POLYH_ORIENTATION =1.e-14
static