Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __PARAMEDMEM_MEDCOUPLINGCMESH_HXX__
00021 #define __PARAMEDMEM_MEDCOUPLINGCMESH_HXX__
00022
00023 #include "MEDCoupling.hxx"
00024 #include "MEDCouplingMesh.hxx"
00025
00026 namespace ParaMEDMEM
00027 {
00028 class DataArrayDouble;
00029 class MEDCouplingUMesh;
00030
00031 class MEDCOUPLING_EXPORT MEDCouplingCMesh : public MEDCouplingMesh
00032 {
00033 public:
00034 static MEDCouplingCMesh *New();
00035 MEDCouplingMesh *deepCpy() const;
00036 MEDCouplingCMesh *clone(bool recDeepCpy) const;
00037 void updateTime() const;
00038 MEDCouplingMeshType getType() const { return CARTESIAN; }
00039 void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
00040 bool isEqual(const MEDCouplingMesh *other, double prec) const;
00041 bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
00042 void checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
00043 DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const throw(INTERP_KERNEL::Exception);
00044 void checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
00045 DataArrayInt *&cellCor) const throw(INTERP_KERNEL::Exception);
00046 void checkCoherency() const throw(INTERP_KERNEL::Exception);
00047 void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
00048 void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
00049 int getNumberOfCells() const;
00050 int getNumberOfNodes() const;
00051 int getSpaceDimension() const;
00052 int getMeshDimension() const;
00053 int getCellIdFromPos(int i, int j, int k) const;
00054 int getNodeIdFromPos(int i, int j, int k) const;
00055 static void GetPosFromId(int nodeId, int spaceDim, const int *split, int *res);
00056 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
00057 std::set<INTERP_KERNEL::NormalizedCellType> getAllGeoTypes() const;
00058 int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
00059 void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
00060 void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const;
00061 std::string simpleRepr() const;
00062 std::string advancedRepr() const;
00063 const DataArrayDouble *getCoordsAt(int i) const throw(INTERP_KERNEL::Exception);
00064 DataArrayDouble *getCoordsAt(int i) throw(INTERP_KERNEL::Exception);
00065 void setCoordsAt(int i, const DataArrayDouble *arr) throw(INTERP_KERNEL::Exception);
00066 void setCoords(const DataArrayDouble *coordsX,
00067 const DataArrayDouble *coordsY=0,
00068 const DataArrayDouble *coordsZ=0);
00069
00070 DataArrayInt *checkTypeConsistencyAndContig(const std::vector<int>& code, const std::vector<const DataArrayInt *>& idsPerType) const throw(INTERP_KERNEL::Exception);
00071 void splitProfilePerType(const DataArrayInt *profile, std::vector<int>& code, std::vector<DataArrayInt *>& globIdsPerType, std::vector<DataArrayInt *>& idsPerType) const throw(INTERP_KERNEL::Exception);
00072 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
00073 MEDCouplingMesh *buildPart(const int *start, const int *end) const;
00074 MEDCouplingMesh *buildPartAndReduceNodes(const int *start, const int *end, DataArrayInt*& arr) const;
00075 DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
00076 void getBoundingBox(double *bbox) const;
00077 MEDCouplingFieldDouble *getMeasureField(bool isAbs) const;
00078 MEDCouplingFieldDouble *getMeasureFieldOnNode(bool isAbs) const;
00079 MEDCouplingFieldDouble *buildOrthogonalField() const;
00080 int getCellContainingPoint(const double *pos, double eps) const;
00081 void rotate(const double *center, const double *vector, double angle);
00082 void translate(const double *vector);
00083 void scale(const double *point, double factor);
00084 MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
00085 DataArrayDouble *getCoordinatesAndOwner() const;
00086 DataArrayDouble *getBarycenterAndOwner() const;
00087 void renumberCells(const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception);
00088 void fill1DUnstructuredMesh(MEDCouplingUMesh *m) const;
00089 void fill2DUnstructuredMesh(MEDCouplingUMesh *m) const;
00090 void fill3DUnstructuredMesh(MEDCouplingUMesh *m) const;
00091
00092 void getSplitCellValues(int *res) const;
00093 void getSplitNodeValues(int *res) const;
00094
00095 void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
00096 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const;
00097 void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
00098 void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
00099 const std::vector<std::string>& littleStrings);
00100 private:
00101 MEDCouplingCMesh();
00102 MEDCouplingCMesh(const MEDCouplingCMesh& other, bool deepCpy);
00103 ~MEDCouplingCMesh();
00104 private:
00105 DataArrayDouble *_x_array;
00106 DataArrayDouble *_y_array;
00107 DataArrayDouble *_z_array;
00108 };
00109 }
00110
00111 #endif