SALOME - SMESH
StdMeshers_Hexa_3D.hxx
Go to the documentation of this file.
1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 // SMESH SMESH : implementaion of SMESH idl descriptions
23 // File : StdMeshers_Hexa_3D.hxx
24 // Moved here from SMESH_Hexa_3D.hxx
25 // Author : Paul RASCLE, EDF
26 // Module : SMESH
27 //
28 #ifndef _SMESH_HEXA_3D_HXX_
29 #define _SMESH_HEXA_3D_HXX_
30 
31 #include "SMESH_StdMeshers.hxx"
32 
33 #include "SMESH_3D_Algo.hxx"
34 #include "SMESH_Mesh.hxx"
37 
38 #include "SMESH_MesherHelper.hxx"
39 
40 class TopTools_IndexedMapOfShape;
41 
42 typedef struct point3Dstruct
43 {
46 
47 typedef double Pt3[3];
48 
49 typedef struct conv2dstruct
50 {
51  double a1; // X = a1*x + b1*y + c1
52  double b1; // Y = a2*x + b2*y + c2
53  double c1; // a1, b1 a2, b2 in {-1,0,1}
54  double a2; // c1, c2 in {0,1}
55  double b2;
56  double c2;
57  int ia; // I = ia*i + ib*j + ic
58  int ib;
59  int ic;
60  int ja; // J = ja*i + jb*j + jc
61  int jb;
62  int jc;
64 
66  public SMESH_3D_Algo
67 {
68 public:
69  StdMeshers_Hexa_3D(int hypId, int studyId, SMESH_Gen* gen);
71 
72  virtual bool CheckHypothesis(SMESH_Mesh& aMesh,
73  const TopoDS_Shape& aShape,
75 
76  virtual bool Compute(SMESH_Mesh& aMesh,
77  const TopoDS_Shape& aShape)
78  /*throw (SALOME_Exception)*/;
79 
80  virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
81  MapShapeNbElems& aResMap);
82 
83  static TopoDS_Vertex OppositeVertex(const TopoDS_Vertex& aVertex,
84  const TopTools_IndexedMapOfShape& aQuads0Vertices,
85  FaceQuadStruct* aQuads[6]);
86 
87 protected:
88  TopoDS_Edge
90  const TopoDS_Shape& aShape,
91  const TopoDS_Face& aFace,
92  const TopoDS_Vertex& aVertex,
93  const TopTools_IndexedDataMapOfShapeListOfShape& MS);
94 
96  const TopoDS_Shape& aShape,
97  const std::vector<SMESH_subMesh*>& meshFaces,
98  const TopoDS_Vertex& V0,
99  const TopoDS_Vertex& V1,
100  const TopoDS_Vertex& V2,
101  const TopoDS_Vertex& V3);
102 
103  void GetConv2DCoefs(const faceQuadStruct& quad,
104  const TopoDS_Shape& aShape,
105  const TopoDS_Vertex& V0,
106  const TopoDS_Vertex& V1,
107  const TopoDS_Vertex& V2,
108  const TopoDS_Vertex& V3,
109  Conv2DStruct& conv);
110 
111  void GetPoint(Pt3 p,
112  int i, int j, int k,
113  int nbx, int nby, int nbz,
114  Point3DStruct *np,
115  const SMESHDS_Mesh* meshDS);
116 
117  bool ClearAndReturn(FaceQuadStruct* theQuads[6], const bool res);
118 };
119 
120 #endif
StdMeshers_Hexa_3D::CheckHypothesis
virtual bool CheckHypothesis(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, SMESH_Hypothesis::Hypothesis_Status &aStatus)
Check hypothesis definition to mesh a shape.
SMESH_StdMeshers.hxx
conv2dstruct::c2
double c2
Definition: StdMeshers_Hexa_3D.hxx:56
conv2dstruct::ia
int ia
Definition: StdMeshers_Hexa_3D.hxx:57
conv2dstruct::ic
int ic
Definition: StdMeshers_Hexa_3D.hxx:59
conv2dstruct::a2
double a2
Definition: StdMeshers_Hexa_3D.hxx:54
conv2dstruct::ja
int ja
Definition: StdMeshers_Hexa_3D.hxx:60
Pt3
double Pt3[3]
Definition: StdMeshers_Hexa_3D.hxx:47
Utils_SALOME_Exception.hxx
conv2dstruct::b1
double b1
Definition: StdMeshers_Hexa_3D.hxx:52
Conv2DStruct
struct conv2dstruct Conv2DStruct
SMESH_Hypothesis::Hypothesis_Status
Hypothesis_Status
Definition: SMESH_Hypothesis.hxx:51
StdMeshers_Hexa_3D
Definition: StdMeshers_Hexa_3D.hxx:67
StdMeshers_Hexa_3D::EdgeNotInFace
TopoDS_Edge EdgeNotInFace(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, const TopoDS_Face &aFace, const TopoDS_Vertex &aVertex, const TopTools_IndexedDataMapOfShapeListOfShape &MS)
point3Dstruct::node
const SMDS_MeshNode * node
Definition: StdMeshers_Hexa_3D.hxx:44
StdMeshers_Hexa_3D::OppositeVertex
static TopoDS_Vertex OppositeVertex(const TopoDS_Vertex &aVertex, const TopTools_IndexedMapOfShape &aQuads0Vertices, FaceQuadStruct *aQuads[6])
StdMeshers_Quadrangle_2D.hxx
conv2dstruct::c1
double c1
Definition: StdMeshers_Hexa_3D.hxx:53
SMESHDS_Mesh
Definition: SMESHDS_Mesh.hxx:59
point3Dstruct
Definition: StdMeshers_Hexa_3D.hxx:43
SMESH_3D_Algo
Definition: SMESH_3D_Algo.hxx:37
conv2dstruct::b2
double b2
Definition: StdMeshers_Hexa_3D.hxx:55
SMESH_Gen
Definition: SMESH_Gen.hxx:63
StdMeshers_Hexa_3D::ClearAndReturn
bool ClearAndReturn(FaceQuadStruct *theQuads[6], const bool res)
conv2dstruct
Definition: StdMeshers_Hexa_3D.hxx:50
StdMeshers_Hexa_3D::~StdMeshers_Hexa_3D
virtual ~StdMeshers_Hexa_3D()
StdMeshers_Hexa_3D::GetFaceIndex
int GetFaceIndex(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, const std::vector< SMESH_subMesh * > &meshFaces, const TopoDS_Vertex &V0, const TopoDS_Vertex &V1, const TopoDS_Vertex &V2, const TopoDS_Vertex &V3)
SMESH_MesherHelper.hxx
conv2dstruct::jb
int jb
Definition: StdMeshers_Hexa_3D.hxx:61
MapShapeNbElems
std::map< SMESH_subMesh *, std::vector< int > > MapShapeNbElems
Definition: SMESH_Algo.hxx:55
SMESH_3D_Algo.hxx
StdMeshers_Hexa_3D::StdMeshers_Hexa_3D
StdMeshers_Hexa_3D(int hypId, int studyId, SMESH_Gen *gen)
StdMeshers_Hexa_3D::Compute
virtual bool Compute(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape)
Computes mesh on a shape.
SMESH_Mesh
Definition: SMESH_Mesh.hxx:55
StdMeshers_Hexa_3D::GetPoint
void GetPoint(Pt3 p, int i, int j, int k, int nbx, int nby, int nbz, Point3DStruct *np, const SMESHDS_Mesh *meshDS)
faceQuadStruct
Definition: StdMeshers_Quadrangle_2D.hxx:48
conv2dstruct::a1
double a1
Definition: StdMeshers_Hexa_3D.hxx:51
STDMESHERS_EXPORT
#define STDMESHERS_EXPORT
Definition: SMESH_StdMeshers.hxx:37
StdMeshers_Hexa_3D::Evaluate
virtual bool Evaluate(SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, MapShapeNbElems &aResMap)
evaluates size of prospective mesh on a shape
conv2dstruct::jc
int jc
Definition: StdMeshers_Hexa_3D.hxx:62
SMDS_MeshNode
Definition: SMDS_MeshNode.hxx:36
Point3DStruct
struct point3Dstruct Point3DStruct
SMESH_Mesh.hxx
conv2dstruct::ib
int ib
Definition: StdMeshers_Hexa_3D.hxx:58
StdMeshers_Hexa_3D::GetConv2DCoefs
void GetConv2DCoefs(const faceQuadStruct &quad, const TopoDS_Shape &aShape, const TopoDS_Vertex &V0, const TopoDS_Vertex &V1, const TopoDS_Vertex &V2, const TopoDS_Vertex &V3, Conv2DStruct &conv)