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
full_circle_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
27
#ifndef OOMPH_FULL_CIRCLE_MESH_HEADER
28
#define OOMPH_FULL_CIRCLE_MESH_HEADER
29
30
// Headers
31
#include "generic/refineable_quad_mesh.h"
32
33
// Include the headers file for domain
34
#include "
full_circle_domain.h
"
35
36
namespace
oomph
37
{
38
//====================================================================
39
/// Full circle mesh class.
40
/// The domain is specified by the GeomObject that identifies
41
/// the entire area. Non-refineable base version!
42
///
43
/// The mesh boundaries are numbered as follows:
44
/// - Boundary 0: The outer wall, represented by \f$\xi_1 = 1\f$.
45
/// .
46
///
47
//====================================================================
48
template
<
class
ELEMENT>
49
class
FullCircleMesh
:
public
virtual
QuadMeshBase
50
{
51
public
:
52
/// Constructor: Pass pointer to geometric object that
53
/// specifies the area; values of theta at which dividing lines
54
/// are to be placed, fractions of the radius for the central box
55
/// at the dividing lines and the timestepper.
56
/// Timestepper defaults to Steady dummy timestepper.
57
FullCircleMesh
(
GeomObject
* wall_pt,
58
const
Vector<double>
&
theta_positions
,
59
const
Vector<double>
&
radius_box
,
60
TimeStepper
*
time_stepper_pt
= &Mesh::Default_TimeStepper);
61
62
/// Destructor: empty
63
virtual
~FullCircleMesh
()
64
{
65
delete
Domain_pt
;
66
}
67
68
/// Access function to GeomObject representing wall
69
GeomObject
*&
area_pt
()
70
{
71
return
Area_pt
;
72
}
73
74
/// Access function to domain
75
FullCircleDomain
*
domain_pt
()
76
{
77
return
Domain_pt
;
78
}
79
80
/// Access function to underlying domain
81
FullCircleDomain
*
domain_pt
()
const
82
{
83
return
Domain_pt
;
84
}
85
86
protected
:
87
/// Pointer to domain
88
FullCircleDomain
*
Domain_pt
;
89
90
/// Pointer to the geometric object that represents the entire domain
91
GeomObject
*
Area_pt
;
92
};
93
94
95
////////////////////////////////////////////////////////////////////
96
////////////////////////////////////////////////////////////////////
97
////////////////////////////////////////////////////////////////////
98
99
//=============================================================
100
/// Adaptative version of the FullCircleMesh base mesh.
101
/// The domain is specified by the GeomObject that identifies
102
/// the entire area
103
///
104
/// The mesh boundaries are numbered as follows:
105
/// - Boundary 1: The outer wall, represetned by \f$\xi_1 = 1\f$.
106
/// .
107
///
108
//=============================================================
109
template
<
class
ELEMENT>
110
class
RefineableFullCircleMesh
:
public
FullCircleMesh
<ELEMENT>,
111
public
RefineableQuadMesh<ELEMENT>
112
113
{
114
public
:
115
/// Constructor for adaptive deformable quarter tube mesh class.
116
/// Pass pointer to geometric object that
117
/// specifies the volume, start and end coordinates for the centreline
118
/// on the geometric object. Values of theta at which dividing lines
119
/// are to be placed, fractions of the radius for the central box
120
/// at the dividing lines, the number of layers
121
/// and the timestepper.
122
/// Timestepper defaults to Steady dummy timestepper.
123
RefineableFullCircleMesh
(
124
GeomObject
* wall_pt,
125
const
Vector<double>
&
theta_positions
,
126
const
Vector<double>
&
radius_box
,
127
TimeStepper
*
time_stepper_pt
= &Mesh::Default_TimeStepper)
128
:
FullCircleMesh
<
ELEMENT
>(
129
wall_pt,
theta_positions
,
radius_box
,
time_stepper_pt
)
130
{
131
// Loop over all elements and set macro element pointer
132
for
(
unsigned
ielem
= 0;
ielem < FullCircleMesh<ELEMENT>::nelement
();
133
ielem
++)
134
{
135
dynamic_cast<
RefineableQElement<2>
*
>
(
136
FullCircleMesh<ELEMENT>::element_pt
(
ielem
))
137
->
set_macro_elem_pt
(this->
Domain_pt
->macro_element_pt(
ielem
));
138
}
139
140
// Setup Quadtree forest: Turn elements into individual octrees
141
// and plant in forest
142
Vector<TreeRoot*>
trees_pt
;
143
for
(
unsigned
iel
= 0;
iel < FullCircleMesh<ELEMENT>::nelement
();
iel
++)
144
{
145
FiniteElement
*
el_pt
=
FullCircleMesh<ELEMENT>::finite_element_pt
(
iel
);
146
ELEMENT
*
ref_el_pt
=
dynamic_cast<
ELEMENT
*
>
(
el_pt
);
147
QuadTreeRoot
*
quadtree_root_pt
=
new
QuadTreeRoot
(
ref_el_pt
);
148
trees_pt
.push_back(
quadtree_root_pt
);
149
}
150
151
this->
Forest_pt
=
new
QuadTreeForest
(
trees_pt
);
152
153
#ifdef PARANOID
154
// Run self test
155
unsigned
success_flag
=
156
dynamic_cast<
QuadTreeForest
*
>
(this->
Forest_pt
)->self_test();
157
if
(
success_flag
== 0)
158
{
159
oomph_info
<<
"Successfully built quadtree forest "
<< std::endl;
160
}
161
else
162
{
163
throw
OomphLibError
(
"Trouble in building quadtree forest "
,
164
OOMPH_CURRENT_FUNCTION
,
165
OOMPH_EXCEPTION_LOCATION
);
166
}
167
#endif
168
}
169
170
/// Destructor: empty
171
virtual
~RefineableFullCircleMesh
() {}
172
};
173
174
}
// namespace oomph
175
#include "
full_circle_mesh.template.cc
"
176
#endif
oomph::FullCircleDomain
Topologically circular domain, e.g. a tube cross section. The entire domain must be defined by a Geom...
Definition
full_circle_domain.h:69
oomph::FullCircleMesh
Full circle mesh class. The domain is specified by the GeomObject that identifies the entire area....
Definition
full_circle_mesh.h:50
oomph::FullCircleMesh::Domain_pt
FullCircleDomain * Domain_pt
Pointer to domain.
Definition
full_circle_mesh.h:88
oomph::FullCircleMesh::Area_pt
GeomObject * Area_pt
Pointer to the geometric object that represents the entire domain.
Definition
full_circle_mesh.h:91
oomph::FullCircleMesh::area_pt
GeomObject *& area_pt()
Access function to GeomObject representing wall.
Definition
full_circle_mesh.h:69
oomph::FullCircleMesh::domain_pt
FullCircleDomain * domain_pt() const
Access function to underlying domain.
Definition
full_circle_mesh.h:81
oomph::FullCircleMesh::~FullCircleMesh
virtual ~FullCircleMesh()
Destructor: empty.
Definition
full_circle_mesh.h:63
oomph::FullCircleMesh::domain_pt
FullCircleDomain * domain_pt()
Access function to domain.
Definition
full_circle_mesh.h:75
oomph::RefineableFullCircleMesh
Adaptative version of the FullCircleMesh base mesh. The domain is specified by the GeomObject that id...
Definition
full_circle_mesh.h:113
oomph::RefineableFullCircleMesh::RefineableFullCircleMesh
RefineableFullCircleMesh(GeomObject *wall_pt, const Vector< double > &theta_positions, const Vector< double > &radius_box, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor for adaptive deformable quarter tube mesh class. Pass pointer to geometric object that sp...
Definition
full_circle_mesh.h:123
oomph::RefineableFullCircleMesh::~RefineableFullCircleMesh
virtual ~RefineableFullCircleMesh()
Destructor: empty.
Definition
full_circle_mesh.h:171
oomph::RefineableTriangleMesh
Unstructured refineable Triangle Mesh.
Definition
triangle_mesh.h:2225
full_circle_domain.h
full_circle_mesh.template.cc
oomph
Definition
annular_domain.h:35