www.mooseframework.org
ScalarCoupleable.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef SCALARCOUPLEABLE_H
16 #define SCALARCOUPLEABLE_H
17 
18 #include "Moose.h"
19 
20 // MOOSE includes
21 #include "MooseVariableBase.h"
22 
23 // C++ includes
24 #include <map>
25 #include <string>
26 #include <vector>
27 
28 // Forward declarations
29 class FEProblemBase;
30 class InputParameters;
31 class MooseObject;
33 
39 {
40 public:
45  ScalarCoupleable(const MooseObject * moose_object);
46 
50  virtual ~ScalarCoupleable();
51 
56  const std::vector<MooseVariableScalar *> & getCoupledMooseScalarVars();
57 
58 protected:
59  // Reference to the interface's input parameters
61 
67  virtual bool isCoupledScalar(const std::string & var_name, unsigned int i = 0);
68 
73  virtual unsigned int coupledScalarComponents(const std::string & var_name);
74 
81  virtual unsigned int coupledScalar(const std::string & var_name, unsigned int comp = 0);
82 
89  virtual Order coupledScalarOrder(const std::string & var_name, unsigned int comp = 0);
90 
97  virtual VariableValue & coupledScalarValue(const std::string & var_name, unsigned int comp = 0);
98 
105  virtual VariableValue & coupledScalarValueOld(const std::string & var_name,
106  unsigned int comp = 0);
107 
114  virtual VariableValue & coupledScalarValueOlder(const std::string & var_name,
115  unsigned int comp = 0);
122  virtual VariableValue & coupledScalarDot(const std::string & var_name, unsigned int comp = 0);
123 
131  virtual VariableValue & coupledScalarDotDu(const std::string & var_name, unsigned int comp = 0);
132 
133 protected:
134  // Reference to FEProblemBase
136 
138  std::map<std::string, std::vector<MooseVariableScalar *>> _coupled_scalar_vars;
139 
141  std::map<std::string, VariableValue *> _default_value;
142 
144  std::vector<MooseVariableScalar *> _coupled_moose_scalar_vars;
145 
148 
151 
158  VariableValue * getDefaultValue(const std::string & var_name);
159 
166  MooseVariableScalar * getScalarVar(const std::string & var_name, unsigned int comp);
167 };
168 
169 #endif // SCALARCOUPLEABLE_H
const std::vector< MooseVariableScalar * > & getCoupledMooseScalarVars()
Get the list of coupled scalar variables.
virtual unsigned int coupledScalarComponents(const std::string &var_name)
Return the number of components to the coupled scalar variable.
virtual bool isCoupledScalar(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled_as name.
virtual ~ScalarCoupleable()
Destructor for object.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual VariableValue & coupledScalarDotDu(const std::string &var_name, unsigned int comp=0)
Time derivative of a scalar coupled variable with respect to the coefficients.
FEProblemBase & _sc_fe_problem
VariableValue * getDefaultValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
virtual unsigned int coupledScalar(const std::string &var_name, unsigned int comp=0)
Returns the index for a scalar coupled variable by name.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const InputParameters & _coupleable_params
Local InputParameters.
MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp)
Extract pointer to a scalar coupled variable.
bool _sc_is_implicit
True if implicit value is required.
virtual VariableValue & coupledScalarValueOld(const std::string &var_name, unsigned int comp=0)
Returns the old (previous time step) value of a scalar coupled variable.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:36
virtual Order coupledScalarOrder(const std::string &var_name, unsigned int comp=0)
Returns the order for a scalar coupled variable by name.
std::map< std::string, std::vector< MooseVariableScalar * > > _coupled_scalar_vars
Coupled vars whose values we provide.
virtual VariableValue & coupledScalarValue(const std::string &var_name, unsigned int comp=0)
Returns value of a scalar coupled variable.
const InputParameters & _sc_parameters
std::map< std::string, VariableValue * > _default_value
Will hold the default value for optional coupled scalar variables.
ScalarCoupleable(const MooseObject *moose_object)
Constructing the object.
std::vector< MooseVariableScalar * > _coupled_moose_scalar_vars
Vector of coupled variables.
Class for scalar variables (they are different).
virtual VariableValue & coupledScalarDot(const std::string &var_name, unsigned int comp=0)
Returns the time derivative of a scalar coupled variable.
Interface for objects that needs scalar coupling capabilities.
virtual VariableValue & coupledScalarValueOlder(const std::string &var_name, unsigned int comp=0)
Returns the older (two time steps previous) value of a scalar coupled variable.