GRINS-0.6.0
mesh_builder.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2015 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 
26 #ifndef GRINS_MESH_BUILDER_H
27 #define GRINS_MESH_BUILDER_H
28 
29 // C++
30 #include "boost/tr1/memory.hpp"
31 
32 // libMesh
33 #include "libmesh/mesh.h"
34 #include "libmesh/getpot.h"
35 
36 
37 // GRINS
38 #include "grins/common.h"
39 
40 namespace GRINS
41 {
42 
44  {
45  public:
46 
48 
50  MeshBuilder();
51  ~MeshBuilder();
52 
53  void read_input_options( const GetPot& input );
54 
56  std::tr1::shared_ptr<libMesh::UnstructuredMesh> build
57  ( const GetPot& input,
58  const libMesh::Parallel::Communicator &comm
59  LIBMESH_CAN_DEFAULT_TO_COMMWORLD );
60 
62 
66  void do_mesh_refinement_from_input( const GetPot& input,
67  const libMesh::Parallel::Communicator &comm,
68  libMesh::UnstructuredMesh& mesh ) const;
69 
70  private:
71 
72  void generate_mesh( const std::string& mesh_build_type, const GetPot& input,
73  libMesh::UnstructuredMesh* mesh );
74 
76  template <typename T>
77  void deprecated_option( const GetPot& input, const std::string& old_option,
78  const std::string& new_option, const T& default_value,
79  T& option_value ) const;
80 
81  };
82 
83  template <typename T>
84  inline
85  void MeshBuilder::deprecated_option( const GetPot& input, const std::string& old_option,
86  const std::string& new_option, const T& default_value,
87  T& option_value ) const
88  {
89  if( input.have_variable(old_option) )
90  {
91  std::string warning = "WARNING: "+old_option+" is DEPRECATED.\n";
92  warning += " Please update to use "+new_option+".\n";
93  grins_warning(warning);
94 
95  option_value = input(old_option, default_value);
96  }
97 
98  return;
99  }
100 } // end namespace block
101 
102 #endif // GRINS_MESH_BUILDER_H
void read_input_options(const GetPot &input)
#define grins_warning(message)
Definition: common.h:34
MeshBuilder()
This Object handles building a libMesh::UnstructuredMesh subclass.
Definition: mesh_builder.C:46
GRINS namespace.
std::tr1::shared_ptr< libMesh::UnstructuredMesh > build(const GetPot &input, const libMesh::Parallel::Communicator &comm LIBMESH_CAN_DEFAULT_TO_COMMWORLD)
Builds the libMesh::Mesh according to input options.
Definition: mesh_builder.C:57
void generate_mesh(const std::string &mesh_build_type, const GetPot &input, libMesh::UnstructuredMesh *mesh)
Definition: mesh_builder.C:178
void do_mesh_refinement_from_input(const GetPot &input, const libMesh::Parallel::Communicator &comm, libMesh::UnstructuredMesh &mesh) const
Refine the mesh based on user input parameters.
Definition: mesh_builder.C:360
void deprecated_option(const GetPot &input, const std::string &old_option, const std::string &new_option, const T &default_value, T &option_value) const
Helper function for displaying deprecated warnings.
Definition: mesh_builder.h:85

Generated on Mon Jun 22 2015 21:32:20 for GRINS-0.6.0 by  doxygen 1.8.9.1