Nektar++
BLMesh.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: BLMesh.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 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: class for boundary layer meshing
32 //
33 ////////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef NEKTAR_MESHUTILS_BLMESHING_BLMESH_H
36 #define NEKTAR_MESHUTILS_BLMESHING_BLMESH_H
37 
40 
41 namespace Nektar
42 {
43 namespace NekMeshUtils
44 {
45 
46 class BLMesh
47 {
48 public:
49  friend class MemoryManager<BLMesh>;
50 
51  /**
52  *@brief default constructor
53  */
54  BLMesh(MeshSharedPtr m, std::vector<unsigned int> bls, NekDouble b, int l,
55  NekDouble p, int id)
56  : m_mesh(m), m_blsurfs(bls), m_bl(b), m_prog(p), m_layer(l), m_id(id)
57  {
58 
59  };
60 
61  /**
62  * @brief Execute boundary layer meshing
63  */
64  void Mesh();
65 
66  std::vector<unsigned int> GetSymSurfs()
67  {
68  return m_symSurfs;
69  }
70  std::vector<unsigned int> GetBLSurfs()
71  {
72  return m_blsurfs;
73  }
74 
75  std::map<NodeSharedPtr, NodeSharedPtr> GetSymNodes();
76 
77  std::vector<ElementSharedPtr> GetPseudoSurface()
78  {
79  return m_psuedoSurface;
80  }
81 
82  struct blInfo
83  {
86  int bl;
88  int symsurf;
89  bool onSym;
90  std::vector<ElementSharedPtr> els;
91  std::set<int> surfs;
92 
93  bool stopped;
94 
96  {
97  pNode->m_x = oNode->m_x + t * N[0];
98  pNode->m_y = oNode->m_y + t * N[1];
99  pNode->m_z = oNode->m_z + t * N[2];
100  }
101  };
102  typedef std::shared_ptr<blInfo> blInfoSharedPtr;
103 
104 private:
105  void Setup();
106  void GrowLayers();
107  void Shrink();
108  void BuildElements();
112 
113  NekDouble Visability(std::vector<ElementSharedPtr> tris,
115  Array<OneD, NekDouble> GetNormal(std::vector<ElementSharedPtr> tris);
116 
117  /// mesh object containing surface mesh
119  /// List of surfaces onto which boundary layers are placed
120  std::vector<unsigned int> m_blsurfs;
121  /// thickness of the boundary layer
124  int m_layer;
125  int m_id;
127  /// list of surfaces to be remeshed due to the boundary layer
128  std::vector<unsigned int> m_symSurfs;
129  /// data structure used to store and develop bl information
130  std::map<NodeSharedPtr, blInfoSharedPtr> m_blData;
131  std::map<NodeSharedPtr, std::vector<blInfoSharedPtr> >
132  m_nToNInfo; // node to neighbouring information
133  std::map<ElementSharedPtr, ElementSharedPtr> m_priToTri;
134  std::vector<ElementSharedPtr> m_psuedoSurface;
136 };
137 
138 typedef std::shared_ptr<BLMesh> BLMeshSharedPtr;
139 }
140 }
141 
142 #endif
Array< OneD, NekDouble > GetNormal(std::vector< ElementSharedPtr > tris)
Definition: BLMesh.cpp:842
std::vector< unsigned int > m_symSurfs
list of surfaces to be remeshed due to the boundary layer
Definition: BLMesh.h:128
std::vector< ElementSharedPtr > m_psuedoSurface
Definition: BLMesh.h:134
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
std::vector< ElementSharedPtr > els
Definition: BLMesh.h:90
MeshSharedPtr m_mesh
mesh object containing surface mesh
Definition: BLMesh.h:118
NekDouble Visability(std::vector< ElementSharedPtr > tris, Array< OneD, NekDouble > N)
Definition: BLMesh.cpp:828
void AlignNode(NekDouble t)
Definition: BLMesh.h:95
std::map< NodeSharedPtr, NodeSharedPtr > GetSymNodes()
Definition: BLMesh.cpp:158
Array< OneD, NekDouble > m_layerT
Definition: BLMesh.h:126
std::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
Definition: Mesh.h:156
BLMesh(MeshSharedPtr m, std::vector< unsigned int > bls, NekDouble b, int l, NekDouble p, int id)
default constructor
Definition: BLMesh.h:54
std::shared_ptr< Node > NodeSharedPtr
Definition: CADVert.h:49
NekDouble m_bl
thickness of the boundary layer
Definition: BLMesh.h:122
std::vector< unsigned int > GetSymSurfs()
Definition: BLMesh.h:66
std::map< NodeSharedPtr, blInfoSharedPtr > m_blData
data structure used to store and develop bl information
Definition: BLMesh.h:130
NekDouble Proximity(NodeSharedPtr n, ElementSharedPtr el)
Definition: BLMesh.cpp:360
NekMatrix< NekDouble > m_deriv[3]
Definition: BLMesh.h:135
std::shared_ptr< blInfo > blInfoSharedPtr
Definition: BLMesh.h:102
bool TestIntersectionEl(ElementSharedPtr e1, ElementSharedPtr e2)
Definition: BLMesh.cpp:449
std::shared_ptr< Element > ElementSharedPtr
Definition: Edge.h:49
Array< OneD, NekDouble > N
Definition: BLMesh.h:87
double NekDouble
bool IsPrismValid(ElementSharedPtr el)
Definition: BLMesh.cpp:696
std::map< NodeSharedPtr, std::vector< blInfoSharedPtr > > m_nToNInfo
Definition: BLMesh.h:132
std::vector< unsigned int > GetBLSurfs()
Definition: BLMesh.h:70
void Mesh()
Execute boundary layer meshing.
Definition: BLMesh.cpp:120
std::map< ElementSharedPtr, ElementSharedPtr > m_priToTri
Definition: BLMesh.h:133
std::shared_ptr< BLMesh > BLMeshSharedPtr
Definition: BLMesh.h:138
std::vector< ElementSharedPtr > GetPseudoSurface()
Definition: BLMesh.h:77
std::vector< unsigned int > m_blsurfs
List of surfaces onto which boundary layers are placed.
Definition: BLMesh.h:120