Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CurveMesh.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: Curvemesh.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: object for individual curve meshes.
33 //
34 ////////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_MESHUTILS_SURFACEMESHING_CURVEMESH_H
37 #define NEKTAR_MESHUTILS_SURFACEMESHING_CURVEMESH_H
38 
39 #include <boost/shared_ptr.hpp>
40 
45 
48 
49 /**
50  * @brief class for meshing individual curves (1d meshing)
51  */
52 namespace Nektar
53 {
54 namespace NekMeshUtils
55 {
56 
57 class CurveMesh
58 {
59 public:
60  friend class MemoryManager<CurveMesh>;
61 
62  /**
63  * @brief default constructor
64  */
66  : m_cadcurve(c), m_octree(o), m_id(id), m_mesh(m){};
67 
68  /**
69  * @brief execute meshing
70  */
71  void Mesh();
72 
73  /**
74  * @brief get id of first node
75  */
77  {
78  return m_meshpoints[0];
79  }
80 
81  /**
82  * @brief get id of last node
83  */
85  {
86  return m_meshpoints.back();
87  }
88 
89  /**
90  * @brief get list of mesh nodes
91  */
92  std::vector<NodeSharedPtr> GetMeshPoints()
93  {
94  return m_meshpoints;
95  }
96 
97  /**
98  * @brief get the number of points in the curve
99  */
101  {
102  return m_meshpoints.size();
103  }
104 
105  /**
106  * @brief get the length of the curve
107  */
109  {
110  return m_curvelength;
111  }
112 
113 private:
114  /**
115  * @brief get node spacing sampling function
116  */
117  void GetSampleFunction();
118 
119  /**
120  * @brief get node spacing phi function
121  */
122  void GetPhiFunction();
123 
124  /**
125  * @brief evaluate paramter ds at curve location s
126  */
128 
129  /**
130  * @brief evaluate paramter ps at curve location s
131  */
133 
134  /// CAD curve
136  /// Octree object
138  /// length of the curve in real space
140  /// number of sampling points used in algorithm
142  /// coords of the ends of the parametric curve
144  /// array of function ds evaluations
145  std::vector<std::vector<NekDouble> > m_dst;
146  /// array of function ps evaluations
147  std::vector<std::vector<NekDouble> > m_ps;
148  /// spacing function evaluation
150  /// ds
152  /// number of edges to be made in the curve as defined by the spacing
153  /// funtion
154  int Ne;
155  /// paramteric coordiates of the mesh nodes
156  std::vector<NekDouble> meshsvalue;
157  /// ids of the mesh nodes
158  std::vector<NodeSharedPtr> m_meshpoints;
159  /// id of the curvemesh
160  int m_id;
161  ///
163 };
164 
165 typedef boost::shared_ptr<CurveMesh> CurveMeshSharedPtr;
166 }
167 }
168 
169 #endif
void GetSampleFunction()
get node spacing sampling function
Definition: CurveMesh.cpp:343
CurveMesh(int id, MeshSharedPtr m, CADCurveSharedPtr c, OctreeSharedPtr o)
default constructor
Definition: CurveMesh.h:65
NekDouble GetLength()
get the length of the curve
Definition: CurveMesh.h:108
Array< OneD, NekDouble > m_bounds
coords of the ends of the parametric curve
Definition: CurveMesh.h:143
int m_numSamplePoints
number of sampling points used in algorithm
Definition: CurveMesh.h:141
std::vector< std::vector< NekDouble > > m_ps
array of function ps evaluations
Definition: CurveMesh.h:147
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
NekDouble Ae
spacing function evaluation
Definition: CurveMesh.h:149
void Mesh()
execute meshing
Definition: CurveMesh.cpp:44
int m_id
id of the curvemesh
Definition: CurveMesh.h:160
OctreeSharedPtr m_octree
Octree object.
Definition: CurveMesh.h:137
std::vector< NodeSharedPtr > GetMeshPoints()
get list of mesh nodes
Definition: CurveMesh.h:92
int Ne
number of edges to be made in the curve as defined by the spacing funtion
Definition: CurveMesh.h:154
boost::shared_ptr< CurveMesh > CurveMeshSharedPtr
Definition: CurveMesh.h:165
std::vector< NodeSharedPtr > m_meshpoints
ids of the mesh nodes
Definition: CurveMesh.h:158
boost::shared_ptr< Node > NodeSharedPtr
Definition: Node.h:50
int GetNumPoints()
get the number of points in the curve
Definition: CurveMesh.h:100
double NekDouble
boost::shared_ptr< Octree > OctreeSharedPtr
Definition: Octree.h:186
CADCurveSharedPtr m_cadcurve
CAD curve.
Definition: CurveMesh.h:135
NodeSharedPtr GetLastPoint()
get id of last node
Definition: CurveMesh.h:84
NodeSharedPtr GetFirstPoint()
get id of first node
Definition: CurveMesh.h:76
boost::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
Definition: Mesh.h:137
void GetPhiFunction()
get node spacing phi function
Definition: CurveMesh.cpp:239
NekDouble m_curvelength
length of the curve in real space
Definition: CurveMesh.h:139
NekDouble EvaluateDS(NekDouble s)
evaluate paramter ds at curve location s
Definition: CurveMesh.cpp:261
NekDouble EvaluatePS(NekDouble s)
evaluate paramter ps at curve location s
Definition: CurveMesh.cpp:298
std::vector< std::vector< NekDouble > > m_dst
array of function ds evaluations
Definition: CurveMesh.h:145
std::vector< NekDouble > meshsvalue
paramteric coordiates of the mesh nodes
Definition: CurveMesh.h:156
boost::shared_ptr< CADCurve > CADCurveSharedPtr
Definition: CADCurve.h:168