00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __PARAMEDMEM_MEDCOUPLINGUMESHDESC_HXX__
00021 #define __PARAMEDMEM_MEDCOUPLINGUMESHDESC_HXX__
00022
00023 #include "MEDCouplingPointSet.hxx"
00024 #include "MEDCoupling.hxx"
00025 #include "NormalizedUnstructuredMesh.hxx"
00026
00027 #include <set>
00028
00029 namespace ParaMEDMEM
00030 {
00031 class MEDCouplingUMeshDesc : public MEDCouplingPointSet
00032 {
00033 public:
00034 MEDCOUPLING_EXPORT static MEDCouplingUMeshDesc *New();
00035 MEDCOUPLING_EXPORT static MEDCouplingUMeshDesc *New(const char *meshName, int meshDim);
00036 MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const;
00037 MEDCOUPLING_EXPORT void checkCoherency() const throw(INTERP_KERNEL::Exception);
00038 MEDCOUPLING_EXPORT void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
00039 MEDCOUPLING_EXPORT void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
00040 MEDCOUPLING_EXPORT void checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
00041 DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const throw(INTERP_KERNEL::Exception);
00042 MEDCOUPLING_EXPORT void checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
00043 DataArrayInt *&cellCor) const throw(INTERP_KERNEL::Exception);
00044 MEDCOUPLING_EXPORT void setMeshDimension(unsigned meshDim);
00045 MEDCOUPLING_EXPORT int getNumberOfCells() const;
00046 MEDCOUPLING_EXPORT int getNumberOfFaces() const;
00047 MEDCOUPLING_EXPORT int getCellMeshLength() const;
00048 MEDCOUPLING_EXPORT int getFaceMeshLength() const;
00049 MEDCOUPLING_EXPORT int getMeshDimension() const { return _mesh_dim; }
00050 MEDCOUPLING_EXPORT INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
00051 MEDCOUPLING_EXPORT std::set<INTERP_KERNEL::NormalizedCellType> getAllGeoTypes() const;
00052 MEDCOUPLING_EXPORT int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
00053 MEDCOUPLING_EXPORT void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
00054 MEDCOUPLING_EXPORT void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const;
00055 MEDCOUPLING_EXPORT std::string simpleRepr() const;
00056 MEDCOUPLING_EXPORT std::string advancedRepr() const;
00057 MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return UNSTRUCTURED_DESC; }
00058 MEDCOUPLING_EXPORT void setConnectivity(DataArrayInt *descConn, DataArrayInt *descConnIndex, DataArrayInt *nodalFaceConn, DataArrayInt *nodalFaceConnIndx);
00059
00060 MEDCOUPLING_EXPORT DataArrayInt *checkTypeConsistencyAndContig(const std::vector<int>& code, const std::vector<const DataArrayInt *>& idsPerType) const throw(INTERP_KERNEL::Exception);
00061 MEDCOUPLING_EXPORT void splitProfilePerType(const DataArrayInt *profile, std::vector<int>& code, std::vector<DataArrayInt *>& globIdsPerType, std::vector<DataArrayInt *>& idsPerType) const throw(INTERP_KERNEL::Exception);
00062 MEDCOUPLING_EXPORT void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
00063 MEDCOUPLING_EXPORT bool isEmptyMesh(const std::vector<int>& tinyInfo) const;
00064 MEDCOUPLING_EXPORT void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const;
00065 MEDCOUPLING_EXPORT void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
00066 MEDCOUPLING_EXPORT void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2, const std::vector<std::string>& littleStrings);
00067 MEDCOUPLING_EXPORT void getCellsInBoundingBox(const double *bbox, double eps, std::vector<int>& elems);
00068 MEDCOUPLING_EXPORT void getCellsInBoundingBox(const INTERP_KERNEL::DirectedBoundingBox &bbox, double eps, std::vector<int>& elems);
00069 MEDCOUPLING_EXPORT DataArrayInt *mergeNodes(double precision, bool& areNodesMerged, int& newNbOfNodes);
00070 MEDCOUPLING_EXPORT DataArrayInt *mergeNodes2(double precision, bool& areNodesMerged, int& newNbOfNodes);
00071 MEDCOUPLING_EXPORT void tryToShareSameCoordsPermute(const MEDCouplingPointSet& other, double epsilon) throw(INTERP_KERNEL::Exception);
00072 MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelf(const int *start, const int *end, bool keepCoords) const;
00073 MEDCOUPLING_EXPORT MEDCouplingPointSet *buildPartOfMySelfNode(const int *start, const int *end, bool fullyIn) const;
00074 MEDCOUPLING_EXPORT MEDCouplingPointSet *buildFacePartOfMySelfNode(const int *start, const int *end, bool fullyIn) const;
00075 MEDCOUPLING_EXPORT DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
00076 MEDCOUPLING_EXPORT void findBoundaryNodes(std::vector<int>& nodes) const;
00077 MEDCOUPLING_EXPORT MEDCouplingPointSet *buildBoundaryMesh(bool keepCoords) const;
00078 MEDCOUPLING_EXPORT MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
00079 MEDCOUPLING_EXPORT void renumberCells(const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception);
00080 MEDCOUPLING_EXPORT void renumberNodes(const int *newNodeNumbers, int newNbOfNodes);
00081 MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureField(bool isAbs) const;
00082 MEDCOUPLING_EXPORT MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const;
00083 MEDCOUPLING_EXPORT int getCellContainingPoint(const double *pos, double eps) const;
00084 MEDCOUPLING_EXPORT MEDCouplingFieldDouble *buildOrthogonalField() const;
00085 MEDCOUPLING_EXPORT DataArrayInt *zipCoordsTraducer();
00086 MEDCOUPLING_EXPORT MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
00087 MEDCOUPLING_EXPORT DataArrayDouble *getBarycenterAndOwner() const;
00088 private:
00089 MEDCouplingUMeshDesc();
00090 ~MEDCouplingUMeshDesc();
00091 void computeTypes();
00092 void checkFullyDefined() const throw(INTERP_KERNEL::Exception);
00093 private:
00094 int _mesh_dim;
00095 DataArrayInt *_desc_connec;
00096 DataArrayInt *_desc_connec_index;
00097 DataArrayInt *_nodal_connec_face;
00098 DataArrayInt *_nodal_connec_face_index;
00099 std::set<INTERP_KERNEL::NormalizedCellType> _types;
00100 };
00101 }
00102
00103 #endif