$extrastylesheet
mesh_generation.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 
00020 #ifndef LIBMESH_MESH_GENERATION_H
00021 #define LIBMESH_MESH_GENERATION_H
00022 
00023 // Local Includes -----------------------------------
00024 // #include "libmesh/libmesh_common.h" // needed for Real
00025 #include "libmesh/libmesh.h"
00026 #include "libmesh/enum_elem_type.h"
00027 #include "libmesh/mesh_triangle_interface.h"
00028 #include "libmesh/vector_value.h"
00029 
00030 // C++ Includes   -----------------------------------
00031 #include <cstddef>
00032 #include <vector>
00033 
00034 namespace libMesh
00035 {
00036 
00037 // forward declarations
00038 class MeshBase;
00039 class UnstructuredMesh;
00040 
00041 
00042 
00043 // ------------------------------------------------------------
00044 // MeshTools::Generation namespace
00045 namespace MeshTools
00046 {
00053 namespace Generation
00054 {
00064 void build_cube (UnstructuredMesh& mesh,
00065                  const unsigned int nx=0,
00066                  const unsigned int ny=0,
00067                  const unsigned int nz=0,
00068                  const Real xmin=0., const Real xmax=1.,
00069                  const Real ymin=0., const Real ymax=1.,
00070                  const Real zmin=0., const Real zmax=1.,
00071                  const ElemType type=INVALID_ELEM,
00072                  const bool gauss_lobatto_grid=false);
00073 
00078 void build_point (UnstructuredMesh& mesh,
00079                   const ElemType type=INVALID_ELEM,
00080                   const bool gauss_lobatto_grid=false);
00081 
00088 void build_line (UnstructuredMesh& mesh,
00089                  const unsigned int nx,
00090                  const Real xmin=0., const Real xmax=1.,
00091                  const ElemType type=INVALID_ELEM,
00092                  const bool gauss_lobatto_grid=false);
00093 
00100 void build_square (UnstructuredMesh& mesh,
00101                    const unsigned int nx,
00102                    const unsigned int ny,
00103                    const Real xmin=0., const Real xmax=1.,
00104                    const Real ymin=0., const Real ymax=1.,
00105                    const ElemType type=INVALID_ELEM,
00106                    const bool gauss_lobatto_grid=false);
00107 
00111 void build_sphere (UnstructuredMesh& mesh,
00112                    const Real rad=1,
00113                    const unsigned int nr=2,
00114                    const ElemType type=INVALID_ELEM,
00115                    const unsigned int n_smooth=2,
00116                    const bool flat=true);
00117 
00121 void build_extrusion (UnstructuredMesh& mesh,
00122                       const MeshBase& cross_section,
00123                       const unsigned int nz,
00124                       RealVectorValue extrusion_vector);
00125 
00126 #ifdef LIBMESH_HAVE_TRIANGLE
00127 
00132 void build_delaunay_square(UnstructuredMesh& mesh,
00133                            const unsigned int nx, // num. of elements in x-dir
00134                            const unsigned int ny, // num. of elements in y-dir
00135                            const Real xmin, const Real xmax,
00136                            const Real ymin, const Real ymax,
00137                            const ElemType type,
00138                            const std::vector<TriangleInterface::Hole*>* holes=NULL);
00139 #endif // #define LIBMESH_HAVE_TRIANGLE
00140 
00141 } // end namespace Meshtools::Generation
00142 } // end namespace MeshTools
00143 
00144 
00145 } // namespace libMesh
00146 
00147 #endif // LIBMESH_MESH_GENERATION_H