GRINS-0.6.0
parameter_user.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 #ifndef GRINS_PARAMETER_USER_H
26 #define GRINS_PARAMETER_USER_H
27 
28 // C++
29 #include <string>
30 #include <set>
31 
32 //GRINS
33 #include "grins_config.h"
34 
35 //libMesh
36 #include "libmesh/libmesh.h"
37 
38 //C++
39 #include <map>
40 #include <string>
41 
42 // libMesh forward declarations
43 class GetPot;
44 namespace libMesh
45 {
46  template <typename Scalar>
47  class ParameterMultiPointer;
48 }
49 
51 namespace GRINS
52 {
54 
62  {
63 
64  public:
65 
66  ParameterUser(const std::string & user_name) : _my_name(user_name) {}
67  virtual ~ParameterUser() {}
68 
70  //file and prepare it for registration with this call.
71  virtual void set_parameter
72  ( libMesh::Number & param_variable,
73  const GetPot & input,
74  const std::string & param_name,
75  libMesh::Number param_default );
76 
77  // FIXME: add set_parameter for vectors
78 
80  // variable when the library makes this call.
81  // If the subclass has more than one copy to register, or if the
82  // subclass needs to register a parameter which was not
83  // previously assigned with set_parameter, then this method will
84  // need to be overridden.
85  virtual void register_parameter
86  ( const std::string & param_name,
88  const;
89 
90  private:
91  std::map<std::string, libMesh::Number*> _my_parameters;
92 
93  // This could be more efficient as a reference now, but we'd
94  // probably inadvertently break it later.
95  std::string _my_name;
96 
97  }; // End Physics class declarations
98 
99  /* ------------------------- Inline Functions -------------------------*/
100 
101 } // End namespace GRINS
102 
103 #endif //GRINS_PARAMETER_USER_H
virtual void set_parameter(libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
Each subclass can simultaneously read a parameter value from.
virtual void register_parameter(const std::string &param_name, libMesh::ParameterMultiPointer< libMesh::Number > &param_pointer) const
Each subclass will register its copy of an independent.
ParameterUser(const std::string &user_name)
GRINS namespace.
std::map< std::string, libMesh::Number * > _my_parameters
ParameterUser base class. Utility methods for subclasses.

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