Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FaceMesh.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: SurfaceMesh.h
4 //
5 // For more information, please see: http://www.nektar.info/
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // License for the specific language governing rights and limitations under
14 // Permission is hereby granted, free of charge, to any person obtaining a
15 // copy of this software and associated documentation files (the "Software"),
16 // to deal in the Software without restriction, including without limitation
17 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
18 // and/or sell copies of the Software, and to permit persons to whom the
19 // Software is furnished to do so, subject to the following conditions:
20 //
21 // The above copyright notice and this permission notice shall be included
22 // in all copies or substantial portions of the Software.
23 //
24 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30 // DEALINGS IN THE SOFTWARE.
31 //
32 // Description: class for indivdual surface meshes
33 //
34 ////////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NekMeshUtils_SURFACEMESHING_FACEMESH
37 #define NekMeshUtils_SURFACEMESHING_FACEMESH
38 
43 
44 namespace Nektar
45 {
46 namespace NekMeshUtils
47 {
48 
49 /**
50  * @brief class for surface meshes on individual surfaces (paramter plane
51  * meshes)
52  */
53 class FaceMesh
54 {
55 public:
56  friend class MemoryManager<FaceMesh>;
57 
58  /**
59  * @brief Default constructor
60  */
61  FaceMesh(const int id,
62  MeshSharedPtr m,
63  CADSurfSharedPtr cad,
64  OctreeSharedPtr oct,
65  const std::map<int, CurveMeshSharedPtr> &cmeshes)
66  : m_mesh(m), m_cadsurf(cad), m_octree(oct), m_curvemeshes(cmeshes),
67  m_id(id)
68 
69  {
70  m_edgeloops = m_cadsurf->GetEdges();
71  m_makebl = false;
72  };
73 
74  /**
75  * @brief constructor for building with boundary layer
76  */
77  FaceMesh(const int id,
78  MeshSharedPtr m,
79  CADSurfSharedPtr cad,
80  OctreeSharedPtr oct,
81  const std::map<int, CurveMeshSharedPtr> &cmeshes,
82  const NekDouble b)
83  : m_mesh(m), m_cadsurf(cad), m_octree(oct), m_curvemeshes(cmeshes),
84  m_id(id), m_bl(b)
85 
86  {
87  m_edgeloops = m_cadsurf->GetEdges();
88  m_makebl = true;
89  };
90 
91  /**
92  * @brief mesh exectuation command
93  */
94  void Mesh();
95 
96 private:
97  /**
98  * @brief Calculate the paramter plane streching factor
99  */
100  void Stretching();
101 
102  /**
103  * @brief performs node smoothing on face
104  */
105  void Smoothing();
106 
107  /**
108  * @brief performs diagonal swapping of edges
109  */
110  void DiagonalSwap();
111 
112  /**
113  * @brief build a local version of mesh elements
114  */
115  void BuildLocalMesh();
116 
117  /**
118  * @brief function which calls the optimisation routines
119  */
120  void OptimiseLocalMesh();
121 
122  /**
123  * @brief Validate the surface mesh base on the octree and real
124  * dimensions of the edges
125  */
126  bool Validate();
127 
128  /**
129  * @brief Get the boundries of the surface and extracts the nodes from
130  * the curve meshes in the correct order
131  */
132  void OrientateCurves();
133 
134  /**
135  * @brief adds a new stiener point to the triangulation for meshing
136  */
138 
139  /**
140  * @brief adds a quad layer around any interior loops
141  */
142  void MakeBL();
143 
144  /// mesh pointer
146  /// CAD surface
148  /// Octree object
150  /// Map of the curve meshes which bound the surfaces
151  std::map<int, CurveMeshSharedPtr> m_curvemeshes;
152  /// data structure containing the edges, their order and oreientation for
153  /// the surface
154  std::vector<EdgeLoop> m_edgeloops;
155  /// id of the surface mesh
156  int m_id;
157  /// list of boundary nodes in their order loops
158  std::vector<std::vector<NodeSharedPtr> > orderedLoops;
159  /// list of stiener points in the triangulation
160  std::vector<NodeSharedPtr> m_stienerpoints;
161  /// pplane stretching
163  /// triangle connectiviities
164  std::vector<std::vector<NodeSharedPtr> > m_connec;
165  /// local set of nodes
167  /// local set of edges
169  /// local list of elements
170  std::vector<ElementSharedPtr> m_localElements;
171  /// boundary layer thickness
173  /// should build boundary layer
174  bool m_makebl;
175  /// list of node links between node on loop and its corresponding interior
176  /// node in quads
177  std::vector<std::pair<NodeSharedPtr, NodeSharedPtr> > blpairs;
178 };
179 
180 typedef boost::shared_ptr<FaceMesh> FaceMeshSharedPtr;
181 }
182 }
183 
184 #endif
std::vector< std::vector< NodeSharedPtr > > orderedLoops
list of boundary nodes in their order loops
Definition: FaceMesh.h:158
bool Validate()
Validate the surface mesh base on the octree and real dimensions of the edges.
Definition: FaceMesh.cpp:921
std::map< int, CurveMeshSharedPtr > m_curvemeshes
Map of the curve meshes which bound the surfaces.
Definition: FaceMesh.h:151
FaceMesh(const int id, MeshSharedPtr m, CADSurfSharedPtr cad, OctreeSharedPtr oct, const std::map< int, CurveMeshSharedPtr > &cmeshes, const NekDouble b)
constructor for building with boundary layer
Definition: FaceMesh.h:77
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
void Stretching()
Calculate the paramter plane streching factor.
Definition: FaceMesh.cpp:873
std::vector< ElementSharedPtr > m_localElements
local list of elements
Definition: FaceMesh.h:170
OctreeSharedPtr m_octree
Octree object.
Definition: FaceMesh.h:149
NekDouble m_bl
boundary layer thickness
Definition: FaceMesh.h:172
boost::unordered_set< NodeSharedPtr, NodeHash > NodeSet
Definition: Node.h:357
std::vector< std::vector< NodeSharedPtr > > m_connec
triangle connectiviities
Definition: FaceMesh.h:164
std::vector< std::pair< NodeSharedPtr, NodeSharedPtr > > blpairs
list of node links between node on loop and its corresponding interior node in quads ...
Definition: FaceMesh.h:177
void Mesh()
mesh exectuation command
Definition: FaceMesh.cpp:49
EdgeSet m_localEdges
local set of edges
Definition: FaceMesh.h:168
boost::shared_ptr< FaceMesh > FaceMeshSharedPtr
Definition: FaceMesh.h:180
int m_id
id of the surface mesh
Definition: FaceMesh.h:156
void OrientateCurves()
Get the boundries of the surface and extracts the nodes from the curve meshes in the correct order...
Definition: FaceMesh.cpp:1022
double NekDouble
void DiagonalSwap()
performs diagonal swapping of edges
Definition: FaceMesh.cpp:363
std::vector< NodeSharedPtr > m_stienerpoints
list of stiener points in the triangulation
Definition: FaceMesh.h:160
FaceMesh(const int id, MeshSharedPtr m, CADSurfSharedPtr cad, OctreeSharedPtr oct, const std::map< int, CurveMeshSharedPtr > &cmeshes)
Default constructor.
Definition: FaceMesh.h:61
boost::shared_ptr< Octree > OctreeSharedPtr
Definition: Octree.h:186
std::vector< EdgeLoop > m_edgeloops
data structure containing the edges, their order and oreientation for the surface ...
Definition: FaceMesh.h:154
void MakeBL()
adds a quad layer around any interior loops
Definition: FaceMesh.cpp:147
boost::shared_ptr< CADSurf > CADSurfSharedPtr
Definition: CADSurf.h:217
bool m_makebl
should build boundary layer
Definition: FaceMesh.h:174
boost::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
Definition: Mesh.h:137
NekDouble m_str
pplane stretching
Definition: FaceMesh.h:162
void AddNewPoint(Array< OneD, NekDouble > uv)
adds a new stiener point to the triangulation for meshing
Definition: FaceMesh.cpp:976
void Smoothing()
performs node smoothing on face
Definition: FaceMesh.cpp:210
void BuildLocalMesh()
build a local version of mesh elements
Definition: FaceMesh.cpp:745
boost::unordered_set< EdgeSharedPtr, EdgeHash > EdgeSet
Definition: Edge.h:222
void OptimiseLocalMesh()
function which calls the optimisation routines
Definition: FaceMesh.cpp:199
CADSurfSharedPtr m_cadsurf
CAD surface.
Definition: FaceMesh.h:147
MeshSharedPtr m_mesh
mesh pointer
Definition: FaceMesh.h:145
class for surface meshes on individual surfaces (paramter plane meshes)
Definition: FaceMesh.h:53
NodeSet m_localNodes
local set of nodes
Definition: FaceMesh.h:166