$extrastylesheet
00001 // The libMesh Finite Element Library. 00002 // Copyright (C) 2002-2014 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner 00003 00004 // This library is free software; you can redistribute it and/or 00005 // modify it under the terms of the GNU Lesser General Public 00006 // License as published by the Free Software Foundation; either 00007 // version 2.1 of the License, or (at your option) any later version. 00008 00009 // This library is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 // Lesser General Public License for more details. 00013 00014 // You should have received a copy of the GNU Lesser General Public 00015 // License along with this library; if not, write to the Free Software 00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 #ifndef LIBMESH_MESH_TETGEN_WRAPPER_H 00019 #define LIBMESH_MESH_TETGEN_WRAPPER_H 00020 00021 #include "libmesh/libmesh_config.h" 00022 #ifdef LIBMESH_HAVE_TETGEN 00023 00024 // Local includes 00025 00026 // TetGen include file 00027 #include "tetgen.h" // Defines REAL and other Tetgen types 00028 00029 // C++ includes 00030 #include <string> 00031 00032 namespace libMesh 00033 { 00041 class TetGenWrapper 00042 { 00043 public: 00044 00048 TetGenWrapper (); 00049 00053 ~TetGenWrapper (); 00054 00087 void set_switches(const std::string& s); 00088 00092 void run_tetgen(); 00093 00097 int get_numberoftetrahedra(); 00098 00102 int get_numberoftrifaces(); 00103 00107 void set_numberofpoints(int i); 00108 00112 int get_numberofpoints(); 00113 00117 void set_numberoffacets(int i); 00118 00122 void set_numberofholes(int i); 00123 00127 void set_numberofregions(int i); 00128 00132 void allocate_pointlist(int numofpoints); 00133 00137 void allocate_facetlist(int numoffacets, int numofholes); 00138 00142 void allocate_regionlist(int numofregions); 00143 00147 void set_node(unsigned i, REAL x, REAL y, REAL z); 00148 00152 void get_output_node(unsigned i, REAL& x, REAL& y, REAL& z); 00153 00157 int get_element_node(unsigned i, unsigned j); 00158 00162 int get_triface_node(unsigned i, unsigned j); 00163 00167 REAL get_element_attribute(unsigned i); 00168 00172 void set_hole(unsigned i, REAL x, REAL y, REAL z); 00173 00177 void set_facet_numberofpolygons(unsigned i, int num); 00178 00182 void set_facet_numberofholes(unsigned i, int num); 00183 00188 void allocate_facet_polygonlist(unsigned i, int numofpolygons); 00189 00193 void set_polygon_numberofvertices(unsigned i, unsigned j, int num); 00194 00199 void allocate_polygon_vertexlist(unsigned i, unsigned j, int numofvertices); 00200 00205 void set_vertex(unsigned i, unsigned j, unsigned k, int nodeindex); 00206 00213 void set_region(unsigned i, REAL x, REAL y, REAL z, 00214 REAL attribute, REAL vol_constraint); 00215 00219 tetgenio tetgen_data; 00220 00224 tetgenio* tetgen_output; 00225 00229 tetgenmesh tetgen_mesh; 00230 00234 tetgenbehavior tetgen_be; 00235 }; 00236 00237 00238 00239 } // namespace libMesh 00240 00241 00242 #endif // LIBMESH_HAVE_TETGEN 00243 #endif // LIBMESH_MESH_TETGEN_WRAPPER_H