X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCoupling1GTUMesh.hxx;h=b69f9b13021c8a7300d3adbf47855485f01a9501;hb=e7835cba1eb17f50ef4e130c2cb8d0f54bc25083;hp=3ccb85cb51ade26f3cec4c832ee99d8040bf2edc;hpb=56fddf07c0b7170f79791d38e2b909a8a5b0b872;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCoupling1GTUMesh.hxx b/src/MEDCoupling/MEDCoupling1GTUMesh.hxx index 3ccb85cb5..b69f9b130 100644 --- a/src/MEDCoupling/MEDCoupling1GTUMesh.hxx +++ b/src/MEDCoupling/MEDCoupling1GTUMesh.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -22,13 +22,14 @@ #define __PARAMEDMEM_MEDCOUPLING1GTUMESH_HXX__ #include "MEDCoupling.hxx" +#include "MCType.hxx" #include "MEDCouplingPointSet.hxx" #include "MEDCouplingMemArray.hxx" -#include "MEDCouplingAutoRefCountObjectPtr.hxx" +#include "MCAuto.hxx" #include "CellModel.hxx" -namespace ParaMEDMEM +namespace MEDCoupling { class MEDCoupling1GTUUMeshCellIterator; @@ -41,25 +42,26 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT INTERP_KERNEL::NormalizedCellType getCellModelEnum() const; MEDCOUPLING_EXPORT int getMeshDimension() const; MEDCOUPLING_EXPORT DataArrayInt *giveCellsWithType(INTERP_KERNEL::NormalizedCellType type) const; - MEDCOUPLING_EXPORT int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const; - MEDCOUPLING_EXPORT INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const; + MEDCOUPLING_EXPORT std::size_t getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const; + MEDCOUPLING_EXPORT INTERP_KERNEL::NormalizedCellType getTypeOfCell(std::size_t cellId) const; MEDCOUPLING_EXPORT std::set getAllGeoTypes() const; MEDCOUPLING_EXPORT std::vector getDistributionOfTypes() 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 DataArrayInt *checkTypeConsistencyAndContig(const std::vector& code, const std::vector& idsPerType) const; MEDCOUPLING_EXPORT void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const; MEDCOUPLING_EXPORT std::string getVTKDataSetType() const; MEDCOUPLING_EXPORT std::string getVTKFileExtension() const; // MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDCOUPLING_EXPORT int getNodalConnectivityLength() const; + MEDCOUPLING_EXPORT std::size_t getNodalConnectivityLength() const; MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const; MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const; - MEDCOUPLING_EXPORT void checkCoherency() const; - MEDCOUPLING_EXPORT DataArrayDouble *getBarycenterAndOwner() const; + MEDCOUPLING_EXPORT void checkConsistencyLight() const; + MEDCOUPLING_EXPORT DataArrayDouble *computeCellCenterOfMass() const; MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureField(bool isAbs) const; MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) 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 MEDCouplingFieldDouble *buildOrthogonalField() const; MEDCOUPLING_EXPORT DataArrayInt *getCellsInBoundingBox(const double *bbox, double eps) const; MEDCOUPLING_EXPORT DataArrayInt *getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox& bbox, double eps); @@ -72,7 +74,7 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT virtual void allocateCells(int nbOfCells=0) = 0; MEDCOUPLING_EXPORT virtual void insertNextCell(const int *nodalConnOfCellBg, const int *nodalConnOfCellEnd) = 0; MEDCOUPLING_EXPORT virtual DataArrayInt *getNodalConnectivity() const = 0; - MEDCOUPLING_EXPORT virtual void checkCoherencyOfConnectivity() const = 0; + MEDCOUPLING_EXPORT virtual void checkConsistencyOfConnectivity() const = 0; protected: MEDCoupling1GTUMesh(const std::string& name, const INTERP_KERNEL::CellModel& cm); MEDCoupling1GTUMesh(const MEDCoupling1GTUMesh& other, bool recDeepCpy); @@ -91,26 +93,27 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m); //! useless constructor only for CORBA -> not swigged MEDCOUPLING_EXPORT static MEDCoupling1SGTUMesh *New(); + // Copy methods MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh *clone(bool recDeepCpy) const; - MEDCOUPLING_EXPORT MEDCouplingPointSet *deepCpyConnectivityOnly() const; + MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh *deepCopy() const; + MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh *deepCopyConnectivityOnly() const; // overload of TimeLabel and RefCountObject MEDCOUPLING_EXPORT void updateTime() const; MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDCOUPLING_EXPORT std::vector getDirectChildrenWithNull() const; // overload of MEDCouplingMesh MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED; } - MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const; + MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const; MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const; MEDCOUPLING_EXPORT void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const; - MEDCOUPLING_EXPORT void checkCoherency() const; - MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const; - MEDCOUPLING_EXPORT void checkCoherency2(double eps=1e-12) const; - MEDCOUPLING_EXPORT int getNumberOfCells() const; + MEDCOUPLING_EXPORT void checkConsistencyLight() const; + MEDCOUPLING_EXPORT void checkConsistency(double eps=1e-12) const; + MEDCOUPLING_EXPORT std::size_t getNumberOfCells() const; MEDCOUPLING_EXPORT DataArrayInt *computeNbOfNodesPerCell() const; MEDCOUPLING_EXPORT DataArrayInt *computeNbOfFacesPerCell() const; MEDCOUPLING_EXPORT DataArrayInt *computeEffectiveNbOfNodesPerCell() const; - MEDCOUPLING_EXPORT void getNodeIdsOfCell(int cellId, std::vector& conn) 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 DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const; @@ -123,7 +126,7 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other); MEDCOUPLING_EXPORT MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const; MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoords(const int *begin, const int *end) const; - MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoords2(int start, int end, int step) const; + MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const; MEDCOUPLING_EXPORT void computeNodeIdsAlg(std::vector& nodeIdsInUse) const; MEDCOUPLING_EXPORT void getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const; MEDCOUPLING_EXPORT void checkFullyDefined() const; @@ -136,8 +139,10 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT void fillCellIdsToKeepFromNodeIds(const int *begin, const int *end, bool fullyIn, DataArrayInt *&cellIdsKeptArr) const; MEDCOUPLING_EXPORT int getNumberOfNodesInCell(int cellId) const; MEDCOUPLING_EXPORT DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const; + MEDCOUPLING_EXPORT MEDCouplingFieldDouble *computeDiameterField() const; + MEDCOUPLING_EXPORT void invertOrientationOfAllCells(); // overload of MEDCoupling1GTUMesh - MEDCOUPLING_EXPORT void checkCoherencyOfConnectivity() const; + MEDCOUPLING_EXPORT void checkConsistencyOfConnectivity() const; MEDCOUPLING_EXPORT void allocateCells(int nbOfCells=0); MEDCOUPLING_EXPORT void insertNextCell(const int *nodalConnOfCellBg, const int *nodalConnOfCellEnd); public://specific @@ -172,7 +177,7 @@ namespace ParaMEDMEM MEDCoupling1DGTUMesh *computeDualMesh3D() const; MEDCoupling1DGTUMesh *computeDualMesh2D() const; private: - MEDCouplingAutoRefCountObjectPtr _conn; + MCAuto _conn; public: static const int HEXA8_FACE_PAIRS[6]; }; @@ -184,26 +189,27 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m); //! useless constructor only for CORBA -> not swigged MEDCOUPLING_EXPORT static MEDCoupling1DGTUMesh *New(); + // Copy methods MEDCOUPLING_EXPORT MEDCoupling1DGTUMesh *clone(bool recDeepCpy) const; - MEDCOUPLING_EXPORT MEDCouplingPointSet *deepCpyConnectivityOnly() const; + MEDCOUPLING_EXPORT MEDCoupling1DGTUMesh *deepCopy() const; + MEDCOUPLING_EXPORT MEDCoupling1DGTUMesh *deepCopyConnectivityOnly() const; + // overload of TimeLabel and RefCountObject MEDCOUPLING_EXPORT void updateTime() const; MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDCOUPLING_EXPORT std::vector getDirectChildrenWithNull() const; // overload of MEDCouplingMesh MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED; } - MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const; MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const; MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const; MEDCOUPLING_EXPORT void checkFastEquivalWith(const MEDCouplingMesh *other, double prec) const; - MEDCOUPLING_EXPORT void checkCoherency() const; - MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const; - MEDCOUPLING_EXPORT void checkCoherency2(double eps=1e-12) const; - MEDCOUPLING_EXPORT int getNumberOfCells() const; + MEDCOUPLING_EXPORT void checkConsistencyLight() const; + MEDCOUPLING_EXPORT void checkConsistency(double eps=1e-12) const; + MEDCOUPLING_EXPORT std::size_t getNumberOfCells() const; MEDCOUPLING_EXPORT DataArrayInt *computeNbOfNodesPerCell() const; MEDCOUPLING_EXPORT DataArrayInt *computeNbOfFacesPerCell() const; MEDCOUPLING_EXPORT DataArrayInt *computeEffectiveNbOfNodesPerCell() const; - MEDCOUPLING_EXPORT void getNodeIdsOfCell(int cellId, std::vector& conn) 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 DataArrayDouble *computeIsoBarycenterOfNodesPerCell() const; @@ -216,7 +222,7 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other); MEDCOUPLING_EXPORT MEDCouplingPointSet *mergeMyselfWithOnSameCoords(const MEDCouplingPointSet *other) const; MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoords(const int *begin, const int *end) const; - MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoords2(int start, int end, int step) const; + MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfKeepCoordsSlice(int start, int end, int step) const; MEDCOUPLING_EXPORT void computeNodeIdsAlg(std::vector& nodeIdsInUse) const; MEDCOUPLING_EXPORT void getReverseNodalConnectivity(DataArrayInt *revNodal, DataArrayInt *revNodalIndx) const; MEDCOUPLING_EXPORT void checkFullyDefined() const; @@ -229,8 +235,10 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT void fillCellIdsToKeepFromNodeIds(const int *begin, const int *end, bool fullyIn, DataArrayInt *&cellIdsKeptArr) const; MEDCOUPLING_EXPORT int getNumberOfNodesInCell(int cellId) const; MEDCOUPLING_EXPORT DataArrayDouble *getBoundingBoxForBBTree(double arcDetEps=1e-12) const; + MEDCOUPLING_EXPORT MEDCouplingFieldDouble *computeDiameterField() const; + MEDCOUPLING_EXPORT void invertOrientationOfAllCells(); // overload of MEDCoupling1GTUMesh - MEDCOUPLING_EXPORT void checkCoherencyOfConnectivity() const; + MEDCOUPLING_EXPORT void checkConsistencyOfConnectivity() const; MEDCOUPLING_EXPORT void allocateCells(int nbOfCells=0); MEDCOUPLING_EXPORT void insertNextCell(const int *nodalConnOfCellBg, const int *nodalConnOfCellEnd); public://specific @@ -260,8 +268,8 @@ namespace ParaMEDMEM void checkDynamicGeoT2ype() const; static MEDCoupling1DGTUMesh *Merge1DGTUMeshesLL(std::vector& a); private: - MEDCouplingAutoRefCountObjectPtr _conn_indx; - MEDCouplingAutoRefCountObjectPtr _conn; + MCAuto _conn_indx; + MCAuto _conn; }; }