00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __PARAMEDMEM_MEDCOUPLINGEXTRUDEDMESH_HXX__
00021 #define __PARAMEDMEM_MEDCOUPLINGEXTRUDEDMESH_HXX__
00022
00023 #include "MEDCoupling.hxx"
00024 #include "MEDCouplingMesh.hxx"
00025
00026 #include <vector>
00027
00028 namespace ParaMEDMEM
00029 {
00030 class DataArrayInt;
00031 class DataArrayDouble;
00032 class MEDCouplingUMesh;
00033 class MEDCouplingFieldDouble;
00034
00035 class MEDCOUPLING_EXPORT MEDCouplingExtrudedMesh : public MEDCouplingMesh
00036 {
00037 public:
00038 static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
00039 static MEDCouplingExtrudedMesh *New();
00040 MEDCouplingMeshType getType() const;
00041 void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
00042 int getNumberOfCells() const;
00043 int getNumberOfNodes() const;
00044 int getSpaceDimension() const;
00045 int getMeshDimension() const;
00046 MEDCouplingMesh *deepCpy() const;
00047 MEDCouplingExtrudedMesh *clone(bool recDeepCpy) const;
00048 bool isEqual(const MEDCouplingMesh *other, double prec) const;
00049 bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
00050 void checkDeepEquivalWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
00051 DataArrayInt *&cellCor, DataArrayInt *&nodeCor) const throw(INTERP_KERNEL::Exception);
00052 void checkDeepEquivalOnSameNodesWith(const MEDCouplingMesh *other, int cellCompPol, double prec,
00053 DataArrayInt *&cellCor) const throw(INTERP_KERNEL::Exception);
00054 INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const;
00055 std::set<INTERP_KERNEL::NormalizedCellType> getAllGeoTypes() const;
00056 int getNumberOfCellsWithType(INTERP_KERNEL::NormalizedCellType type) const;
00057 void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
00058 void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const;
00059 std::string simpleRepr() const;
00060 std::string advancedRepr() const;
00061 void checkCoherency() const throw (INTERP_KERNEL::Exception);
00062 void checkCoherency1(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
00063 void checkCoherency2(double eps=1e-12) const throw(INTERP_KERNEL::Exception);
00064 void getBoundingBox(double *bbox) const;
00065 void updateTime() const;
00066 void renumberCells(const int *old2NewBg, bool check) throw(INTERP_KERNEL::Exception);
00067 MEDCouplingUMesh *getMesh2D() const { return _mesh2D; }
00068 MEDCouplingUMesh *getMesh1D() const { return _mesh1D; }
00069 DataArrayInt *getMesh3DIds() const { return _mesh3D_ids; }
00070 MEDCouplingUMesh *build3DUnstructuredMesh() const;
00071 MEDCouplingUMesh *buildUnstructured() const throw(INTERP_KERNEL::Exception);
00072 MEDCouplingFieldDouble *getMeasureField(bool) const;
00073 MEDCouplingFieldDouble *getMeasureFieldOnNode(bool) const;
00074 MEDCouplingFieldDouble *buildOrthogonalField() const;
00075 int getCellContainingPoint(const double *pos, double eps) const;
00076 static int FindCorrespCellByNodalConn(const std::vector<int>& nodalConnec,
00077 const int *revNodalPtr, const int *revNodalIndxPtr) throw(INTERP_KERNEL::Exception);
00078 static void Project1DMeshes(const MEDCouplingUMesh *m1, const MEDCouplingUMesh *m2, double eps,
00079 MEDCouplingUMesh *&m1r, MEDCouplingUMesh *&m2r, double *v) throw(INTERP_KERNEL::Exception);
00080 void rotate(const double *center, const double *vector, double angle);
00081 void translate(const double *vector);
00082 void scale(const double *point, double factor);
00083 DataArrayInt *checkTypeConsistencyAndContig(const std::vector<int>& code, const std::vector<const DataArrayInt *>& idsPerType) const throw(INTERP_KERNEL::Exception);
00084 void splitProfilePerType(const DataArrayInt *profile, std::vector<int>& code, std::vector<DataArrayInt *>& globIdsPerType, std::vector<DataArrayInt *>& idsPerType) const throw(INTERP_KERNEL::Exception);
00085 MEDCouplingMesh *buildPart(const int *start, const int *end) const;
00086 MEDCouplingMesh *buildPartAndReduceNodes(const int *start, const int *end, DataArrayInt*& arr) const;
00087 DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
00088 MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
00089 DataArrayDouble *getCoordinatesAndOwner() const;
00090 DataArrayDouble *getBarycenterAndOwner() const;
00091
00092 void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
00093 void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const;
00094 void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
00095 void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
00096 const std::vector<std::string>& littleStrings);
00097 private:
00098 MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
00099 MEDCouplingExtrudedMesh(const MEDCouplingExtrudedMesh& other, bool deepCpy);
00100 MEDCouplingExtrudedMesh();
00101 void computeExtrusion(const MEDCouplingUMesh *mesh3D) throw(INTERP_KERNEL::Exception);
00102 void computeExtrusionAlg(const MEDCouplingUMesh *mesh3D) throw(INTERP_KERNEL::Exception);
00103 void build1DExtrusion(int idIn3DDesc, int newId, int nbOf1DLev, MEDCouplingUMesh *subMesh,
00104 const int *desc3D, const int *descIndx3D,
00105 const int *revDesc3D, const int *revDescIndx3D,
00106 bool computeMesh1D) throw(INTERP_KERNEL::Exception);
00107 int findOppositeFaceOf(int current2DCell, int current3DCell, const std::vector<int>& connSorted,
00108 const int *desc3D, const int *descIndx3D,
00109 const int *conn2D, const int *conn2DIndx) throw(INTERP_KERNEL::Exception);
00110 void computeBaryCenterOfFace(const std::vector<int>& nodalConnec, int lev1DId);
00111 ~MEDCouplingExtrudedMesh();
00112 private:
00113 MEDCouplingUMesh *_mesh2D;
00114 MEDCouplingUMesh *_mesh1D;
00116 DataArrayInt *_mesh3D_ids;
00117 int _cell_2D_id;
00118 };
00119 }
00120
00121 #endif