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
Installation
Installation guide
Copyright
About
People
Contact/Get involved
Publications
Acknowledgements
Picture show
Go
src
generic
triangle_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// Copyright (C) 2006-2023 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_TRIANGLE_SCAFFOLD_MESH_HEADER
27
#define OOMPH_TRIANGLE_SCAFFOLD_MESH_HEADER
28
29
// Config header generated by autoconfig
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
40
#include "
triangle_mesh.h
"
41
#include "
Telements.h
"
42
43
44
namespace
oomph
45
{
46
//=====================================================================
47
/// Triangle Mesh that is based on input files generated by the
48
/// triangle mesh generator Triangle.
49
//=====================================================================
50
class
TriangleScaffoldMesh
:
public
virtual
Mesh
51
{
52
public
:
53
/// Empty constructor
54
TriangleScaffoldMesh
() {}
55
56
/// Constructor: Pass the filenames of the triangle files
57
TriangleScaffoldMesh
(
const
std::string
& node_file_name,
58
const
std::string
& element_file_name,
59
const
std::string
& poly_file_name);
60
61
#ifdef OOMPH_HAS_TRIANGLE_LIB
62
63
/// Constructor: Pass the TriangulateIO object
64
TriangleScaffoldMesh
(
TriangulateIO
& triangle_data);
65
66
#endif
67
68
/// Broken copy constructor
69
TriangleScaffoldMesh
(
const
TriangleScaffoldMesh
&) =
delete
;
70
71
/// Broken assignment operator
72
void
operator=
(
const
TriangleScaffoldMesh
&) =
delete
;
73
74
/// Empty destructor
75
~TriangleScaffoldMesh
() {}
76
77
/// Return the global node of each local node
78
/// listed element-by-element e*n_local_node + n_local
79
/// Note that the node numbers are indexed from 1
80
unsigned
global_node_number
(
const
unsigned
&
i
)
81
{
82
return
Global_node
[
i
];
83
}
84
85
/// Return the boundary id of the i-th edge in the e-th element:
86
/// This is zero-based as in triangle. Zero means the edge is not
87
/// on a boundary. Postive numbers identify the boundary.
88
/// Will be reduced by one to identify the oomph-lib boundary.
89
unsigned
edge_boundary
(
const
unsigned
&
e
,
const
unsigned
&
i
)
const
90
{
91
return
Edge_boundary
[
e
][
i
];
92
}
93
94
/// Return the number of internal edges
95
unsigned
nglobal_edge
()
96
{
97
return
Nglobal_edge
;
98
}
99
100
/// Return the global index of the i-th edge in the e-th element:
101
/// The global index starts from zero
102
unsigned
edge_index
(
const
unsigned
&
e
,
const
unsigned
&
i
)
const
103
{
104
return
Edge_index
[
e
][
i
];
105
}
106
107
/// Return the attribute of the element e
108
double
element_attribute
(
const
unsigned
&
e
)
const
109
{
110
return
Element_attribute
[
e
];
111
}
112
113
/// Vectors of hole centre coordinates
114
Vector<Vector<double>
>&
internal_point
()
115
{
116
return
Hole_centre
;
117
}
118
119
protected
:
120
/// Check mesh integrity -- performs some internal consistency checks
121
/// and throws error if violated.
122
void
check_mesh_integrity
();
123
124
/// Number of internal edges
125
unsigned
Nglobal_edge
;
126
127
/// Storage for global node numbers listed element-by-element
128
Vector<unsigned>
Global_node
;
129
130
/// Vector of vectors containing the boundary ids of the
131
/// elements' edges
132
Vector<Vector<unsigned>
>
Edge_boundary
;
133
134
/// Vector of vectors containing the global edge index of
135
// the elements' edges
136
Vector<Vector<unsigned>
>
Edge_index
;
137
138
/// Vector of double attributes for each element
139
Vector<double>
Element_attribute
;
140
141
/// Vectors of hole centre coordinates
142
Vector<Vector<double>
>
Hole_centre
;
143
};
144
145
}
// namespace oomph
146
147
#endif
Telements.h
e
e
Definition:
cfortran.h:571
i
cstr elem_len * i
Definition:
cfortran.h:603
oomph::Mesh
A general mesh class.
Definition:
mesh.h:67
oomph::TriangleScaffoldMesh
Triangle Mesh that is based on input files generated by the triangle mesh generator Triangle.
Definition:
triangle_scaffold_mesh.h:51
oomph::TriangleScaffoldMesh::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:
triangle_scaffold_mesh.h:80
oomph::TriangleScaffoldMesh::TriangleScaffoldMesh
TriangleScaffoldMesh(const TriangleScaffoldMesh &)=delete
Broken copy constructor.
oomph::TriangleScaffoldMesh::Global_node
Vector< unsigned > Global_node
Storage for global node numbers listed element-by-element.
Definition:
triangle_scaffold_mesh.h:128
oomph::TriangleScaffoldMesh::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:
triangle_scaffold_mesh.h:102
oomph::TriangleScaffoldMesh::operator=
void operator=(const TriangleScaffoldMesh &)=delete
Broken assignment operator.
oomph::TriangleScaffoldMesh::check_mesh_integrity
void check_mesh_integrity()
Check mesh integrity – performs some internal consistency checks and throws error if violated.
Definition:
triangle_scaffold_mesh.cc:35
oomph::TriangleScaffoldMesh::Nglobal_edge
unsigned Nglobal_edge
Number of internal edges.
Definition:
triangle_scaffold_mesh.h:125
oomph::TriangleScaffoldMesh::Element_attribute
Vector< double > Element_attribute
Vector of double attributes for each element.
Definition:
triangle_scaffold_mesh.h:139
oomph::TriangleScaffoldMesh::internal_point
Vector< Vector< double > > & internal_point()
Vectors of hole centre coordinates.
Definition:
triangle_scaffold_mesh.h:114
oomph::TriangleScaffoldMesh::TriangleScaffoldMesh
TriangleScaffoldMesh()
Empty constructor.
Definition:
triangle_scaffold_mesh.h:54
oomph::TriangleScaffoldMesh::element_attribute
double element_attribute(const unsigned &e) const
Return the attribute of the element e.
Definition:
triangle_scaffold_mesh.h:108
oomph::TriangleScaffoldMesh::Edge_boundary
Vector< Vector< unsigned > > Edge_boundary
Vector of vectors containing the boundary ids of the elements' edges.
Definition:
triangle_scaffold_mesh.h:132
oomph::TriangleScaffoldMesh::edge_boundary
unsigned edge_boundary(const unsigned &e, const unsigned &i) const
Return the boundary id of the i-th edge in the e-th element: This is zero-based as in triangle....
Definition:
triangle_scaffold_mesh.h:89
oomph::TriangleScaffoldMesh::nglobal_edge
unsigned nglobal_edge()
Return the number of internal edges.
Definition:
triangle_scaffold_mesh.h:95
oomph::TriangleScaffoldMesh::~TriangleScaffoldMesh
~TriangleScaffoldMesh()
Empty destructor.
Definition:
triangle_scaffold_mesh.h:75
oomph::TriangleScaffoldMesh::Hole_centre
Vector< Vector< double > > Hole_centre
Vectors of hole centre coordinates.
Definition:
triangle_scaffold_mesh.h:142
oomph::TriangleScaffoldMesh::Edge_index
Vector< Vector< unsigned > > Edge_index
Vector of vectors containing the global edge index of.
Definition:
triangle_scaffold_mesh.h:136
oomph::Vector
A slight extension to the standard template vector class so that we can include "graceful" array rang...
Definition:
Vector.h:58
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:286
oomph
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
Definition:
advection_diffusion_elements.cc:30
oomph::TriangulateIO
The Triangle data structure, modified from the triangle.h header supplied with triangle 1....
Definition:
unstructured_two_d_mesh_geometry_base.h:57
triangle_mesh.h