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
Get it
Installation guide
Get code from subversion repository
Get code as tar file
Copyright
About
People
Contact/Get involved
Publications
Acknowledgements
Picture show
Go
src
generic
tetgen_scaffold_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// Version 1.0; svn revision $LastChangedRevision$
7
//LIC//
8
//LIC// $LastChangedDate$
9
//LIC//
10
//LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11
//LIC//
12
//LIC// This library is free software; you can redistribute it and/or
13
//LIC// modify it under the terms of the GNU Lesser General Public
14
//LIC// License as published by the Free Software Foundation; either
15
//LIC// version 2.1 of the License, or (at your option) any later version.
16
//LIC//
17
//LIC// This library is distributed in the hope that it will be useful,
18
//LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
//LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
//LIC// Lesser General Public License for more details.
21
//LIC//
22
//LIC// You should have received a copy of the GNU Lesser General Public
23
//LIC// License along with this library; if not, write to the Free Software
24
//LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25
//LIC// 02110-1301 USA.
26
//LIC//
27
//LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28
//LIC//
29
//LIC//====================================================================
30
#ifndef OOMPH_TETGEN_SCAFFOLD_MESH_HEADER
31
#define OOMPH_TETGEN_SCAFFOLD_MESH_HEADER
32
33
#include "
mesh.h
"
34
#include "
Telements.h
"
35
36
//Include the data structure from tetgen
37
//#include "../../external_src/oomph_tetgen/tetgen.h"
38
#include "oomph_tetgen/tetgen.h"
39
40
namespace
oomph
41
{
42
43
//======================================================================
44
/// \short Mesh that is based on input files generated by the tetrahedra
45
/// mesh generator tetgen.
46
//======================================================================
47
class
TetgenScaffoldMesh
:
public
virtual
Mesh
48
{
49
50
public
:
51
52
///Empty constructor
53
TetgenScaffoldMesh
() {}
54
55
/// \short Constructor: Pass the filename of the tetrahedra file
56
TetgenScaffoldMesh
(
const
std::string
& node_file_name,
57
const
std::string
& element_file_name,
58
const
std::string
& face_file_name);
59
60
/// \short Constructor using direct tetgenio object
61
TetgenScaffoldMesh
(tetgenio& tetgen_data);
62
63
/// Empty destructor
64
~TetgenScaffoldMesh
() {}
65
66
/// \short Return the global node of each local node
67
/// listed element-by-element e*n_local_node + n_local
68
/// Note that the node numbers are indexed from 1
69
unsigned
global_node_number
(
const
unsigned
&
i
)
70
{
return
Global_node
[
i
];}
71
72
/// \short Return the boundary id of the i-th face in the e-th element:
73
/// This is zero-based as in tetgen. Zero means the face is not
74
/// on a boundary. Postive numbers identify the boundary.
75
/// Will be reduced by one to identify the oomph-lib boundary.
76
unsigned
face_boundary
(
const
unsigned
&
e
,
const
unsigned
&
i
)
const
77
{
return
Face_boundary
[
e
][
i
];}
78
79
/// \short Return the number of internal edges
80
unsigned
nglobal_edge
()
81
{
return
Nglobal_edge
;}
82
83
/// \short Return a boolean indicating whether the i-th global
84
/// edge is on a boundary
85
bool
edge_boundary
(
const
unsigned
&
i
)
86
{
return
Edge_boundary
[
i
];}
87
88
/// \short Return the global index of the i-th edge in the e-th element:
89
/// The global index starts from zero
90
unsigned
edge_index
(
const
unsigned
&
e
,
const
unsigned
&
i
)
const
91
{
return
Edge_index
[
e
][
i
];}
92
93
/// \short Return the number of internal face
94
unsigned
nglobal_face
()
95
{
return
Nglobal_face
;}
96
97
/// \short Return the global index of the i-th face in the e-th element:
98
/// The global index starts from zero
99
unsigned
face_index
(
const
unsigned
&
e
,
const
unsigned
&
i
)
const
100
{
return
Face_index
[
e
][
i
];}
101
102
/// \short Return the attribute of the element e.
103
/// NOTE: Attributes are doubles because tetgen forces us to! We only
104
/// use them for region IDs
105
double
element_attribute
(
const
unsigned
&
e
)
const
106
{
return
Element_attribute
[
e
];}
107
108
109
protected
:
110
111
/// \short Storage for the number of global faces
112
unsigned
Nglobal_face
;
113
114
/// \short Storage for the number of global edges
115
unsigned
Nglobal_edge
;
116
117
/// \short Storage for global node numbers listed element-by-element
118
Vector<unsigned>
Global_node
;
119
120
/// \short Vector of booleans to indicate whether a global edge lies
121
/// on a boundary
122
std::vector<bool>
Edge_boundary
;
123
124
/// \short Vector of vectors containing the boundary ids of the
125
/// elements' faces
126
Vector<Vector<unsigned>
>
Face_boundary
;
127
128
/// \short Vector of vectors containing the global edge index of
129
// the elements' edges
130
Vector<Vector<unsigned>
>
Edge_index
;
131
132
/// \short Vector of vectors containing the global edge index of
133
// the elements' edges
134
Vector<Vector<unsigned>
>
Face_index
;
135
136
/// \short Vector of double attributes for each element.
137
/// NOTE: This stores doubles because tetgen forces us to! We only
138
/// use it for region IDs
139
Vector<double>
Element_attribute
;
140
141
};
142
143
}
144
145
#endif
oomph::TetgenScaffoldMesh::global_node_number
unsigned global_node_number(const unsigned &i)
Return the global node of each local node listed element-by-element e*n_local_node + n_local Note tha...
Definition:
tetgen_scaffold_mesh.h:69
oomph::TetgenScaffoldMesh::nglobal_edge
unsigned nglobal_edge()
Return the number of internal edges.
Definition:
tetgen_scaffold_mesh.h:80
oomph::TetgenScaffoldMesh::edge_index
unsigned edge_index(const unsigned &e, const unsigned &i) const
Return the global index of the i-th edge in the e-th element: The global index starts from zero...
Definition:
tetgen_scaffold_mesh.h:90
oomph::TetgenScaffoldMesh::Nglobal_face
unsigned Nglobal_face
Storage for the number of global faces.
Definition:
tetgen_scaffold_mesh.h:112
oomph::TetgenScaffoldMesh::Face_boundary
Vector< Vector< unsigned > > Face_boundary
Vector of vectors containing the boundary ids of the elements' faces.
Definition:
tetgen_scaffold_mesh.h:126
i
cstr elem_len * i
Definition:
cfortran.h:607
mesh.h
oomph::TetgenScaffoldMesh::Edge_index
Vector< Vector< unsigned > > Edge_index
Vector of vectors containing the global edge index of.
Definition:
tetgen_scaffold_mesh.h:130
Telements.h
e
e
Definition:
cfortran.h:575
oomph::TetgenScaffoldMesh::TetgenScaffoldMesh
TetgenScaffoldMesh()
Empty constructor.
Definition:
tetgen_scaffold_mesh.h:53
oomph::TetgenScaffoldMesh::Nglobal_edge
unsigned Nglobal_edge
Storage for the number of global edges.
Definition:
tetgen_scaffold_mesh.h:115
oomph
Definition:
advection_diffusion_elements.cc:33
oomph::Vector< unsigned >
oomph::TetgenScaffoldMesh::Element_attribute
Vector< double > Element_attribute
Vector of double attributes for each element. NOTE: This stores doubles because tetgen forces us to! ...
Definition:
tetgen_scaffold_mesh.h:139
oomph::TetgenScaffoldMesh::Global_node
Vector< unsigned > Global_node
Storage for global node numbers listed element-by-element.
Definition:
tetgen_scaffold_mesh.h:118
oomph::TetgenScaffoldMesh::face_boundary
unsigned face_boundary(const unsigned &e, const unsigned &i) const
Return the boundary id of the i-th face in the e-th element: This is zero-based as in tetgen...
Definition:
tetgen_scaffold_mesh.h:76
oomph::TetgenScaffoldMesh::element_attribute
double element_attribute(const unsigned &e) const
Return the attribute of the element e. NOTE: Attributes are doubles because tetgen forces us to! We o...
Definition:
tetgen_scaffold_mesh.h:105
oomph::TetgenScaffoldMesh::Face_index
Vector< Vector< unsigned > > Face_index
Vector of vectors containing the global edge index of.
Definition:
tetgen_scaffold_mesh.h:134
oomph::TetgenScaffoldMesh::~TetgenScaffoldMesh
~TetgenScaffoldMesh()
Empty destructor.
Definition:
tetgen_scaffold_mesh.h:64
oomph::Global_string_for_annotation::string
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
Definition:
oomph_definitions.cc:278
oomph::TetgenScaffoldMesh
Mesh that is based on input files generated by the tetrahedra mesh generator tetgen.
Definition:
tetgen_scaffold_mesh.h:47
oomph::TetgenScaffoldMesh::Edge_boundary
std::vector< bool > Edge_boundary
Vector of booleans to indicate whether a global edge lies on a boundary.
Definition:
tetgen_scaffold_mesh.h:122
oomph::TetgenScaffoldMesh::nglobal_face
unsigned nglobal_face()
Return the number of internal face.
Definition:
tetgen_scaffold_mesh.h:94
oomph::TetgenScaffoldMesh::edge_boundary
bool edge_boundary(const unsigned &i)
Return a boolean indicating whether the i-th global edge is on a boundary.
Definition:
tetgen_scaffold_mesh.h:85
oomph::Mesh
A general mesh class.
Definition:
mesh.h:74
oomph::TetgenScaffoldMesh::face_index
unsigned face_index(const unsigned &e, const unsigned &i) const
Return the global index of the i-th face in the e-th element: The global index starts from zero...
Definition:
tetgen_scaffold_mesh.h:99