Version: 9.12.0
MEDCoupling::MEDCouplingUMesh Class Reference
Inheritance diagram for MEDCoupling::MEDCouplingUMesh:
Collaboration diagram for MEDCoupling::MEDCouplingUMesh:

Public Member Functions

std::string advancedRepr () const
 
void allocateCells (mcIdType nbOfCells=0)
 
void are2DCellsNotCorrectlyOriented (const double *vec, bool polyOnly, std::vector< mcIdType > &cells) const
 
bool areCellsIncludedIn (const MEDCouplingUMesh *other, int compType, DataArrayIdType *&arr) const
 
bool areCellsIncludedInPolicy7 (const MEDCouplingUMesh *other, DataArrayIdType *&arr) const
 
bool areOnlySimplexCells () const
 
void arePolyhedronsNotCorrectlyOriented (std::vector< mcIdType > &cells) const
 
void attractSeg3MidPtsAroundNodes (double ratio, const mcIdType *nodeIdsBg, const mcIdType *nodeIdsEnd)
 
MEDCouplingUMeshbuildBoundaryMesh (bool keepCoords) const
 
MEDCouplingUMeshbuildDescendingConnectivity (DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const
 
MEDCouplingUMeshbuildDescendingConnectivity2 (DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const
 
MEDCouplingFieldDoublebuildDirectionVectorField () const
 
MEDCouplingUMeshbuildExtrudedMesh (const MEDCouplingUMesh *mesh1D, int policy)
 
MEDCouplingUMeshbuildFacePartOfMySelfNode (const mcIdType *begin, const mcIdType *end, bool fullyIn) const
 
MEDCouplingFieldDoublebuildOrthogonalField () const
 
MEDCouplingUMeshbuildPartOfMySelf (const mcIdType *begin, const mcIdType *end, bool keepCoords=true) const
 
MEDCouplingUMeshbuildPartOfMySelfSlice (mcIdType start, mcIdType end, mcIdType step, bool keepCoords=true) const
 
MEDCouplingFieldDoublebuildPartOrthogonalField (const mcIdType *begin, const mcIdType *end) const
 
MEDCouplingUMeshbuildSetInstanceFromThis (std::size_t spaceDim) const
 
MEDCouplingUMeshbuildSlice3D (const double *origin, const double *vec, double eps, DataArrayIdType *&cellIds) const
 
MEDCouplingUMeshbuildSlice3DSurf (const double *origin, const double *vec, double eps, DataArrayIdType *&cellIds) const
 
MEDCouplingUMeshbuildSpreadZonesWithPoly () const
 
DataArrayIdType * buildUnionOf2DMesh () const
 
DataArrayIdType * buildUnionOf3DMesh () const
 
MEDCouplingUMeshbuildUnstructured () const
 
MEDCouplingUMeshCellIteratorcellIterator ()
 
MEDCouplingUMeshCellByTypeEntrycellsByType ()
 
void changeOrientationOfCells ()
 
void checkButterflyCells (std::vector< mcIdType > &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
 
void checkGeomConsistency (double eps=1e-12) const
 
DataArrayIdType * checkTypeConsistencyAndContig (const std::vector< mcIdType > &code, const std::vector< const DataArrayIdType * > &idsPerType) const
 
MCAuto< MEDCouplingUMeshclipSingle3DCellByPlane (const double origin[3], const double vec[3], double eps) const
 
MEDCouplingUMeshclone (bool recDeepCpy) const
 
DataArrayIdType * colinearize2D (double eps)
 
void colinearizeEdges (double eps)
 
DataArrayIdType * colinearizeKeepingConform2D (double eps)
 
DataArrayDoublecomputeCellCenterOfMass () const
 
DataArrayDoublecomputeCellCenterOfMassWithPrecision (double eps) const
 
void computeCellNeighborhoodFromNodesOne (const DataArrayIdType *nodeNeigh, const DataArrayIdType *nodeNeighI, MCAuto< DataArrayIdType > &cellNeigh, MCAuto< DataArrayIdType > &cellNeighIndex) const
 
MEDCouplingFieldDoublecomputeDiameterField () const
 
DataArrayIdType * computeEffectiveNbOfNodesPerCell () const
 
void computeEnlargedNeighborsOfNodes (MCAuto< DataArrayIdType > &neighbors, MCAuto< DataArrayIdType > &neighborsIdx) const
 
DataArrayIdType * computeFetchedNodeIds () const
 
DataArrayDoublecomputeIsoBarycenterOfNodesPerCell () const
 
DataArrayIdType * computeNbOfFacesPerCell () const
 
DataArrayIdType * computeNbOfNodesPerCell () const
 
void computeNeighborsOfCells (DataArrayIdType *&neighbors, DataArrayIdType *&neighborsIdx) const
 
void computeNeighborsOfNodes (DataArrayIdType *&neighbors, DataArrayIdType *&neighborsIdx) const
 
void computeNodeIdsAlg (std::vector< bool > &nodeIdsInUse) const
 
DataArrayDoublecomputePlaneEquationOf3DFaces () const
 
MEDCouplingUMeshcomputeSkin () const
 
void computeTypes ()
 
DataArrayIdType * conformize2D (double eps)
 
DataArrayIdType * conformize3D (double eps)
 
void convertAllToPoly ()
 
DataArrayIdType * convertCellArrayPerGeoType (const DataArrayIdType *da) const
 
void convertDegeneratedCells ()
 
DataArrayIdType * convertDegeneratedCellsAndRemoveFlatOnes ()
 
void convertExtrudedPolyhedra ()
 
MEDCoupling1GTUMeshconvertIntoSingleGeoTypeMesh () const
 
DataArrayIdType * convertLinearCellsToQuadratic (int conversionType=0)
 
void convertNodalConnectivityToDynamicGeoTypeMesh (DataArrayIdType *&nodalConn, DataArrayIdType *&nodalConnIndex) const
 
DataArrayIdType * convertNodalConnectivityToStaticGeoTypeMesh () const
 
void convertQuadraticCellsToLinear ()
 
void convertToPolyTypes (const mcIdType *cellIdsToConvertBg, const mcIdType *cellIdsToConvertEnd)
 
DataArrayIdType * convexEnvelop2D ()
 
std::string cppRepr () const
 
MEDCouplingUMeshdeepCopy () const
 
MEDCouplingUMeshdeepCopyConnectivityOnly () const
 
double distanceToPoint (const double *ptBg, const double *ptEnd, mcIdType &cellId) const
 
DataArrayDoubledistanceToPoints (const DataArrayDouble *pts, DataArrayIdType *&cellIds) const
 
void duplicateNodes (const mcIdType *nodeIdsToDuplicateBg, const mcIdType *nodeIdsToDuplicateEnd)
 
void duplicateNodesInConn (const mcIdType *nodeIdsToDuplicateBg, const mcIdType *nodeIdsToDuplicateEnd, mcIdType offset)
 
MEDCouplingUMeshemulateMEDMEMBDC (const MEDCouplingUMesh *nM1LevMesh, DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *&revDesc, DataArrayIdType *&revDescIndx, DataArrayIdType *&nM1LevMeshIds, DataArrayIdType *&meshnM1Old2New) const
 
MEDCouplingUMeshexplode3DMeshTo1D (DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const
 
MCAuto< MEDCouplingUMeshexplodeIntoEdges (MCAuto< DataArrayIdType > &desc, MCAuto< DataArrayIdType > &descIndex, MCAuto< DataArrayIdType > &revDesc, MCAuto< DataArrayIdType > &revDescIndx) const
 
MEDCouplingUMeshexplodeMeshIntoMicroEdges (DataArrayIdType *desc, DataArrayIdType *descIndx, DataArrayIdType *revDesc, DataArrayIdType *revDescIndx) const
 
MCAuto< MEDCouplingUMeshexplodeMeshTo (int targetDeltaLevel, MCAuto< DataArrayIdType > &desc, MCAuto< DataArrayIdType > &descIndx, MCAuto< DataArrayIdType > &revDesc, MCAuto< DataArrayIdType > &revDescIndx) const
 
DataArrayIdType * findAndCorrectBadOriented3DCells ()
 
DataArrayIdType * findAndCorrectBadOriented3DExtrudedCells ()
 
DataArrayIdType * findBoundaryNodes () const
 
void findCellIdsLyingOn (const MEDCouplingUMesh &otherDimM1OnSameCoords, DataArrayIdType *&cellIdsRk0, DataArrayIdType *&cellIdsRk1) const
 
DataArrayIdType * findCellIdsOnBoundary () const
 
void findCellsToRenumber (const MEDCouplingUMesh &otherDimM1OnSameCoords, const mcIdType *nodeIdsToDuplicateBg, const mcIdType *nodeIdsToDuplicateEnd, DataArrayIdType *&cellIdsNeededToBeRenum, DataArrayIdType *&cellIdsNotModified) const
 
void findCommonCells (int compType, mcIdType startCellId, DataArrayIdType *&commonCellsArr, DataArrayIdType *&commonCellsIArr) const
 
DataArrayIdType * findNodesToDuplicate (const MEDCouplingUMesh &otherDimM1OnSameCoords) 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
 
mcIdType getCellContainingPoint (const double *pos, double eps) const
 
DataArrayIdType * getCellIdsCrossingPlane (const double *origin, const double *vec, double eps) const
 
void getCellsContainingPoint (const double *pos, double eps, std::vector< mcIdType > &elts) const
 
void getCellsContainingPoints (const double *pos, mcIdType nbOfPoints, double eps, MCAuto< DataArrayIdType > &elts, MCAuto< DataArrayIdType > &eltsIndex) const override
 
void getCellsContainingPointsLinearPartOnlyOnNonDynType (const double *pos, mcIdType nbOfPoints, double eps, MCAuto< DataArrayIdType > &elts, MCAuto< DataArrayIdType > &eltsIndex) const override
 
DataArrayIdType * getCellsInBoundingBox (const double *bbox, double eps) const
 
DataArrayIdType * getCellsInBoundingBox (const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps)
 
std::string getClassName () const override
 
std::vector< const BigMemoryObject * > getDirectChildrenWithNull () const
 
std::vector< mcIdType > getDistributionOfTypes () const
 
MEDCouplingFieldDoublegetEdgeRatioField () const
 
void getFastAveragePlaneOfThis (double *vec, double *pos) const
 
std::size_t getHeapMemorySizeWithoutChildren () const
 
DataArrayIdType * getLevArrPerCellTypes (const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd, DataArrayIdType *&nbPerType) const
 
MEDCouplingFieldDoublegetMeasureField (bool isAbs) const
 
MEDCouplingFieldDoublegetMeasureFieldOnNode (bool isAbs) const
 
int getMeshDimension () const
 
DataArrayIdType * getNodalConnectivity ()
 
const DataArrayIdType * getNodalConnectivity () const
 
mcIdType getNodalConnectivityArrayLen () const
 
DataArrayIdType * getNodalConnectivityIndex ()
 
const DataArrayIdType * getNodalConnectivityIndex () const
 
DataArrayIdType * getNodeIdsInUse (mcIdType &nbrOfNodesInUse) const
 
void getNodeIdsOfCell (mcIdType cellId, std::vector< mcIdType > &conn) const
 
mcIdType getNumberOfCells () const
 
mcIdType getNumberOfCellsWithType (INTERP_KERNEL::NormalizedCellType type) const
 
mcIdType getNumberOfNodesInCell (mcIdType cellId) const
 
DataArrayDoublegetPartBarycenterAndOwner (const mcIdType *begin, const mcIdType *end) const
 
DataArrayDoublegetPartMeasureField (bool isAbs, const mcIdType *begin, const mcIdType *end) const
 
std::vector< bool > getQuadraticStatus () const
 
DataArrayIdType * getRenumArrForConsecutiveCellTypesSpec (const INTERP_KERNEL::NormalizedCellType *orderBg, const INTERP_KERNEL::NormalizedCellType *orderEnd) const
 
DataArrayIdType * getRenumArrForMEDFileFrmt () const
 
void getReverseNodalConnectivity (DataArrayIdType *revNodal, DataArrayIdType *revNodalIndx) const
 
MEDCouplingFieldDoublegetSkewField () const
 
void getTinySerializationInformation (std::vector< double > &tinyInfoD, std::vector< mcIdType > &tinyInfo, std::vector< std::string > &littleStrings) const
 
MEDCouplingMeshType getType () const
 
INTERP_KERNEL::NormalizedCellType getTypeOfCell (mcIdType cellId) const
 
std::set< INTERP_KERNEL::NormalizedCellType > getTypesOfPart (const mcIdType *begin, const mcIdType *end) const
 
std::string getVTKDataSetType () const
 
std::string getVTKFileExtension () const
 
MEDCouplingFieldDoublegetWarpField () const
 
DataArrayIdType * giveCellsWithType (INTERP_KERNEL::NormalizedCellType type) const
 
void insertNextCell (INTERP_KERNEL::NormalizedCellType type, mcIdType size, const mcIdType *nodalConnOfCell)
 
void invertOrientationOfAllCells ()
 
bool isContiguous1D () const
 
bool isEmptyMesh (const std::vector< mcIdType > &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
 
DataArrayIdType * keepCellIdsByType (INTERP_KERNEL::NormalizedCellType type, const mcIdType *begin, const mcIdType *end) const
 
MEDCouplingUMeshkeepSpecifiedCells (INTERP_KERNEL::NormalizedCellType type, const mcIdType *idsPerGeoTypeBg, const mcIdType *idsPerGeoTypeEnd) const
 
MEDCouplingMeshmergeMyselfWith (const MEDCouplingMesh *other) const
 
MEDCouplingUMeshmergeMyselfWithOnSameCoords (const MEDCouplingPointSet *other) const
 
DataArrayIdType * orderConsecutiveCells1D () const
 
void orientCorrectly2DCells (const double *vec, bool polyOnly)
 
void orientCorrectly2DCells (const MEDCouplingUMesh *refFaces=nullptr)
 
void orientCorrectlyPolyhedrons ()
 
std::vector< DataArrayIdType * > partitionBySpreadZone () const
 
void project1D (const double *pt, const double *v, double eps, double *res) const
 
DataArrayIdType * rearrange2ConsecutiveCellTypes ()
 
bool removeDegenerated1DCells ()
 
void renumberCells (const mcIdType *old2NewBg, bool check=true)
 
void renumberNodesInConn (const INTERP_KERNEL::HashMap< mcIdType, mcIdType > &newNodeNumbersO2N)
 
void renumberNodesInConn (const mcIdType *newNodeNumbersO2N)
 
void renumberNodesInConn (const std::map< mcIdType, mcIdType > &newNodeNumbersO2N) override
 
void renumberNodesWithOffsetInConn (mcIdType offset)
 
std::string reprConnectivityOfThis () const
 
void reprQuickOverview (std::ostream &stream) const
 
void resizeForUnserialization (const std::vector< mcIdType > &tinyInfo, DataArrayIdType *a1, DataArrayDouble *a2, std::vector< std::string > &littleStrings) const
 
void serialize (DataArrayIdType *&a1, DataArrayDouble *&a2) const
 
void setConnectivity (DataArrayIdType *conn, DataArrayIdType *connIndex, bool isComputingTypes=true)
 
void setMeshDimension (int meshDim)
 
void setPartOfMySelf (const mcIdType *cellIdsBg, const mcIdType *cellIdsEnd, const MEDCouplingUMesh &otherOnSameCoordsThanThis)
 
void setPartOfMySelfSlice (mcIdType start, mcIdType end, mcIdType step, const MEDCouplingUMesh &otherOnSameCoordsThanThis)
 
void shallowCopyConnectivityFrom (const MEDCouplingPointSet *other)
 
void shiftNodeNumbersInConn (mcIdType delta)
 
std::string simpleRepr () const
 
DataArrayIdType * simplexize (int policy)
 
void simplifyPolyhedra (double eps)
 
DataArrayIdType * sortCellsInMEDFileFrmt ()
 
mcIdType split2DCells (const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *subNodesInSeg, const DataArrayIdType *subNodesInSegI, const DataArrayIdType *midOpt=0, const DataArrayIdType *midOptI=0)
 
std::vector< MEDCouplingUMesh * > splitByType () const
 
void splitProfilePerType (const DataArrayIdType *profile, std::vector< mcIdType > &code, std::vector< DataArrayIdType * > &idsInPflPerType, std::vector< DataArrayIdType * > &idsPerType, bool smartPflKiller=true) const
 
void tessellate2D (double eps)
 
MEDCoupling1SGTUMeshtetrahedrize (int policy, DataArrayIdType *&n2oCells, mcIdType &nbOfAdditionalPoints) const
 
bool unPolyze ()
 
void unserialization (const std::vector< double > &tinyInfoD, const std::vector< mcIdType > &tinyInfo, const DataArrayIdType *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
 
DataArrayIdType * zipCoordsTraducer ()
 
- Public Member Functions inherited from MEDCoupling::MEDCouplingPointSet
virtual bool areAllNodesFetched () const
 
bool areCellsFrom2MeshEqual (const MEDCouplingPointSet *other, mcIdType 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
 
DataArrayIdType * buildNewNumberingFromCommonNodesFormat (const DataArrayIdType *comm, const DataArrayIdType *commIndex, mcIdType &newNbOfNodes) const
 
MEDCouplingMeshbuildPart (const mcIdType *start, const mcIdType *end) const
 
MEDCouplingMeshbuildPartAndReduceNodes (const mcIdType *start, const mcIdType *end, DataArrayIdType *&arr) const
 
virtual MEDCouplingPointSetbuildPartOfMySelfNode (const mcIdType *start, const mcIdType *end, bool fullyIn) const
 
MEDCouplingMeshbuildPartRange (mcIdType beginCellIds, mcIdType endCellIds, mcIdType stepCellIds) const
 
MEDCouplingMeshbuildPartRangeAndReduceNodes (mcIdType beginCellIds, mcIdType endCellIds, mcIdType stepCellIds, mcIdType &beginOut, mcIdType &endOut, mcIdType &stepOut, DataArrayIdType *&arr) const
 
DataArrayIdType * buildPermArrayForMergeNode (double precision, mcIdType limitNodeId, bool &areNodesMerged, mcIdType &newNbOfNodes) const
 
void changeSpaceDimension (int newSpaceDim, double dftVal=0.)
 
void checkDeepEquivalOnSameNodesWith (const MEDCouplingMesh *other, int cellCompPol, double prec, DataArrayIdType *&cellCor) const
 
void checkDeepEquivalWith (const MEDCouplingMesh *other, int cellCompPol, double prec, DataArrayIdType *&cellCor, DataArrayIdType *&nodeCor) const
 
void copyTinyStringsFrom (const MEDCouplingMesh *other)
 
void duplicateNodesInCoords (const mcIdType *nodeIdsToDuplicateBg, const mcIdType *nodeIdsToDuplicateEnd)
 
void findCommonNodes (double prec, mcIdType limitNodeId, DataArrayIdType *&comm, DataArrayIdType *&commIndex) const
 
void findNodesOnLine (const double *pt, const double *vec, double eps, std::vector< mcIdType > &nodes) const
 
void findNodesOnPlane (const double *pt, const double *vec, double eps, std::vector< mcIdType > &nodes) const
 
void getBoundingBox (double *bbox) const
 
double getCaracteristicDimension () const
 
DataArrayIdType * getCellIdsFullyIncludedInNodeIds (const mcIdType *partBg, const mcIdType *partEnd) const
 
DataArrayIdType * getCellIdsLyingOnNodes (const mcIdType *begin, const mcIdType *end, bool fullyIn) const
 
DataArrayDoublegetCoordinatesAndOwner () const
 
void getCoordinatesOfNode (mcIdType nodeId, std::vector< double > &coo) const
 
DataArrayDoublegetCoords ()
 
const DataArrayDoublegetCoords () const
 
const DataArrayDoublegetDirectAccessOfCoordsArrIfInStructure () const
 
DataArrayIdType * getNodeIdsNearPoint (const double *pos, double eps) const
 
void getNodeIdsNearPoints (const double *pos, mcIdType nbOfPoints, double eps, DataArrayIdType *&c, DataArrayIdType *&cI) const
 
mcIdType getNumberOfNodes () const
 
int getSpaceDimension () const
 
virtual DataArrayIdType * mergeNodes (double precision, bool &areNodesMerged, mcIdType &newNbOfNodes)
 
virtual DataArrayIdType * mergeNodesCenter (double precision, bool &areNodesMerged, mcIdType &newNbOfNodes)
 
void recenterForMaxPrecision (double eps)
 
virtual void renumberNodes (const mcIdType *newNodeNumbers, mcIdType newNbOfNodes)
 
virtual void renumberNodesCenter (const mcIdType *newNodeNumbers, mcIdType 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 DataArrayIdType * zipConnectivityTraducer (int compType, mcIdType 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, DataArrayIdType *&cellCor, DataArrayIdType *&nodeCor) const
 
virtual MCAuto< DataArrayDoublecomputeMeshCenterOfMass () const
 
virtual void copyTinyInfoFrom (const MEDCouplingMesh *other)
 
virtual MEDCouplingFieldDoublefillFromAnalytic (TypeOfField t, int nbOfComp, const std::string &func) const
 
virtual MEDCouplingFieldDoublefillFromAnalytic (TypeOfField t, int nbOfComp, FunctionToEvaluate 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::RefCountObjectOnly
bool decrRef () const
 
int getRCValue () const
 
void incrRef () const
 
RefCountObjectOnlyoperator= (const RefCountObjectOnly &other)
 
- Public Member Functions inherited from MEDCoupling::BigMemoryObject
std::string debugHeapMemorySize () const
 
std::vector< const BigMemoryObject * > getAllTheProgeny () const
 
std::vector< const BigMemoryObject * > getDirectChildren () const
 
std::size_t getHeapMemorySize () const
 
std::string getHeapMemorySizeStr () const
 
bool isObjectInTheProgeny (const BigMemoryObject *obj) const
 
virtual ~BigMemoryObject ()
 
- Public Member Functions inherited from MEDCoupling::TimeLabel
void declareAsNew () const
 
std::size_t getTimeOfThis () const
 
TimeLabeloperator= (const TimeLabel &other)
 
 TimeLabel (const TimeLabel &other)=default
 

Static Public Member Functions

static MEDCouplingUMeshAggregateSortedByTypeMeshesOnSameCoords (const std::vector< const MEDCouplingUMesh * > &ms, DataArrayIdType *&szOfCellGrpOfSameType, DataArrayIdType *&idInMsOfCellGrpOfSameType)
 
static int AreCellsEqual (const mcIdType *conn, const mcIdType *connI, mcIdType cell1, mcIdType cell2, int compType)
 
static int AreCellsEqualPolicy0 (const mcIdType *conn, const mcIdType *connI, mcIdType cell1, mcIdType cell2)
 
static int AreCellsEqualPolicy1 (const mcIdType *conn, const mcIdType *connI, mcIdType cell1, mcIdType cell2)
 
static int AreCellsEqualPolicy2 (const mcIdType *conn, const mcIdType *connI, mcIdType cell1, mcIdType cell2)
 
static int AreCellsEqualPolicy2NoType (const mcIdType *conn, const mcIdType *connI, mcIdType cell1, mcIdType cell2)
 
static int AreCellsEqualPolicy7 (const mcIdType *conn, const mcIdType *connI, mcIdType cell1, mcIdType cell2)
 
static MEDCouplingUMeshBuild0DMeshFromCoords (DataArrayDouble *da)
 
static MCAuto< MEDCouplingUMeshBuild1DMeshFromCoords (DataArrayDouble *da)
 
static bool BuildConvexEnvelopOf2DCellJarvis (const double *coords, const mcIdType *nodalConnBg, const mcIdType *nodalConnEnd, DataArrayIdType *nodalConnecOut)
 
static void ComputeNeighborsOfCellsAdv (const DataArrayIdType *desc, const DataArrayIdType *descI, const DataArrayIdType *revDesc, const DataArrayIdType *revDescI, DataArrayIdType *&neighbors, DataArrayIdType *&neighborsIdx)
 
static DataArrayIdType * ComputeSpreadZoneGradually (const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn)
 
static DataArrayIdType * ComputeSpreadZoneGraduallyFromSeed (const mcIdType *seedBg, const mcIdType *seedEnd, const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn, mcIdType nbOfDepthPeeling, mcIdType &nbOfDepthPeelingPerformed)
 
static void ComputeVecAndPtOfFace (double eps, const double *coords, const mcIdType *begin, const mcIdType *end, double *v, double *p)
 
static void CorrectExtrudedStaticCell (mcIdType *begin, mcIdType *end)
 
static void FindCommonCellsAlg (int compType, mcIdType startCellId, const DataArrayIdType *nodal, const DataArrayIdType *nodalI, const DataArrayIdType *revNodal, const DataArrayIdType *revNodalI, DataArrayIdType *&commonCellsArr, DataArrayIdType *&commonCellsIArr)
 
static MEDCouplingUMeshFuseUMeshesOnSameCoords (const std::vector< const MEDCouplingUMesh * > &meshes, int compType, std::vector< DataArrayIdType * > &corr)
 
static MEDCouplingUMeshIntersect2DMeshes (const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps, DataArrayIdType *&cellNb1, DataArrayIdType *&cellNb2)
 
static void Intersect2DMeshWith1DLine (const MEDCouplingUMesh *mesh2D, const MEDCouplingUMesh *mesh1D, double eps, MEDCouplingUMesh *&splitMesh2D, MEDCouplingUMesh *&splitMesh1D, DataArrayIdType *&cellIdInMesh2D, DataArrayIdType *&cellIdInMesh1D)
 
static bool Is3DExtrudedStaticCellWellOriented (const mcIdType *begin, const mcIdType *end, const double *coords)
 
static bool IsPolygonWellOriented (bool isQuadratic, const double *vec, const mcIdType *begin, const mcIdType *end, const double *coords)
 
static bool IsPolyhedronWellOriented (const mcIdType *begin, const mcIdType *end, const double *coords)
 
static bool IsPyra5WellOriented (const mcIdType *begin, const mcIdType *end, const double *coords)
 
static bool IsTetra4WellOriented (const mcIdType *begin, const mcIdType *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< DataArrayIdType * > PartitionBySpreadZone (const DataArrayIdType *arrIn, const DataArrayIdType *arrIndxIn)
 
static void PutUMeshesOnSameAggregatedCoords (const std::vector< MEDCouplingUMesh * > &meshes)
 
static void SimplifyPolyhedronCell (double eps, const DataArrayDouble *coords, mcIdType index, DataArrayIdType *res, MEDCouplingUMesh *faces, DataArrayIdType *E_Fi, DataArrayIdType *E_F, DataArrayIdType *F_Ei, DataArrayIdType *F_E)
 
static void TryToCorrectPolyhedronOrientation (mcIdType *begin, mcIdType *end, const double *coords)
 
- Static Public Member Functions inherited from MEDCoupling::MEDCouplingPointSet
static MEDCouplingPointSetBuildInstanceFromMeshType (MEDCouplingMeshType type)
 
static DataArrayIdType * ComputeNbOfInteractionsWithSrcCells (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 mcIdType 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 Member Functions inherited from MEDCoupling::BigMemoryObject
static std::size_t GetHeapMemorySizeOfObjs (const std::vector< const BigMemoryObject * > &objs)
 

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 deepCpy)
 
void project2DCellOnXY (const mcIdType *startConn, const mcIdType *endConn, std::vector< double > &res) const
 
void rotate2D (const double *center, double angle)
 
void rotate3D (const double *center, const double *vect, double angle)
 
 ~MEDCouplingPointSet ()
 
- Protected Member Functions inherited from MEDCoupling::MEDCouplingMesh
 MEDCouplingMesh ()
 
 MEDCouplingMesh (const MEDCouplingMesh &other)
 
virtual ~MEDCouplingMesh ()
 
- Protected Member Functions inherited from MEDCoupling::RefCountObject
 RefCountObject ()
 
 RefCountObject (const RefCountObject &other)
 
virtual ~RefCountObject ()
 
- Protected Member Functions inherited from MEDCoupling::RefCountObjectOnly
 RefCountObjectOnly ()
 
 RefCountObjectOnly (const RefCountObjectOnly &other)
 
virtual ~RefCountObjectOnly ()
 
- Protected Member Functions inherited from MEDCoupling::TimeLabel
void forceTimeOfThis (const TimeLabel &other) const
 
 TimeLabel ()
 
void updateTimeWith (const TimeLabel &other) const
 
virtual ~TimeLabel ()
 
- Static Protected Member Functions 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

◆ New() [1/2]

◆ New() [2/2]

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

◆ getClassName()

std::string MEDCoupling::MEDCouplingUMesh::getClassName ( ) const
overridevirtual

Reimplemented from MEDCoupling::BigMemoryObject.

◆ deepCopy()

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::New(), MEDCoupling::WriteUMesh(), and MEDCoupling::MEDCouplingFieldDouble::zipConnectivity().

◆ clone()

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 deepCopy(), deepCopyConnectivityOnly(), getCellIdsCrossingPlane(), and MEDCoupling::MEDCouplingMappedExtrudedMesh::Project1DMeshes().

◆ deepCopyConnectivityOnly()

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(), and getNodalConnectivityIndex().

◆ shallowCopyConnectivityFrom()

void MEDCouplingUMesh::shallowCopyConnectivityFrom ( const MEDCouplingPointSet other)
virtual

◆ updateTime()

void MEDCouplingUMesh::updateTime ( ) const
virtual

◆ getHeapMemorySizeWithoutChildren()

std::size_t MEDCouplingUMesh::getHeapMemorySizeWithoutChildren ( ) const
virtual

◆ getDirectChildrenWithNull()

std::vector< const BigMemoryObject * > MEDCouplingUMesh::getDirectChildrenWithNull ( ) const
virtual

◆ getType()

MEDCouplingMeshType MEDCoupling::MEDCouplingUMesh::getType ( ) const
virtual

◆ isEqualIfNotWhy()

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

◆ isEqualWithoutConsideringStr()

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

◆ checkFastEquivalWith()

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

◆ checkConsistencyLight()

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

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

◆ checkConsistency()

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 informatically clean, 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. For more geometrical checking checkGeomConsistency method is better than this.

See also
MEDCouplingUMesh::checkGeomConsistency
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(), getMeshDimension(), getNumberOfCells(), and MEDCoupling::MEDCouplingPointSet::getNumberOfNodes().

Referenced by checkGeomConsistency().

◆ checkGeomConsistency()

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

This method adds some geometrical checks in addition to the informatical check of checkConsistency method. This method in particular checks that a same node is not repeated several times in a cell.

Exceptions
Ifthere is a presence a multiple same node ID in nodal connectivity of cell.

References checkConsistency(), and getNumberOfCells().

◆ setMeshDimension()

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

◆ allocateCells()

void MEDCouplingUMesh::allocateCells ( mcIdType  nbOfCells = 0)

Allocates memory to store an estimation of the given number of cells. The closer the estimation to the number of cells effectively inserted, the less need the library requires to reallocate memory. If the number of cells to be inserted is not known simply assign 0 to this parameter. If a nodal connectivity previously 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().

Referenced by orientCorrectly2DCells().

◆ insertNextCell()

void MEDCouplingUMesh::insertNextCell ( INTERP_KERNEL::NormalizedCellType  type,
mcIdType  size,
const mcIdType *  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.

◆ finishInsertingCells()

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

Referenced by orientCorrectly2DCells().

◆ cellIterator()

MEDCouplingUMeshCellIterator * MEDCouplingUMesh::cellIterator ( )

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

◆ cellsByType()

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

◆ getAllGeoTypes()

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(), invertOrientationOfAllCells(), MEDCoupling::MEDCoupling1GTUMesh::New(), MEDCoupling::MEDCoupling1SGTUMesh::New(), and MEDCoupling::MEDCoupling1DGTUMesh::New().

◆ getAllGeoTypesSorted()

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 getNodalConnectivityArrayLen(), and getNumberOfCells().

◆ getTypesOfPart()

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

Returns types of cells of the specified part of this mesh. This method avoids computing sub-mesh explicitly 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()

◆ setConnectivity()

void MEDCouplingUMesh::setConnectivity ( DataArrayIdType *  conn,
DataArrayIdType *  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(), and MEDCoupling::TimeLabel::declareAsNew().

Referenced by colinearizeEdges(), convertLinearCellsToQuadratic(), convertQuadraticCellsToLinear(), convertToPolyTypes(), convexEnvelop2D(), MergeUMeshesOnSameCoords(), removeDegenerated1DCells(), renumberCells(), setPartOfMySelf(), setPartOfMySelfSlice(), shallowCopyConnectivityFrom(), simplifyPolyhedra(), and unserialization().

◆ getNodalConnectivity() [1/2]

◆ getNodalConnectivityIndex() [1/2]

◆ getNodalConnectivity() [2/2]

DataArrayIdType* MEDCoupling::MEDCouplingUMesh::getNodalConnectivity ( )

◆ getNodalConnectivityIndex() [2/2]

DataArrayIdType* MEDCoupling::MEDCouplingUMesh::getNodalConnectivityIndex ( )

◆ getTypeOfCell()

INTERP_KERNEL::NormalizedCellType MEDCouplingUMesh::getTypeOfCell ( mcIdType  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.

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

◆ giveCellsWithType()

DataArrayIdType * 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 getMeshDimension(), and getNumberOfCells().

Referenced by computeDiameterField(), and invertOrientationOfAllCells().

◆ getNumberOfCellsWithType()

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

◆ getNodeIdsOfCell()

void MEDCouplingUMesh::getNodeIdsOfCell ( mcIdType  cellId,
std::vector< mcIdType > &  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.

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

◆ simpleRepr()

◆ advancedRepr()

◆ cppRepr()

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(), and MEDCoupling::DataArrayDouble::reprCppStream().

◆ reprConnectivityOfThis()

std::string MEDCouplingUMesh::reprConnectivityOfThis ( ) const

◆ buildSetInstanceFromThis()

MEDCouplingUMesh * MEDCouplingUMesh::buildSetInstanceFromThis ( std::size_t  spaceDim) const

This method builds a newly allocated instance (with the same name than this) that the caller has the responsibility 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, getMeshDimension(), MEDCoupling::MEDCouplingMesh::getName(), MEDCoupling::DataArrayDouble::New(), and New().

◆ getNumberOfNodesInCell()

mcIdType MEDCouplingUMesh::getNumberOfNodesInCell ( mcIdType  cellId) const
virtual

◆ getNumberOfCells()

mcIdType MEDCouplingUMesh::getNumberOfCells ( ) const
virtual

Returns a number of cells constituting this mesh.

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

Implements MEDCoupling::MEDCouplingMesh.

Referenced by are2DCellsNotCorrectlyOriented(), areCellsIncludedIn(), areCellsIncludedInPolicy7(), areOnlySimplexCells(), arePolyhedronsNotCorrectlyOriented(), buildDirectionVectorField(), MEDCoupling::MEDFileUMesh::buildExtrudedMesh(), buildOrthogonalField(), changeOrientationOfCells(), checkButterflyCells(), checkConsecutiveCellTypes(), checkConsecutiveCellTypesAndOrder(), checkConsistency(), checkGeomConsistency(), checkTypeConsistencyAndContig(), clipSingle3DCellByPlane(), colinearizeEdges(), computeCellCenterOfMass(), computeCellNeighborhoodFromNodesOne(), computeDiameterField(), computeEffectiveNbOfNodesPerCell(), computeEnlargedNeighborsOfNodes(), computeIsoBarycenterOfNodesPerCell(), computeNbOfFacesPerCell(), computeNbOfNodesPerCell(), computeNodeIdsAlg(), computePlaneEquationOf3DFaces(), conformize2D(), conformize3D(), convertAllToPoly(), convertCellArrayPerGeoType(), convertDegeneratedCells(), convertDegeneratedCellsAndRemoveFlatOnes(), convertExtrudedPolyhedra(), convertNodalConnectivityToDynamicGeoTypeMesh(), convertNodalConnectivityToStaticGeoTypeMesh(), convertQuadraticCellsToLinear(), convertToPolyTypes(), convexEnvelop2D(), distanceToPoints(), duplicateNodesInConn(), findAndCorrectBadOriented3DCells(), findAndCorrectBadOriented3DExtrudedCells(), findCellIdsOnBoundary(), generateGraph(), getAllGeoTypesSorted(), getAspectRatioField(), getBoundingBoxForBBTree1DQuadratic(), getBoundingBoxForBBTree2DQuadratic(), getBoundingBoxForBBTreeFast(), getCellsInBoundingBox(), getDistributionOfTypes(), getEdgeRatioField(), getLevArrPerCellTypes(), 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(), removeDegenerated1DCells(), renumberCells(), renumberNodesInConn(), renumberNodesWithOffsetInConn(), serialize(), setPartOfMySelf(), setPartOfMySelfSlice(), shiftNodeNumbersInConn(), simpleRepr(), simplifyPolyhedra(), splitByType(), splitProfilePerType(), tetrahedrize(), unPolyze(), and writeVTKLL().

◆ getMeshDimension()

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(), MEDCoupling::MEDFileUMesh::buildExtrudedMesh(), buildExtrudedMesh(), buildOrthogonalField(), buildPartOfMySelf(), buildPartOfMySelfSlice(), buildPartOrthogonalField(), buildSetInstanceFromThis(), buildSlice3D(), buildSlice3DSurf(), buildSpreadZonesWithPoly(), buildUnionOf2DMesh(), buildUnionOf3DMesh(), changeOrientationOfCells(), checkButterflyCells(), checkConsistency(), clipSingle3DCellByPlane(), colinearizeEdges(), computeNeighborsOfNodes(), computePlaneEquationOf3DFaces(), conformize2D(), conformize3D(), convertDegeneratedCells(), convertDegeneratedCellsAndRemoveFlatOnes(), convertExtrudedPolyhedra(), convertLinearCellsToQuadratic(), convertToPolyTypes(), convexEnvelop2D(), cppRepr(), distanceToPoint(), distanceToPoints(), emulateMEDMEMBDC(), explode3DMeshTo1D(), explodeIntoEdges(), explodeMeshIntoMicroEdges(), explodeMeshTo(), findAndCorrectBadOriented3DCells(), findAndCorrectBadOriented3DExtrudedCells(), findCellIdsLyingOn(), findCellsToRenumber(), findNodesToDuplicate(), generateGraph(), getAspectRatioField(), getBoundingBoxForBBTree(), getBoundingBoxForBBTree1DQuadratic(), getBoundingBoxForBBTree2DQuadratic(), getCellsInBoundingBox(), getEdgeRatioField(), getFastAveragePlaneOfThis(), getMeasureField(), getPartMeasureField(), getSkewField(), getTinySerializationInformation(), getWarpField(), giveCellsWithType(), Intersect2DMeshes(), Intersect2DMeshWith1DLine(), isContiguous1D(), orderConsecutiveCells1D(), orientCorrectly2DCells(), orientCorrectlyPolyhedrons(), project1D(), removeDegenerated1DCells(), serialize(), MEDCoupling::MEDFileUMesh::setMeshes(), setPartOfMySelf(), setPartOfMySelfSlice(), simplifyPolyhedra(), split2DCells(), tessellate2D(), tetrahedrize(), unPolyze(), and WriteFieldT().

◆ getNodalConnectivityArrayLen()

mcIdType 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
mcIdType - the length of the nodal connectivity array.

Referenced by convertDegeneratedCells(), convertDegeneratedCellsAndRemoveFlatOnes(), convertQuadraticCellsToLinear(), getAllGeoTypesSorted(), getTinySerializationInformation(), MEDCoupling::MEDCoupling1DGTUMesh::New(), serialize(), and unPolyze().

◆ computeTypes()

◆ getTinySerializationInformation()

void MEDCouplingUMesh::getTinySerializationInformation ( std::vector< double > &  tinyInfoD,
std::vector< mcIdType > &  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().

◆ isEmptyMesh()

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

First step of unserialization process.

Implements MEDCoupling::MEDCouplingPointSet.

◆ resizeForUnserialization()

void MEDCouplingUMesh::resizeForUnserialization ( const std::vector< mcIdType > &  tinyInfo,
DataArrayIdType *  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.
a1DataArrayDouble
a2DataArrayDouble
littleStringsstring vector

Reimplemented from MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::MEDCouplingPointSet::resizeForUnserialization().

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

◆ serialize()

void MEDCouplingUMesh::serialize ( DataArrayIdType *&  a1,
DataArrayDouble *&  a2 
) const
virtual

◆ unserialization()

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

Second and final unserialization process.

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

Reimplemented from MEDCoupling::MEDCouplingPointSet.

References setConnectivity(), setMeshDimension(), and MEDCoupling::MEDCouplingPointSet::unserialization().

◆ getVTKDataSetType()

std::string MEDCouplingUMesh::getVTKDataSetType ( ) const
virtual

Implements MEDCoupling::MEDCouplingMesh.

Referenced by writeVTKLL().

◆ getVTKFileExtension()

std::string MEDCouplingUMesh::getVTKFileExtension ( ) const
virtual

◆ writeVTKLL()

◆ reprQuickOverview()

◆ AreCellsEqual()

int MEDCouplingUMesh::AreCellsEqual ( const mcIdType *  conn,
const mcIdType *  connI,
mcIdType  cell1,
mcIdType  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().

◆ AreCellsEqualPolicy0()

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

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

Referenced by AreCellsEqual().

◆ AreCellsEqualPolicy1()

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

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

Referenced by AreCellsEqual().

◆ AreCellsEqualPolicy2()

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

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

Referenced by AreCellsEqual().

◆ AreCellsEqualPolicy2NoType()

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

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

Referenced by AreCellsEqual().

◆ AreCellsEqualPolicy7()

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

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

Referenced by AreCellsEqual().

◆ convertToPolyTypes()

void MEDCouplingUMesh::convertToPolyTypes ( const mcIdType *  cellIdsToConvertBg,
const mcIdType *  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(), getMeshDimension(), getNumberOfCells(), and setConnectivity().

Referenced by convertAllToPoly().

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

◆ convertExtrudedPolyhedra()

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 getMeshDimension(), getNumberOfCells(), and MEDCoupling::MEDCouplingPointSet::getSpaceDimension().

◆ unPolyze()

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(), and getNumberOfCells().

◆ simplifyPolyhedra()

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.

WARNING: this method will not modify edges connectivity! Take a look at colinearizeEdges for that.

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 buildDescendingConnectivity(), MEDCoupling::DataArrayDouble::deepCopy(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::recenterForMaxPrecision(), setConnectivity(), and SimplifyPolyhedronCell().

◆ colinearizeEdges()

void MEDCouplingUMesh::colinearizeEdges ( 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 simplify edges of polyhedron cells so that consecutive colinear segments (with intermediate points not used by any other cell) are merged together.

Parameters
[in]epsis a relative precision that allows to establish if two consecutive 3D segments are colinear or not.
See also
simplifyPolyhedra

References MEDCoupling::DataArrayTemplate< T >::begin(), buildDescendingConnectivity(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and setConnectivity().

◆ buildSpreadZonesWithPoly()

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 buildPartOfMySelf(), buildUnionOf2DMesh(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), MEDCoupling::MEDCouplingMesh::getName(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), New(), and partitionBySpreadZone().

◆ partitionBySpreadZone()

std::vector< DataArrayIdType * > 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().

◆ computeFetchedNodeIds()

DataArrayIdType * 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 DataArrayIdType instance.

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

Implements MEDCoupling::MEDCouplingPointSet.

References computeNodeIdsAlg().

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

◆ getNodeIdsInUse()

DataArrayIdType * MEDCouplingUMesh::getNodeIdsInUse ( mcIdType &  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
DataArrayIdType * - a new instance of DataArrayIdType. 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 getNumberOfCells(), and MEDCoupling::MEDCouplingPointSet::getNumberOfNodes().

◆ computeNodeIdsAlg()

void MEDCouplingUMesh::computeNodeIdsAlg ( std::vector< bool > &  nodeIdsInUse) const
virtual
Parameters
[in,out]nodeIdsInUsean array of size typically equal to nbOfNodes.
See also
MEDCouplingUMesh::getNodeIdsInUse, areAllNodesFetched

Implements MEDCoupling::MEDCouplingPointSet.

References getNumberOfCells().

Referenced by computeFetchedNodeIds().

◆ computeNbOfNodesPerCell()

DataArrayIdType * 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 getNodalConnectivity(), getNodalConnectivityIndex(), and getNumberOfCells().

Referenced by getMeasureFieldOnNode().

◆ computeNbOfFacesPerCell()

DataArrayIdType * 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 getNodalConnectivity(), getNodalConnectivityIndex(), and getNumberOfCells().

◆ computeEffectiveNbOfNodesPerCell()

DataArrayIdType * 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
DataArrayIdType * - new object to be deallocated by the caller.
See also
MEDCouplingUMesh::computeNbOfNodesPerCell

Implements MEDCoupling::MEDCouplingMesh.

References getNodalConnectivity(), getNodalConnectivityIndex(), and getNumberOfCells().

◆ zipCoordsTraducer()

DataArrayIdType * 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
DataArrayIdType * - a new instance of DataArrayIdType 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 SimplifyPolyhedronCell().

◆ findCommonCells()

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

This method find cells that are equal (regarding compType) in this. The comparison is specified by compType (see zipConnectivityTraducer). This method keeps the coordinates of this. The comparison starts at rank startCellId cell id (included). If startCellId is equal to 0 algorithm starts at cell #0 and for each cell candidates being searched have cell id higher than current cellId. If startCellId is greater than 0 algorithm starts at cell #startCellId but for each cell all candidates are considered. 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)

Implements MEDCoupling::MEDCouplingPointSet.

References FindCommonCellsAlg(), and getReverseNodalConnectivity().

◆ areCellsIncludedIn()

bool MEDCouplingUMesh::areCellsIncludedIn ( const MEDCouplingUMesh other,
int  compType,
DataArrayIdType *&  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 DataArrayIdType 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::MEDCouplingMesh::getName(), getNumberOfCells(), and MergeUMeshesOnSameCoords().

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

◆ areCellsIncludedInPolicy7()

bool MEDCouplingUMesh::areCellsIncludedInPolicy7 ( const MEDCouplingUMesh other,
DataArrayIdType *&  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::MEDCouplingMesh::getName(), getNumberOfCells(), and MergeUMeshesOnSameCoords().

◆ getReverseNodalConnectivity()

void MEDCouplingUMesh::getReverseNodalConnectivity ( DataArrayIdType *  revNodal,
DataArrayIdType *  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, getNumberOfCells(), and MEDCoupling::MEDCouplingPointSet::getNumberOfNodes().

Referenced by explodeMeshTo(), findCommonCells(), generateGraph(), getMeasureFieldOnNode(), and orientCorrectly2DCells().

◆ explodeIntoEdges()

MCAuto< MEDCouplingUMesh > MEDCouplingUMesh::explodeIntoEdges ( MCAuto< DataArrayIdType > &  desc,
MCAuto< DataArrayIdType > &  descIndex,
MCAuto< DataArrayIdType > &  revDesc,
MCAuto< DataArrayIdType > &  revDescIndx 
) const

Explodes this into edges whatever its dimension.

References buildDescendingConnectivity(), explode3DMeshTo1D(), and getMeshDimension().

◆ explodeMeshTo()

MCAuto< MEDCouplingUMesh > MEDCouplingUMesh::explodeMeshTo ( int  targetDeltaLevel,
MCAuto< DataArrayIdType > &  desc,
MCAuto< DataArrayIdType > &  descIndx,
MCAuto< DataArrayIdType > &  revDesc,
MCAuto< DataArrayIdType > &  revDescIndx 
) const

This method is a generalization of buildDescendingConnectivity method. This method return mesh containing subcells of this at level specified by targetDeltaLevel and return descending and reverse descending correspondances to this.

Parameters
[in]targetDeltaLeveltarget delta level compared to this mesh dimension. This parameter is expected to be lower than zero.
Exceptions
IftargetDeltaLevel is greater or equal to zero
IftargetDeltaLevel is lower than -meshDim
See also
MEDCouplingUMesh::buildDescendingConnectivity, MEDCouplingUMesh::explode3DMeshTo1D

References Build0DMeshFromCoords(), buildDescendingConnectivity(), checkConsistencyLight(), explode3DMeshTo1D(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNodalConnectivity(), getNodalConnectivityIndex(), and getReverseNodalConnectivity().

◆ explode3DMeshTo1D()

MEDCouplingUMesh * MEDCouplingUMesh::explode3DMeshTo1D ( DataArrayIdType *  desc,
DataArrayIdType *  descIndx,
DataArrayIdType *  revDesc,
DataArrayIdType *  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(), explodeIntoEdges(), and explodeMeshTo().

◆ buildDescendingConnectivity()

MEDCouplingUMesh * MEDCouplingUMesh::buildDescendingConnectivity ( DataArrayIdType *  desc,
DataArrayIdType *  descIndx,
DataArrayIdType *  revDesc,
DataArrayIdType *  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(), clipSingle3DCellByPlane(), colinearizeEdges(), computeNeighborsOfCells(), computeNeighborsOfNodes(), computeSkin(), conformize2D(), conformize3D(), emulateMEDMEMBDC(), explodeIntoEdges(), explodeMeshTo(), findCellIdsOnBoundary(), orderConsecutiveCells1D(), and simplifyPolyhedra().

◆ buildDescendingConnectivity2()

MEDCouplingUMesh * MEDCouplingUMesh::buildDescendingConnectivity2 ( DataArrayIdType *  desc,
DataArrayIdType *  descIndx,
DataArrayIdType *  revDesc,
DataArrayIdType *  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().

◆ explodeMeshIntoMicroEdges()

MEDCouplingUMesh * MEDCouplingUMesh::explodeMeshIntoMicroEdges ( DataArrayIdType *  desc,
DataArrayIdType *  descIndx,
DataArrayIdType *  revDesc,
DataArrayIdType *  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 dimension equal to 2 or 3. Dynamical cells are not supported (polygons, polyhedrons...)

See also
explode3DMeshTo1D, buildDescendingConnectiviy

References getMeshDimension().

◆ computeNeighborsOfCells()

void MEDCouplingUMesh::computeNeighborsOfCells ( DataArrayIdType *&  neighbors,
DataArrayIdType *&  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 for every cell in this its neighbor cells. To compute the result only connectivities are considered. The neighbor cells of a given 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(), and ComputeNeighborsOfCellsAdv().

Referenced by partitionBySpreadZone().

◆ computeCellNeighborhoodFromNodesOne()

void MEDCouplingUMesh::computeCellNeighborhoodFromNodesOne ( const DataArrayIdType *  nodeNeigh,
const DataArrayIdType *  nodeNeighI,
MCAuto< DataArrayIdType > &  cellNeigh,
MCAuto< DataArrayIdType > &  cellNeighIndex 
) const

Given a set of identifiers indexed by the node IDs of the mesh (and given in the (Indirect indexing format) , re-arrange the data to produce a set indexed by cell IDs. The mapping between a node ID and a cell ID is done using the connectivity of the mesh (e.g. a triangular element will receive the information from its three vertices). Doublons are eliminated. If present in the inital dataset, the ID of the cell itself is also remooved.

Parameters
[in]nodeNeigha set of identifiers (mcIdType) stored by node index (Indirect indexing format)
[in]nodeNeighIa set of identifiers (mcIdType) stored by node index (Indirect indexing format)
[out]cellNeighThis array is newly allocated and should be dealt by the caller. It contains the initial identifiers provided in the input parameters but stored now by cell index (See 2nd output parameter and Indirect indexing).
[out]cellNeighIis 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).

\raise if the number of tuples in nodeNeighI is not equal to the number of nodes in the mesh.

References checkConsistencyLight(), getNumberOfCells(), and MEDCoupling::MEDCouplingPointSet::getNumberOfNodes().

◆ ComputeNeighborsOfCellsAdv()

void MEDCouplingUMesh::ComputeNeighborsOfCellsAdv ( const DataArrayIdType *  desc,
const DataArrayIdType *  descIndx,
const DataArrayIdType *  revDesc,
const DataArrayIdType *  revDescIndx,
DataArrayIdType *&  neighbors,
DataArrayIdType *&  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.

Referenced by computeNeighborsOfCells(), and findCellsToRenumber().

◆ computeNeighborsOfNodes()

void MEDCouplingUMesh::computeNeighborsOfNodes ( DataArrayIdType *&  neighbors,
DataArrayIdType *&  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 for every node in this its neighbor nodes. 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.
See also
MEDCouplingUMesh::computeEnlargedNeighborsOfNodes

References buildDescendingConnectivity(), explode3DMeshTo1D(), getMeshDimension(), and MEDCoupling::MEDCouplingPointSet::getNumberOfNodes().

◆ computeEnlargedNeighborsOfNodes()

void MEDCouplingUMesh::computeEnlargedNeighborsOfNodes ( MCAuto< DataArrayIdType > &  neighbors,
MCAuto< DataArrayIdType > &  neighborsIdx 
) const

Computes enlarged neighbors for each nodes in this. The behavior of this method is close to MEDCouplingUMesh::computeNeighborsOfNodes except that the neighborhood of each node is wider here. A node j is considered to be in the neighborhood of i if and only if there is a cell in this containing in its nodal connectivity both i and j. This method is useful to find ghost cells of a part of a mesh with a code based on fields on nodes.

See also
MEDCouplingUMesh::computeNeighborsOfNodes

References getNumberOfCells(), and MEDCoupling::MEDCouplingPointSet::getNumberOfNodes().

◆ mergeMyselfWithOnSameCoords()

MEDCouplingUMesh * MEDCouplingUMesh::mergeMyselfWithOnSameCoords ( const MEDCouplingPointSet other) const
virtual

◆ buildPartOfMySelf()

MEDCouplingUMesh * MEDCouplingUMesh::buildPartOfMySelf ( const mcIdType *  begin,
const mcIdType *  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(), conformize2D(), findCellIdsLyingOn(), findCellsToRenumber(), findNodesToDuplicate(), Intersect2DMeshWith1DLine(), keepSpecifiedCells(), SimplifyPolyhedronCell(), and splitByType().

◆ buildPartOfMySelfSlice()

MEDCouplingUMesh * MEDCouplingUMesh::buildPartOfMySelfSlice ( mcIdType  start,
mcIdType  end,
mcIdType  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 explicitly but by a range python like.

Parameters
startstarting ID
endend ID (excluded)
stepstep size
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().

◆ setPartOfMySelf()

void MEDCouplingUMesh::setPartOfMySelf ( const mcIdType *  cellIdsBg,
const mcIdType *  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::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNumberOfCells(), and setConnectivity().

Referenced by conformize2D().

◆ setPartOfMySelfSlice()

void MEDCouplingUMesh::setPartOfMySelfSlice ( mcIdType  start,
mcIdType  end,
mcIdType  step,
const MEDCouplingUMesh otherOnSameCoordsThanThis 
)

◆ buildFacePartOfMySelfNode()

MEDCouplingUMesh * MEDCouplingUMesh::buildFacePartOfMySelfNode ( const mcIdType *  begin,
const mcIdType *  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().

◆ buildUnstructured()

MEDCouplingUMesh * MEDCouplingUMesh::buildUnstructured ( ) const
virtual

◆ findBoundaryNodes()

DataArrayIdType * MEDCouplingUMesh::findBoundaryNodes ( ) const
virtual

Finds nodes lying on the boundary of this mesh.

Returns
DataArrayIdType * - a new instance of DataArrayIdType 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 computeSkin().

Referenced by findNodesToDuplicate().

◆ buildBoundaryMesh()

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(), and buildPartOfMySelf().

◆ findCellIdsOnBoundary()

DataArrayIdType * MEDCouplingUMesh::findCellIdsOnBoundary ( ) const

This method returns a newly created DataArrayIdType 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 buildDescendingConnectivity(), MEDCoupling::RefCountObjectOnly::decrRef(), and getNumberOfCells().

◆ findCellIdsLyingOn()

void MEDCouplingUMesh::findCellIdsLyingOn ( const MEDCouplingUMesh otherDimM1OnSameCoords,
DataArrayIdType *&  cellIdsRk0,
DataArrayIdType *&  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]otherDimM1OnSameCoordsother mesh
[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 buildPartOfMySelf(), computeFetchedNodeIds(), MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes(), MEDCoupling::MEDCouplingPointSet::getCoords(), and getMeshDimension().

◆ computeSkin()

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

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

◆ findNodesToDuplicate()

DataArrayIdType * MEDCouplingUMesh::findNodesToDuplicate ( const MEDCouplingUMesh crackingMesh) 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. Those are the 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, it will 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]crackingMesha 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.
Returns
node ids which need to be duplicated following the algorithm explained above.

References buildPartOfMySelf(), computeFetchedNodeIds(), computeSkin(), findBoundaryNodes(), MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes(), MEDCoupling::MEDCouplingPointSet::getCoords(), and getMeshDimension().

◆ findCellsToRenumber()

void MEDCouplingUMesh::findCellsToRenumber ( const MEDCouplingUMesh otherDimM1OnSameCoords,
const mcIdType *  nodeIdsToDuplicateBg,
const mcIdType *  nodeIdsToDuplicateEnd,
DataArrayIdType *&  cellIdsNeededToBeRenum,
DataArrayIdType *&  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 is part of the MEDFileUMesh::buildInnerBoundaryAlongM1Group() algorithm. Given a set of nodes to duplicate, this method identifies which cells should have their connectivity modified to produce the inner boundary. It is typically called after findNodesToDuplicate().

Parameters
[in]otherDimM1OnSameCoordsa mesh lying on the same coords than this and with a mesh dimension equal to those of this minus 1.
[in]nodeIdsToDuplicateBgnode ids needed to be duplicated, as returned by findNodesToDuplicate.
[in]nodeIdsToDuplicateEndnode ids needed to be duplicated, as returned by findNodesToDuplicate.
[out]cellIdsNeededToBeRenumcell ids in this in which the renumber of nodes should be performed.
[out]cellIdsNotModifiedcell ids in this that lies on otherDimM1OnSameCoords mesh whose connectivity do not need to be modified as it is the case for cellIdsNeededToBeRenum.

References buildPartOfMySelf(), ComputeNeighborsOfCellsAdv(), ComputeSpreadZoneGraduallyFromSeed(), MEDCoupling::MEDCouplingPointSet::getCellIdsLyingOnNodes(), MEDCoupling::MEDCouplingPointSet::getCoords(), and getMeshDimension().

◆ duplicateNodes()

void MEDCouplingUMesh::duplicateNodes ( const mcIdType *  nodeIdsToDuplicateBg,
const mcIdType *  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 explicitly the renumber array in nodes is not explicitly 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().

◆ renumberNodesWithOffsetInConn()

void MEDCouplingUMesh::renumberNodesWithOffsetInConn ( mcIdType  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 getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), and updateTime().

◆ renumberNodesInConn() [1/3]

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

Same than renumberNodesInConn(const mcIdType *) 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.

◆ renumberNodesInConn() [2/3]

void MEDCouplingUMesh::renumberNodesInConn ( const mcIdType *  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 getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), and updateTime().

◆ renumberNodesInConn() [3/3]

void MEDCouplingUMesh::renumberNodesInConn ( const std::map< mcIdType, mcIdType > &  newNodeNumbersO2N)
overridevirtual

Same than renumberNodesInConn(const mcIdType *) 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.

◆ shiftNodeNumbersInConn()

void MEDCouplingUMesh::shiftNodeNumbersInConn ( mcIdType  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 getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), and updateTime().

◆ duplicateNodesInConn()

void MEDCouplingUMesh::duplicateNodesInConn ( const mcIdType *  nodeIdsToDuplicateBg,
const mcIdType *  nodeIdsToDuplicateEnd,
mcIdType  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 explicitly the renumber array in nodes is not explicitly 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 getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), and updateTime().

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

◆ renumberCells()

void MEDCouplingUMesh::renumberCells ( const mcIdType *  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()
checkwhether to check content of old2NewBg

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::C_DEALLOC, getNumberOfCells(), and setConnectivity().

Referenced by rearrange2ConsecutiveCellTypes(), and sortCellsInMEDFileFrmt().

◆ getCellsInBoundingBox() [1/2]

DataArrayIdType * 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
DataArrayIdType * - a new instance of DataArrayIdType 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 >::getConstPointer(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and MEDCoupling::MEDCouplingPointSet::intersectsBoundingBox().

Referenced by getCellIdsCrossingPlane().

◆ getCellsInBoundingBox() [2/2]

DataArrayIdType * MEDCouplingUMesh::getCellsInBoundingBox ( const INTERP_KERNEL::DirectedBoundingBox &  bbox,
double  eps 
)
virtual

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

Implements MEDCoupling::MEDCouplingPointSet.

References MEDCoupling::DataArrayTemplate< T >::getConstPointer(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and MEDCoupling::MEDCouplingPointSet::intersectsBoundingBox().

◆ getMeasureField()

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

Returns a new MEDCouplingFieldDouble containing volumes of cells constituting this mesh.
For 1D cells, the returned field contains lengths.
For 2D cells, the returned field contains areas.
For 3D cells, the returned field contains volumes.

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 cells and one time . The caller is to delete this field using decrRef() as it is no more needed.

Implements MEDCoupling::MEDCouplingMesh.

References MEDCoupling::DataArrayTemplate< T >::getConstPointer(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), MEDCoupling::MEDCouplingMesh::getName(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::ON_CELLS, and MEDCoupling::ONE_TIME.

Referenced by buildOrthogonalField(), and getMeasureFieldOnNode().

◆ getPartMeasureField()

DataArrayDouble * MEDCouplingUMesh::getPartMeasureField ( bool  isAbs,
const mcIdType *  begin,
const mcIdType *  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 >::getConstPointer(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), MEDCoupling::MEDCouplingMesh::getName(), getNodalConnectivity(), getNodalConnectivityIndex(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and MEDCoupling::DataArrayDouble::New().

◆ getMeasureFieldOnNode()

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 computeNbOfNodesPerCell(), getMeasureField(), MEDCoupling::MEDCouplingMesh::getName(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), getReverseNodalConnectivity(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::MEDCouplingFieldDouble::New(), and MEDCoupling::ON_NODES.

◆ buildOrthogonalField()

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, computeCellCenterOfMass(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), getMeasureField(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::ON_CELLS, and MEDCoupling::ONE_TIME.

◆ buildPartOrthogonalField()

MEDCouplingFieldDouble * MEDCouplingUMesh::buildPartOrthogonalField ( const mcIdType *  begin,
const mcIdType *  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 >::getConstPointer(), getMeshDimension(), getPartBarycenterAndOwner(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::ON_CELLS, and MEDCoupling::ONE_TIME.

◆ buildDirectionVectorField()

MEDCouplingFieldDouble * MEDCouplingUMesh::buildDirectionVectorField ( ) const

Returns a new MEDCouplingFieldDouble holding a direction vector for each SEG2 in this 1D mesh. The computed vectors have this->getSpaceDimension() components and are not normalized.

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.
Ifthis->getMeshDimension() != 1.
Ifthis mesh includes cells of type other than SEG2.

References MEDCoupling::DataArrayTemplate< T >::getConstPointer(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNodeIdsOfCell(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::ON_CELLS, and MEDCoupling::ONE_TIME.

Referenced by project1D().

◆ buildSlice3D()

MEDCouplingUMesh * MEDCouplingUMesh::buildSlice3D ( const double *  origin,
const double *  vec,
double  eps,
DataArrayIdType *&  cellIds 
) const

Creates a 2D mesh by cutting this 3D mesh with a plane. In addition to the mesh, returns a new DataArrayIdType, 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 DataArrayIdType 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 buildPartOfMySelf(), MEDCoupling::MEDCouplingPointSet::findNodesOnPlane(), getCellIdsCrossingPlane(), getMeshDimension(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and New().

◆ buildSlice3DSurf()

MEDCouplingUMesh * MEDCouplingUMesh::buildSlice3DSurf ( const double *  origin,
const double *  vec,
double  eps,
DataArrayIdType *&  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 DataArrayIdType, 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 DataArrayIdType 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 buildPartOfMySelf(), getCellIdsCrossingPlane(), getMeshDimension(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and New().

◆ clipSingle3DCellByPlane()

◆ getCellIdsCrossingPlane()

DataArrayIdType * 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
DataArrayIdType * - a new instance of DataArrayIdType 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::MEDCouplingPointSet::getSpaceDimension(), and MEDCoupling::DataArrayDouble::Rotate3DAlg().

Referenced by buildSlice3D(), and buildSlice3DSurf().

◆ isContiguous1D()

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 useful.

References getMeshDimension(), and getNumberOfCells().

Referenced by buildExtrudedMesh().

◆ project1D()

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

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

◆ distanceToPoint()

double MEDCouplingUMesh::distanceToPoint ( const double *  ptBg,
const double *  ptEnd,
mcIdType &  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::C_DEALLOC, distanceToPoints(), getMeshDimension(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and MEDCoupling::DataArrayDouble::New().

◆ distanceToPoints()

DataArrayDouble * MEDCouplingUMesh::distanceToPoints ( const DataArrayDouble pts,
DataArrayIdType *&  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 >::begin(), MEDCoupling::DataArrayTemplate< T >::checkAllocated(), getBoundingBoxForBBTree(), getMeshDimension(), getNumberOfCells(), MEDCoupling::DataArray::getNumberOfComponents(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and MEDCoupling::DataArrayDouble::New().

Referenced by distanceToPoint().

◆ getCellContainingPoint()

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

◆ getCellsContainingPoint()

void MEDCouplingUMesh::getCellsContainingPoint ( const double *  pos,
double  eps,
std::vector< mcIdType > &  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 (i.e. the precision) relative to max dimension along X, Y or Z of the the considered cell bounding box.
[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 getCellsContainingPoints().

Referenced by getCellContainingPoint().

◆ getCellsContainingPoints()

void MEDCouplingUMesh::getCellsContainingPoints ( const double *  pos,
mcIdType  nbOfPoints,
double  eps,
MCAuto< DataArrayIdType > &  elts,
MCAuto< DataArrayIdType > &  eltsIndex 
) const
overridevirtual

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- ball radius (i.e. the precision) relative to max dimension along X, Y or Z of the the considered cell bounding box.
[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.

Referenced by getCellsContainingPoint(), and Intersect2DMeshWith1DLine().

◆ getCellsContainingPointsLinearPartOnlyOnNonDynType()

void MEDCouplingUMesh::getCellsContainingPointsLinearPartOnlyOnNonDynType ( const double *  pos,
mcIdType  nbOfPoints,
double  eps,
MCAuto< DataArrayIdType > &  elts,
MCAuto< DataArrayIdType > &  eltsIndex 
) const
overridevirtual

Behaves like MEDCouplingMesh::getCellsContainingPoints for cells in this that are linear. For quadratic cells in this, this method behaves by just considering linear part of cells. This method is here only for backward compatibility (interpolation GaussPoints to GaussPoints).

See also
MEDCouplingUMesh::getCellsContainingPoints, MEDCouplingRemapper::prepareNotInterpKernelOnlyGaussGauss

Reimplemented from MEDCoupling::MEDCouplingMesh.

◆ checkButterflyCells()

void MEDCouplingUMesh::checkButterflyCells ( std::vector< mcIdType > &  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 getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::MEDCouplingPointSet::isButterfly2DCell(), and MEDCoupling::MEDCouplingPointSet::project2DCellOnXY().

◆ convexEnvelop2D()

DataArrayIdType * 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 BuildConvexEnvelopOf2DCellJarvis(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and setConnectivity().

◆ findAndCorrectBadOriented3DExtrudedCells()

DataArrayIdType * 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
DataArrayIdType * - a new instance of DataArrayIdType 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 >::begin(), CorrectExtrudedStaticCell(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and Is3DExtrudedStaticCellWellOriented().

◆ findAndCorrectBadOriented3DCells()

DataArrayIdType * MEDCouplingUMesh::findAndCorrectBadOriented3DCells ( )

This method is a faster method to correct orientation of all 3D cells in this. This method works only if this is a 3D mesh, that is to say a mesh with mesh dimension 3 and a space dimension 3. This method makes the hypothesis that this a coherent that is to say MEDCouplingUMesh::checkConsistency should throw no exception.

Returns
a newly allocated mcIdType array with one components containing cell ids renumbered to fit the convention of MED (MED file and MEDCoupling)
See also
MEDCouplingUMesh::orientCorrectlyPolyhedrons,

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::begin(), CorrectExtrudedStaticCell(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), Is3DExtrudedStaticCellWellOriented(), IsPolyhedronWellOriented(), IsPyra5WellOriented(), IsTetra4WellOriented(), TryToCorrectPolyhedronOrientation(), and updateTime().

◆ getBoundingBoxForBBTree()

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

◆ getBoundingBoxForBBTreeFast()

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 >::begin(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and MEDCoupling::DataArrayDouble::New().

Referenced by getBoundingBoxForBBTree().

◆ getBoundingBoxForBBTree2DQuadratic()

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 >::begin(), INTERP_KERNEL::QuadraticPolygon::BuildArcCirclePolygon(), INTERP_KERNEL::QuadraticPolygon::BuildLinearPolygon(), INTERP_KERNEL::ComposedEdge::fillBounds(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and MEDCoupling::DataArrayDouble::New().

Referenced by getBoundingBoxForBBTree().

◆ getBoundingBoxForBBTree1DQuadratic()

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 >::begin(), INTERP_KERNEL::QuadraticPolygon::BuildArcCircleEdge(), INTERP_KERNEL::QuadraticPolygon::BuildLinearEdge(), INTERP_KERNEL::Edge::decrRef(), INTERP_KERNEL::Edge::getBounds(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and MEDCoupling::DataArrayDouble::New().

Referenced by getBoundingBoxForBBTree().

◆ buildExtrudedMesh()

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::MEDCouplingPointSet::setCoords(), and updateTime().

◆ isFullyQuadratic()

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

◆ isPresenceOfQuadratic()

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

◆ convertQuadraticCellsToLinear()

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 getNodalConnectivityArrayLen(), getNumberOfCells(), getTypeOfCell(), and setConnectivity().

◆ convertLinearCellsToQuadratic()

DataArrayIdType * 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 DataArrayIdType 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(), setConnectivity(), and MEDCoupling::MEDCouplingPointSet::setCoords().

◆ tessellate2D()

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

◆ tetrahedrize()

MEDCoupling1SGTUMesh * MEDCouplingUMesh::tetrahedrize ( int  policy,
DataArrayIdType *&  n2oCells,
mcIdType &  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 DataArrayIdType 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 independently ! 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 >::begin(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), MEDCoupling::MEDCouplingMesh::getName(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::MEDCoupling1SGTUMesh::New(), and MEDCoupling::DataArrayDouble::New().

◆ simplexize()

DataArrayIdType * MEDCouplingUMesh::simplexize ( int  policy)
virtual

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:
  • 0 - to split QUAD4 by cutting it along 0-2 diagonal (for 2D mesh only).
  • 1 - to split QUAD4 by cutting it along 1-3 diagonal (for 2D mesh only).
  • INTERP_KERNEL::PLANAR_FACE_5 - to split HEXA8 into 5 TETRA4 (for 3D mesh only - see INTERP_KERNEL::SplittingPolicy for an image).
  • INTERP_KERNEL::PLANAR_FACE_6 - to split HEXA8 into 6 TETRA4 (for 3D mesh only - see INTERP_KERNEL::SplittingPolicy for an image).
Returns
DataArrayIdType * - a new instance of DataArrayIdType 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.

◆ areOnlySimplexCells()

bool MEDCouplingUMesh::areOnlySimplexCells ( ) const

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

  • 1D: INTERP_KERNEL::NORM_SEG2
  • 2D: INTERP_KERNEL::NORM_TRI3
  • 3D: INTERP_KERNEL::NORM_TETRA4.

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 getMeshDimension(), and getNumberOfCells().

◆ convertDegeneratedCells()

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. Quadratic cells in 2D are also handled. In those cells edges where start=end=midpoint are removed. 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(), and getNumberOfCells().

◆ convertDegeneratedCellsAndRemoveFlatOnes()

DataArrayIdType * MEDCouplingUMesh::convertDegeneratedCellsAndRemoveFlatOnes ( )

Same as MEDCouplingUMesh::convertDegeneratedCells() plus deletion of the flat cells. A cell is flat in the following cases:

  • for a linear cell, all points in the connectivity are equal
  • for a quadratic cell, either the above, or a quadratic polygon with two (linear) points and two identical quadratic points
    Returns
    a new instance of DataArrayIdType holding ids of removed cells. The caller is to delete this array using decrRef() as it is no more needed.

References computeTypes(), getMeshDimension(), getNodalConnectivityArrayLen(), and getNumberOfCells().

◆ removeDegenerated1DCells()

bool MEDCouplingUMesh::removeDegenerated1DCells ( )

This method remove null 1D cells from this. A 1D cell is considered null if start node is equal to end node. Only connectivity is considered here.

References getMeshDimension(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), and setConnectivity().

◆ are2DCellsNotCorrectlyOriented()

void MEDCouplingUMesh::are2DCellsNotCorrectlyOriented ( const double *  vec,
bool  polyOnly,
std::vector< mcIdType > &  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(), and IsPolygonWellOriented().

◆ orientCorrectly2DCells() [1/2]

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(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), IsPolygonWellOriented(), and updateTime().

◆ orientCorrectly2DCells() [2/2]

void MEDCouplingUMesh::orientCorrectly2DCells ( const MEDCouplingUMesh refFaces = nullptr)

Orient cells of this 2D mesh equally to refFaces.

Parameters
[in]refFaces- 2D mesh containing correctly oriented faces. It is optional. If there are no cells in refFaces or it is nullptr, then any face in this mesh is used as a reference
Exceptions
Ifthis mesh is not well defined.
Ifthis mesh or \refFaces are not 2D.
Ifthis mesh and \refFaces do not share nodes.
IfrefFaces are not equally oriented.
Ifthis mesh plus refFaces together form a non-manifold mesh.

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

References allocateCells(), checkConsistencyLight(), finishInsertingCells(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNodalConnectivity(), getNodalConnectivityIndex(), getNodeIdsOfCell(), getNumberOfCells(), getReverseNodalConnectivity(), getTypeOfCell(), New(), and MEDCoupling::MEDCouplingPointSet::setCoords().

◆ changeOrientationOfCells()

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 getMeshDimension(), and getNumberOfCells().

◆ arePolyhedronsNotCorrectlyOriented()

void MEDCouplingUMesh::arePolyhedronsNotCorrectlyOriented ( std::vector< mcIdType > &  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(), and IsPolyhedronWellOriented().

◆ orientCorrectlyPolyhedrons()

void MEDCouplingUMesh::orientCorrectlyPolyhedrons ( )

Tries to fix connectivity of polyhedra, so that normal vector of all facets to point out of the cell.

Exceptions
Ifthis->getMeshDimension() != 3.
Ifthis->getSpaceDimension() != 3.
Ifthe coordinates array is not set.
Ifthe nodal connectivity of cells is not defined.
Ifthe reparation fails.

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

See also
MEDCouplingUMesh::findAndCorrectBadOriented3DCells

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

◆ invertOrientationOfAllCells()

void MEDCouplingUMesh::invertOrientationOfAllCells ( )
virtual

This method invert orientation of all cells in this. After calling this method the absolute value of measure of cells in this are the same than before calling. This method only operates on the connectivity so coordinates are not touched at all.

Implements MEDCoupling::MEDCouplingPointSet.

References getAllGeoTypes(), giveCellsWithType(), and updateTime().

◆ getFastAveragePlaneOfThis()

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

◆ attractSeg3MidPtsAroundNodes()

void MEDCoupling::MEDCouplingUMesh::attractSeg3MidPtsAroundNodes ( double  ratio,
const mcIdType *  nodeIdsBg,
const mcIdType *  nodeIdsEnd 
)

◆ getEdgeRatioField()

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 >::begin(), checkConsistencyLight(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::ON_CELLS, and MEDCoupling::ONE_TIME.

◆ getAspectRatioField()

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 >::begin(), checkConsistencyLight(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::ON_CELLS, and MEDCoupling::ONE_TIME.

◆ getWarpField()

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 >::begin(), checkConsistencyLight(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::ON_CELLS, and MEDCoupling::ONE_TIME.

◆ getSkewField()

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 >::begin(), checkConsistencyLight(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::ON_CELLS, and MEDCoupling::ONE_TIME.

◆ computeDiameterField()

MEDCouplingFieldDouble * MEDCouplingUMesh::computeDiameterField ( ) const
virtual

Returns the cell field giving for each cell in this its diameter. Diameter means the max length of all possible SEG2 in the cell.

Returns
a new instance of field containing the result. The returned instance has to be deallocated by the caller.
See also
getSkewField, getWarpField, getAspectRatioField, getEdgeRatioField

Implements MEDCoupling::MEDCouplingPointSet.

References checkConsistencyLight(), MEDCoupling::MEDCouplingPointSet::getCoords(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getPointer(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), giveCellsWithType(), MEDCoupling::DataArrayDouble::New(), MEDCoupling::MEDCouplingFieldDouble::New(), MEDCoupling::ON_CELLS, and MEDCoupling::ONE_TIME.

◆ getDistributionOfTypes()

std::vector< mcIdType > 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 method listed above.

Implements MEDCoupling::MEDCouplingMesh.

References getAllGeoTypes(), and getNumberOfCells().

Referenced by keepSpecifiedCells().

◆ checkTypeConsistencyAndContig()

DataArrayIdType * MEDCouplingUMesh::checkTypeConsistencyAndContig ( const std::vector< mcIdType > &  code,
const std::vector< const DataArrayIdType * > &  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 DataArrayIdType instance is returned that the user has the responsibility to deallocate.

Implements MEDCoupling::MEDCouplingMesh.

References checkConsecutiveCellTypesAndOrder(), and getNumberOfCells().

◆ splitProfilePerType()

void MEDCouplingUMesh::splitProfilePerType ( const DataArrayIdType *  profile,
std::vector< mcIdType > &  code,
std::vector< DataArrayIdType * > &  idsInPflPerType,
std::vector< DataArrayIdType * > &  idsPerType,
bool  smartPflKiller = true 
) 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]profilelist of IDs constituing the 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 getNumberOfCells().

◆ emulateMEDMEMBDC()

MEDCouplingUMesh * MEDCouplingUMesh::emulateMEDMEMBDC ( const MEDCouplingUMesh nM1LevMesh,
DataArrayIdType *  desc,
DataArrayIdType *  descIndx,
DataArrayIdType *&  revDesc,
DataArrayIdType *&  revDescIndx,
DataArrayIdType *&  nM1LevMeshIds,
DataArrayIdType *&  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, buildDescendingConnectivity(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), and New().

◆ sortCellsInMEDFileFrmt()

DataArrayIdType * 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
DataArrayIdType * - a new instance of DataArrayIdType. 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 getRenumArrForMEDFileFrmt(), and renumberCells().

◆ checkConsecutiveCellTypes()

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

Referenced by cellsByType().

◆ checkConsecutiveCellTypesForMEDFileFrmt()

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

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

Referenced by checkConsecutiveCellTypesForMEDFileFrmt(), and checkTypeConsistencyAndContig().

◆ getLevArrPerCellTypes()

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

This method returns 2 newly allocated DataArrayIdType 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 occurrence of type in 'this'.

References getNumberOfCells().

Referenced by getRenumArrForConsecutiveCellTypesSpec().

◆ getRenumArrForMEDFileFrmt()

DataArrayIdType * 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 correspondence.
See also
MEDCouplingUMesh::getRenumArrForConsecutiveCellTypesSpec, MEDCouplingUMesh::sortCellsInMEDFileFrmt.

References getRenumArrForConsecutiveCellTypesSpec().

Referenced by sortCellsInMEDFileFrmt(), WriteFieldT(), and WriteFieldUsingAlreadyWrittenMeshT().

◆ getRenumArrForConsecutiveCellTypesSpec()

DataArrayIdType * 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 specified 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 getLevArrPerCellTypes().

Referenced by getRenumArrForMEDFileFrmt().

◆ rearrange2ConsecutiveCellTypes()

DataArrayIdType * 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 correspondence old to new.

References computeTypes(), getNumberOfCells(), and renumberCells().

◆ splitByType()

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

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

References buildPartOfMySelf(), and getNumberOfCells().

◆ convertIntoSingleGeoTypeMesh()

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::MEDCoupling1SGTUMesh::setNodalConnectivity(), and MEDCoupling::MEDCoupling1DGTUMesh::setNodalConnectivity().

◆ convertNodalConnectivityToStaticGeoTypeMesh()

DataArrayIdType * MEDCouplingUMesh::convertNodalConnectivityToStaticGeoTypeMesh ( ) const

◆ convertNodalConnectivityToDynamicGeoTypeMesh()

void MEDCouplingUMesh::convertNodalConnectivityToDynamicGeoTypeMesh ( DataArrayIdType *&  nodalConn,
DataArrayIdType *&  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
nodalConnnodal connectivity
nodalConnIndexnodal connectivity indices

References getNumberOfCells().

Referenced by convertIntoSingleGeoTypeMesh().

◆ AggregateSortedByTypeMeshesOnSameCoords()

MEDCouplingUMesh * MEDCouplingUMesh::AggregateSortedByTypeMeshesOnSameCoords ( const std::vector< const MEDCouplingUMesh * > &  ms,
DataArrayIdType *&  szOfCellGrpOfSameType,
DataArrayIdType *&  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 particularly 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 DataArrayIdType 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 DataArrayIdType 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 MergeUMeshesOnSameCoords().

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

◆ keepCellIdsByType()

DataArrayIdType * MEDCouplingUMesh::keepCellIdsByType ( INTERP_KERNEL::NormalizedCellType  type,
const mcIdType *  begin,
const mcIdType *  end 
) const

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

◆ convertCellArrayPerGeoType()

DataArrayIdType * MEDCouplingUMesh::convertCellArrayPerGeoType ( const DataArrayIdType *  da) const

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

References getAllGeoTypes(), and getNumberOfCells().

◆ keepSpecifiedCells()

MEDCouplingUMesh * MEDCouplingUMesh::keepSpecifiedCells ( INTERP_KERNEL::NormalizedCellType  type,
const mcIdType *  idsPerGeoTypeBg,
const mcIdType *  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 buildPartOfMySelf(), MEDCoupling::MEDCouplingMesh::copyTinyInfoFrom(), and getDistributionOfTypes().

◆ getQuadraticStatus()

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 getNodalConnectivity(), getNodalConnectivityIndex(), and getNumberOfCells().

◆ mergeMyselfWith()

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.

◆ computeCellCenterOfMass()

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 degenerated meshes (not well oriented, cells with measure close to zero). Beware also that for quadratic meshes, degenerated arc of circles are turned into linear edges for the computation. This happens with a default detection precision of eps=1.0e-14. If you need control over this use computeCellCenterOfMassWithPrecision().

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
MEDCouplingUMesh::computeCellCenterOfMassWithPrecision

Implements MEDCoupling::MEDCouplingMesh.

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

Referenced by buildOrthogonalField(), and computeCellCenterOfMassWithPrecision().

◆ computeCellCenterOfMassWithPrecision()

DataArrayDouble * MEDCouplingUMesh::computeCellCenterOfMassWithPrecision ( double  eps) const

See computeCellCenterOfMass().

Parameters
epsa precision for the detection of degenerated arc of circles.
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
MEDCouplingUMesh::computeCellCenterOfMassWithPrecision

References computeCellCenterOfMass().

◆ computeIsoBarycenterOfNodesPerCell()

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 >::begin(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and MEDCoupling::DataArrayDouble::New().

◆ getPartBarycenterAndOwner()

DataArrayDouble * MEDCouplingUMesh::getPartBarycenterAndOwner ( const mcIdType *  begin,
const mcIdType *  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().

◆ computePlaneEquationOf3DFaces()

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 >::begin(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getNumberOfNodes(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), and MEDCoupling::DataArrayDouble::New().

◆ conformize2D()

DataArrayIdType * 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 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 invocation 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
DataArrayIdType * - 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 buildDescendingConnectivity(), buildPartOfMySelf(), checkConsistencyLight(), INTERP_KERNEL::Edge::decrRef(), MEDCoupling::MEDCouplingPointSet::getCoords(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), INTERP_KERNEL::Edge::intersectWith(), MEDCoupling::MEDCouplingPointSet::mergeNodes(), MEDCoupling::MEDCouplingPointSet::setCoords(), setPartOfMySelf(), and INTERP_KERNEL::Edge::sortSubNodesAbs().

◆ colinearize2D()

DataArrayIdType * 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 automatically. 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
DataArrayIdType * - 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.

◆ colinearizeKeepingConform2D()

DataArrayIdType * MEDCouplingUMesh::colinearizeKeepingConform2D ( double  eps)

Performs exactly the same job as colinearize2D, except that this function does not create new non-conformal cells. In a given 2D cell, if two edges are colinear and the junction point is used by a third edge, the two edges will not be merged, contrary to colinearize2D().

See also
MEDCouplingUMesh::colinearize2D

◆ conformize3D()

DataArrayIdType * 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.

WARNING this method only works for 'partition-like' non-conformities. When joining adjacent faces, the set of all small faces must fit exactly into the neighboring bigger face. No real face intersection is actually computed.

Parameters
[in]epsthe absolute (geometric) error to detect merged edges.
Returns
DataArrayIdType * - 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.
Ifthe 'partition-like' condition described above is not respected.
See also
MEDCouplingUMesh::mergeNodes, MEDCouplingUMesh::conformize2D, MEDCouplingUMesh::convertAllToPoly()

References MEDCoupling::MEDCouplingPointSet::_coords, MEDCoupling::DataArrayTemplate< T >::begin(), buildDescendingConnectivity(), buildDescendingConnectivity2(), checkConsistencyLight(), MEDCoupling::MEDCouplingPointSet::getCaracteristicDimension(), MEDCoupling::DataArrayTemplate< T >::getConstPointer(), MEDCoupling::MEDCouplingPointSet::getCoords(), MEDCoupling::DataArrayTemplate< T >::getIJ(), getMeshDimension(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), and MEDCoupling::MEDCouplingPointSet::getSpaceDimension().

◆ split2DCells()

mcIdType MEDCouplingUMesh::split2DCells ( const DataArrayIdType *  desc,
const DataArrayIdType *  descI,
const DataArrayIdType *  subNodesInSeg,
const DataArrayIdType *  subNodesInSegI,
const DataArrayIdType *  midOpt = 0,
const DataArrayIdType *  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
mcIdType - 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 getMeshDimension(), and MEDCoupling::MEDCouplingPointSet::getSpaceDimension().

◆ Build0DMeshFromCoords()

MEDCouplingUMesh * MEDCouplingUMesh::Build0DMeshFromCoords ( DataArrayDouble da)
static

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

References MEDCoupling::DataArrayTemplate< T >::checkAllocated(), MEDCoupling::DataArray::getName(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), and New().

Referenced by explodeMeshTo().

◆ Build1DMeshFromCoords()

◆ MergeUMeshes() [1/2]

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

◆ MergeUMeshes() [2/2]

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

◆ MergeUMeshesOnSameCoords() [1/2]

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

◆ MergeUMeshesOnSameCoords() [2/2]

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 >::front(), New(), setConnectivity(), MEDCoupling::MEDCouplingPointSet::setCoords(), setMeshDimension(), and MEDCoupling::MEDCouplingMesh::setName().

◆ FuseUMeshesOnSameCoords()

MEDCouplingUMesh * MEDCouplingUMesh::FuseUMeshesOnSameCoords ( const std::vector< const MEDCouplingUMesh * > &  meshes,
int  compType,
std::vector< DataArrayIdType * > &  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 DataArrayIdType, 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::MEDCouplingMesh::getName(), and MergeUMeshesOnSameCoords().

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

◆ PutUMeshesOnSameAggregatedCoords()

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

◆ MergeNodesOnUMeshesSharingSameCoords()

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 particularly 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::DataArrayDouble::findCommonTuples(), MEDCoupling::DataArrayTemplate< T >::getNumberOfTuples(), and MEDCoupling::DataArrayTemplate< T >::renumberAndReduce().

◆ IsPolygonWellOriented()

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

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

Referenced by are2DCellsNotCorrectlyOriented(), and orientCorrectly2DCells().

◆ IsPolyhedronWellOriented()

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

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

References EPS_FOR_POLYH_ORIENTATION.

Referenced by arePolyhedronsNotCorrectlyOriented(), findAndCorrectBadOriented3DCells(), and orientCorrectlyPolyhedrons().

◆ Is3DExtrudedStaticCellWellOriented()

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

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

Referenced by findAndCorrectBadOriented3DCells(), and findAndCorrectBadOriented3DExtrudedCells().

◆ CorrectExtrudedStaticCell()

void MEDCouplingUMesh::CorrectExtrudedStaticCell ( mcIdType *  begin,
mcIdType *  end 
)
static

◆ IsTetra4WellOriented()

bool MEDCouplingUMesh::IsTetra4WellOriented ( const mcIdType *  begin,
const mcIdType *  end,
const double *  coords 
)
static

◆ IsPyra5WellOriented()

bool MEDCouplingUMesh::IsPyra5WellOriented ( const mcIdType *  begin,
const mcIdType *  end,
const double *  coords 
)
static

◆ SimplifyPolyhedronCell()

void MEDCouplingUMesh::SimplifyPolyhedronCell ( double  eps,
const DataArrayDouble coords,
mcIdType  index,
DataArrayIdType *  res,
MEDCouplingUMesh faces,
DataArrayIdType *  E_Fi,
DataArrayIdType *  E_F,
DataArrayIdType *  F_Ei,
DataArrayIdType *  F_E 
)
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]indexbegin of the nodal connectivity (geometric type included) of a single polyhedron cell
[out]resthe result is put at the end of the vector without any alteration of the data.

References MEDCoupling::DataArrayTemplate< T >::begin(), buildPartOfMySelf(), ComputeVecAndPtOfFace(), getNodalConnectivity(), getNodalConnectivityIndex(), MEDCoupling::DataArrayDouble::New(), INTERP_KERNEL::EdgeArcCircle::SafeAsin(), and zipCoordsTraducer().

Referenced by simplifyPolyhedra().

◆ ComputeVecAndPtOfFace()

void MEDCouplingUMesh::ComputeVecAndPtOfFace ( double  eps,
const double *  coords,
const mcIdType *  begin,
const mcIdType *  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().

◆ TryToCorrectPolyhedronOrientation()

void MEDCouplingUMesh::TryToCorrectPolyhedronOrientation ( mcIdType *  begin,
mcIdType *  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().

◆ Intersect2DMeshes()

MEDCouplingUMesh * MEDCouplingUMesh::Intersect2DMeshes ( const MEDCouplingUMesh m1,
const MEDCouplingUMesh m2,
double  eps,
DataArrayIdType *&  cellNb1,
DataArrayIdType *&  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. WARNING: the two meshes should be correctly oriented for this method to work properly. Methods changeSpaceDimension() and orientCorrectly2DCells() can be used for this. WARNING: the two meshes should be "clean" (no un-merged nodes, no non-conformal cells)

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 DataArrayIdType 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 DataArrayIdType 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::MEDCouplingPointSet::getCoords(), getMeshDimension(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MEDCoupling::DataArrayDouble::New(), and New().

◆ Intersect2DMeshWith1DLine()

void MEDCouplingUMesh::Intersect2DMeshWith1DLine ( const MEDCouplingUMesh mesh2D,
const MEDCouplingUMesh mesh1D,
double  eps,
MEDCouplingUMesh *&  splitMesh2D,
MEDCouplingUMesh *&  splitMesh1D,
DataArrayIdType *&  cellIdInMesh2D,
DataArrayIdType *&  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 finally, 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.

WARNING: the 2D mesh should be correctly oriented for this method to work properly. Methods changeSpaceDimension() and orientCorrectly2DCells() can be used for this. WARNING: the two meshes should be "clean" (no un-merged nodes, no non-conformal cells)

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 buildDescendingConnectivity2(), buildPartOfMySelf(), MEDCoupling::C_DEALLOC, getCellsContainingPoints(), MEDCoupling::MEDCouplingPointSet::getCoords(), MEDCoupling::DataArray::getInfoOnComponents(), getMeshDimension(), getNumberOfCells(), MEDCoupling::MEDCouplingPointSet::getSpaceDimension(), MergeUMeshesOnSameCoords(), and MEDCoupling::DataArrayDouble::New().

◆ BuildConvexEnvelopOf2DCellJarvis()

bool MEDCouplingUMesh::BuildConvexEnvelopOf2DCellJarvis ( const double *  coords,
const mcIdType *  nodalConnBg,
const mcIdType *  nodalConnEnd,
DataArrayIdType *  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().

Referenced by convexEnvelop2D().

◆ PartitionBySpreadZone()

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

Referenced by partitionBySpreadZone().

◆ ComputeSpreadZoneGradually()

DataArrayIdType * MEDCouplingUMesh::ComputeSpreadZoneGradually ( const DataArrayIdType *  arrIn,
const DataArrayIdType *  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 DataArrayIdType. 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().

◆ ComputeSpreadZoneGraduallyFromSeed()

DataArrayIdType * MEDCouplingUMesh::ComputeSpreadZoneGraduallyFromSeed ( const mcIdType *  seedBg,
const mcIdType *  seedEnd,
const DataArrayIdType *  arrIn,
const DataArrayIdType *  arrIndxIn,
mcIdType  nbOfDepthPeeling,
mcIdType &  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 DataArrayIdType. 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

Referenced by ComputeSpreadZoneGradually(), and findCellsToRenumber().

◆ FindCommonCellsAlg()

void MEDCouplingUMesh::FindCommonCellsAlg ( int  compType,
mcIdType  startCellId,
const DataArrayIdType *  nodal,
const DataArrayIdType *  nodalI,
const DataArrayIdType *  revNodal,
const DataArrayIdType *  revNodalI,
DataArrayIdType *&  commonCellsArr,
DataArrayIdType *&  commonCellsIArr 
)
static

Referenced by findCommonCells().

◆ buildUnionOf2DMesh()

DataArrayIdType * 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(), and MEDCoupling::MEDCouplingPointSet::getSpaceDimension().

Referenced by buildSpreadZonesWithPoly().

◆ buildUnionOf3DMesh()

DataArrayIdType * MEDCouplingUMesh::buildUnionOf3DMesh ( ) const

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

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

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

◆ orderConsecutiveCells1D()

DataArrayIdType * 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 DataArrayIdType.

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
DataArrayIdType::sortEachPairToMakeALinkedList

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

◆ generateGraph()

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 getMeshDimension(), getNodalConnectivity(), getNodalConnectivityIndex(), getNumberOfCells(), and getReverseNodalConnectivity().

Member Data Documentation

◆ EPS_FOR_POLYH_ORIENTATION

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