Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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 
42 
43 namespace Nektar
44 {
45 namespace NekMeshUtils
46 {
47 
48 /**
49  * @brief class for surface meshes on individual surfaces (paramter plane
50  * meshes)
51  */
52 class FaceMesh
53 {
54 public:
55  friend class MemoryManager<FaceMesh>;
56 
57  /**
58  * @brief Default constructor
59  */
60  FaceMesh(const int id,
61  MeshSharedPtr m,
62  const std::map<int, CurveMeshSharedPtr> &cmeshes,
63  const int comp)
64  : m_mesh(m), m_curvemeshes(cmeshes), m_id(id), m_compId(comp)
65 
66  {
67  m_cadsurf = m_mesh->m_cad->GetSurf(m_id);
68  m_edgeloops = m_cadsurf->GetEdges();
69  };
70 
71  /**
72  * @brief mesh exectuation command
73  */
74  void Mesh();
75 
76  /**
77  * @brief validate the curve meshes
78  */
79  bool ValidateCurves();
80 
81 private:
82 
83  /**
84  * @brief Get the boundries of the surface and extracts the nodes from
85  * the curve meshes in the correct order
86  */
87  void OrientateCurves();
88 
89  /**
90  * @brief Calculate the paramter plane streching factor
91  */
92  void Stretching();
93 
94  /**
95  * @brief performs node smoothing on face
96  */
97  void Smoothing();
98 
99  /**
100  * @brief performs diagonal swapping of edges
101  */
102  void DiagonalSwap();
103 
104  /**
105  * @brief build a local version of mesh elements
106  */
107  void BuildLocalMesh();
108 
109  /**
110  * @brief function which calls the optimisation routines
111  */
112  void OptimiseLocalMesh();
113 
114  /**
115  * @brief Validate the surface mesh base on the octree and real
116  * dimensions of the edges
117  */
118  bool Validate();
119 
120  /**
121  * @brief adds a new stiener point to the triangulation for meshing
122  */
124 
125  /**
126  * @brief adds a quad layer around any interior loops
127  */
128  void MakeBL();
129 
130  /// mesh pointer
132  /// CAD surface
134  /// Map of the curve meshes which bound the surfaces
135  std::map<int, CurveMeshSharedPtr> m_curvemeshes;
136  /// data structure containing the edges, their order and oreientation for
137  /// the surface
138  std::vector<CADSystem::EdgeLoopSharedPtr> m_edgeloops;
139  /// id of the surface mesh
140  int m_id;
141  /// list of boundary nodes in their order loops
142  std::vector<std::vector<NodeSharedPtr> > orderedLoops;
143  /// list of stiener points in the triangulation
144  std::vector<NodeSharedPtr> m_stienerpoints;
145  /// pplane stretching
147  /// triangle connectiviities
148  std::vector<std::vector<NodeSharedPtr> > m_connec;
149  /// local set of nodes
151  /// local set of edges
153  /// local list of elements
154  std::vector<ElementSharedPtr> m_localElements;
155  /// set of nodes which are in the boundary (easier to identify conflicts with)
157  /// identity to put into element tags
158  int m_compId;
159 };
160 
161 typedef boost::shared_ptr<FaceMesh> FaceMeshSharedPtr;
162 }
163 }
164 
165 #endif
std::vector< std::vector< NodeSharedPtr > > orderedLoops
list of boundary nodes in their order loops
Definition: FaceMesh.h:142
bool Validate()
Validate the surface mesh base on the octree and real dimensions of the edges.
Definition: FaceMesh.cpp:998
std::map< int, CurveMeshSharedPtr > m_curvemeshes
Map of the curve meshes which bound the surfaces.
Definition: FaceMesh.h:135
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:944
FaceMesh(const int id, MeshSharedPtr m, const std::map< int, CurveMeshSharedPtr > &cmeshes, const int comp)
Default constructor.
Definition: FaceMesh.h:60
std::vector< ElementSharedPtr > m_localElements
local list of elements
Definition: FaceMesh.h:154
bool ValidateCurves()
validate the curve meshes
Definition: FaceMesh.cpp:47
boost::unordered_set< NodeSharedPtr, NodeHash > NodeSet
Definition: Node.h:441
int m_compId
identity to put into element tags
Definition: FaceMesh.h:158
std::vector< std::vector< NodeSharedPtr > > m_connec
triangle connectiviities
Definition: FaceMesh.h:148
std::vector< CADSystem::EdgeLoopSharedPtr > m_edgeloops
data structure containing the edges, their order and oreientation for the surface ...
Definition: FaceMesh.h:138
void Mesh()
mesh exectuation command
Definition: FaceMesh.cpp:127
EdgeSet m_localEdges
local set of edges
Definition: FaceMesh.h:152
boost::shared_ptr< FaceMesh > FaceMeshSharedPtr
Definition: FaceMesh.h:161
int m_id
id of the surface mesh
Definition: FaceMesh.h:140
void OrientateCurves()
Get the boundries of the surface and extracts the nodes from the curve meshes in the correct order...
Definition: FaceMesh.cpp:1155
double NekDouble
void DiagonalSwap()
performs diagonal swapping of edges
Definition: FaceMesh.cpp:488
std::vector< NodeSharedPtr > m_stienerpoints
list of stiener points in the triangulation
Definition: FaceMesh.h:144
void MakeBL()
adds a quad layer around any interior loops
boost::shared_ptr< CADSurf > CADSurfSharedPtr
Definition: CADSurf.h:172
boost::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
Definition: Mesh.h:147
NekDouble m_str
pplane stretching
Definition: FaceMesh.h:146
void AddNewPoint(Array< OneD, NekDouble > uv)
adds a new stiener point to the triangulation for meshing
Definition: FaceMesh.cpp:1109
void Smoothing()
performs node smoothing on face
Definition: FaceMesh.cpp:237
void BuildLocalMesh()
build a local version of mesh elements
Definition: FaceMesh.cpp:883
boost::unordered_set< EdgeSharedPtr, EdgeHash > EdgeSet
Definition: Edge.h:162
void OptimiseLocalMesh()
function which calls the optimisation routines
Definition: FaceMesh.cpp:225
CADSurfSharedPtr m_cadsurf
CAD surface.
Definition: FaceMesh.h:133
MeshSharedPtr m_mesh
mesh pointer
Definition: FaceMesh.h:131
class for surface meshes on individual surfaces (paramter plane meshes)
Definition: FaceMesh.h:52
NodeSet m_localNodes
local set of nodes
Definition: FaceMesh.h:150
NodeSet m_inBoundary
set of nodes which are in the boundary (easier to identify conflicts with)
Definition: FaceMesh.h:156