GRINS-0.8.0
parameter_antioch_reset.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_PARAMETER_ANTIOCH_RESET_H
26 #define GRINS_PARAMETER_ANTIOCH_RESET_H
27 
28 #include "grins_config.h"
29 
30 #ifdef GRINS_HAVE_ANTIOCH
31 
32 // Antioch ------------------------------------------
33 #include "antioch/reaction_set.h"
34 
35 // libMesh ------------------------------------------
36 #include "libmesh/libmesh_common.h"
37 #include "libmesh/parameter_accessor.h"
38 
39 namespace GRINS
40 {
41 
47  public libMesh::ParameterAccessor<libMesh::Number>
48  {
49  public:
54 
59  (Antioch::ReactionSet<libMesh::Real> & reaction_set,
60  const std::string & param_name);
61 
65  virtual ParameterAccessor<libMesh::Number> &
66  operator= (libMesh::Number * /* new_ptr */) { libmesh_error(); return *this; }
67 
71  virtual void set (const libMesh::Number & new_value);
72 
76  virtual const libMesh::Number& get () const;
77 
78  void push_back
79  (Antioch::ReactionSet<libMesh::Real> & new_reaction_set)
80  { _reaction_sets.push_back(&new_reaction_set); }
81 
86  std::size_t size() const { return _reaction_sets.size(); }
87 
91  virtual libMesh::UniquePtr<ParameterAccessor<libMesh::Number> > clone() const {
92  // Default shallow copy works for this class
94 
95  return libMesh::UniquePtr<ParameterAccessor<libMesh::Number> >(par);
96  }
97 
98  private:
99  // The Antioch getter/setter APIs take a reaction ID and a set of
100  // keywords to define which reaction parameter is of concern
101  std::string _reaction_id;
102  std::vector<std::string> _keywords;
103 
104  // We might have multiple Physics, each with its own ReactionSet, in
105  // need of perturbation
106  std::vector<Antioch::ReactionSet<libMesh::Number> *> _reaction_sets;
107 
108  // We need to return a reference from get(). That's a pointless
109  // pessimization for libMesh::Number but it might become worthwhile
110  // later when we handle field parameters.
111  mutable libMesh::Number _current_val;
112  };
113 
114 } // namespace GRINS
115 
116 #endif // GRINS_HAVE_ANTIOCH
117 
118 #endif // GRINS_PARAMETER_ANTIOCH_RESET_H
virtual ParameterAccessor< libMesh::Number > & operator=(libMesh::Number *)
GRINS namespace.
void push_back(Antioch::ReactionSet< libMesh::Real > &new_reaction_set)
std::vector< std::string > _keywords
virtual void set(const libMesh::Number &new_value)
virtual libMesh::UniquePtr< ParameterAccessor< libMesh::Number > > clone() const
std::vector< Antioch::ReactionSet< libMesh::Number > * > _reaction_sets

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