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
algebraic_elements.h
brick_mesh.h
e
e
Definition
cfortran.h:571
oomph::BrickMeshBase
Base class for brick meshes (meshes made of 3D brick elements).
Definition
brick_mesh.h:178
oomph::Domain
Base class for Domains with curvilinear and/or time-dependent boundaries. Domain boundaries are typic...
Definition
domain.h:67
oomph::Domain::macro_element_pt
MacroElement * macro_element_pt(const unsigned &i)
Access to i-th macro element.
Definition
domain.h:116
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::FiniteElement
A general Finite Element class.
Definition
elements.h:1317
oomph::Mesh::Default_TimeStepper
static Steady< 0 > Default_TimeStepper
Default Steady Timestepper, to be used in default arguments to Mesh constructors.
Definition
mesh.h:75
oomph::Mesh::finite_element_pt
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
Definition
mesh.h:477
oomph::Mesh::element_pt
const Vector< GeneralisedElement * > & element_pt() const
Return reference to the Vector of elements.
Definition
mesh.h:464
oomph::Mesh::self_test
unsigned self_test()
Self-test: Check elements and nodes. Return 0 for OK.
Definition
mesh.cc:778
oomph::Mesh::nelement
unsigned long nelement() const
Return number of elements in the mesh.
Definition
mesh.h:598
oomph::OcTreeForest
An OcTreeForest consists of a collection of OcTreeRoots. Each member tree can have neighbours to its ...
Definition
octree.h:928
oomph::OcTreeRoot
OcTreeRoot is a OcTree that forms the root of a (recursive) octree. The "root node" is special as it ...
Definition
octree.h:611
oomph::OcTree::setup_static_data
static void setup_static_data()
Setup the static data, rotation and reflection schemes, etc.
Definition
octree.cc:1040
oomph::RefineableBrickMesh
Intermediate mesh class that implements the mesh adaptation functions specified in the TreeBasedRefin...
Definition
refineable_brick_mesh.h:59
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::TAdvectionDiffusionReactionElement
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
Definition
Tadvection_diffusion_reaction_elements.h:66
oomph::TimeStepper
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Definition
timesteppers.h:231
oomph::TreeBasedRefineableMeshBase::Forest_pt
TreeForest * Forest_pt
Forest representation of the mesh.
Definition
refineable_mesh.h:768
domain.h
eighth_sphere_domain.h
eighth_sphere_mesh.template.cc
macro_element.h
oomph
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition
advection_diffusion_elements.cc:30
refineable_brick_mesh.h