Version: 9.16.0
StdMeshers_Penta_3D.hxx
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, 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, or (at your option) any later version.
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
23// SMESH StdMeshers : implementation of SMESH idl descriptions
24// File : StdMeshers_Penta_3D.hxx
25// Module : SMESH
26//
27#ifndef StdMeshers_Penta_3D_HeaderFile
28#define StdMeshers_Penta_3D_HeaderFile
29
30#include "SMESH_StdMeshers.hxx"
31
32#include <map>
33
35//
36// class StdMeshers_SMESHBlock
37//
39#include <TColStd_MapOfInteger.hxx>
40#include <TopTools_IndexedMapOfOrientedShape.hxx>
41#include <TopoDS_Shell.hxx>
42#include <TopoDS_Vertex.hxx>
43#include <gp_Pnt.hxx>
44#include <gp_XYZ.hxx>
45
46#include "SMESH_Algo.hxx"
47#include "SMESH_Block.hxx"
50
51typedef std::map< double, std::vector<const SMDS_MeshNode*> > StdMeshers_IJNodeMap;
52
54
55public:
56 //
58
59 void Load (const TopoDS_Shell& theShell);
60
61 void Load (const TopoDS_Shell& theShell,
62 const TopoDS_Vertex& theV000,
63 const TopoDS_Vertex& theV001);
64
65 void ComputeParameters(const gp_Pnt& thePnt,
66 gp_XYZ& theXYZ);
67
68 void ComputeParameters(const gp_Pnt& thePnt,
69 const TopoDS_Shape& theShape,
70 gp_XYZ& theXYZ);
71
72 void ComputeParameters(const double& theU,
73 const TopoDS_Shape& theShape,
74 gp_XYZ& theXYZ);
75
76 void Point(const gp_XYZ& theParams,
77 gp_Pnt& thePnt);
78
79 void Point(const gp_XYZ& theParams,
80 const TopoDS_Shape& theShape,
81 gp_Pnt& thePnt);
82
83 int ShapeID(const TopoDS_Shape& theShape);
84
85 const TopoDS_Shape& Shape(const int theID);
86
87 SMESH_Block & Block() { return myTBlock; }
88
89 bool IsForwardEdge(const int theEdgeID);
90
91 int ErrorStatus() const;
92
93 SMESH_ComputeErrorPtr GetError() const;
94
95
96protected:
97 TopoDS_Shell myShell;
98 TopTools_IndexedMapOfOrientedShape myShapeIDMap;
100 TopoDS_Shape myEmptyShape;
101 std::vector<int> myIsEdgeForward;
102 //
104};
105
107//
108// class StdMeshers_TNode
109//
111#include "SMDS_MeshNode.hxx"
112
114
115public:
116
118 myNode=NULL;
119 myXYZ.SetCoord(99., 99., 99.);
120 myShapeSupportID=-1;
121 myBaseNodeID=-1;
122 }
123
124 void SetNode(const SMDS_MeshNode* theNode) {
125 myNode=(SMDS_MeshNode*) theNode;
126 }
127
128 const SMDS_MeshNode* Node()const {
129 return myNode;
130 }
131
132 void SetShapeSupportID (const int theID) {
133 myShapeSupportID=theID;
134 }
135
136 int ShapeSupportID()const {
137 return myShapeSupportID;
138 }
139
140 void SetNormCoord (const gp_XYZ& theXYZ) {
141 myXYZ=theXYZ;
142 }
143
144 const gp_XYZ& NormCoord ()const{
145 return myXYZ;
146 }
147
148 void SetBaseNodeID (const int theID) {
149 myBaseNodeID=theID;
150 }
151
152 int BaseNodeID ()const{
153 return myBaseNodeID;
154 }
155
156private:
159 gp_XYZ myXYZ;
161};
162
164//
165// class StdMeshers_Penta_3D
166//
168#include "SMESH_Mesh.hxx"
169#include <TopoDS_Shape.hxx>
170//
172//
173 public: // methods
175
177
178 bool Compute(SMESH_Mesh& , const TopoDS_Shape& );
179
180 int ErrorStatus() const {
181 if (myErrorStatus->IsOK())
182 return 0;
183 return myErrorStatus->myName;
184 }
185
187 return myErrorStatus;
188 }
189
190 void SetTolerance(const double theTol3D) {
191 myTol3D=theTol3D;
192 }
193
194 double Tolerance() const {
195 return myTol3D;
196 }
197
198 bool LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes,
199 const TopoDS_Face& theFace,
200 const TopoDS_Edge& theBaseEdge,
201 SMESHDS_Mesh* theMesh);
202 // Load nodes bound to theFace into column (vectors) and rows
203 // of theIJNodes.
204 // The value of theIJNodes map is a vector of ordered nodes so
205 // that the 0-the one lies on theBaseEdge.
206 // The key of theIJNodes map is a normalized parameter of each
207 // 0-the node on theBaseEdge.
208
209 bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape,
210 MapShapeNbElems& aResMap);
211
212
213 protected: // methods
214
215 void CheckData();
216
217 void MakeBlock();
218
219 void MakeNodes();
220
221 double SetHorizEdgeXYZ(const gp_XYZ& aBNXYZ,
222 const int aFaceID,
223 std::vector<const SMDS_MeshNode*>*& aCol1,
224 std::vector<const SMDS_MeshNode*>*& aCol2);
225
226 void ShapeSupportID(const bool theIsUpperLayer,
227 const SMESH_Block::TShapeID theBNSSID,
228 SMESH_Block::TShapeID& theSSID);
229
230 void FindNodeOnShape(const TopoDS_Shape& aS,
231 const gp_XYZ& aParams,
232 const int z,
233 StdMeshers_TNode& aTN);
234
235 void CreateNode(const bool theIsUpperLayer,
236 const gp_XYZ& aParams,
237 StdMeshers_TNode& aTN);
238
239 void ClearMeshOnFxy1();
240
241 void MakeMeshOnFxy1();
242
243 void MakeConnectingMap();
244
245 int GetIndexOnLayer(const int aID);
246
247 void MakeVolumeMesh();
248
249 void SetMesh(SMESH_Mesh& theMesh) {
250 myMesh=(void *)&theMesh;
251 }
252
254 return (SMESH_Mesh*)myMesh;
255 }
256
257 protected: // fields
258 TopoDS_Shape myShape;
260 void * myMesh;
262 //
263 std::vector <StdMeshers_TNode> myTNodes;
266 double myTol3D; // Tolerance value
267 std::map < int, int > myConnectingMap;
268 //
269 std::vector<StdMeshers_IJNodeMap> myWallNodesMaps; // nodes on a face
270 std::vector<gp_XYZ> myShapeXYZ; // point on each sub-shape
271
273 SMESH_MesherHelper* myTool; // tool building quadratic elements
274};
275
276#endif
std::map< SMESH_subMesh *, std::vector< smIdType > > MapShapeNbElems
Definition: SMESH_Algo.hxx:63
boost::shared_ptr< SMESH_ComputeError > SMESH_ComputeErrorPtr
Definition: SMESH_ComputeError.hxx:38
#define STDMESHERS_EXPORT
Definition: SMESH_StdMeshers.hxx:38
std::map< double, std::vector< const SMDS_MeshNode * > > StdMeshers_IJNodeMap
Definition: StdMeshers_Penta_3D.hxx:51
Definition: SMDS_MeshNode.hxx:36
Definition: SMESHDS_Mesh.hxx:98
Definition: SMESH_Block.hxx:63
TShapeID
Definition: SMESH_Block.hxx:65
Definition: SMESH_Mesh.hxx:80
It helps meshers to add elements and provides other utilities.
Definition: SMESH_MesherHelper.hxx:84
Definition: StdMeshers_Penta_3D.hxx:171
void SetMesh(SMESH_Mesh &theMesh)
Definition: StdMeshers_Penta_3D.hxx:249
SMESH_MesherHelper * myTool
Definition: StdMeshers_Penta_3D.hxx:273
std::map< int, int > myConnectingMap
Definition: StdMeshers_Penta_3D.hxx:267
std::vector< StdMeshers_IJNodeMap > myWallNodesMaps
Definition: StdMeshers_Penta_3D.hxx:269
void * myMesh
Definition: StdMeshers_Penta_3D.hxx:260
int myJSize
Definition: StdMeshers_Penta_3D.hxx:265
std::vector< StdMeshers_TNode > myTNodes
Definition: StdMeshers_Penta_3D.hxx:263
SMESH_Mesh * GetMesh() const
Definition: StdMeshers_Penta_3D.hxx:253
double Tolerance() const
Definition: StdMeshers_Penta_3D.hxx:194
bool myCreateQuadratic
Definition: StdMeshers_Penta_3D.hxx:272
double myTol3D
Definition: StdMeshers_Penta_3D.hxx:266
SMESH_ComputeErrorPtr GetComputeError() const
Definition: StdMeshers_Penta_3D.hxx:186
StdMeshers_SMESHBlock myBlock
Definition: StdMeshers_Penta_3D.hxx:259
void SetTolerance(const double theTol3D)
Definition: StdMeshers_Penta_3D.hxx:190
int myISize
Definition: StdMeshers_Penta_3D.hxx:264
std::vector< gp_XYZ > myShapeXYZ
Definition: StdMeshers_Penta_3D.hxx:270
TopoDS_Shape myShape
Definition: StdMeshers_Penta_3D.hxx:258
int ErrorStatus() const
Definition: StdMeshers_Penta_3D.hxx:180
SMESH_ComputeErrorPtr myErrorStatus
Definition: StdMeshers_Penta_3D.hxx:261
Definition: StdMeshers_Penta_3D.hxx:53
SMESH_Block & Block()
Definition: StdMeshers_Penta_3D.hxx:87
TopoDS_Shell myShell
Definition: StdMeshers_Penta_3D.hxx:97
SMESH_Block myTBlock
Definition: StdMeshers_Penta_3D.hxx:99
TopoDS_Shape myEmptyShape
Definition: StdMeshers_Penta_3D.hxx:100
TopTools_IndexedMapOfOrientedShape myShapeIDMap
Definition: StdMeshers_Penta_3D.hxx:98
std::vector< int > myIsEdgeForward
Definition: StdMeshers_Penta_3D.hxx:101
int myErrorStatus
Definition: StdMeshers_Penta_3D.hxx:103
Definition: StdMeshers_Penta_3D.hxx:113
int myBaseNodeID
Definition: StdMeshers_Penta_3D.hxx:160
int BaseNodeID() const
Definition: StdMeshers_Penta_3D.hxx:152
StdMeshers_TNode()
Definition: StdMeshers_Penta_3D.hxx:117
int myShapeSupportID
Definition: StdMeshers_Penta_3D.hxx:158
int ShapeSupportID() const
Definition: StdMeshers_Penta_3D.hxx:136
void SetBaseNodeID(const int theID)
Definition: StdMeshers_Penta_3D.hxx:148
void SetNormCoord(const gp_XYZ &theXYZ)
Definition: StdMeshers_Penta_3D.hxx:140
gp_XYZ myXYZ
Definition: StdMeshers_Penta_3D.hxx:159
void SetNode(const SMDS_MeshNode *theNode)
Definition: StdMeshers_Penta_3D.hxx:124
const SMDS_MeshNode * Node() const
Definition: StdMeshers_Penta_3D.hxx:128
SMDS_MeshNode * myNode
Definition: StdMeshers_Penta_3D.hxx:157
void SetShapeSupportID(const int theID)
Definition: StdMeshers_Penta_3D.hxx:132
const gp_XYZ & NormCoord() const
Definition: StdMeshers_Penta_3D.hxx:144