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
xda_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_XDA_TET_MESH_HEADER
27
#define OOMPH_XDA_TET_MESH_HEADER
28
29
// Config header
30
#ifdef HAVE_CONFIG_H
31
#include <oomph-lib-config.h>
32
#endif
33
34
#ifdef OOMPH_HAS_MPI
35
// mpi headers
36
#include "mpi.h"
37
#endif
38
39
#include <string>
40
#include <iterator>
41
#include <algorithm>
42
43
#include "
generic/mesh.h
"
44
#include "
generic/tet_mesh.h
"
45
46
namespace
oomph
47
{
48
//========================================================================
49
/// Tet mesh made of quadratic (ten node) tets built from xda input file.
50
//========================================================================
51
template
<
class
ELEMENT>
52
class
XdaTetMesh
:
public
virtual
TetMeshBase
53
{
54
public
:
55
/// Constructor: Pass name of xda file. Note that
56
/// all boundary elements get their own ID -- this is required for
57
/// FSI problems. In this case; the vector containing the oomph-lib
58
/// boundary IDs of all oomph-lib boundaries that collectively form
59
/// a given boundary as specified in the xda input file can be
60
/// obtained from the access function oomph_lib_boundary_ids(...).
61
/// Timestepper defaults to steady pseudo-timestepper.
62
XdaTetMesh
(
const
std::string
xda_file_name
,
63
TimeStepper
* time_stepper_pt = &
Mesh::Default_TimeStepper
);
64
65
/// Setup boundary coordinate on boundary b while is
66
/// temporarily flattened to simplex faces. Boundary coordinates are the
67
/// x-y coordinates in the plane of that boundary with the
68
/// x-axis along the line from the (lexicographically)
69
/// "lower left" to the "upper right" node. The y axis
70
/// is obtained by taking the cross-product of the positive
71
/// x direction with the outer unit normal computed by
72
/// the face elements (or its negative if switch_normal is set
73
/// to true).
74
void
setup_boundary_coordinates
(
const
unsigned
& b,
75
const
bool
&
switch_normal
)
76
{
77
std::ofstream
outfile
;
78
setup_boundary_coordinates
(b,
switch_normal
,
outfile
);
79
}
80
81
/// Setup boundary coordinate on boundary b while is
82
/// temporarily flattened to simplex faces. Boundary coordinates are the
83
/// x-y coordinates in the plane of that boundary with the
84
/// x-axis along the line from the (lexicographically)
85
/// "lower left" to the "upper right" node. The y axis
86
/// is obtained by taking the cross-product of the positive
87
/// x direction with the outer unit normal computed by
88
/// the face elements (or its negative if switch_normal is set
89
/// to true). Doc faces in output file.
90
void
setup_boundary_coordinates
(
const
unsigned
& b,
91
const
bool
&
switch_normal
,
92
std::ofstream&
outfile
);
93
94
/// Access function to the number of distinct boundaries specified
95
/// in the original xda enumeration.
96
unsigned
nxda_boundary
()
97
{
98
return
Boundary_id
.
size
();
99
}
100
101
/// Access functions to the Vector of oomph-lib boundary ids
102
/// that make up boundary b in the original xda enumeration
103
Vector<unsigned>
oomph_lib_boundary_ids
(
const
unsigned
&
xda_boundary_id
)
104
{
105
return
Boundary_id
[
xda_boundary_id
];
106
}
107
108
private
:
109
/// Vector of vectors containing the boundary IDs of
110
/// the overall boundary specified in the xda file.
111
Vector<Vector<unsigned>
>
Boundary_id
;
112
};
113
114
115
////////////////////////////////////////////////////////////////////
116
////////////////////////////////////////////////////////////////////
117
////////////////////////////////////////////////////////////////////
118
119
//==========================================================================
120
/// Xda-based tet mesh upgraded to become a solid mesh.
121
//=========================================================================
122
template
<
class
ELEMENT>
123
class
SolidXdaTetMesh
:
public
virtual
XdaTetMesh
<ELEMENT>,
124
public
virtual
SolidMesh
125
{
126
public
:
127
/// Constructor. Boundary coordinates are setup
128
/// automatically.
129
SolidXdaTetMesh
(
const
std::string
xda_file_name
,
130
TimeStepper
* time_stepper_pt = &
Mesh::Default_TimeStepper
)
131
:
XdaTetMesh
<ELEMENT>(
xda_file_name
, time_stepper_pt)
132
{
133
// Assign the Lagrangian coordinates
134
set_lagrangian_nodal_coordinates
();
135
}
136
137
/// Empty Destructor
138
virtual
~SolidXdaTetMesh
() {}
139
};
140
141
142
////////////////////////////////////////////////////////////////////
143
////////////////////////////////////////////////////////////////////
144
////////////////////////////////////////////////////////////////////
145
146
}
// namespace oomph
147
148
#include "
xda_tet_mesh.template.cc
"
149
#endif
oomph::FiniteElement::size
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
Definition
elements.cc:4320
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::SolidMesh
General SolidMesh class.
Definition
mesh.h:2570
oomph::SolidMesh::set_lagrangian_nodal_coordinates
void set_lagrangian_nodal_coordinates()
Make the current configuration the undeformed one by setting the nodal Lagrangian coordinates to thei...
Definition
mesh.cc:9564
oomph::SolidXdaTetMesh
Xda-based tet mesh upgraded to become a solid mesh.
Definition
xda_tet_mesh.h:125
oomph::SolidXdaTetMesh::SolidXdaTetMesh
SolidXdaTetMesh(const std::string xda_file_name, TimeStepper *time_stepper_pt=&Mesh::Default_TimeStepper)
Constructor. Boundary coordinates are setup automatically.
Definition
xda_tet_mesh.h:129
oomph::SolidXdaTetMesh::~SolidXdaTetMesh
virtual ~SolidXdaTetMesh()
Empty Destructor.
Definition
xda_tet_mesh.h:138
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::XdaTetMesh
Tet mesh made of quadratic (ten node) tets built from xda input file.
Definition
xda_tet_mesh.h:53
oomph::XdaTetMesh::oomph_lib_boundary_ids
Vector< unsigned > oomph_lib_boundary_ids(const unsigned &xda_boundary_id)
Access functions to the Vector of oomph-lib boundary ids that make up boundary b in the original xda ...
Definition
xda_tet_mesh.h:103
oomph::XdaTetMesh::Boundary_id
Vector< Vector< unsigned > > Boundary_id
Vector of vectors containing the boundary IDs of the overall boundary specified in the xda file.
Definition
xda_tet_mesh.h:111
oomph::XdaTetMesh::setup_boundary_coordinates
void setup_boundary_coordinates(const unsigned &b, const bool &switch_normal)
Setup boundary coordinate on boundary b while is temporarily flattened to simplex faces....
Definition
xda_tet_mesh.h:74
oomph::XdaTetMesh::nxda_boundary
unsigned nxda_boundary()
Access function to the number of distinct boundaries specified in the original xda enumeration.
Definition
xda_tet_mesh.h:96
mesh.h
oomph
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition
advection_diffusion_elements.cc:30
tet_mesh.h
xda_tet_mesh.template.cc