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