Interface for objects that needs scalar coupling capabilities. More...
#include <ScalarCoupleable.h>
Public Member Functions | |
ScalarCoupleable (const MooseObject *moose_object) | |
Constructing the object. More... | |
const std::vector< MooseVariableScalar * > & | getCoupledMooseScalarVars () |
Get the list of coupled scalar variables. More... | |
const std::set< TagID > & | getScalarVariableCoupleableVectorTags () const |
const std::set< TagID > & | getScalarVariableCoupleableMatrixTags () const |
Protected Member Functions | |
bool | isCoupledScalar (const std::string &var_name, unsigned int i=0) const |
Returns true if a variables has been coupled_as name. More... | |
unsigned int | coupledScalarComponents (const std::string &var_name) const |
Return the number of components to the coupled scalar variable. More... | |
unsigned int | coupledScalar (const std::string &var_name, unsigned int comp=0) const |
Returns the index for a scalar coupled variable by name. More... | |
Order | coupledScalarOrder (const std::string &var_name, unsigned int comp=0) const |
Returns the order for a scalar coupled variable by name. More... | |
const VariableValue & | coupledScalarValue (const std::string &var_name, unsigned int comp=0) const |
Returns value of a scalar coupled variable. More... | |
const ADVariableValue & | adCoupledScalarValue (const std::string &var_name, unsigned int comp=0) const |
Returns AD value of a scalar coupled variable. More... | |
template<bool is_ad> | |
const GenericVariableValue< is_ad > & | coupledGenericScalarValue (const std::string &var_name, unsigned int comp=0) const |
Returns value of a coupled scalar variable for use in templated automatic differentiation classes. More... | |
const VariableValue & | coupledVectorTagScalarValue (const std::string &var_name, TagID tag, unsigned int comp=0) const |
Returns value of a scalar coupled variable. More... | |
const VariableValue & | coupledMatrixTagScalarValue (const std::string &var_name, TagID tag, unsigned int comp=0) const |
Returns value of a scalar coupled variable. More... | |
const VariableValue & | coupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const |
Returns the old (previous time step) value of a scalar coupled variable. More... | |
const VariableValue & | coupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const |
Returns the older (two time steps previous) value of a scalar coupled variable. More... | |
const VariableValue & | coupledScalarDot (const std::string &var_name, unsigned int comp=0) const |
Returns the time derivative of a scalar coupled variable. More... | |
const ADVariableValue & | adCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const |
Returns the time derivative of a scalar coupled variable, including its dependence on the nonlinear degrees of freedom through automatic differentiation. More... | |
const VariableValue & | coupledScalarDotDot (const std::string &var_name, unsigned int comp=0) const |
Returns the second time derivative of a scalar coupled variable. More... | |
const VariableValue & | coupledScalarDotOld (const std::string &var_name, unsigned int comp=0) const |
Returns the old time derivative of a scalar coupled variable. More... | |
const VariableValue & | coupledScalarDotDotOld (const std::string &var_name, unsigned int comp=0) const |
Returns the old second time derivative of a scalar coupled variable. More... | |
const VariableValue & | coupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const |
Time derivative of a scalar coupled variable with respect to the coefficients. More... | |
const VariableValue & | coupledScalarDotDotDu (const std::string &var_name, unsigned int comp=0) const |
Second time derivative of a scalar coupled variable with respect to the coefficients. More... | |
const MooseVariableScalar * | getScalarVar (const std::string &var_name, unsigned int comp) const |
Extract pointer to a scalar coupled variable. More... | |
template<> | |
const GenericVariableValue< false > & | coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const |
template<> | |
const GenericVariableValue< true > & | coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const |
Protected Attributes | |
FEProblemBase & | _sc_fe_problem |
const THREAD_ID | _sc_tid |
Thread ID of the thread using this object. More... | |
const Real & | _real_zero |
Scalar zero. More... | |
const VariableValue & | _scalar_zero |
Zero value of a scalar variable. More... | |
const Point & | _point_zero |
Zero point. More... | |
Private Member Functions | |
const VariableValue * | getDefaultValue (const std::string &var_name) const |
Helper method to return (and insert if necessary) the default value for an uncoupled variable. More... | |
const ADVariableValue * | getADDefaultValue (const std::string &var_name) const |
Helper method to return (and insert if necessary) the AD default value for an uncoupled variable. More... | |
void | checkVar (const std::string &var_name) const |
Check that the right kind of variable is being coupled in. More... | |
void | validateExecutionerType (const std::string &name, const std::string &fn_name) const |
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are coupled in. More... | |
Private Attributes | |
const InputParameters & | _sc_parameters |
const std::string & | _sc_name |
The name of the object this interface is part of. More... | |
const bool | _sc_is_implicit |
True if implicit value is required. More... | |
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > | _coupled_scalar_vars |
Coupled vars whose values we provide. More... | |
std::unordered_map< std::string, std::unique_ptr< VariableValue > > | _default_value |
Will hold the default value for optional coupled scalar variables. More... | |
std::unordered_map< std::string, std::unique_ptr< ADVariableValue > > | _dual_default_value |
Will hold the default AD value for optional coupled scalar variables. More... | |
std::vector< MooseVariableScalar * > | _coupled_moose_scalar_vars |
Vector of coupled variables. More... | |
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > | _sc_coupled_vars |
Field variables coupled into this object (for error checking) More... | |
std::set< TagID > | _sc_coupleable_vector_tags |
The scalar coupleable vector tags. More... | |
std::set< TagID > | _sc_coupleable_matrix_tags |
The scalar coupleable matrix tags. More... | |
Interface for objects that needs scalar coupling capabilities.
Definition at line 32 of file ScalarCoupleable.h.
ScalarCoupleable::ScalarCoupleable | ( | const MooseObject * | moose_object | ) |
Constructing the object.
parameters | Parameters that come from constructing the object |
Definition at line 19 of file ScalarCoupleable.C.
|
protected |
Returns the time derivative of a scalar coupled variable, including its dependence on the nonlinear degrees of freedom through automatic differentiation.
var_name | Name of coupled variable |
comp | Component number for vector of coupled variables |
Definition at line 252 of file ScalarCoupleable.C.
|
protected |
Returns AD value of a scalar coupled variable.
var_name | Name of coupled variable |
comp | Component number for vector of coupled variables |
Definition at line 135 of file ScalarCoupleable.C.
|
private |
Check that the right kind of variable is being coupled in.
var_name | The name of the coupled variable |
Definition at line 300 of file ScalarCoupleable.C.
Referenced by adCoupledScalarDot(), adCoupledScalarValue(), coupledMatrixTagScalarValue(), coupledScalar(), coupledScalarDot(), coupledScalarDotDot(), coupledScalarDotDotDu(), coupledScalarDotDotOld(), coupledScalarDotDu(), coupledScalarDotOld(), coupledScalarOrder(), coupledScalarValue(), coupledScalarValueOld(), coupledScalarValueOlder(), and coupledVectorTagScalarValue().
|
protected |
Returns value of a coupled scalar variable for use in templated automatic differentiation classes.
var_name | Name of coupled scalar variable |
comp | Component number for vector of coupled scalar variables |
|
protected |
Definition at line 152 of file ScalarCoupleable.C.
|
protected |
Definition at line 160 of file ScalarCoupleable.C.
|
protected |
Returns value of a scalar coupled variable.
var_name | Name of coupled variable |
tag | Tag ID of coupled matrix; |
comp | Component number for vector of coupled variables |
Definition at line 202 of file ScalarCoupleable.C.
|
protected |
Returns the index for a scalar coupled variable by name.
var_name | Name of coupled variable |
comp | Component number for vector of coupled variables |
Definition at line 93 of file ScalarCoupleable.C.
Referenced by ParsedODEKernel::ParsedODEKernel().
|
protected |
Return the number of components to the coupled scalar variable.
var_name | The of the coupled variable |
Definition at line 353 of file ScalarCoupleable.C.
|
protected |
Returns the time derivative of a scalar coupled variable.
var_name | Name of coupled variable |
comp | Component number for vector of coupled variables |
Definition at line 244 of file ScalarCoupleable.C.
|
protected |
Returns the second time derivative of a scalar coupled variable.
var_name | Name of coupled variable |
comp | Component number for vector of coupled variables |
Definition at line 260 of file ScalarCoupleable.C.
|
protected |
Second time derivative of a scalar coupled variable with respect to the coefficients.
var_name | Name of coupled variable |
comp | Component number for vector of coupled variables |
Definition at line 292 of file ScalarCoupleable.C.
|
protected |
Returns the old second time derivative of a scalar coupled variable.
var_name | Name of coupled variable |
comp | Component number for vector of coupled variables |
Definition at line 276 of file ScalarCoupleable.C.
|
protected |
Time derivative of a scalar coupled variable with respect to the coefficients.
var_name | Name of coupled variable |
comp | Component number for vector of coupled variables |
Definition at line 284 of file ScalarCoupleable.C.
|
protected |
Returns the old time derivative of a scalar coupled variable.
var_name | Name of coupled variable |
comp | Component number for vector of coupled variables |
Definition at line 268 of file ScalarCoupleable.C.
|
protected |
Returns the order for a scalar coupled variable by name.
var_name | Name of coupled variable |
comp | Component number for vector of coupled variables |
Definition at line 100 of file ScalarCoupleable.C.
|
protected |
Returns value of a scalar coupled variable.
var_name | Name of coupled variable |
comp | Component number for vector of coupled variables |
Definition at line 124 of file ScalarCoupleable.C.
Referenced by ParsedODEKernel::ParsedODEKernel().
|
protected |
Returns the old (previous time step) value of a scalar coupled variable.
var_name | Name of coupled variable |
comp | Component number for vector of coupled variables |
Definition at line 216 of file ScalarCoupleable.C.
|
protected |
Returns the older (two time steps previous) value of a scalar coupled variable.
var_name | Name of coupled variable |
comp | Component number for vector of coupled variables |
Definition at line 228 of file ScalarCoupleable.C.
|
protected |
Returns value of a scalar coupled variable.
var_name | Name of coupled variable |
tag | Tag ID of coupled vector ; |
comp | Component number for vector of coupled variables |
Definition at line 181 of file ScalarCoupleable.C.
|
private |
Helper method to return (and insert if necessary) the AD default value for an uncoupled variable.
var_name | the name of the variable for which to retrieve a default value |
Definition at line 167 of file ScalarCoupleable.C.
Referenced by adCoupledScalarValue().
|
inline |
Get the list of coupled scalar variables.
Definition at line 45 of file ScalarCoupleable.h.
Referenced by AuxScalarKernel::AuxScalarKernel(), MortarScalarBase::computeJacobian(), and ScalarInitialCondition::ScalarInitialCondition().
|
private |
Helper method to return (and insert if necessary) the default value for an uncoupled variable.
var_name | the name of the variable for which to retrieve a default value |
Definition at line 110 of file ScalarCoupleable.C.
Referenced by coupledMatrixTagScalarValue(), coupledScalarValue(), coupledScalarValueOld(), coupledScalarValueOlder(), and coupledVectorTagScalarValue().
|
protected |
Extract pointer to a scalar coupled variable.
var_name | Name of parameter desired |
comp | Component number of multiple coupled variables |
Definition at line 321 of file ScalarCoupleable.C.
Referenced by adCoupledScalarDot(), adCoupledScalarValue(), coupledMatrixTagScalarValue(), coupledScalar(), coupledScalarDot(), coupledScalarDotDot(), coupledScalarDotDotDu(), coupledScalarDotDotOld(), coupledScalarDotDu(), coupledScalarDotOld(), coupledScalarOrder(), coupledScalarValue(), coupledScalarValueOld(), coupledScalarValueOlder(), coupledVectorTagScalarValue(), and ParsedODEKernel::ParsedODEKernel().
|
inline |
Definition at line 55 of file ScalarCoupleable.h.
|
inline |
Definition at line 50 of file ScalarCoupleable.h.
|
protected |
Returns true if a variables has been coupled_as name.
var_name | The of the coupled variable |
i | By default 0, in general the index to test in a vector of MooseVariable pointers. |
Definition at line 70 of file ScalarCoupleable.C.
Referenced by adCoupledScalarValue(), coupledMatrixTagScalarValue(), coupledScalarOrder(), coupledScalarValue(), coupledScalarValueOld(), coupledScalarValueOlder(), and coupledVectorTagScalarValue().
|
private |
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are coupled in.
name | the name of the variable |
fn_name | The name of the function that called this method - used in the error message |
Definition at line 339 of file ScalarCoupleable.C.
Referenced by adCoupledScalarDot(), coupledScalarDot(), coupledScalarDotDot(), coupledScalarDotDotDu(), coupledScalarDotDotOld(), coupledScalarDotDu(), coupledScalarDotOld(), coupledScalarValueOld(), and coupledScalarValueOlder().
|
private |
Vector of coupled variables.
Definition at line 297 of file ScalarCoupleable.h.
Referenced by getCoupledMooseScalarVars(), and ScalarCoupleable().
|
private |
Coupled vars whose values we provide.
Definition at line 288 of file ScalarCoupleable.h.
Referenced by coupledScalarComponents(), getScalarVar(), isCoupledScalar(), and ScalarCoupleable().
|
mutableprivate |
Will hold the default value for optional coupled scalar variables.
Definition at line 291 of file ScalarCoupleable.h.
Referenced by getDefaultValue().
|
mutableprivate |
Will hold the default AD value for optional coupled scalar variables.
Definition at line 294 of file ScalarCoupleable.h.
Referenced by getADDefaultValue().
|
protected |
Zero point.
Definition at line 244 of file ScalarCoupleable.h.
Referenced by FunctionDT::computeDT(), FunctionScalarAux::computeValue(), and FunctionScalarIC::value().
|
protected |
Scalar zero.
Definition at line 238 of file ScalarCoupleable.h.
|
mutableprivate |
The scalar coupleable matrix tags.
Definition at line 305 of file ScalarCoupleable.h.
Referenced by coupledMatrixTagScalarValue(), and getScalarVariableCoupleableMatrixTags().
|
mutableprivate |
The scalar coupleable vector tags.
Definition at line 303 of file ScalarCoupleable.h.
Referenced by coupledVectorTagScalarValue(), and getScalarVariableCoupleableVectorTags().
|
private |
Field variables coupled into this object (for error checking)
Definition at line 300 of file ScalarCoupleable.h.
Referenced by checkVar(), and ScalarCoupleable().
|
protected |
Definition at line 232 of file ScalarCoupleable.h.
Referenced by coupledScalarOrder(), coupledVectorTagScalarValue(), getADDefaultValue(), getDefaultValue(), and validateExecutionerType().
|
private |
True if implicit value is required.
Definition at line 285 of file ScalarCoupleable.h.
Referenced by adCoupledScalarValue(), coupledScalarValue(), coupledScalarValueOld(), and coupledScalarValueOlder().
|
private |
The name of the object this interface is part of.
Definition at line 282 of file ScalarCoupleable.h.
Referenced by checkVar(), coupledScalarComponents(), coupledVectorTagScalarValue(), getScalarVar(), isCoupledScalar(), ScalarCoupleable(), and validateExecutionerType().
|
private |
Definition at line 279 of file ScalarCoupleable.h.
Referenced by checkVar(), coupledScalarComponents(), getADDefaultValue(), getDefaultValue(), getScalarVar(), isCoupledScalar(), and ScalarCoupleable().
|
protected |
Thread ID of the thread using this object.
Definition at line 235 of file ScalarCoupleable.h.
Referenced by ScalarCoupleable().
|
protected |
Zero value of a scalar variable.
Definition at line 241 of file ScalarCoupleable.h.