GRINS-0.8.0
runner.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 #ifndef GRINS_RUNNER_H
26 #define GRINS_RUNNER_H
27 
28 // GRINS
31 #include "grins/simulation.h"
32 
33 // libMesh
34 #include "libmesh/getpot.h"
35 
36 // C++
37 #include <iostream>
38 
39 namespace GRINS
40 {
42 
47  class Runner
48  {
49  public:
50 
52 
56  Runner( int argc, char* argv[] );
57 
58  ~Runner(){}
59 
60  const GetPot & get_input_file() const
61  { return *_inputfile; }
62 
63  const GetPot & get_command_line() const
64  { return _command_line; }
65 
67  { libmesh_assert(_simulation);
68  return *_simulation; }
69 
70  const Simulation & get_simulation() const
71  { libmesh_assert(_simulation);
72  return *_simulation; }
73 
74  const libMesh::LibMeshInit & get_libmesh_init() const
75  { return *_libmesh_init; }
76 
78  void init();
79 
81  void run();
82 
83  protected:
84 
86  void echo_version_info( std::ostream & out, int argc, char* argv[] );
87 
89  std::string check_and_get_inputfile(int argc, char* argv[], GetPot & command_line);
90 
92  void check_for_unused_vars( const GetPot& input, bool warning_only );
93 
95 
97 
98  GetPot _command_line;
99 
100  libMesh::UniquePtr<libMesh::LibMeshInit> _libmesh_init;
101 
102  libMesh::UniquePtr<GetPot> _inputfile;
103 
104  libMesh::UniquePtr<Simulation> _simulation;
105 
106  private:
107 
108  Runner();
109 
110  };
111 } // end namespace GRINS
112 
113 #endif // GRINS_RUNNER_H
void echo_version_info(std::ostream &out, int argc, char *argv[])
Echo GRINS, libMesh version info as well as command line.
Definition: runner.C:62
libMesh::UniquePtr< Simulation > _simulation
Definition: runner.h:104
void init()
Initialize the Simulation objects.
Definition: runner.C:53
void check_for_unused_vars(const GetPot &input, bool warning_only)
Check for any unused variables in GetPot input file.
Definition: runner.C:114
SimulationBuilder _sim_builder
Definition: runner.h:96
const GetPot & get_input_file() const
Definition: runner.h:60
const libMesh::LibMeshInit & get_libmesh_init() const
Definition: runner.h:74
GRINS namespace.
SimulationInitializer _initializer
Definition: runner.h:94
const Simulation & get_simulation() const
Definition: runner.h:70
Initialize static objects needed for simulation.
GetPot _command_line
Definition: runner.h:98
std::string check_and_get_inputfile(int argc, char *argv[], GetPot &command_line)
Check (and error if not found) and then return GetPot input file name.
Definition: runner.C:76
const GetPot & get_command_line() const
Definition: runner.h:63
libMesh::UniquePtr< GetPot > _inputfile
Definition: runner.h:102
Class to encapsulate initializing and running GRINS Simulation.
Definition: runner.h:47
libMesh::UniquePtr< libMesh::LibMeshInit > _libmesh_init
Definition: runner.h:100
void run()
Runs the simulation that was setup at construction time.
Definition: runner.C:104
Simulation & get_simulation()
Definition: runner.h:66

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