GRINS-0.8.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-2017 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 // libMesh
30 #include "libmesh/mesh.h"
31 #include "libmesh/getpot.h"
32 
33 
34 // GRINS
35 #include "grins/common.h"
36 #include "grins/shared_ptr.h"
37 
38 namespace GRINS
39 {
40 
42  {
43  public:
44 
46 
50 
52  SharedPtr<libMesh::UnstructuredMesh> build
53  ( const GetPot& input,
54  const libMesh::Parallel::Communicator &comm
55  LIBMESH_CAN_DEFAULT_TO_COMMWORLD );
56 
58 
62  void do_mesh_refinement_from_input( const GetPot& input,
63  const libMesh::Parallel::Communicator &comm,
64  libMesh::UnstructuredMesh& mesh ) const;
65 
66  private:
67 
68  void generate_mesh( const std::string& mesh_build_type, const GetPot& input,
69  libMesh::UnstructuredMesh* mesh );
70 
72  template <typename T>
73  void deprecated_option( const GetPot& input, const std::string& old_option,
74  const std::string& new_option, const T& default_value,
75  T& option_value ) const;
76 
77  };
78 
79  template <typename T>
80  inline
81  void MeshBuilder::deprecated_option( const GetPot& input, const std::string& old_option,
82  const std::string& new_option, const T& default_value,
83  T& option_value ) const
84  {
85  if( input.have_variable(old_option) )
86  {
87  std::string warning = "WARNING: "+old_option+" is DEPRECATED.\n";
88  warning += " Please update to use "+new_option+".\n";
89  grins_warning(warning);
90 
91  option_value = input(old_option, default_value);
92  }
93 
94  return;
95  }
96 } // end namespace block
97 
98 #endif // GRINS_MESH_BUILDER_H
#define grins_warning(message)
Definition: common.h:34
MeshBuilder()
This Object handles building a libMesh::UnstructuredMesh subclass.
Definition: mesh_builder.h:48
GRINS namespace.
SharedPtr< 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:46
void generate_mesh(const std::string &mesh_build_type, const GetPot &input, libMesh::UnstructuredMesh *mesh)
Definition: mesh_builder.C:173
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:355
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:81

Generated on Tue Dec 19 2017 12:47:28 for GRINS-0.8.0 by  doxygen 1.8.9.1