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.template.cc
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_QUARTER_PIPE_MESH_TEMPLATE_HEADER
27
#define OOMPH_QUARTER_PIPE_MESH_TEMPLATE_HEADER
28
29
#ifndef OOMPH_QUARTER_PIPE_MESH_HEADER
30
#error __FILE__ should only be included from quarter_pipe_mesh.h.
31
#endif
// OOMPH_QUARTER_PIPE_MESH_HEADER
32
33
namespace
oomph
34
{
35
//====================================================================
36
/// Constructor: Pass number of elements in various directions,
37
/// the inner and outer radius and the length of the tube
38
//====================================================================
39
template
<
class
ELEMENT>
40
QuarterPipeMesh<ELEMENT>::QuarterPipeMesh
(
const
unsigned
&
ntheta
,
41
const
unsigned
&
nr
,
42
const
unsigned
& nz,
43
const
double
&
rmin
,
44
const
double
&
rmax
,
45
const
double
&
length
,
46
TimeStepper
*
time_stepper_pt
)
47
:
SimpleCubicMesh
<
ELEMENT
>(
48
ntheta
,
nr
, nz, 1.0, 1.0,
length
,
time_stepper_pt
)
49
{
50
// Mesh can only be built with 3D Qelements.
51
MeshChecker::assert_geometric_element<QElementGeometricBase, ELEMENT>(3);
52
53
// Variables declaration
54
Ntheta
=
ntheta
;
55
Nr
=
nr
;
56
Nz
=
nz
;
57
Rmin
=
rmin
;
58
Rmax
=
rmax
;
59
Length
=
length
;
60
61
// Build macro element-based domain
62
Domain_pt
=
new
QuarterPipeDomain
(
ntheta
,
nr
,
nz
,
rmin
,
rmax
,
length
);
63
64
// Loop over all elements
65
unsigned
nel
= this->
nelement
();
66
for
(
unsigned
e
= 0;
e
<
nel
;
e
++)
67
{
68
// Try to cast to FiniteElement
69
FiniteElement
*
el_pt
=
dynamic_cast<
FiniteElement
*
>
(this->
element_pt
(
e
));
70
71
// Set macro element pointer
72
el_pt
->set_macro_elem_pt(
Domain_pt
->macro_element_pt(
e
));
73
}
74
75
// Update node coordinates with macroelement coordinates,
76
// updating solid coordinates too.
77
this->node_update(
true
);
78
79
// Setup boundary coordinates on inner boundary (boundary 1)
80
unsigned
b
= 1;
81
unsigned
nnod
= this->
nboundary_node
(
b
);
82
for
(
unsigned
j
= 0;
j
<
nnod
;
j
++)
83
{
84
// Pointer to node
85
Node
*
nod_pt
= this->
boundary_node_pt
(
b
,
j
);
86
87
// Get the Eulerian coordinates
88
double
x =
nod_pt
->x(0);
89
double
y =
nod_pt
->x(1);
90
double
z
=
nod_pt
->x(2);
91
92
// Polar angle
93
double
phi
=
atan2
(y, x);
94
95
// Set boundary coordinates
96
Vector<double>
zeta
(2);
97
zeta
[0] =
z
;
98
zeta
[1] =
phi
;
99
nod_pt
->set_coordinates_on_boundary(
b
,
zeta
);
100
}
101
this->
set_boundary_coordinate_exists
(
b
);
102
}
103
104
}
// namespace oomph
105
106
#endif
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::Length
double Length
Length.
Definition
quarter_pipe_mesh.h:98
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
QuarterPipeMesh(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.template.cc:40
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::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