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: 1097 $
7 //LIC//
8 //LIC// $LastChangedDate: 2015-12-17 11:53:17 +0000 (Thu, 17 Dec 2015) $
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
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
79  {
80  BrokenCopy::broken_copy("TriangleScaffoldMesh");
81  }
82 
83  /// Broken assignment operator
85  {
86  BrokenCopy::broken_assign("TriangleScaffoldMesh");
87  }
88 
89 
90  /// Empty destructor
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
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
133 
134  /// \short Vector of vectors containing the boundary ids of the
135  /// elements' edges
137 
138  /// \short Vector of vectors containing the global edge index of
139  // the elements' edges
141 
142  /// \short Vector of double attributes for each element
144 
145  /// Vectors of hole centre coordinates
147 
148  };
149 
150 }
151 
152 #endif
TriangleScaffoldMesh(const TriangleScaffoldMesh &)
Broken copy constructor.
void broken_copy(const std::string &class_name)
Issue error message and terminate execution.
Triangle Mesh that is based on input files generated by the triangle mesh generator Triangle...
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...
unsigned Nglobal_edge
Number of internal edges.
double element_attribute(const unsigned &e) const
Return the attribute of the element e.
cstr elem_len * i
Definition: cfortran.h:607
Vector< double > Element_attribute
Vector of double attributes for each element.
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...
Vector< Vector< double > > Hole_centre
Vectors of hole centre coordinates.
Vector< Vector< unsigned > > Edge_index
Vector of vectors containing the global edge index of.
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...
e
Definition: cfortran.h:575
Vector< unsigned > Global_node
Storage for global node numbers listed element-by-element.
Vector< Vector< double > > & internal_point()
Vectors of hole centre coordinates.
TriangleScaffoldMesh()
Empty constructor.
unsigned nglobal_edge()
Return the number of internal edges.
~TriangleScaffoldMesh()
Empty destructor.
void broken_assign(const std::string &class_name)
Issue error message and terminate execution.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
void operator=(const TriangleScaffoldMesh &)
Broken assignment operator.
Vector< Vector< unsigned > > Edge_boundary
Vector of vectors containing the boundary ids of the elements' edges.
A general mesh class.
Definition: mesh.h:74