mesh_tetgen_wrapper.h
Go to the documentation of this file.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 #ifndef LIBMESH_MESH_TETGEN_WRAPPER_H
19 #define LIBMESH_MESH_TETGEN_WRAPPER_H
20 
21 #include "libmesh/libmesh_config.h"
22 #ifdef LIBMESH_HAVE_TETGEN
23 
24 // Local includes
25 
26 // TetGen include file
27 #include "tetgen.h" // Defines REAL and other Tetgen types
28 
29 // C++ includes
30 #include <string>
31 
32 namespace libMesh
33 {
42  {
43  public:
44 
48  TetGenWrapper ();
49 
53  ~TetGenWrapper ();
54 
87  void set_switches(const std::string& s);
88 
92  void run_tetgen();
93 
98 
102  int get_numberoftrifaces();
103 
107  void set_numberofpoints(int i);
108 
112  int get_numberofpoints();
113 
117  void set_numberoffacets(int i);
118 
122  void set_numberofholes(int i);
123 
127  void set_numberofregions(int i);
128 
132  void allocate_pointlist(int numofpoints);
133 
137  void allocate_facetlist(int numoffacets, int numofholes);
138 
142  void allocate_regionlist(int numofregions);
143 
147  void set_node(unsigned i, REAL x, REAL y, REAL z);
148 
152  void get_output_node(unsigned i, REAL& x, REAL& y, REAL& z);
153 
157  int get_element_node(unsigned i, unsigned j);
158 
162  int get_triface_node(unsigned i, unsigned j);
163 
167  REAL get_element_attribute(unsigned i);
168 
172  void set_hole(unsigned i, REAL x, REAL y, REAL z);
173 
177  void set_facet_numberofpolygons(unsigned i, int num);
178 
182  void set_facet_numberofholes(unsigned i, int num);
183 
188  void allocate_facet_polygonlist(unsigned i, int numofpolygons);
189 
193  void set_polygon_numberofvertices(unsigned i, unsigned j, int num);
194 
199  void allocate_polygon_vertexlist(unsigned i, unsigned j, int numofvertices);
200 
205  void set_vertex(unsigned i, unsigned j, unsigned k, int nodeindex);
206 
213  void set_region(unsigned i, REAL x, REAL y, REAL z,
214  REAL attribute, REAL vol_constraint);
215 
219  tetgenio tetgen_data;
220 
224  tetgenio* tetgen_output;
225 
229  tetgenmesh tetgen_mesh;
230 
234  tetgenbehavior tetgen_be;
235  };
236 
237 
238 
239 } // namespace libMesh
240 
241 
242 #endif // LIBMESH_HAVE_TETGEN
243 #endif // LIBMESH_MESH_TETGEN_WRAPPER_H

Site Created By: libMesh Developers
Last modified: February 07 2014 16:57:06 UTC

Hosted By:
SourceForge.net Logo