Toggle navigation
Documentation
Big picture
The finite element method
The data structure
Not-so-quick guide
Optimisation
Order of action functions
Example codes and tutorials
List of example codes and tutorials
Meshing
Solvers
MPI parallel processing
Post-processing/visualisation
Other
Change log
Creating documentation
Coding conventions
Index
FAQ
About
People
Contact/Get involved
Publications
Acknowledgements
Copyright
Picture show
Go
src
meshes
tube_mesh.h
Go to the documentation of this file.
1
// LIC// ====================================================================
2
// LIC// This file forms part of oomph-lib, the object-oriented,
3
// LIC// multi-physics finite-element library, available
4
// LIC// at http://www.oomph-lib.org.
5
// LIC//
6
// LIC// Copyright (C) 2006-2025 Matthias Heil and Andrew Hazel
7
// LIC//
8
// LIC// This library is free software; you can redistribute it and/or
9
// LIC// modify it under the terms of the GNU Lesser General Public
10
// LIC// License as published by the Free Software Foundation; either
11
// LIC// version 2.1 of the License, or (at your option) any later version.
12
// LIC//
13
// LIC// This library is distributed in the hope that it will be useful,
14
// LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
// LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
// LIC// Lesser General Public License for more details.
17
// LIC//
18
// LIC// You should have received a copy of the GNU Lesser General Public
19
// LIC// License along with this library; if not, write to the Free Software
20
// LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21
// LIC// 02110-1301 USA.
22
// LIC//
23
// LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24
// LIC//
25
// LIC//====================================================================
26
#ifndef OOMPH_TUBE_MESH_HEADER
27
#define OOMPH_TUBE_MESH_HEADER
28
29
// Headers
30
#include "generic/refineable_brick_mesh.h"
31
#include "generic/macro_element.h"
32
#include "generic/domain.h"
33
#include "generic/algebraic_elements.h"
34
#include "generic/brick_mesh.h"
35
#include "generic/macro_element_node_update_element.h"
36
37
// Include the headers file for domain
38
#include "
tube_domain.h
"
39
40
namespace
oomph
41
{
42
//====================================================================
43
/// 3D tube mesh class.
44
/// The domain is specified by the GeomObject that identifies
45
/// the entire volume. Non-refineable base version!
46
///
47
/// The mesh boundaries are numbered as follows:
48
/// - Boundary 0: "Inflow" cross section; located along the
49
/// line parametrised by \f$ \xi_0 = \xi_0^{lo} \f$.
50
/// - Boundary 1: The outer wall, represetned by \f$\xi_2 = 1\f$.
51
/// - Boundary 2: The out flow, represented by \f$\xi_0 = \xi_0^{hi}\f$.
52
///
53
//====================================================================
54
template
<
class
ELEMENT>
55
class
TubeMesh
:
public
virtual
BrickMeshBase
56
{
57
public
:
58
/// Constructor: Pass pointer to geometric object that
59
/// specifies the volume, start and end coordinates for the centreline
60
/// on the geometric object. Values of theta at which dividing lines
61
/// are to be placed, fractions of the radius for the central box
62
/// at the dividing lines, the number of layers
63
/// and the timestepper.
64
/// Timestepper defaults to Steady dummy timestepper.
65
TubeMesh
(
GeomObject
* wall_pt,
66
const
Vector<double>
&
centreline_limits
,
67
const
Vector<double>
&
theta_positions
,
68
const
Vector<double>
&
radius_box
,
69
const
unsigned
&
nlayer
,
70
TimeStepper
*
time_stepper_pt
= &Mesh::Default_TimeStepper);
71
72
/// Destructor: empty
73
virtual
~TubeMesh
()
74
{
75
delete
Domain_pt
;
76
}
77
78
/// Access function to GeomObject representing wall
79
GeomObject
*&
volume_pt
()
80
{
81
return
Volume_pt
;
82
}
83
84
/// Access function to domain
85
TubeDomain
*
domain_pt
()
86
{
87
return
Domain_pt
;
88
}
89
90
/// Access function to underlying domain
91
TubeDomain
*
domain_pt
()
const
92
{
93
return
Domain_pt
;
94
}
95
96
protected
:
97
/// Pointer to domain
98
TubeDomain
*
Domain_pt
;
99
100
/// Pointer to the geometric object that represents the curved wall
101
GeomObject
*
Volume_pt
;
102
};
103
104
105
////////////////////////////////////////////////////////////////////
106
////////////////////////////////////////////////////////////////////
107
////////////////////////////////////////////////////////////////////
108
109
//=============================================================
110
/// Adaptative version of the TubeMesh base mesh.
111
/// The domain is specified by the GeomObject that identifies
112
/// the entire volume
113
///
114
/// The mesh boundaries are numbered as follows:
115
/// - Boundary 0: "Inflow" cross section; located along the
116
/// line parametrised by \f$ \xi_0 = \xi_0^{lo} \f$.
117
/// - Boundary 1: The outer wall, represetned by \f$\xi_2 = 1\f$.
118
/// - Boundary 2: The out flow, represented by \f$\xi_0 = \xi_0^{hi}\f$.
119
///
120
//=============================================================
121
template
<
class
ELEMENT>
122
class
RefineableTubeMesh
:
public
TubeMesh
<ELEMENT>,
123
public
RefineableBrickMesh<ELEMENT>
124
125
{
126
public
:
127
/// Constructor for adaptive deformable quarter tube mesh class.
128
/// Pass pointer to geometric object that
129
/// specifies the volume, start and end coordinates for the centreline
130
/// on the geometric object. Values of theta at which dividing lines
131
/// are to be placed, fractions of the radius for the central box
132
/// at the dividing lines, the number of layers
133
/// and the timestepper.
134
/// Timestepper defaults to Steady dummy timestepper.
135
RefineableTubeMesh
(
136
GeomObject
* wall_pt,
137
const
Vector<double>
&
centreline_limits
,
138
const
Vector<double>
&
theta_positions
,
139
const
Vector<double>
&
radius_box
,
140
const
unsigned
&
nlayer
,
141
TimeStepper
*
time_stepper_pt
= &Mesh::Default_TimeStepper)
142
:
TubeMesh
<
ELEMENT
>(wall_pt,
143
centreline_limits
,
144
theta_positions
,
145
radius_box
,
146
nlayer
,
147
time_stepper_pt
)
148
{
149
// Loop over all elements and set macro element pointer
150
for
(
unsigned
ielem
= 0;
ielem < TubeMesh<ELEMENT>::nelement
();
ielem
++)
151
{
152
dynamic_cast<
RefineableQElement<3>
*
>
(
153
TubeMesh<ELEMENT>::element_pt
(
ielem
))
154
->
set_macro_elem_pt
(this->
Domain_pt
->macro_element_pt(
ielem
));
155
}
156
157
// Setup Octree forest: Turn elements into individual octrees
158
// and plant in forest
159
Vector<TreeRoot*>
trees_pt
;
160
for
(
unsigned
iel
= 0;
iel < TubeMesh<ELEMENT>::nelement
();
iel
++)
161
{
162
FiniteElement
*
el_pt
=
TubeMesh<ELEMENT>::finite_element_pt
(
iel
);
163
ELEMENT
*
ref_el_pt
=
dynamic_cast<
ELEMENT
*
>
(
el_pt
);
164
OcTreeRoot
*
octree_root_pt
=
new
OcTreeRoot
(
ref_el_pt
);
165
trees_pt
.push_back(
octree_root_pt
);
166
}
167
this->
Forest_pt
=
new
OcTreeForest
(
trees_pt
);
168
169
#ifdef PARANOID
170
// Run self test
171
unsigned
success_flag
=
172
dynamic_cast<
OcTreeForest
*
>
(this->
Forest_pt
)->self_test();
173
if
(
success_flag
== 0)
174
{
175
oomph_info
<<
"Successfully built octree forest "
<< std::endl;
176
}
177
else
178
{
179
throw
OomphLibError
(
"Trouble in building octree forest "
,
180
OOMPH_CURRENT_FUNCTION
,
181
OOMPH_EXCEPTION_LOCATION
);
182
}
183
#endif
184
}
185
186
/// Destructor: empty
187
virtual
~RefineableTubeMesh
() {}
188
};
189
190
}
// namespace oomph
191
#include "
tube_mesh.template.cc
"
192
#endif
oomph::GeompackQuadMesh
Quadrilateral mesh generator; Uses input from Geompack++. See: http://members.shaw....
Definition
geompack_mesh.h:42
oomph::RefineableTubeMesh
Adaptative version of the TubeMesh base mesh. The domain is specified by the GeomObject that identifi...
Definition
tube_mesh.h:125
oomph::RefineableTubeMesh::RefineableTubeMesh
RefineableTubeMesh(GeomObject *wall_pt, const Vector< double > ¢reline_limits, const Vector< double > &theta_positions, const Vector< double > &radius_box, const unsigned &nlayer, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor for adaptive deformable quarter tube mesh class. Pass pointer to geometric object that sp...
Definition
tube_mesh.h:135
oomph::RefineableTubeMesh::~RefineableTubeMesh
virtual ~RefineableTubeMesh()
Destructor: empty.
Definition
tube_mesh.h:187
oomph::TubeDomain
Tube as a domain. The entire domain must be defined by a GeomObject with the following convention: ze...
Definition
tube_domain.h:70
oomph::TubeMesh
3D tube mesh class. The domain is specified by the GeomObject that identifies the entire volume....
Definition
tube_mesh.h:56
oomph::TubeMesh::Volume_pt
GeomObject * Volume_pt
Pointer to the geometric object that represents the curved wall.
Definition
tube_mesh.h:101
oomph::TubeMesh::domain_pt
TubeDomain * domain_pt()
Access function to domain.
Definition
tube_mesh.h:85
oomph::TubeMesh::Domain_pt
TubeDomain * Domain_pt
Pointer to domain.
Definition
tube_mesh.h:98
oomph::TubeMesh::domain_pt
TubeDomain * domain_pt() const
Access function to underlying domain.
Definition
tube_mesh.h:91
oomph::TubeMesh::volume_pt
GeomObject *& volume_pt()
Access function to GeomObject representing wall.
Definition
tube_mesh.h:79
oomph::TubeMesh::~TubeMesh
virtual ~TubeMesh()
Destructor: empty.
Definition
tube_mesh.h:73
oomph
Definition
annular_domain.h:35
tube_domain.h
tube_mesh.template.cc