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
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// 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_TRIANGLE_SCAFFOLD_MESH_HEADER
31
#define OOMPH_TRIANGLE_SCAFFOLD_MESH_HEADER
32
33
// Config header generated by autoconfig
34
#ifdef HAVE_CONFIG_H
35
#include <oomph-lib-config.h>
36
#endif
37
38
#ifdef OOMPH_HAS_MPI
39
//mpi headers
40
#include "mpi.h"
41
#endif
42
43
44
#include "
triangle_mesh.h
"
45
#include "
Telements.h
"
46
47
48
namespace
oomph
49
{
50
51
52
53
//=====================================================================
54
/// \short Triangle Mesh that is based on input files generated by the
55
/// triangle mesh generator Triangle.
56
//=====================================================================
57
class
TriangleScaffoldMesh
:
public
virtual
Mesh
58
{
59
60
public
:
61
62
/// Empty constructor
63
TriangleScaffoldMesh
() {}
64
65
/// \short Constructor: Pass the filenames of the triangle files
66
TriangleScaffoldMesh
(
const
std::string
& node_file_name,
67
const
std::string
& element_file_name,
68
const
std::string
& poly_file_name);
69
70
#ifdef OOMPH_HAS_TRIANGLE_LIB
71
72
/// \short Constructor: Pass the TriangulateIO object
73
TriangleScaffoldMesh
(
TriangulateIO
& triangle_data);
74
75
#endif
76
77
/// Broken copy constructor
78
TriangleScaffoldMesh
(
const
TriangleScaffoldMesh
&)
79
{
80
BrokenCopy::broken_copy
(
"TriangleScaffoldMesh"
);
81
}
82
83
/// Broken assignment operator
84
void
operator=
(
const
TriangleScaffoldMesh
&)
85
{
86
BrokenCopy::broken_assign
(
"TriangleScaffoldMesh"
);
87
}
88
89
90
/// Empty destructor
91
~TriangleScaffoldMesh
() {}
92
93
/// \short Return the global node of each local node
94
/// listed element-by-element e*n_local_node + n_local
95
/// Note that the node numbers are indexed from 1
96
unsigned
global_node_number
(
const
unsigned
&
i
)
97
{
return
Global_node
[
i
];}
98
99
/// \short Return the boundary id of the i-th edge in the e-th element:
100
/// This is zero-based as in triangle. Zero means the edge is not
101
/// on a boundary. Postive numbers identify the boundary.
102
/// Will be reduced by one to identify the oomph-lib boundary.
103
unsigned
edge_boundary
(
const
unsigned
&
e
,
const
unsigned
&
i
)
const
104
{
return
Edge_boundary
[
e
][
i
];}
105
106
/// \short Return the number of internal edges
107
unsigned
nglobal_edge
()
108
{
return
Nglobal_edge
;}
109
110
/// \short Return the global index of the i-th edge in the e-th element:
111
/// The global index starts from zero
112
unsigned
edge_index
(
const
unsigned
&
e
,
const
unsigned
&
i
)
const
113
{
return
Edge_index
[
e
][
i
];}
114
115
/// \short Return the attribute of the element e
116
double
element_attribute
(
const
unsigned
&
e
)
const
117
{
return
Element_attribute
[
e
];}
118
119
/// Vectors of hole centre coordinates
120
Vector<Vector<double>
>&
internal_point
(){
return
Hole_centre
;}
121
122
protected
:
123
124
/// Check mesh integrity -- performs some internal consistency checks
125
/// and throws error if violated.
126
void
check_mesh_integrity
();
127
128
/// \short Number of internal edges
129
unsigned
Nglobal_edge
;
130
131
/// \short Storage for global node numbers listed element-by-element
132
Vector<unsigned>
Global_node
;
133
134
/// \short Vector of vectors containing the boundary ids of the
135
/// elements' edges
136
Vector<Vector<unsigned>
>
Edge_boundary
;
137
138
/// \short Vector of vectors containing the global edge index of
139
// the elements' edges
140
Vector<Vector<unsigned>
>
Edge_index
;
141
142
/// \short Vector of double attributes for each element
143
Vector<double>
Element_attribute
;
144
145
/// Vectors of hole centre coordinates
146
Vector<Vector<double>
>
Hole_centre
;
147
148
};
149
150
}
151
152
#endif
oomph::TriangleScaffoldMesh::TriangleScaffoldMesh
TriangleScaffoldMesh(const TriangleScaffoldMesh &)
Broken copy constructor.
Definition:
triangle_scaffold_mesh.h:78
triangle_mesh.h
oomph::BrokenCopy::broken_copy
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
Definition:
oomph_utilities.cc:107
oomph::TriangleScaffoldMesh
Triangle Mesh that is based on input files generated by the triangle mesh generator Triangle...
Definition:
triangle_scaffold_mesh.h:57
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:96
oomph::TriangleScaffoldMesh::Nglobal_edge
unsigned Nglobal_edge
Number of internal edges.
Definition:
triangle_scaffold_mesh.h:129
i
cstr elem_len * i
Definition:
cfortran.h:607
oomph::TriangleScaffoldMesh::Element_attribute
Vector< double > Element_attribute
Vector of double attributes for each element.
Definition:
triangle_scaffold_mesh.h:143
oomph::TriangleScaffoldMesh::Hole_centre
Vector< Vector< double > > Hole_centre
Vectors of hole centre coordinates.
Definition:
triangle_scaffold_mesh.h:146
oomph::TriangleScaffoldMesh::Edge_index
Vector< Vector< unsigned > > Edge_index
Vector of vectors containing the global edge index of.
Definition:
triangle_scaffold_mesh.h:140
oomph::TriangleScaffoldMesh::element_attribute
double element_attribute(const unsigned &e) const
Return the attribute of the element e.
Definition:
triangle_scaffold_mesh.h:116
Telements.h
e
e
Definition:
cfortran.h:575
oomph::TriangleScaffoldMesh::Global_node
Vector< unsigned > Global_node
Storage for global node numbers listed element-by-element.
Definition:
triangle_scaffold_mesh.h:132
oomph
Definition:
advection_diffusion_elements.cc:33
oomph::Vector
Definition:
Vector.h:63
oomph::TriangleScaffoldMesh::internal_point
Vector< Vector< double > > & internal_point()
Vectors of hole centre coordinates.
Definition:
triangle_scaffold_mesh.h:120
oomph::TriangleScaffoldMesh::TriangleScaffoldMesh
TriangleScaffoldMesh()
Empty constructor.
Definition:
triangle_scaffold_mesh.h:63
oomph::TriangleScaffoldMesh::check_mesh_integrity
void check_mesh_integrity()
Definition:
triangle_scaffold_mesh.cc:41
oomph::TriangulateIO
Definition:
unstructured_two_d_mesh_geometry_base.h:65
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:103
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:112
oomph::TriangleScaffoldMesh::nglobal_edge
unsigned nglobal_edge()
Return the number of internal edges.
Definition:
triangle_scaffold_mesh.h:107
oomph::TriangleScaffoldMesh::~TriangleScaffoldMesh
~TriangleScaffoldMesh()
Empty destructor.
Definition:
triangle_scaffold_mesh.h:91
oomph::BrokenCopy::broken_assign
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
Definition:
oomph_utilities.cc:90
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::TriangleScaffoldMesh::operator=
void operator=(const TriangleScaffoldMesh &)
Broken assignment operator.
Definition:
triangle_scaffold_mesh.h:84
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:136
oomph::Mesh
A general mesh class.
Definition:
mesh.h:74