GRINS-0.8.0
qoi_factory.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 QOI_FACTORY_H
26 #define QOI_FACTORY_H
27 
28 //libMesh
29 #include "libmesh/getpot.h"
30 
31 //GRINS
32 #include "grins/composite_qoi.h"
33 #include "grins/rayfire_mesh.h"
34 
35 // shared_ptr
36 #include "grins/shared_ptr.h"
37 
38 namespace GRINS
39 {
40  class QoIFactory
41  {
42  public:
43 
44  QoIFactory();
45 
46  virtual ~QoIFactory();
47 
48  virtual SharedPtr<CompositeQoI> build(const GetPot& input);
49 
50  protected:
51 
52  virtual void add_qoi( const GetPot& input,
53  const std::string& qoi_name,
54  SharedPtr<CompositeQoI>& qois );
55 
56  virtual void check_qoi_physics_consistency( const GetPot& input,
57  const std::string& qoi_name );
58 
59  virtual void echo_qoi_list( SharedPtr<CompositeQoI>& qois );
60 
61  void consistency_helper( const std::set<std::string>& requested_physics,
62  const std::set<std::string>& required_physics,
63  const std::string& qoi_name );
64 
65  void consistency_error_msg( const std::string& qoi_name, const std::set<std::string>& required_physics );
66 
67  private:
69  template<typename T>
70  void get_var_value( const GetPot & input, T & value, std::string input_var, T default_value);
71  };
72 }
73 #endif // QOI_FACTORY_H
virtual SharedPtr< CompositeQoI > build(const GetPot &input)
Definition: qoi_factory.C:66
virtual void check_qoi_physics_consistency(const GetPot &input, const std::string &qoi_name)
Definition: qoi_factory.C:219
void consistency_error_msg(const std::string &qoi_name, const std::set< std::string > &required_physics)
Definition: qoi_factory.C:283
GRINS namespace.
void get_var_value(const GetPot &input, T &value, std::string input_var, T default_value)
Helper function to read a required value from the input file, or error if value is missing...
Definition: qoi_factory.C:303
virtual ~QoIFactory()
Definition: qoi_factory.C:61
virtual void echo_qoi_list(SharedPtr< CompositeQoI > &qois)
Definition: qoi_factory.C:248
void consistency_helper(const std::set< std::string > &requested_physics, const std::set< std::string > &required_physics, const std::string &qoi_name)
Definition: qoi_factory.C:264
virtual void add_qoi(const GetPot &input, const std::string &qoi_name, SharedPtr< CompositeQoI > &qois)
Definition: qoi_factory.C:98

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