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
simple_cubic_tet_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_SIMPLE_CUBIC_TET_MESH_HEADER
27
#define OOMPH_SIMPLE_CUBIC_TET_MESH_HEADER
28
29
#include "
generic/Telements.h
"
30
#include "
generic/tet_mesh.h
"
31
#include "
generic/simple_cubic_scaffold_tet_mesh.h
"
32
33
namespace
oomph
34
{
35
//===================================================================
36
/// MySimple 3D tet mesh for TElements
37
//===================================================================
38
template
<
class
ELEMENT>
39
class
SimpleCubicTetMesh
:
public
TetMeshBase
40
{
41
public
:
42
/// Constructor: Pass number of element blocks
43
/// in the x, y and z directions and the corresponding dimensions.
44
/// Timestepper defaults to Steady.
45
SimpleCubicTetMesh
(
46
const
unsigned
&
n_x
,
47
const
unsigned
&
n_y
,
48
const
unsigned
&
n_z
,
49
const
double
&
l_x
,
50
const
double
& l_y,
51
const
double
&
l_z
,
52
TimeStepper
* time_stepper_pt = &
Mesh::Default_TimeStepper
)
53
{
54
// Mesh can only be built with 3D Telements.
55
MeshChecker::assert_geometric_element<TElementGeometricBase, ELEMENT>(3);
56
57
std::ostringstream
warn_message
;
58
warn_message
59
<<
"Note: The SimpleCubicTetMesh() is quite inefficient.\n"
60
<<
" If your code takes a long time in the constructor\n"
61
<<
" consider using another tet mesh\n"
;
62
OomphLibWarning
(
warn_message
.str(),
63
"SimpleCubicTetMesh::SimpleCubicTetMesh()"
,
64
OOMPH_EXCEPTION_LOCATION
);
65
oomph_info
<<
"Starting mesh construction..."
<< std::endl;
66
double
start_t
=
TimingHelpers::timer
();
67
68
// Build scaffold mesh
69
Tmp_mesh_pt
=
70
new
SimpleCubicScaffoldTetMesh
(
n_x
,
n_y
,
n_z
,
l_x
, l_y,
l_z
);
71
72
// Build actual mesh from scaffold mesh
73
build_from_scaffold
(time_stepper_pt);
74
75
delete
Tmp_mesh_pt
;
76
77
double
end_t
=
TimingHelpers::timer
();
78
oomph_info
<<
"...finished mesh construction. Total time [sec] "
79
<<
end_t
-
start_t
<< std::endl;
80
}
81
82
private
:
83
/// Build mesh from scaffold mesh
84
void
build_from_scaffold
(
TimeStepper
* time_stepper_pt);
85
86
/// Temporary scaffold mesh
87
Mesh
*
Tmp_mesh_pt
;
88
};
89
90
}
// namespace oomph
91
92
#include "
simple_cubic_tet_mesh.template.cc
"
93
#endif
Telements.h
oomph::Mesh
A general mesh class.
Definition
mesh.h:67
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::OomphLibWarning
An OomphLibWarning object which should be created as a temporary object to issue a warning....
Definition
oomph_definitions.h:274
oomph::SimpleCubicScaffoldTetMesh
Scaffold mesh for cubic tet mesh.
Definition
simple_cubic_scaffold_tet_mesh.h:37
oomph::SimpleCubicTetMesh
MySimple 3D tet mesh for TElements.
Definition
simple_cubic_tet_mesh.h:40
oomph::SimpleCubicTetMesh::Tmp_mesh_pt
Mesh * Tmp_mesh_pt
Temporary scaffold mesh.
Definition
simple_cubic_tet_mesh.h:87
oomph::SimpleCubicTetMesh::build_from_scaffold
void build_from_scaffold(TimeStepper *time_stepper_pt)
Build mesh from scaffold mesh.
Definition
simple_cubic_tet_mesh.template.cc:47
oomph::SimpleCubicTetMesh::SimpleCubicTetMesh
SimpleCubicTetMesh(const unsigned &n_x, const unsigned &n_y, const unsigned &n_z, const double &l_x, const double &l_y, const double &l_z, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor: Pass number of element blocks in the x, y and z directions and the corresponding dimensi...
Definition
simple_cubic_tet_mesh.h:45
oomph::TAdvectionDiffusionReactionElement
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
Definition
Tadvection_diffusion_reaction_elements.h:66
oomph::TetMeshBase
Base class for tet meshes (meshes made of 3D tet elements).
Definition
tet_mesh.h:847
oomph::TimeStepper
Base class for time-stepping schemes. Timestepper provides an approximation of the temporal derivativ...
Definition
timesteppers.h:231
oomph::TimingHelpers::timer
double timer()
returns the time in seconds after some point in past
Definition
oomph_utilities.cc:1303
oomph
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition
advection_diffusion_elements.cc:30
oomph::oomph_info
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...
Definition
oomph_definitions.cc:326
simple_cubic_scaffold_tet_mesh.h
simple_cubic_tet_mesh.template.cc
tet_mesh.h