$extrastylesheet
mesh_tetgen_interface.h
Go to the documentation of this file.
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 
00019 #ifndef LIBMESH_MESH_TETGEN_INTERFACE_H
00020 #define LIBMESH_MESH_TETGEN_INTERFACE_H
00021 
00022 #include "libmesh/libmesh_config.h"
00023 #ifdef LIBMESH_HAVE_TETGEN
00024 
00025 
00026 // Local includes
00027 #include "libmesh/elem.h"
00028 #include "libmesh/mesh_serializer.h"
00029 #include "libmesh/point.h" // used for specifying holes
00030 
00031 // C++ includes
00032 #include <cstddef>
00033 #include <map>
00034 #include <string>
00035 #include <vector>
00036 
00037 namespace libMesh
00038 {
00039 // Forward Declarations
00040 class UnstructuredMesh;
00041 class TetGenWrapper;
00042 
00043 
00053 class TetGenMeshInterface
00054 {
00055 public:
00056 
00060   explicit
00061   TetGenMeshInterface (UnstructuredMesh& mesh);
00062 
00066   ~TetGenMeshInterface() {}
00067 
00072   void triangulate_pointset ();
00073 
00078   void pointset_convexhull ();
00079 
00085   void triangulate_conformingDelaunayMesh (double quality_constraint=0.,
00086                                            double volume_constraint=0.);
00087 
00093   void triangulate_conformingDelaunayMesh_carvehole (const std::vector<Point>& holes,
00094                                                      double quality_constraint=0.,
00095                                                      double volume_constraint=0.);
00096 
00097 
00098 
00099 protected:
00106   void fill_pointlist(TetGenWrapper& wrapper);
00107 
00112   void assign_nodes_to_elem(unsigned* node_labels, Elem* elem);
00113 
00126   unsigned check_hull_integrity();
00127 
00134   void process_hull_integrity_result(unsigned result);
00135 
00140   void delete_2D_hull_elements();
00141 
00145   UnstructuredMesh& _mesh;
00146 
00154   std::vector<unsigned> _sequential_to_libmesh_node_map;
00155 
00159   MeshSerializer _serializer;
00160 
00161 };
00162 
00163 } // namespace libMesh
00164 
00165 #endif // LIBMESH_HAVE_TETGEN
00166 
00167 #endif // LIBMESH_MESH_TETGEN_INTERFACE_H