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
eighth_sphere_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_EIGHTH_SPHERE_MESH_HEADER
27
#define OOMPH_EIGHTH_SPHERE_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
36
// Include the headers file for domain
37
#include "
eighth_sphere_domain.h
"
38
39
namespace
oomph
40
{
41
//======================================================================
42
/// Eight of a sphere brick mesh, based on the EightSphereDomain
43
/// Non-refineable version with four brick elements.
44
/// The eighth-sphere is located in the positive octant,
45
/// centred at the origin. The mesh boundaries are numbered
46
/// as follows:
47
/// - Boundary 0: Plane x=0
48
/// - Boundary 1: Plane y=0
49
/// - Boundary 2: Plane z=0
50
/// - Boundary 3: The surface of the sphere.
51
//======================================================================
52
template
<
class
ELEMENT>
53
class
EighthSphereMesh
:
public
virtual
BrickMeshBase
54
{
55
public
:
56
/// Constructor: Pass radius and timestepper; defaults to
57
/// static default timestepper
58
EighthSphereMesh
(
const
double
&
radius
,
59
TimeStepper
*
time_stepper_pt
= &Mesh::Default_TimeStepper);
60
61
/// Destructor
62
~EighthSphereMesh
()
63
{
64
delete
Domain_pt
;
65
Domain_pt
= 0;
66
}
67
68
protected
:
69
/// Pointer to the domain
70
Domain*
Domain_pt
;
71
72
/// Radius of the sphere
73
double
Radius
;
74
};
75
76
//======================================================================
77
/// Refineable version of the eight of a sphere brick mesh.
78
/// The eighth-sphere is located in the positive octant,
79
/// centred at the origin. The mesh boundaries are numbered
80
/// as follows:
81
/// - Boundary 0: Plane x=0
82
/// - Boundary 1: Plane y=0
83
/// - Boundary 2: Plane z=0
84
/// - Boundary 3: The surface of the sphere.
85
//======================================================================
86
template
<
class
ELEMENT>
87
class
RefineableEighthSphereMesh
:
public
EighthSphereMesh
<ELEMENT>,
88
public
virtual
RefineableBrickMesh<ELEMENT>
89
{
90
public
:
91
/// Constructor: Pass radius and timestepper; defaults to
92
/// static default timestepper
93
RefineableEighthSphereMesh
(
94
const
double
&
radius
,
95
TimeStepper
*
time_stepper_pt
= &Mesh::Default_TimeStepper)
96
:
EighthSphereMesh
<
ELEMENT
>(
radius
,
time_stepper_pt
)
97
{
98
// Loop over all elements and set macro element pointer
99
unsigned
nel
= this->
nelement
();
100
for
(
unsigned
ielem
= 0;
ielem
<
nel
;
ielem
++)
101
{
102
dynamic_cast<
RefineableQElement<3>
*
>
(this->
element_pt
(
ielem
))
103
->
set_macro_elem_pt
(this->
Domain_pt
->macro_element_pt(
ielem
));
104
}
105
106
// Associate the elements with octrees and plant in forest
107
Vector<TreeRoot*>
tree_pt
;
108
OcTreeRoot::setup_static_data();
109
for
(
unsigned
e
= 0;
e
<
nel
;
e
++)
110
{
111
FiniteElement
*
el_pt
= this->
finite_element_pt
(
e
);
112
ELEMENT
*
ref_el_pt
=
dynamic_cast<
ELEMENT
*
>
(
el_pt
);
113
OcTreeRoot
*
octree_root_pt
=
new
OcTreeRoot
(
ref_el_pt
);
114
tree_pt
.push_back(
octree_root_pt
);
115
}
116
117
// Plant in forest
118
this->
Forest_pt
=
new
OcTreeForest
(
tree_pt
);
119
120
#ifdef PARANOID
121
// Run self test on octree forest
122
dynamic_cast<
OcTreeForest
*
>
(this->
Forest_pt
)->self_test();
123
#endif
124
}
125
};
126
127
}
// namespace oomph
128
129
#include "
eighth_sphere_mesh.template.cc
"
130
#endif
oomph::EighthSphereMesh
Eight of a sphere brick mesh, based on the EightSphereDomain Non-refineable version with four brick e...
Definition
eighth_sphere_mesh.h:54
oomph::EighthSphereMesh::~EighthSphereMesh
~EighthSphereMesh()
Destructor.
Definition
eighth_sphere_mesh.h:62
oomph::EighthSphereMesh::Domain_pt
Domain * Domain_pt
Pointer to the domain.
Definition
eighth_sphere_mesh.h:70
oomph::EighthSphereMesh::Radius
double Radius
Radius of the sphere.
Definition
eighth_sphere_mesh.h:73
oomph::RefineableEighthSphereMesh
Refineable version of the eight of a sphere brick mesh. The eighth-sphere is located in the positive ...
Definition
eighth_sphere_mesh.h:89
oomph::RefineableEighthSphereMesh::RefineableEighthSphereMesh
RefineableEighthSphereMesh(const double &radius, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass radius and timestepper; defaults to static default timestepper.
Definition
eighth_sphere_mesh.h:93
oomph::TetgenMesh
Unstructured tet mesh based on output from Tetgen: http://wias-berlin.de/software/tetgen/.
Definition
tetgen_mesh.h:51
eighth_sphere_domain.h
eighth_sphere_mesh.template.cc
oomph
Definition
annular_domain.h:35