Line data Source code
1 : // The libMesh Finite Element Library. 2 : // Copyright (C) 2002-2023 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 : 19 : #ifndef LIBMESH_MESH_NETGEN_INTERFACE_H 20 : #define LIBMESH_MESH_NETGEN_INTERFACE_H 21 : 22 : #include "libmesh/libmesh_config.h" 23 : 24 : #ifdef LIBMESH_HAVE_NETGEN 25 : 26 : // Local includes 27 : #include "libmesh/mesh_serializer.h" 28 : #include "libmesh/mesh_tet_interface.h" 29 : #include "libmesh/point.h" // used for specifying holes 30 : 31 : namespace nglib { 32 : #include "netgen/nglib/nglib.h" 33 : } 34 : 35 : // C++ includes 36 : #include <cstddef> 37 : #include <map> 38 : #include <string> 39 : #include <vector> 40 : 41 : namespace libMesh 42 : { 43 : // Forward Declarations 44 : class UnstructuredMesh; 45 : class Elem; 46 : 47 : /** 48 : * Class \p NetGenMeshInterface provides an interface for 49 : * tetrahedralization of meshes using the NetGen library. For 50 : * information about TetGen cf. 51 : * <a href="https://github.com/NGSolve/netgen/">NetGen github 52 : * repository</a>. 53 : * 54 : * \author Roy H. Stogner 55 : * \date 2024 56 : */ 57 : class NetGenMeshInterface : public MeshTetInterface 58 : { 59 : public: 60 : 61 : /** 62 : * Constructor. Takes a reference to the mesh containing the 63 : * triangulated surface which is to be tetrahedralized. 64 : */ 65 : explicit 66 : NetGenMeshInterface (UnstructuredMesh & mesh); 67 : 68 : /** 69 : * Empty destructor. 70 : */ 71 0 : virtual ~NetGenMeshInterface() override = default; 72 : 73 : /** 74 : * Method invokes NetGen library to compute a tetrahedralization 75 : */ 76 : virtual void triangulate () override; 77 : 78 : protected: 79 : 80 : /** 81 : * Tetgen only operates on serial meshes. 82 : */ 83 : MeshSerializer _serializer; 84 : }; 85 : 86 : } // namespace libMesh 87 : 88 : #endif // LIBMESH_HAVE_NETGEN 89 : 90 : #endif // LIBMESH_MESH_NETGEN_INTERFACE_H