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
quarter_pipe_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
// Include guards
27
#ifndef OOMPH_QUARTER_PIPE_MESH_TEMPLATE_HEADER
28
#define OOMPH_QUARTER_PIPE_MESH_TEMPLATE_HEADER
29
30
// Generic oomph-lib includes
31
#include "generic/mesh.h"
32
#include "generic/brick_mesh.h"
33
#include "generic/refineable_brick_mesh.h"
34
#include "
simple_cubic_mesh.h
"
35
#include "
quarter_pipe_domain.h
"
36
37
#include "generic/macro_element.h"
38
#include "generic/domain.h"
39
40
namespace
oomph
41
{
42
//================================================================
43
/// Non refineable quarter pipe mesh class
44
/// Deform a simple cubic mesh into a quarter pipe
45
/// r: radial direction
46
/// theta: azimuthal direction
47
/// z: axis direction
48
//================================================================
49
template
<
class
ELEMENT>
50
class
QuarterPipeMesh
:
public
virtual
SimpleCubicMesh
<ELEMENT>
51
{
52
public
:
53
/// Constructor: Pass number of elements in various directions,
54
/// the inner and outer radius and the length of the tube
55
QuarterPipeMesh
(
const
unsigned
&
ntheta
,
56
const
unsigned
&
nr
,
57
const
unsigned
&
nz
,
58
const
double
&
rmin
,
59
const
double
&
rmax
,
60
const
double
&
length
,
61
TimeStepper
*
time_stepper_pt
= &Mesh::Default_TimeStepper);
62
63
/// Empty Destructor
64
virtual
~QuarterPipeMesh
()
65
{
66
delete
Domain_pt
;
67
}
68
69
/// Access function to domain
70
QuarterPipeDomain
*
domain_pt
()
71
{
72
return
Domain_pt
;
73
}
74
75
/// Access function to underlying domain
76
QuarterPipeDomain
*
domain_pt
()
const
77
{
78
return
Domain_pt
;
79
}
80
81
protected
:
82
/// Number of elements azimuthal direction
83
unsigned
Ntheta
;
84
85
/// Number of elements radial direction
86
unsigned
Nr
;
87
88
/// Number of elements axial direction
89
unsigned
Nz
;
90
91
/// Inner radius
92
double
Rmin
;
93
94
/// Outer radius
95
double
Rmax
;
96
97
/// Length
98
double
Length
;
99
100
/// Pointer to domain
101
QuarterPipeDomain
*
Domain_pt
;
102
103
};
// endofclass
104
105
106
//////////////////////////////////////////////////////////////////////////
107
//////////////////////////////////////////////////////////////////////////
108
//////////////////////////////////////////////////////////////////////////
109
110
//================================================================
111
/// Refineable quarter pipe mesh class
112
//================================================================
113
template
<
class
ELEMENT>
114
class
RefineableQuarterPipeMesh
:
public
virtual
QuarterPipeMesh
<ELEMENT>,
115
public
RefineableBrickMesh<ELEMENT>
116
{
117
public
:
118
/// Constructor: Pass number of elements in various directions,
119
/// the inner and outer radius and the length of the tube
120
RefineableQuarterPipeMesh
(
121
const
unsigned
&
ntheta
,
122
const
unsigned
&
nr
,
123
const
unsigned
&
nz
,
124
const
double
&
rmin
,
125
const
double
&
rmax
,
126
const
double
&
length
,
127
TimeStepper
*
time_stepper_pt
= &Mesh::Default_TimeStepper)
128
:
SimpleCubicMesh
<
ELEMENT
>(
129
ntheta
,
nr
,
nz
, 1.0, 1.0, 1.0,
time_stepper_pt
),
130
QuarterPipeMesh
<
ELEMENT
>(
131
ntheta
,
nr
,
nz
,
rmin
,
rmax
,
length
,
time_stepper_pt
)
132
{
133
// Setup Octree forest: Turn elements into individual octrees
134
// and plant in forest
135
Vector<TreeRoot*>
trees_pt
;
136
for
(
unsigned
iel
= 0;
iel
< (
nr
*
ntheta
*
nz
);
iel
++)
137
{
138
FiniteElement
*
el_pt
=
QuarterPipeMesh<ELEMENT>::finite_element_pt
(
iel
);
139
ELEMENT
*
ref_el_pt
=
dynamic_cast<
ELEMENT
*
>
(
el_pt
);
140
OcTreeRoot
*
octree_root_pt
=
new
OcTreeRoot
(
ref_el_pt
);
141
trees_pt
.push_back(
octree_root_pt
);
142
}
143
144
this->
Forest_pt
=
new
OcTreeForest
(
trees_pt
);
145
}
146
147
/// Destructor -- delete forest
148
virtual
~RefineableQuarterPipeMesh
()
149
{
150
delete
this->
Forest_pt
;
151
}
152
153
};
// endofclass
154
155
156
//////////////////////////////////////////////////////////////////////////
157
//////////////////////////////////////////////////////////////////////////
158
//////////////////////////////////////////////////////////////////////////
159
160
//================================================================
161
/// Non refineable elastic quarter pipe mesh class
162
/// setup lagrangian coordinates for solid mechanics problems
163
//================================================================
164
template
<
class
ELEMENT>
165
class
ElasticQuarterPipeMesh
:
public
virtual
QuarterPipeMesh
<ELEMENT>,
166
public
virtual
SolidMesh
167
{
168
public
:
169
/// Constructor: Pass number of elements in various directions,
170
/// the inner and outer radius and the length of the tube.
171
/// Builds mesh and copies Eulerian coords to Lagrangian
172
/// ones so that the initial configuration is the stress-free one.
173
ElasticQuarterPipeMesh
(
174
const
unsigned
&
ntheta
,
175
const
unsigned
&
nr
,
176
const
unsigned
&
nz
,
177
const
double
&
rmin
,
178
const
double
&
rmax
,
179
const
double
&
length
,
180
TimeStepper
*
time_stepper_pt
= &Mesh::Default_TimeStepper)
181
:
SimpleCubicMesh
<
ELEMENT
>(
182
ntheta
,
nr
,
nz
, 1.0, 1.0, 1.0,
time_stepper_pt
),
183
QuarterPipeMesh
<
ELEMENT
>(
184
ntheta
,
nr
,
nz
,
rmin
,
rmax
,
length
,
time_stepper_pt
)
185
{
186
/// Make the current configuration the undeformed one by
187
/// setting the nodal Lagrangian coordinates to their current
188
/// Eulerian ones
189
set_lagrangian_nodal_coordinates
();
190
}
191
};
192
193
194
//////////////////////////////////////////////////////////////////////////
195
//////////////////////////////////////////////////////////////////////////
196
//////////////////////////////////////////////////////////////////////////
197
198
//================================================================
199
/// Refineable elastic quarter pipe mesh class
200
//================================================================
201
template
<
class
ELEMENT>
202
class
ElasticRefineableQuarterPipeMesh
203
:
public
virtual
ElasticQuarterPipeMesh
<ELEMENT>,
204
public
RefineableBrickMesh<ELEMENT>
205
{
206
public
:
207
/// Constructor: Pass number of elements in various directions,
208
/// the inner and outer radius and the length of the tube.
209
/// Builds mesh and copies Eulerian coords to Lagrangian
210
/// ones so that the initial configuration is the stress-free one.
211
ElasticRefineableQuarterPipeMesh
(
212
const
unsigned
&
ntheta
,
213
const
unsigned
&
nr
,
214
const
unsigned
&
nz
,
215
const
double
&
rmin
,
216
const
double
&
rmax
,
217
const
double
&
length
,
218
TimeStepper
*
time_stepper_pt
= &Mesh::Default_TimeStepper)
219
:
SimpleCubicMesh
<
ELEMENT
>(
220
ntheta
,
nr
,
nz
, 1.0, 1.0, 1.0,
time_stepper_pt
),
221
QuarterPipeMesh
<
ELEMENT
>(
222
ntheta
,
nr
,
nz
,
rmin
,
rmax
,
length
,
time_stepper_pt
),
223
ElasticQuarterPipeMesh
<
ELEMENT
>(
224
ntheta
,
nr
,
nz
,
rmin
,
rmax
,
length
,
time_stepper_pt
)
225
{
226
// Setup Octree forest: Turn elements into individual octrees
227
// and plant in forest
228
Vector<TreeRoot*>
trees_pt
;
229
for
(
unsigned
iel
= 0;
iel
< (
nr
*
ntheta
*
nz
);
iel
++)
230
{
231
FiniteElement
*
el_pt
=
QuarterPipeMesh<ELEMENT>::finite_element_pt
(
iel
);
232
ELEMENT
*
ref_el_pt
=
dynamic_cast<
ELEMENT
*
>
(
el_pt
);
233
OcTreeRoot
*
octree_root_pt
=
new
OcTreeRoot
(
ref_el_pt
);
234
trees_pt
.push_back(
octree_root_pt
);
235
}
236
this->
Forest_pt
=
new
OcTreeForest
(
trees_pt
);
237
238
// Loop over all elements and set the undeformed macro element pointer
239
unsigned
n_element
= this->
nelement
();
240
for
(
unsigned
e
= 0;
e
<
n_element
;
e
++)
241
{
242
// Get pointer to full element type
243
ELEMENT
*
el_pt
=
dynamic_cast<
ELEMENT
*
>
(this->
element_pt
(
e
));
244
245
// Set pointer to macro element so the curvlinear boundaries
246
// of the undeformed mesh/domain get picked up during adaptive
247
// mesh refinement
248
el_pt
->set_undeformed_macro_elem_pt(
249
this->
Domain_pt
->macro_element_pt(
e
));
250
251
// Use MacroElement representation for
252
// Lagrangian coordinates of newly created
253
// nodes
254
el_pt
255
->enable_use_of_undeformed_macro_element_for_new_lagrangian_coords();
256
}
257
}
258
};
259
260
}
// namespace oomph
261
262
#include "
quarter_pipe_mesh.template.cc
"
263
#endif
oomph::ElasticQuarterPipeMesh
Non refineable elastic quarter pipe mesh class setup lagrangian coordinates for solid mechanics probl...
Definition
quarter_pipe_mesh.h:167
oomph::ElasticQuarterPipeMesh::ElasticQuarterPipeMesh
ElasticQuarterPipeMesh(const unsigned &ntheta, const unsigned &nr, const unsigned &nz, const double &rmin, const double &rmax, const double &length, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in various directions, the inner and outer radius and the length...
Definition
quarter_pipe_mesh.h:173
oomph::ElasticRefineableQuarterPipeMesh
Refineable elastic quarter pipe mesh class.
Definition
quarter_pipe_mesh.h:205
oomph::ElasticRefineableQuarterPipeMesh::ElasticRefineableQuarterPipeMesh
ElasticRefineableQuarterPipeMesh(const unsigned &ntheta, const unsigned &nr, const unsigned &nz, const double &rmin, const double &rmax, const double &length, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in various directions, the inner and outer radius and the length...
Definition
quarter_pipe_mesh.h:211
oomph::MacroElementNodeUpdateCollapsibleChannelMesh
Collapsible channel mesh with MacroElement-based node update. The collapsible segment is represented ...
Definition
collapsible_channel_mesh.h:236
oomph::QuarterPipeDomain
Domain representing a quarter pipe.
Definition
quarter_pipe_domain.h:41
oomph::QuarterPipeMesh
Non refineable quarter pipe mesh class Deform a simple cubic mesh into a quarter pipe r: radial direc...
Definition
quarter_pipe_mesh.h:51
oomph::QuarterPipeMesh::Length
double Length
Length.
Definition
quarter_pipe_mesh.h:98
oomph::QuarterPipeMesh::domain_pt
QuarterPipeDomain * domain_pt()
Access function to domain.
Definition
quarter_pipe_mesh.h:70
oomph::QuarterPipeMesh::Domain_pt
QuarterPipeDomain * Domain_pt
Pointer to domain.
Definition
quarter_pipe_mesh.h:101
oomph::QuarterPipeMesh::Nz
unsigned Nz
Number of elements axial direction.
Definition
quarter_pipe_mesh.h:89
oomph::QuarterPipeMesh::~QuarterPipeMesh
virtual ~QuarterPipeMesh()
Empty Destructor.
Definition
quarter_pipe_mesh.h:64
oomph::QuarterPipeMesh::domain_pt
QuarterPipeDomain * domain_pt() const
Access function to underlying domain.
Definition
quarter_pipe_mesh.h:76
oomph::QuarterPipeMesh::Nr
unsigned Nr
Number of elements radial direction.
Definition
quarter_pipe_mesh.h:86
oomph::QuarterPipeMesh::Rmin
double Rmin
Inner radius.
Definition
quarter_pipe_mesh.h:92
oomph::QuarterPipeMesh::Ntheta
unsigned Ntheta
Number of elements azimuthal direction.
Definition
quarter_pipe_mesh.h:83
oomph::QuarterPipeMesh::Rmax
double Rmax
Outer radius.
Definition
quarter_pipe_mesh.h:95
oomph::RefineableQuarterPipeMesh
Refineable quarter pipe mesh class.
Definition
quarter_pipe_mesh.h:116
oomph::RefineableQuarterPipeMesh::RefineableQuarterPipeMesh
RefineableQuarterPipeMesh(const unsigned &ntheta, const unsigned &nr, const unsigned &nz, const double &rmin, const double &rmax, const double &length, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of elements in various directions, the inner and outer radius and the length...
Definition
quarter_pipe_mesh.h:120
oomph::RefineableQuarterPipeMesh::~RefineableQuarterPipeMesh
virtual ~RefineableQuarterPipeMesh()
Destructor – delete forest.
Definition
quarter_pipe_mesh.h:148
oomph::SimpleCubicMesh
Simple cubic 3D Brick mesh class.
Definition
simple_cubic_mesh.h:47
oomph::SimpleCubicMesh::nz
const unsigned & nz() const
Access function for number of elements in y directions.
Definition
simple_cubic_mesh.h:119
oomph
Definition
annular_domain.h:35
quarter_pipe_domain.h
quarter_pipe_mesh.template.cc
simple_cubic_mesh.h