Back to index

salome-med  6.5.0
MEDCouplingExtrudedMesh.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
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, const 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 throw(INTERP_KERNEL::Exception);
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     std::vector<int> getDistributionOfTypes() const throw(INTERP_KERNEL::Exception);
00084     DataArrayInt *checkTypeConsistencyAndContig(const std::vector<int>& code, const std::vector<const DataArrayInt *>& idsPerType) const throw(INTERP_KERNEL::Exception);
00085     void splitProfilePerType(const DataArrayInt *profile, std::vector<int>& code, std::vector<DataArrayInt *>& idsInPflPerType, std::vector<DataArrayInt *>& idsPerType) const throw(INTERP_KERNEL::Exception);
00086     MEDCouplingMesh *buildPart(const int *start, const int *end) const;
00087     MEDCouplingMesh *buildPartAndReduceNodes(const int *start, const int *end, DataArrayInt*& arr) const;
00088     DataArrayInt *simplexize(int policy) throw(INTERP_KERNEL::Exception);
00089     MEDCouplingMesh *mergeMyselfWith(const MEDCouplingMesh *other) const;
00090     DataArrayDouble *getCoordinatesAndOwner() const;
00091     DataArrayDouble *getBarycenterAndOwner() const;
00092     //Serialization unserialisation
00093     void getTinySerializationInformation(std::vector<double>& tinyInfoD, std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
00094     void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings) const;
00095     void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
00096     void unserialization(const std::vector<double>& tinyInfoD, const std::vector<int>& tinyInfo, const DataArrayInt *a1, DataArrayDouble *a2,
00097                          const std::vector<std::string>& littleStrings);
00098   private:
00099     MEDCouplingExtrudedMesh(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
00100     MEDCouplingExtrudedMesh(const MEDCouplingExtrudedMesh& other, bool deepCopy);
00101     MEDCouplingExtrudedMesh();
00102     void computeExtrusion(const MEDCouplingUMesh *mesh3D) throw(INTERP_KERNEL::Exception);
00103     void computeExtrusionAlg(const MEDCouplingUMesh *mesh3D) throw(INTERP_KERNEL::Exception);
00104     void build1DExtrusion(int idIn3DDesc, int newId, int nbOf1DLev, MEDCouplingUMesh *subMesh,
00105                           const int *desc3D, const int *descIndx3D,
00106                           const int *revDesc3D, const int *revDescIndx3D,
00107                           bool computeMesh1D) throw(INTERP_KERNEL::Exception);
00108     int findOppositeFaceOf(int current2DCell, int current3DCell, const std::vector<int>& connSorted,
00109                            const int *desc3D, const int *descIndx3D,
00110                            const int *conn2D, const int *conn2DIndx) throw(INTERP_KERNEL::Exception);
00111     void computeBaryCenterOfFace(const std::vector<int>& nodalConnec, int lev1DId);
00112     ~MEDCouplingExtrudedMesh();
00113     void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData) const throw(INTERP_KERNEL::Exception);
00114     std::string getVTKDataSetType() const throw(INTERP_KERNEL::Exception);
00115   private:
00116     MEDCouplingUMesh *_mesh2D;
00117     MEDCouplingUMesh *_mesh1D;
00119     DataArrayInt *_mesh3D_ids;
00120     int _cell_2D_id;
00121   };
00122 }
00123 
00124 #endif