X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingUMesh.hxx;h=8a6dc0b4936d48f710bc29b6d7e79429d975027e;hb=06a1e47785f4fc717910e0ba2fd562a238e5e932;hp=9f1a8606ff189520b0614cd31257371c0b8fca5d;hpb=c5f9a2bb5f775564b5bd81de58dfa708bcef020d;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingUMesh.hxx b/src/MEDCoupling/MEDCouplingUMesh.hxx index 9f1a8606f..8a6dc0b49 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.hxx +++ b/src/MEDCoupling/MEDCouplingUMesh.hxx @@ -71,17 +71,17 @@ namespace MEDCoupling MEDCOUPLING_EXPORT const DataArrayInt *getNodalConnectivityIndex() const { return _nodal_connec_index; } MEDCOUPLING_EXPORT DataArrayInt *getNodalConnectivity() { return _nodal_connec; } MEDCOUPLING_EXPORT DataArrayInt *getNodalConnectivityIndex() { return _nodal_connec_index; } - MEDCOUPLING_EXPORT INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const; + MEDCOUPLING_EXPORT INTERP_KERNEL::NormalizedCellType getTypeOfCell(std::size_t cellId) const; MEDCOUPLING_EXPORT DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const; - MEDCOUPLING_EXPORT int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const; - MEDCOUPLING_EXPORT void getNodeIdsOfCell(int cellId, std::vector& conn) const; + MEDCOUPLING_EXPORT std::size_t getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const; + MEDCOUPLING_EXPORT void getNodeIdsOfCell(std::size_t cellId, std::vector& conn) const; MEDCOUPLING_EXPORT std::string simpleRepr() const; MEDCOUPLING_EXPORT std::string advancedRepr() const; MEDCOUPLING_EXPORT std::string cppRepr() const; MEDCOUPLING_EXPORT std::string reprConnectivityOfThis() const; MEDCOUPLING_EXPORT MEDCouplingUMesh *buildSetInstanceFromThis(int spaceDim) const; MEDCOUPLING_EXPORT int getNumberOfNodesInCell(int cellId) const; - MEDCOUPLING_EXPORT int getNumberOfCells() const; + MEDCOUPLING_EXPORT std::size_t getNumberOfCells() const; MEDCOUPLING_EXPORT int getMeshDimension() const; MEDCOUPLING_EXPORT int getNodalConnectivityArrayLen() const; MEDCOUPLING_EXPORT void computeTypes(); @@ -149,6 +149,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT void renumberNodesWithOffsetInConn(int offset); MEDCOUPLING_EXPORT void renumberNodesInConn(const INTERP_KERNEL::HashMap& newNodeNumbersO2N); MEDCOUPLING_EXPORT void renumberNodesInConn(const int *newNodeNumbersO2N); + MEDCOUPLING_EXPORT void renumberNodesInConn(const std::map& newNodeNumbersO2N) override; MEDCOUPLING_EXPORT void shiftNodeNumbersInConn(int delta); MEDCOUPLING_EXPORT void duplicateNodesInConn(const int *nodeIdsToDuplicateBg, const int *nodeIdsToDuplicateEnd, int offset); MEDCOUPLING_EXPORT void renumberCells(const int *old2NewBg, bool check=true); @@ -170,7 +171,8 @@ namespace MEDCoupling MEDCOUPLING_EXPORT DataArrayDouble *distanceToPoints(const DataArrayDouble *pts, DataArrayInt *& cellIds) const; MEDCOUPLING_EXPORT int getCellContainingPoint(const double *pos, double eps) const; MEDCOUPLING_EXPORT void getCellsContainingPoint(const double *pos, double eps, std::vector& elts) const; - MEDCOUPLING_EXPORT void getCellsContainingPoints(const double *pos, int nbOfPoints, double eps, MCAuto& elts, MCAuto& eltsIndex) const; + MEDCOUPLING_EXPORT void getCellsContainingPoints(const double *pos, int nbOfPoints, double eps, MCAuto& elts, MCAuto& eltsIndex) const override; + MEDCOUPLING_EXPORT void getCellsContainingPointsLinearPartOnlyOnNonDynType(const double *pos, int nbOfPoints, double eps, MCAuto& elts, MCAuto& eltsIndex) const override; MEDCOUPLING_EXPORT void checkButterflyCells(std::vector& cells, double eps=1e-12) const; MEDCOUPLING_EXPORT DataArrayInt *convexEnvelop2D(); MEDCOUPLING_EXPORT DataArrayInt *findAndCorrectBadOriented3DExtrudedCells(); @@ -189,6 +191,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT DataArrayInt *simplexize(int policy); MEDCOUPLING_EXPORT bool areOnlySimplexCells() const; MEDCOUPLING_EXPORT void convertDegeneratedCells(); + MEDCOUPLING_EXPORT DataArrayInt *convertDegeneratedCellsAndRemoveFlatOnes(); MEDCOUPLING_EXPORT void are2DCellsNotCorrectlyOriented(const double *vec, bool polyOnly, std::vector& cells) const; MEDCOUPLING_EXPORT void orientCorrectly2DCells(const double *vec, bool polyOnly); MEDCOUPLING_EXPORT void changeOrientationOfCells(); @@ -196,6 +199,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT void orientCorrectlyPolyhedrons(); MEDCOUPLING_EXPORT void invertOrientationOfAllCells(); MEDCOUPLING_EXPORT void getFastAveragePlaneOfThis(double *vec, double *pos) const; + MEDCOUPLING_EXPORT void attractSeg3MidPtsAroundNodes(double ratio, const int *nodeIdsBg, const int *nodeIdsEnd); //Mesh quality MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getEdgeRatioField() const; MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getAspectRatioField() const; @@ -205,7 +209,7 @@ namespace MEDCoupling //utilities for MED File RW MEDCOUPLING_EXPORT std::vector getDistributionOfTypes() const; MEDCOUPLING_EXPORT DataArrayInt *checkTypeConsistencyAndContig(const std::vector& code, const std::vector& idsPerType) const; - MEDCOUPLING_EXPORT void splitProfilePerType(const DataArrayInt *profile, std::vector& code, std::vector& idsInPflPerType, std::vector& idsPerType) const; + MEDCOUPLING_EXPORT void splitProfilePerType(const DataArrayInt *profile, std::vector& code, std::vector& idsInPflPerType, std::vector& idsPerType, bool smartPflKiller=true) const; MEDCOUPLING_EXPORT MEDCouplingUMesh *emulateMEDMEMBDC(const MEDCouplingUMesh *nM1LevMesh, DataArrayInt *desc, DataArrayInt *descIndx, DataArrayInt *&revDesc, DataArrayInt *&revDescIndx, DataArrayInt *& nM1LevMeshIds, DataArrayInt *&meshnM1Old2New) const; MEDCOUPLING_EXPORT DataArrayInt *sortCellsInMEDFileFrmt(); MEDCOUPLING_EXPORT bool checkConsecutiveCellTypes() const; @@ -234,6 +238,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT DataArrayDouble *computePlaneEquationOf3DFaces() const; MEDCOUPLING_EXPORT DataArrayInt *conformize2D(double eps); MEDCOUPLING_EXPORT DataArrayInt *colinearize2D(double eps); + MEDCOUPLING_EXPORT DataArrayInt *colinearizeKeepingConform2D(double eps); MEDCOUPLING_EXPORT DataArrayInt *conformize3D(double eps); MEDCOUPLING_EXPORT int split2DCells(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *subNodesInSeg, const DataArrayInt *subNodesInSegI, const DataArrayInt *midOpt=0, const DataArrayInt *midOptI=0); MEDCOUPLING_EXPORT static MEDCouplingUMesh *Build0DMeshFromCoords(DataArrayDouble *da); @@ -251,7 +256,8 @@ namespace MEDCoupling MEDCOUPLING_EXPORT static void CorrectExtrudedStaticCell(int *begin, int *end); MEDCOUPLING_EXPORT static bool IsTetra4WellOriented(const int *begin, const int *end, const double *coords); MEDCOUPLING_EXPORT static bool IsPyra5WellOriented(const int *begin, const int *end, const double *coords); - MEDCOUPLING_EXPORT static void SimplifyPolyhedronCell(double eps, const DataArrayDouble *coords, const int *begin, const int *end, DataArrayInt *res); + MEDCOUPLING_EXPORT static void SimplifyPolyhedronCell(double eps, const DataArrayDouble *coords, int index, DataArrayInt *res, MEDCouplingUMesh *faces, + DataArrayInt *E_Fi, DataArrayInt *E_F, DataArrayInt *F_Ei, DataArrayInt *F_E); MEDCOUPLING_EXPORT static void ComputeVecAndPtOfFace(double eps, const double *coords, const int *begin, const int *end, double *v, double *p); MEDCOUPLING_EXPORT static void TryToCorrectPolyhedronOrientation(int *begin, int *end, const double *coords); MEDCOUPLING_EXPORT static MEDCouplingUMesh *Intersect2DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps, DataArrayInt *&cellNb1, DataArrayInt *&cellNb2); @@ -318,7 +324,10 @@ namespace MEDCoupling DataArrayInt *buildUnionOf2DMeshQuadratic(const MEDCouplingUMesh *skin, const DataArrayInt *n2o) const; template void getCellsContainingPointsAlg(const double *coords, const double *pos, int nbOfPoints, - double eps, MCAuto& elts, MCAuto& eltsIndex) const; + double eps, MCAuto& elts, MCAuto& eltsIndex, std::function sensibilityTo2DQuadraticLinearCellsFunc) const; + void getCellsContainingPointsZeAlg(const double *pos, int nbOfPoints, double eps, + MCAuto& elts, MCAuto& eltsIndex, + std::function sensibilityTo2DQuadraticLinearCellsFunc) const; /// @cond INTERNAL static MEDCouplingUMesh *MergeUMeshesLL(const std::vector& a); typedef int (*DimM1DescNbrer)(int id, unsigned nb, const INTERP_KERNEL::CellModel& cm, bool compute, const int *conn1, const int *conn2); @@ -348,16 +357,20 @@ namespace MEDCoupling void buildSubCellsFromCut(const std::vector< std::pair >& cut3DSurf, const int *desc, const int *descIndx, const double *coords, double eps, std::vector >& res) const; void split2DCellsLinear(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *subNodesInSeg, const DataArrayInt *subNodesInSegI); int split2DCellsQuadratic(const DataArrayInt *desc, const DataArrayInt *descI, const DataArrayInt *subNodesInSeg, const DataArrayInt *subNodesInSegI, const DataArrayInt *mid, const DataArrayInt *midI); - static bool Colinearize2DCell(const double *coords, const int *connBg, const int *connEnd, int offset, DataArrayInt *newConnOfCell, DataArrayDouble *appendedCoords); + static bool Colinearize2DCell(const double *coords, const int *connBg, const int *connEnd, int offset, const std::map& forbiddenPoints, DataArrayInt *newConnOfCell, DataArrayDouble *appendedCoords); static void ComputeAllTypesInternal(std::set& types, const DataArrayInt *nodalConnec, const DataArrayInt *nodalConnecIndex); static bool OrderPointsAlongLine(const double * coo, int startNode, int endNode, const int * c, const int * cI, const int *idsBg, const int *endBg, std::vector & pointIds, std::vector & hitSegs); static void ReplaceEdgeInFace(const int * sIdxConn, const int * sIdxConnE, int startNode, int endNode, const std::vector& insidePoints, std::vector& modifiedFace); + void attractSeg3MidPtsAroundNodesUnderground(double ratio, const int *nodeIdsBg, const int *nodeIdsEnd); + DataArrayInt *internalColinearize2D(double eps, bool stayConform); + template + void renumberNodesInConnT(const MAPCLS& newNodeNumbersO2N); public: MEDCOUPLING_EXPORT static DataArrayInt *ComputeRangesFromTypeDistribution(const std::vector& code); - MEDCOUPLING_EXPORT static const int N_MEDMEM_ORDER=24; + MEDCOUPLING_EXPORT static const int N_MEDMEM_ORDER=25; MEDCOUPLING_EXPORT static const INTERP_KERNEL::NormalizedCellType MEDMEM_ORDER[N_MEDMEM_ORDER]; MEDCOUPLING_EXPORT static const int MEDCOUPLING2VTKTYPETRADUCER[INTERP_KERNEL::NORM_MAXTYPE+1]; /// @endcond