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// Copyright (C) 2006-2022 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_TETGEN_SCAFFOLD_MESH_HEADER
27 #define OOMPH_TETGEN_SCAFFOLD_MESH_HEADER
28 
29 #include "mesh.h"
30 #include "Telements.h"
31 
32 // Include the data structure from tetgen
33 //#include "../../external_src/oomph_tetgen/tetgen.h"
34 #include "oomph_tetgen/tetgen.h"
35 
36 namespace oomph
37 {
38  //======================================================================
41  //======================================================================
42  class TetgenScaffoldMesh : public virtual Mesh
43  {
44  public:
47 
49  TetgenScaffoldMesh(const std::string& node_file_name,
50  const std::string& element_file_name,
51  const std::string& face_file_name);
52 
54  TetgenScaffoldMesh(tetgenio& tetgen_data);
55 
58 
62  unsigned global_node_number(const unsigned& i)
63  {
64  return Global_node[i];
65  }
66 
71  unsigned face_boundary(const unsigned& e, const unsigned& i) const
72  {
73  return Face_boundary[e][i];
74  }
75 
77  unsigned nglobal_edge()
78  {
79  return Nglobal_edge;
80  }
81 
84  bool edge_boundary(const unsigned& i)
85  {
86  return Edge_boundary[i];
87  }
88 
91  unsigned edge_index(const unsigned& e, const unsigned& i) const
92  {
93  return Edge_index[e][i];
94  }
95 
97  unsigned nglobal_face()
98  {
99  return Nglobal_face;
100  }
101 
104  unsigned face_index(const unsigned& e, const unsigned& i) const
105  {
106  return Face_index[e][i];
107  }
108 
112  double element_attribute(const unsigned& e) const
113  {
114  return Element_attribute[e];
115  }
116 
117 
118  protected:
120  unsigned Nglobal_face;
121 
123  unsigned Nglobal_edge;
124 
127 
130  std::vector<bool> Edge_boundary;
131 
135 
137  // the elements' edges
139 
141  // the elements' edges
143 
148  };
149 
150 } // namespace oomph
151 
152 #endif
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Definition: mesh.h:67
Definition: tetgen_scaffold_mesh.h:43
std::vector< bool > Edge_boundary
Definition: tetgen_scaffold_mesh.h:130
unsigned Nglobal_face
Storage for the number of global faces.
Definition: tetgen_scaffold_mesh.h:120
TetgenScaffoldMesh()
Empty constructor.
Definition: tetgen_scaffold_mesh.h:46
unsigned face_boundary(const unsigned &e, const unsigned &i) const
Definition: tetgen_scaffold_mesh.h:71
Vector< double > Element_attribute
Definition: tetgen_scaffold_mesh.h:147
unsigned nglobal_edge()
Return the number of internal edges.
Definition: tetgen_scaffold_mesh.h:77
bool edge_boundary(const unsigned &i)
Definition: tetgen_scaffold_mesh.h:84
~TetgenScaffoldMesh()
Empty destructor.
Definition: tetgen_scaffold_mesh.h:57
Vector< Vector< unsigned > > Face_index
Vector of vectors containing the global edge index of.
Definition: tetgen_scaffold_mesh.h:142
double element_attribute(const unsigned &e) const
Definition: tetgen_scaffold_mesh.h:112
unsigned edge_index(const unsigned &e, const unsigned &i) const
Definition: tetgen_scaffold_mesh.h:91
unsigned global_node_number(const unsigned &i)
Definition: tetgen_scaffold_mesh.h:62
unsigned Nglobal_edge
Storage for the number of global edges.
Definition: tetgen_scaffold_mesh.h:123
Vector< Vector< unsigned > > Edge_index
Vector of vectors containing the global edge index of.
Definition: tetgen_scaffold_mesh.h:138
Vector< unsigned > Global_node
Storage for global node numbers listed element-by-element.
Definition: tetgen_scaffold_mesh.h:126
Vector< Vector< unsigned > > Face_boundary
Definition: tetgen_scaffold_mesh.h:134
unsigned nglobal_face()
Return the number of internal face.
Definition: tetgen_scaffold_mesh.h:97
unsigned face_index(const unsigned &e, const unsigned &i) const
Definition: tetgen_scaffold_mesh.h:104
Definition: tetgen.h:201
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10