Version: 9.12.0
StdMeshers_QuadToTriaAdaptor.hxx
Go to the documentation of this file.
1 // Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 // File : StdMeshers_QuadToTriaAdaptor.hxx
21 // Module : SMESH
22 //
23 #ifndef _SMESH_QuadToTriaAdaptor_HXX_
24 #define _SMESH_QuadToTriaAdaptor_HXX_
25 
26 #include "SMESH_StdMeshers.hxx"
27 
28 #include "SMESH_ProxyMesh.hxx"
29 
30 #include <TColgp_Array1OfPnt.hxx>
31 #include <TColgp_Array1OfVec.hxx>
32 
33 class SMESH_Mesh;
35 class SMDS_MeshElement;
36 class SMDS_MeshNode;
37 class SMDS_MeshFace;
38 class gp_Pnt;
39 class gp_Vec;
40 
41 
42 #include <set>
43 #include <list>
44 #include <vector>
45 
46 #include <TopoDS_Shape.hxx>
47 #include <NCollection_DataMap.hxx>
48 
53 {
54 public:
56 
58 
59  bool Compute(SMESH_Mesh& aMesh,
60  const TopoDS_Shape& aShape,
61  SMESH_ProxyMesh* aProxyMesh=0);
62 
63  bool Compute(SMESH_Mesh& aMesh);
64 
65  const TopoDS_Shape& GetShape() const { return myShape; }
66 
67 protected:
68 
69  int Preparation(const SMDS_MeshElement* face,
70  TColgp_Array1OfPnt& PN,
71  TColgp_Array1OfVec& VN,
72  std::vector<const SMDS_MeshNode*>& FNodes,
73  gp_Pnt& PC, gp_Vec& VNorm,
74  const SMDS_MeshElement** volumes=0);
75 
76  bool LimitHeight (gp_Pnt& Papex,
77  const gp_Pnt& PC,
78  const TColgp_Array1OfPnt& PN,
79  const std::vector<const SMDS_MeshNode*>& FNodes,
80  SMESH_Mesh& aMesh,
81  const SMDS_MeshElement* NotCheckedFace,
82  const bool UseApexRay,
83  const TopoDS_Shape& Shape = TopoDS_Shape());
84 
85  bool Compute2ndPart(SMESH_Mesh& aMesh,
86  const std::vector<const SMDS_MeshElement*>& pyramids);
87 
88 
89  void MergePiramids( const SMDS_MeshElement* PrmI,
90  const SMDS_MeshElement* PrmJ,
91  std::set<const SMDS_MeshNode*> & nodesToMove);
92 
93  void MergeAdjacent(const SMDS_MeshElement* PrmI,
94  std::set<const SMDS_MeshNode*>& nodesToMove,
95  const bool isRecursion = false);
96 
97  bool DecreaseHeightDifference( const SMDS_MeshElement* pyram,
98  const double h2 );
99 
100  TopoDS_Shape myShape;
101  std::set<const SMDS_MeshElement*> myRemovedTrias;
102  std::list< const SMDS_MeshNode* > myDegNodes;
104 
105  NCollection_DataMap< const SMDS_MeshElement*, double > myPyramHeight2;
106 
107  // work buffers of DecreaseHeightDifference()
108  std::vector< const SMDS_MeshElement* > myAdjPyrams;
109  std::vector<const SMDS_MeshNode *> myNodes;
110 };
111 
112 #endif
#define STDMESHERS_EXPORT
Definition: SMESH_StdMeshers.hxx:38
Base class for elements.
Definition: SMDS_MeshElement.hxx:56
Mesh face.
Definition: SMDS_MeshFace.hxx:41
Definition: SMDS_MeshNode.hxx:36
Definition: SMESH_Mesh.hxx:80
Container of xD mesh elements substituting other ones in the input mesh of an (x+1)D algorithm.
Definition: SMESH_ProxyMesh.hxx:51
"Transforms" quadrilateral faces into triangular ones by creation of pyramids
Definition: StdMeshers_QuadToTriaAdaptor.hxx:53
std::list< const SMDS_MeshNode * > myDegNodes
Definition: StdMeshers_QuadToTriaAdaptor.hxx:102
const TopoDS_Shape & GetShape() const
Definition: StdMeshers_QuadToTriaAdaptor.hxx:65
std::vector< const SMDS_MeshNode * > myNodes
Definition: StdMeshers_QuadToTriaAdaptor.hxx:109
NCollection_DataMap< const SMDS_MeshElement *, double > myPyramHeight2
Definition: StdMeshers_QuadToTriaAdaptor.hxx:105
std::set< const SMDS_MeshElement * > myRemovedTrias
Definition: StdMeshers_QuadToTriaAdaptor.hxx:101
std::vector< const SMDS_MeshElement * > myAdjPyrams
Definition: StdMeshers_QuadToTriaAdaptor.hxx:108
TopoDS_Shape myShape
Definition: StdMeshers_QuadToTriaAdaptor.hxx:100
const SMESH_ElementSearcher * myElemSearcher
Definition: StdMeshers_QuadToTriaAdaptor.hxx:103
Searcher for elements.
Definition: SMESH_MeshAlgos.hxx:75