www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
Coupleable Class Reference

Interface for objects that needs coupling capabilities. More...

#include <Coupleable.h>

Inheritance diagram for Coupleable:
[legend]

Public Member Functions

 Coupleable (const MooseObject *moose_object, bool nodal)
 Constructing the object. More...
 
virtual ~Coupleable ()
 Destructor for object. More...
 
const std::map< std::string, std::vector< MooseVariableFEBase * > > & getCoupledVars ()
 Get the list of coupled variables. More...
 
const std::vector< MooseVariableFEBase * > & getCoupledMooseVars () const
 Get the list of all coupled variables. More...
 
const std::vector< MooseVariable * > & getCoupledStandardMooseVars () const
 Get the list of standard coupled variables. More...
 
const std::vector< VectorMooseVariable * > & getCoupledVectorMooseVars () const
 Get the list of vector coupled variables. More...
 
void addFEVariableCoupleableVectorTag (TagID tag)
 
void addFEVariableCoupleableMatrixTag (TagID tag)
 
std::set< TagID > & getFEVariableCoupleableVectorTags ()
 
std::set< TagID > & getFEVariableCoupleableMatrixTags ()
 
template<ComputeStage compute_stage>
ADVariableValue * getADDefaultValue (const std::string &var_name)
 Helper method to return (and insert if necessary) the default value for Automatic Differentiation for an uncoupled variable. More...
 
template<ComputeStage compute_stage>
ADVectorVariableValue * getADDefaultVectorValue (const std::string &var_name)
 Helper method to return (and insert if necessary) the default vector value for Automatic Differentiation for an uncoupled variable. More...
 
template<ComputeStage compute_stage>
ADVariableGradient & getADDefaultGradient ()
 Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation for an uncoupled variable. More...
 
template<ComputeStage compute_stage>
ADVectorVariableGradient & getADDefaultVectorGradient ()
 Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation for an uncoupled vector variable. More...
 
template<ComputeStage compute_stage>
ADVariableSecond & getADDefaultSecond ()
 Helper method to return (and insert if necessary) the default second derivatives for Automatic Differentiation for an uncoupled variable. More...
 
template<>
VariableValuegetADDefaultValue (const std::string &var_name)
 
template<>
VectorVariableValuegetADDefaultVectorValue (const std::string &var_name)
 
template<>
VariableGradientgetADDefaultGradient ()
 
template<>
VectorVariableGradientgetADDefaultVectorGradient ()
 
template<>
VariableSecondgetADDefaultSecond ()
 
template<>
VariableValuegetADDefaultValue (const std::string &var_name)
 
template<>
VectorVariableValuegetADDefaultVectorValue (const std::string &var_name)
 
template<>
VariableGradientgetADDefaultGradient ()
 
template<>
VectorVariableGradientgetADDefaultVectorGradient ()
 
template<>
VariableSecondgetADDefaultSecond ()
 

Protected Member Functions

virtual bool isCoupled (const std::string &var_name, unsigned int i=0)
 Returns true if a variables has been coupled as name. More...
 
unsigned int coupledComponents (const std::string &var_name)
 Number of coupled components. More...
 
virtual void coupledCallback (const std::string &var_name, bool is_old)
 
virtual unsigned int coupled (const std::string &var_name, unsigned int comp=0)
 Returns the index for a coupled variable by name. More...
 
virtual const VariableValuecoupledValue (const std::string &var_name, unsigned int comp=0)
 Returns value of a coupled variable. More...
 
template<ComputeStage compute_stage>
const ADVariableValue & adCoupledValueTemplate (const std::string &var_name, unsigned int comp=0)
 Returns value of a coupled variable for use in Automatic Differentiation. More...
 
template<ComputeStage compute_stage>
const ADVectorVariableValue & adCoupledVectorValueTemplate (const std::string &var_name, unsigned int comp=0)
 Returns value of a coupled vector variable for use in Automatic Differentiation. More...
 
virtual const VariableValuecoupledVectorTagValue (const std::string &var_name, TagID tag, unsigned int comp=0)
 Returns value of a coupled variable for a given tag. More...
 
virtual const VariableValuecoupledMatrixTagValue (const std::string &var_name, TagID tag, unsigned int comp=0)
 Returns value of a coupled variable for a given tag. More...
 
virtual const VectorVariableValuecoupledVectorValue (const std::string &var_name, unsigned int comp=0)
 Returns value of a coupled vector variable. More...
 
virtual VariableValuewritableCoupledValue (const std::string &var_name, unsigned int comp=0)
 Returns a writable reference to a coupled variable. More...
 
virtual const VariableValuecoupledValueOld (const std::string &var_name, unsigned int comp=0)
 Returns an old value from previous time step of a coupled variable. More...
 
virtual const VariableValuecoupledValueOlder (const std::string &var_name, unsigned int comp=0)
 Returns an old value from two time steps previous of a coupled variable. More...
 
virtual const VariableValuecoupledValuePreviousNL (const std::string &var_name, unsigned int comp=0)
 Returns value of previous Newton iterate of a coupled variable. More...
 
virtual const VectorVariableValuecoupledVectorValueOld (const std::string &var_name, unsigned int comp=0)
 Returns an old value from previous time step of a coupled vector variable. More...
 
virtual const VectorVariableValuecoupledVectorValueOlder (const std::string &var_name, unsigned int comp=0)
 Returns an old value from two time steps previous of a coupled vector variable. More...
 
virtual const VariableGradientcoupledGradient (const std::string &var_name, unsigned int comp=0)
 Returns gradient of a coupled variable. More...
 
template<ComputeStage compute_stage>
const ADVariableGradient & adCoupledGradientTemplate (const std::string &var_name, unsigned int comp=0)
 Returns gradient of a coupled variable for use in Automatic Differentation. More...
 
template<ComputeStage compute_stage>
const ADVectorVariableGradient & adCoupledVectorGradientTemplate (const std::string &var_name, unsigned int comp=0)
 Returns gradient of a coupled vector variable for use in Automatic Differentation. More...
 
template<ComputeStage compute_stage>
const ADVariableSecond & adCoupledSecondTemplate (const std::string &var_name, unsigned int comp=0)
 Returns second derivatives of a coupled variable for use in Automatic Differentation. More...
 
template<ComputeStage compute_stage>
const ADVectorVariableSecond & adCoupledVectorSecondTemplate (const std::string &var_name, unsigned int comp=0)
 Returns second derivatives of a coupled vector variable for use in Automatic Differentation. More...
 
virtual const VariableGradientcoupledGradientOld (const std::string &var_name, unsigned int comp=0)
 Returns an old gradient from previous time step of a coupled variable. More...
 
virtual const VariableGradientcoupledGradientOlder (const std::string &var_name, unsigned int comp=0)
 Returns an old gradient from two time steps previous of a coupled variable. More...
 
virtual const VariableGradientcoupledGradientPreviousNL (const std::string &var_name, unsigned int comp=0)
 Returns gradient of a coupled variable for previous Newton iterate. More...
 
virtual const VariableGradientcoupledGradientDot (const std::string &var_name, unsigned int comp=0)
 Time derivative of the gradient of a coupled variable. More...
 
virtual const VariableGradientcoupledGradientDotDot (const std::string &var_name, unsigned int comp=0)
 Second time derivative of the gradient of a coupled variable. More...
 
virtual const VectorVariableGradientcoupledVectorGradient (const std::string &var_name, unsigned int comp=0)
 Returns gradient of a coupled vector variable. More...
 
virtual const VectorVariableGradientcoupledVectorGradientOld (const std::string &var_name, unsigned int comp=0)
 Returns an old gradient from previous time step of a coupled vector variable. More...
 
virtual const VectorVariableGradientcoupledVectorGradientOlder (const std::string &var_name, unsigned int comp=0)
 Returns an old gradient from two time steps previous of a coupled vector variable. More...
 
virtual const VectorVariableCurlcoupledCurl (const std::string &var_name, unsigned int comp=0)
 Returns curl of a coupled variable. More...
 
virtual const VectorVariableCurlcoupledCurlOld (const std::string &var_name, unsigned int comp=0)
 Returns an old curl from previous time step of a coupled variable. More...
 
virtual const VectorVariableCurlcoupledCurlOlder (const std::string &var_name, unsigned int comp=0)
 Returns an old curl from two time steps previous of a coupled variable. More...
 
virtual const VariableSecondcoupledSecond (const std::string &var_name, unsigned int comp=0)
 Returns second derivative of a coupled variable. More...
 
virtual const VariableSecondcoupledSecondOld (const std::string &var_name, unsigned int comp=0)
 Returns an old second derivative from previous time step of a coupled variable. More...
 
virtual const VariableSecondcoupledSecondOlder (const std::string &var_name, unsigned int comp=0)
 Returns an old second derivative from two time steps previous of a coupled variable. More...
 
virtual const VariableSecondcoupledSecondPreviousNL (const std::string &var_name, unsigned int comp=0)
 Returns second derivative of a coupled variable for the previous Newton iterate. More...
 
virtual const VariableValuecoupledDot (const std::string &var_name, unsigned int comp=0)
 Time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledDotDot (const std::string &var_name, unsigned int comp=0)
 Second time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledDotOld (const std::string &var_name, unsigned int comp=0)
 Old time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledDotDotOld (const std::string &var_name, unsigned int comp=0)
 Old second time derivative of a coupled variable. More...
 
template<ComputeStage compute_stage>
const ADVariableValue & adCoupledDotTemplate (const std::string &var_name, unsigned int comp=0)
 Time derivative of a coupled variable for ad simulations. More...
 
template<ComputeStage compute_stage>
const ADVectorVariableValue & adCoupledVectorDotTemplate (const std::string &var_name, unsigned int comp=0)
 Time derivative of a vector coupled variable for ad simulations. More...
 
virtual const VectorVariableValuecoupledVectorDot (const std::string &var_name, unsigned int comp=0)
 Time derivative of a coupled vector variable. More...
 
virtual const VectorVariableValuecoupledVectorDotDot (const std::string &var_name, unsigned int comp=0)
 Second time derivative of a coupled vector variable. More...
 
virtual const VectorVariableValuecoupledVectorDotOld (const std::string &var_name, unsigned int comp=0)
 Old time derivative of a coupled vector variable. More...
 
virtual const VectorVariableValuecoupledVectorDotDotOld (const std::string &var_name, unsigned int comp=0)
 Old second time derivative of a coupled vector variable. More...
 
virtual const VariableValuecoupledDotDu (const std::string &var_name, unsigned int comp=0)
 Time derivative of a coupled variable with respect to the coefficients. More...
 
virtual const VariableValuecoupledDotDotDu (const std::string &var_name, unsigned int comp=0)
 Second time derivative of a coupled variable with respect to the coefficients. More...
 
template<typename T >
const T & coupledNodalValue (const std::string &var_name, unsigned int comp=0)
 Returns nodal values of a coupled variable. More...
 
template<typename T , ComputeStage compute_stage>
const Moose::ValueType< T, compute_stage >::typeadCoupledNodalValueTemplate (const std::string &var_name, unsigned int comp=0)
 Returns AD nodal values of a coupled variable. More...
 
template<typename T >
const T & coupledNodalValueOld (const std::string &var_name, unsigned int comp=0)
 Returns an old nodal value from previous time step of a coupled variable. More...
 
template<typename T >
const T & coupledNodalValueOlder (const std::string &var_name, unsigned int comp=0)
 Returns an old nodal value from two time steps previous of a coupled variable. More...
 
template<typename T >
const T & coupledNodalValuePreviousNL (const std::string &var_name, unsigned int comp=0)
 Returns nodal values of a coupled variable for previous Newton iterate. More...
 
template<typename T >
const T & coupledNodalDot (const std::string &var_name, unsigned int comp=0)
 Nodal values of time derivative of a coupled variable. More...
 
template<typename T >
const T & getNodalDefaultValue (const std::string &var_name, unsigned int comp=0)
 Get nodal default value. More...
 
virtual const VariableValuecoupledNodalDotDot (const std::string &var_name, unsigned int comp=0)
 Nodal values of second time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledNodalDotOld (const std::string &var_name, unsigned int comp=0)
 Nodal values of old time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledNodalDotDotOld (const std::string &var_name, unsigned int comp=0)
 Nodal values of old second time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledDofValues (const std::string &var_name, unsigned int comp=0)
 Returns DoFs in the current solution vector of a coupled variable for the local element. More...
 
virtual const VariableValuecoupledDofValuesOld (const std::string &var_name, unsigned int comp=0)
 Returns DoFs in the old solution vector of a coupled variable for the local element. More...
 
virtual const VariableValuecoupledDofValuesOlder (const std::string &var_name, unsigned int comp=0)
 Returns DoFs in the older solution vector of a coupled variable for the local element. More...
 
template<ComputeStage compute_stage>
const ADVariableValue & adZeroValueTemplate ()
 Template method that returns _zero to RESIDUAL computing objects and _ad_zero to JACOBIAN computing objects. More...
 
template<ComputeStage compute_stage>
const ADVariableGradient & adZeroGradientTemplate ()
 Template method that returns _grad_zero to RESIDUAL computing objects and _ad_grad_zero to JACOBIAN computing objects. More...
 
template<ComputeStage compute_stage>
const ADVariableSecond & adZeroSecondTemplate ()
 Retrieve a zero second for automatic differentiation. More...
 
void checkVar (const std::string &var_name)
 Check that the right kind of variable is being coupled in. More...
 
MooseVariableFEBasegetFEVar (const std::string &var_name, unsigned int comp)
 Extract pointer to a base finite element coupled variable. More...
 
template<typename T >
MooseVariableFE< T > * getVarHelper (const std::string &var_name, unsigned int comp)
 Helper that segues off to either getVar of getVectorVar depending on template paramter. More...
 
MooseVariablegetVar (const std::string &var_name, unsigned int comp)
 Extract pointer to a coupled variable. More...
 
VectorMooseVariablegetVectorVar (const std::string &var_name, unsigned int comp)
 Extract pointer to a coupled vector variable. 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...
 
template<>
const VariableValueadZeroValueTemplate ()
 
template<>
const VariableGradientadZeroGradientTemplate ()
 
template<>
const VariableSecondadZeroSecondTemplate ()
 
template<>
const RealVectorValue & getNodalDefaultValue (const std::string &var_name, unsigned int)
 
template<>
const VariableValueadZeroValueTemplate ()
 
template<>
const VariableGradientadZeroGradientTemplate ()
 
template<>
const VariableSecondadZeroSecondTemplate ()
 

Protected Attributes

const InputParameters_c_parameters
 
const std::string & _c_name
 The name of the object this interface is part of. More...
 
FEProblemBase_c_fe_problem
 
std::map< std::string, std::vector< MooseVariableFEBase * > > _coupled_vars
 Coupled vars whose values we provide. More...
 
std::vector< MooseVariableFEBase * > _coupled_moose_vars
 Vector of all coupled variables. More...
 
std::vector< MooseVariable * > _coupled_standard_moose_vars
 Vector of standard coupled variables. More...
 
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
 Vector of vector coupled variables. More...
 
bool _c_nodal
 True if we provide coupling to nodal values. More...
 
bool _c_is_implicit
 True if implicit value is required. More...
 
THREAD_ID _c_tid
 Thread ID of the thread using this object. More...
 
std::map< std::string, std::vector< VariableValue * > > _default_value
 Will hold the default value for optional coupled variables. More...
 
std::map< std::string, MooseArray< DualReal > * > _ad_default_value
 Will hold the default value for optional coupled variables for automatic differentiation. More...
 
std::map< std::string, VectorVariableValue * > _default_vector_value
 Will hold the default value for optional vector coupled variables. More...
 
std::map< std::string, MooseArray< DualRealVectorValue > * > _ad_default_vector_value
 Will hold the default value for optional vector coupled variables for automatic differentiation. More...
 
VariableValue _default_value_zero
 This will always be zero because the default values for optionally coupled variables is always constant and this is used for time derivative info. More...
 
VariableGradient _default_gradient
 This will always be zero because the default values for optionally coupled variables is always constant. More...
 
MooseArray< DualRealVectorValue_ad_default_gradient
 This will always be zero because the default values for optionally coupled variables is always constant. More...
 
MooseArray< DualRealTensorValue_ad_default_vector_gradient
 This will always be zero because the default values for optionally coupled vector variables is always constant. More...
 
VariableSecond _default_second
 This will always be zero because the default values for optionally coupled variables is always constant. More...
 
MooseArray< DualRealTensorValue_ad_default_second
 This will always be zero because the default values for optionally coupled variables is always constant. More...
 
const VariableValue_zero
 Zero value of a variable. More...
 
const MooseArray< DualReal > & _ad_zero
 
const VariableGradient_grad_zero
 Zero gradient of a variable. More...
 
const MooseArray< DualRealVectorValue > & _ad_grad_zero
 
const VariableSecond_second_zero
 Zero second derivative of a variable. More...
 
const MooseArray< DualRealTensorValue > & _ad_second_zero
 
const VariablePhiSecond_second_phi_zero
 Zero second derivative of a test function. More...
 
const VectorVariableValue_vector_zero
 Zero value of a vector variable. More...
 
const VectorVariableCurl_vector_curl_zero
 Zero value of the curl of a vector variable. More...
 
VectorVariableValue _default_vector_value_zero
 This will always be zero because the default values for optionally coupled variables is always constant and this is used for time derivative info. More...
 
VectorVariableGradient _default_vector_gradient
 This will always be zero because the default values for optionally coupled variables is always constant. More...
 
VectorVariableCurl _default_vector_curl
 This will always be zero because the default values for optionally coupled variables is always constant. More...
 
bool _coupleable_neighbor
 Whether or not this object is a "neighbor" object: ie all of it's coupled values should be neighbor values. More...
 

Private Member Functions

VariableValuegetDefaultValue (const std::string &var_name, unsigned int comp)
 Helper method to return (and insert if necessary) the default value for an uncoupled variable. More...
 
VectorVariableValuegetDefaultVectorValue (const std::string &var_name)
 Helper method to return (and insert if necessary) the default value for an uncoupled vector variable. More...
 

Private Attributes

unsigned int _coupleable_max_qps
 Maximum qps for any element in this system. More...
 
std::map< std::string, std::vector< unsigned int > > _optional_var_index
 Unique indices for optionally coupled vars that weren't provided. More...
 
std::map< std::string, std::vector< MooseVariableScalar * > > _c_coupled_scalar_vars
 Scalar variables coupled into this object (for error checking) More...
 
std::set< TagID_fe_coupleable_vector_tags
 
std::set< TagID_fe_coupleable_matrix_tags
 

Detailed Description

Interface for objects that needs coupling capabilities.

Definition at line 63 of file Coupleable.h.

Constructor & Destructor Documentation

◆ Coupleable()

Coupleable::Coupleable ( const MooseObject moose_object,
bool  nodal 
)

Constructing the object.

Parameters
parametersParameters that come from constructing the object
nodaltrue if we need to couple with nodal values, otherwise false

Definition at line 19 of file Coupleable.C.

20  : _c_parameters(moose_object->parameters()),
21  _c_name(_c_parameters.get<std::string>("_object_name")),
23  _c_nodal(nodal),
24  _c_is_implicit(_c_parameters.have_parameter<bool>("implicit")
25  ? _c_parameters.get<bool>("implicit")
26  : true),
27  _c_tid(_c_parameters.get<THREAD_ID>("_tid")),
37  _coupleable_neighbor(_c_parameters.have_parameter<bool>("_neighbor")
38  ? _c_parameters.get<bool>("_neighbor")
39  : false),
41 {
42  SubProblem & problem = *_c_parameters.getCheckedPointerParam<SubProblem *>("_subproblem");
43 
44  unsigned int optional_var_index_counter = 0;
45 
46  // Coupling
47  for (auto iter = _c_parameters.coupledVarsBegin(); iter != _c_parameters.coupledVarsEnd(); ++iter)
48  {
49  std::string name = *iter;
50 
51  std::vector<std::string> vars = _c_parameters.getVecMooseType(name);
52  if (vars.size() > 0)
53  {
54  for (const auto & coupled_var_name : vars)
55  {
56  if (problem.hasVariable(coupled_var_name))
57  {
58  MooseVariableFEBase * moose_var =
59  &problem.getVariable(_c_tid,
60  coupled_var_name,
63  _coupled_vars[name].push_back(moose_var);
64  _coupled_moose_vars.push_back(moose_var);
65  if (auto * tmp_var = dynamic_cast<MooseVariable *>(moose_var))
66  _coupled_standard_moose_vars.push_back(tmp_var);
67  else if (auto * tmp_var = dynamic_cast<VectorMooseVariable *>(moose_var))
68  _coupled_vector_moose_vars.push_back(tmp_var);
69  else
70  mooseError("Unknown variable type!");
71  }
72  else if (problem.hasScalarVariable(coupled_var_name))
73  {
74  MooseVariableScalar * moose_scalar_var =
75  &problem.getScalarVariable(_c_tid, coupled_var_name);
76  _c_coupled_scalar_vars[name].push_back(moose_scalar_var);
77  }
78  else
79  mooseError(_c_name, ": Coupled variable '", coupled_var_name, "' was not found");
80  }
81  }
82  else // This means it was optional coupling. Let's assign a unique id to this variable
83  {
85  for (unsigned int j = 0; j < _optional_var_index[name].size(); ++j)
86  _optional_var_index[name][j] =
87  std::numeric_limits<unsigned int>::max() - optional_var_index_counter;
88  ++optional_var_index_counter;
89  }
90  }
91 
101 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:819
const VariableValue & _zero
Zero value of a variable.
Definition: Coupleable.h:792
const VariablePhiSecond & _second_phi_zero
Zero second derivative of a test function.
Definition: Coupleable.h:803
MooseArray< DualRealTensorValue > _ad_default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:789
const VectorVariableValue & _vector_zero
Zero value of a vector variable.
Definition: Coupleable.h:805
const VariableGradient & _grad_zero
Zero gradient of a variable.
Definition: Coupleable.h:796
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:219
MooseArray< DualRealTensorValue > _ad_default_vector_gradient
This will always be zero because the default values for optionally coupled vector variables is always...
Definition: Coupleable.h:783
const VariableSecond & _second_zero
Zero second derivative of a variable.
Definition: Coupleable.h:800
virtual MooseVariableFEBase & getVariable(THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY)=0
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
virtual MooseVariableScalar & getScalarVariable(THREAD_ID tid, const std::string &var_name)=0
Returns the scalar variable reference from whichever system contains it.
T getCheckedPointerParam(const std::string &name, const std::string &error_string="") const
Verifies that the requested parameter exists and is not NULL and returns it to the caller...
THREAD_ID _c_tid
Thread ID of the thread using this object.
Definition: Coupleable.h:756
std::set< std::string >::const_iterator coupledVarsBegin() const
Methods returning iterators to the coupled variables names stored in this InputParameters object...
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:774
std::vector< VariableSecond > _second_zero
std::vector< VectorVariableCurl > _vector_curl_zero
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Definition: Coupleable.h:744
unsigned int numberDefaultCoupledValues(const std::string &coupling_name) const
Get the number of defaulted coupled value entries.
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:735
const MooseArray< DualReal > & _ad_zero
Definition: Coupleable.h:793
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
const MooseArray< DualRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:801
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
Definition: Coupleable.h:747
std::map< std::string, std::vector< MooseVariableScalar * > > _c_coupled_scalar_vars
Scalar variables coupled into this object (for error checking)
Definition: Coupleable.h:940
std::set< std::string >::const_iterator coupledVarsEnd() const
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:777
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:786
MooseArray< DualRealVectorValue > _ad_default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:780
virtual bool hasScalarVariable(const std::string &var_name) const =0
Returns a Boolean indicating whether any system contains a variable with the name provided...
std::map< std::string, std::vector< MooseVariableFEBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:738
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
std::vector< VariablePhiSecond > _second_phi_zero
virtual bool hasVariable(const std::string &var_name) const =0
const VectorVariableCurl & _vector_curl_zero
Zero value of the curl of a vector variable.
Definition: Coupleable.h:807
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:816
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:813
std::vector< VariableGradient > _grad_zero
std::vector< MooseArray< DualRealTensorValue > > _ad_second_zero
std::vector< MooseArray< DualRealVectorValue > > _ad_grad_zero
std::vector< MooseVariableFEBase * > _coupled_moose_vars
Vector of all coupled variables.
Definition: Coupleable.h:741
Class for scalar variables (they are different).
std::vector< MooseArray< DualReal > > _ad_zero
std::vector< VariableValue > _zero
std::vector< VectorVariableValue > _vector_zero
const InputParameters & _c_parameters
Definition: Coupleable.h:729
const MooseArray< DualRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:797
std::map< std::string, std::vector< unsigned int > > _optional_var_index
Unique indices for optionally coupled vars that weren&#39;t provided.
Definition: Coupleable.h:937
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:934
std::vector< std::string > getVecMooseType(const std::string &name) const
unsigned int THREAD_ID
Definition: MooseTypes.h:162
unsigned int getMaxQps() const

◆ ~Coupleable()

Coupleable::~Coupleable ( )
virtual

Destructor for object.

Definition at line 103 of file Coupleable.C.

104 {
105  for (auto & it : _default_value)
106  for (auto itt : it.second)
107  {
108  itt->release();
109  delete itt;
110  }
111  for (auto & it : _default_vector_value)
112  {
113  it.second->release();
114  delete it.second;
115  }
116  for (auto & it : _ad_default_value)
117  {
118  it.second->release();
119  delete it.second;
120  }
121  for (auto & it : _ad_default_vector_value)
122  {
123  it.second->release();
124  delete it.second;
125  }
126 
127  _default_value_zero.release();
128  _default_gradient.release();
129  _default_second.release();
136 }
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:819
MooseArray< DualRealTensorValue > _ad_default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:789
MooseArray< DualRealTensorValue > _ad_default_vector_gradient
This will always be zero because the default values for optionally coupled vector variables is always...
Definition: Coupleable.h:783
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:774
std::map< std::string, MooseArray< DualRealVectorValue > * > _ad_default_vector_value
Will hold the default value for optional vector coupled variables for automatic differentiation.
Definition: Coupleable.h:768
std::map< std::string, std::vector< VariableValue * > > _default_value
Will hold the default value for optional coupled variables.
Definition: Coupleable.h:759
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:777
std::map< std::string, VectorVariableValue * > _default_vector_value
Will hold the default value for optional vector coupled variables.
Definition: Coupleable.h:765
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:786
MooseArray< DualRealVectorValue > _ad_default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:780
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:816
std::map< std::string, MooseArray< DualReal > * > _ad_default_value
Will hold the default value for optional coupled variables for automatic differentiation.
Definition: Coupleable.h:762
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:813
void release()
Manually deallocates the data pointer.
Definition: MooseArray.h:62

Member Function Documentation

◆ adCoupledDotTemplate()

template<ComputeStage compute_stage>
const ADVariableValue & Coupleable::adCoupledDotTemplate ( const std::string &  var_name,
unsigned int  comp = 0 
)
protected

Time derivative of a coupled variable for ad simulations.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the time derivative of the coupled variable
See also
Kernel::dot

Definition at line 1051 of file Coupleable.h.

1052 {
1053  checkVar(var_name);
1054  if (!isCoupled(var_name)) // Return default 0
1055  return *getADDefaultValue<compute_stage>(var_name);
1056 
1057  MooseVariable * var = getVar(var_name, comp);
1058  if (var == nullptr)
1059  mooseError("Call corresponding vector variable method");
1060 
1061  if (!_coupleable_neighbor)
1062  {
1063  if (_c_nodal)
1064  mooseError("Not implemented");
1065  else
1066  return var->adUDot<compute_stage>();
1067  }
1068  else
1069  {
1070  if (_c_nodal)
1071  mooseError("Not implemented");
1072  else
1073  return var->adUDotNeighbor<compute_stage>();
1074  }
1075 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ adCoupledGradientTemplate()

template<ComputeStage compute_stage>
const ADVariableGradient & Coupleable::adCoupledGradientTemplate ( const std::string &  var_name,
unsigned int  comp = 0 
)
protected

Returns gradient of a coupled variable for use in Automatic Differentation.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableGradient containing the gradient of the coupled variable
See also
Kernel::gradient

Definition at line 985 of file Coupleable.h.

986 {
987  if (!isCoupled(var_name)) // Return default 0
988  return getADDefaultGradient<compute_stage>();
989 
990  coupledCallback(var_name, false);
991  if (_c_nodal)
992  mooseError("Nodal variables do not have gradients");
993 
994  MooseVariable * var = getVar(var_name, comp);
995 
997  {
998  if (_c_is_implicit)
999  return var->adGradSln<compute_stage>();
1000  else
1001  mooseError("Not implemented");
1002  }
1003  else
1004  {
1005  if (_c_is_implicit)
1006  return var->adGradSlnNeighbor<compute_stage>();
1007  else
1008  mooseError("Not implemented");
1009  }
1010 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const VariableGradientType< OutputType, compute_stage >::type & adGradSlnNeighbor()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const VariableGradientType< OutputType, compute_stage >::type & adGradSln()

◆ adCoupledNodalValueTemplate()

template<typename T , ComputeStage compute_stage>
template const libMesh::VectorValue< DualReal > & Coupleable::adCoupledNodalValueTemplate< RealVectorValue, JACOBIAN > ( const std::string &  var_name,
unsigned int  comp = 0 
)
protected

Returns AD nodal values of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue for the coupled variable

Definition at line 1537 of file Coupleable.C.

1538 {
1539  static const typename Moose::ValueType<T, compute_stage>::type zero = 0;
1540  if (!isCoupled(var_name))
1541  return zero;
1542 
1543  if (!_c_nodal)
1544  mooseError("The adCoupledNodalValue method should only be called for nodal computing objects");
1546  mooseError(
1547  "The adCoupledNodalValue method shouldn't be called for neighbor computing objects. I "
1548  "don't even know what that would mean, although maybe someone could explain it to me.");
1549  if (!_c_is_implicit)
1550  mooseError("If you're going to use an explicit scheme, then use coupledNodalValue instead of "
1551  "adCoupledNodalValue");
1552 
1553  coupledCallback(var_name, false);
1554  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1555 
1556  return var->template adNodalValue<compute_stage>();
1557 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867

◆ adCoupledSecondTemplate()

template<ComputeStage compute_stage>
const ADVariableSecond & Coupleable::adCoupledSecondTemplate ( const std::string &  var_name,
unsigned int  comp = 0 
)
protected

Returns second derivatives of a coupled variable for use in Automatic Differentation.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableSecond containing the second derivatives of the coupled variable

Definition at line 1014 of file Coupleable.h.

1015 {
1016  if (!isCoupled(var_name)) // Return default 0
1017  return getADDefaultSecond<compute_stage>();
1018 
1019  coupledCallback(var_name, false);
1020  if (_c_nodal)
1021  mooseError("Nodal variables do not have second derivatives");
1022 
1023  MooseVariable * var = getVar(var_name, comp);
1024 
1025  if (!_coupleable_neighbor)
1026  {
1027  if (_c_is_implicit)
1028  return var->adSecondSln<compute_stage>();
1029  else
1030  mooseError("Not implemented");
1031  }
1032  else
1033  {
1034  if (_c_is_implicit)
1035  return var->adSecondSlnNeighbor<compute_stage>();
1036  else
1037  mooseError("Not implemented");
1038  }
1039 }
const VariableSecondType< OutputType, compute_stage >::type & adSecondSlnNeighbor()
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
const VariableSecondType< OutputType, compute_stage >::type & adSecondSln()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867

◆ adCoupledValueTemplate()

template<ComputeStage compute_stage>
const ADVariableValue & Coupleable::adCoupledValueTemplate ( const std::string &  var_name,
unsigned int  comp = 0 
)
protected

Returns value of a coupled variable for use in Automatic Differentiation.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue for the coupled variable
See also
Kernel::value

Definition at line 949 of file Coupleable.h.

950 {
951  if (!isCoupled(var_name))
952  return *getADDefaultValue<compute_stage>(var_name);
953 
954  coupledCallback(var_name, false);
955  MooseVariable * var = getVar(var_name, comp);
956 
958  {
959  if (_c_nodal)
960  mooseError("Not implemented");
961  else
962  {
963  if (_c_is_implicit)
964  return var->adSln<compute_stage>();
965  else
966  mooseError("Not implemented");
967  }
968  }
969  else
970  {
971  if (_c_nodal)
972  mooseError("Not implemented");
973  else
974  {
975  if (_c_is_implicit)
976  return var->adSlnNeighbor<compute_stage>();
977  else
978  mooseError("Not implemented");
979  }
980  }
981 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
const VariableValueType< OutputType, compute_stage >::type & adSln()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const VariableValueType< OutputType, compute_stage >::type & adSlnNeighbor()

◆ adCoupledVectorDotTemplate()

template<ComputeStage compute_stage>
const ADVectorVariableValue & Coupleable::adCoupledVectorDotTemplate ( const std::string &  var_name,
unsigned int  comp = 0 
)
protected

Time derivative of a vector coupled variable for ad simulations.

Parameters
var_nameName of vector coupled variable
compComponent number
Returns
Reference to a VectorVariableValue containing the time derivative of the coupled variable
See also
Kernel::dot

Definition at line 1079 of file Coupleable.h.

1080 {
1081  checkVar(var_name);
1082  if (!isCoupled(var_name)) // Return default 0
1083  return *getADDefaultVectorValue<compute_stage>(var_name);
1084 
1085  VectorMooseVariable * var = getVectorVar(var_name, comp);
1086  if (var == nullptr)
1087  mooseError("Try calling corresponding standard variable method");
1088 
1089  if (!_coupleable_neighbor)
1090  {
1091  if (_c_nodal)
1092  mooseError("Not implemented");
1093  else
1094  return var->adUDot<compute_stage>();
1095  }
1096  else
1097  {
1098  if (_c_nodal)
1099  mooseError("Not implemented");
1100  else
1101  return var->adUDotNeighbor<compute_stage>();
1102  }
1103 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:30
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ adCoupledVectorGradientTemplate()

template<ComputeStage compute_stage>
const ADVectorVariableGradient & Coupleable::adCoupledVectorGradientTemplate ( const std::string &  var_name,
unsigned int  comp = 0 
)
protected

Returns gradient of a coupled vector variable for use in Automatic Differentation.

Parameters
var_nameName of coupled vector variable
compComponent number for vector of coupled vector variables
Returns
Reference to a VectorVariableGradient containing the gradient of the coupled variable
See also
Kernel::gradient

Definition at line 1143 of file Coupleable.h.

1144 {
1145 
1146  if (!isCoupled(var_name)) // Return default 0
1147  return getADDefaultVectorGradient<compute_stage>();
1148 
1149  coupledCallback(var_name, false);
1150  if (_c_nodal)
1151  mooseError("Nodal variables do not have gradients");
1152 
1153  VectorMooseVariable * var = getVectorVar(var_name, comp);
1154 
1155  if (!_coupleable_neighbor)
1156  {
1157  if (_c_is_implicit)
1158  return var->adGradSln<compute_stage>();
1159  else
1160  mooseError("Not implemented");
1161  }
1162  else
1163  {
1164  if (_c_is_implicit)
1165  return var->adGradSlnNeighbor<compute_stage>();
1166  else
1167  mooseError("Not implemented");
1168  }
1169 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:30
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const VariableGradientType< OutputType, compute_stage >::type & adGradSlnNeighbor()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const VariableGradientType< OutputType, compute_stage >::type & adGradSln()

◆ adCoupledVectorSecondTemplate()

template<ComputeStage compute_stage>
const ADVectorVariableSecond& Coupleable::adCoupledVectorSecondTemplate ( const std::string &  var_name,
unsigned int  comp = 0 
)
protected

Returns second derivatives of a coupled vector variable for use in Automatic Differentation.

Parameters
var_nameName of coupled vector variable
compComponent number for vector of coupled vector variables
Returns
Reference to a VectorVariableSecond containing the second derivatives of the coupled variable

◆ adCoupledVectorValueTemplate()

template<ComputeStage compute_stage>
const ADVectorVariableValue & Coupleable::adCoupledVectorValueTemplate ( const std::string &  var_name,
unsigned int  comp = 0 
)
protected

Returns value of a coupled vector variable for use in Automatic Differentiation.

Parameters
var_nameName of coupled vector variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue for the coupled variable
See also
Kernel::value

Definition at line 1107 of file Coupleable.h.

1108 {
1109  if (!isCoupled(var_name))
1110  return *getADDefaultVectorValue<compute_stage>(var_name);
1111 
1112  coupledCallback(var_name, false);
1113  VectorMooseVariable * var = getVectorVar(var_name, comp);
1114 
1115  if (!_coupleable_neighbor)
1116  {
1117  if (_c_nodal)
1118  mooseError("Not implemented");
1119  else
1120  {
1121  if (_c_is_implicit)
1122  return var->adSln<compute_stage>();
1123  else
1124  mooseError("Not implemented");
1125  }
1126  }
1127  else
1128  {
1129  if (_c_nodal)
1130  mooseError("Not implemented");
1131  else
1132  {
1133  if (_c_is_implicit)
1134  return var->adSlnNeighbor<compute_stage>();
1135  else
1136  mooseError("Not implemented");
1137  }
1138  }
1139 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:30
const VariableValueType< OutputType, compute_stage >::type & adSln()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const VariableValueType< OutputType, compute_stage >::type & adSlnNeighbor()

◆ addFEVariableCoupleableMatrixTag()

void Coupleable::addFEVariableCoupleableMatrixTag ( TagID  tag)
inline

Definition at line 116 of file Coupleable.h.

Referenced by coupledMatrixTagValue().

116 { _fe_coupleable_matrix_tags.insert(tag); }
std::set< TagID > _fe_coupleable_matrix_tags
Definition: Coupleable.h:944

◆ addFEVariableCoupleableVectorTag()

void Coupleable::addFEVariableCoupleableVectorTag ( TagID  tag)
inline

Definition at line 114 of file Coupleable.h.

Referenced by coupledVectorTagValue().

114 { _fe_coupleable_vector_tags.insert(tag); }
std::set< TagID > _fe_coupleable_vector_tags
Definition: Coupleable.h:942

◆ adZeroGradientTemplate() [1/3]

template<ComputeStage compute_stage>
const ADVariableGradient & Coupleable::adZeroGradientTemplate ( )
protected

Template method that returns _grad_zero to RESIDUAL computing objects and _ad_grad_zero to JACOBIAN computing objects.

Definition at line 1250 of file Coupleable.h.

1251 {
1252  return _ad_grad_zero;
1253 }
const MooseArray< DualRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:797

◆ adZeroGradientTemplate() [2/3]

template<>
const VariableGradient& Coupleable::adZeroGradientTemplate ( )
protected

◆ adZeroGradientTemplate() [3/3]

template<>
const VariableGradient& Coupleable::adZeroGradientTemplate ( )
protected

Definition at line 1523 of file Coupleable.C.

1524 {
1525  return _grad_zero;
1526 }
const VariableGradient & _grad_zero
Zero gradient of a variable.
Definition: Coupleable.h:796

◆ adZeroSecondTemplate() [1/3]

template<ComputeStage compute_stage>
const ADVariableSecond & Coupleable::adZeroSecondTemplate ( )
protected

Retrieve a zero second for automatic differentiation.

Definition at line 1257 of file Coupleable.h.

1258 {
1259  return _ad_second_zero;
1260 }
const MooseArray< DualRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:801

◆ adZeroSecondTemplate() [2/3]

template<>
const VariableSecond& Coupleable::adZeroSecondTemplate ( )
protected

◆ adZeroSecondTemplate() [3/3]

template<>
const VariableSecond& Coupleable::adZeroSecondTemplate ( )
protected

Definition at line 1530 of file Coupleable.C.

1531 {
1532  return _second_zero;
1533 }
const VariableSecond & _second_zero
Zero second derivative of a variable.
Definition: Coupleable.h:800

◆ adZeroValueTemplate() [1/3]

template<ComputeStage compute_stage>
const ADVariableValue & Coupleable::adZeroValueTemplate ( )
protected

Template method that returns _zero to RESIDUAL computing objects and _ad_zero to JACOBIAN computing objects.

Definition at line 1243 of file Coupleable.h.

1244 {
1245  return _ad_zero;
1246 }
const MooseArray< DualReal > & _ad_zero
Definition: Coupleable.h:793

◆ adZeroValueTemplate() [2/3]

template<>
const VariableValue& Coupleable::adZeroValueTemplate ( )
protected

◆ adZeroValueTemplate() [3/3]

template<>
const VariableValue& Coupleable::adZeroValueTemplate ( )
protected

Definition at line 1516 of file Coupleable.C.

1517 {
1518  return _zero;
1519 }
const VariableValue & _zero
Zero value of a variable.
Definition: Coupleable.h:792

◆ checkVar()

void Coupleable::checkVar ( const std::string &  var_name)
protected

Check that the right kind of variable is being coupled in.

Parameters
var_nameThe name of the coupled variable

Definition at line 180 of file Coupleable.C.

Referenced by adCoupledDotTemplate(), adCoupledVectorDotTemplate(), coupled(), coupledDofValues(), coupledDofValuesOld(), coupledDofValuesOlder(), coupledDot(), coupledDotDot(), coupledDotDotDu(), coupledDotDotOld(), coupledDotDu(), coupledDotOld(), coupledGradient(), coupledGradientDot(), coupledGradientDotDot(), coupledGradientOld(), coupledGradientOlder(), coupledGradientPreviousNL(), coupledMatrixTagValue(), coupledNodalDot(), coupledNodalDotDot(), coupledNodalDotDotOld(), coupledNodalDotOld(), coupledNodalValue(), coupledNodalValueOld(), coupledNodalValueOlder(), coupledNodalValuePreviousNL(), coupledSecond(), coupledSecondOld(), coupledSecondOlder(), coupledSecondPreviousNL(), coupledValue(), coupledValueOld(), coupledValueOlder(), coupledValuePreviousNL(), coupledVectorDot(), coupledVectorDotDot(), coupledVectorDotDotOld(), coupledVectorDotOld(), coupledVectorGradient(), coupledVectorGradientOld(), coupledVectorGradientOlder(), and coupledVectorTagValue().

181 {
182  auto it = _c_coupled_scalar_vars.find(var_name);
183  if (it != _c_coupled_scalar_vars.end())
184  {
185  std::string cvars;
186  for (auto jt : it->second)
187  cvars += " " + jt->name();
189  ": Trying to couple a scalar variable where field variable is expected, '",
190  var_name,
191  " =",
192  cvars,
193  "'");
194  }
195  // NOTE: non-existent variables are handled in the constructor
196 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, std::vector< MooseVariableScalar * > > _c_coupled_scalar_vars
Scalar variables coupled into this object (for error checking)
Definition: Coupleable.h:940
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732

◆ coupled()

unsigned int Coupleable::coupled ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns the index for a coupled variable by name.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Index of coupled variable, if this is an optionally coupled variable that wasn't provided this will return a unique "invalid" index.

Reimplemented in ShapeUserObject< ElementUserObject >, and ShapeUserObject< SideUserObject >.

Definition at line 253 of file Coupleable.C.

Referenced by FunctionMaterialBase::FunctionMaterialBase(), KernelBase::KernelBase(), and NodalEqualValueConstraint::NodalEqualValueConstraint().

254 {
255  checkVar(var_name);
256 
257  if (!isCoupled(var_name))
258  {
259  // make sure we don't try to access default var ids that were not provided
260  if (comp + 1 > _optional_var_index[var_name].size())
262  ": Requested component ",
263  comp,
264  " of coupled value ",
265  var_name,
266  " is out of range.");
267  return _optional_var_index[var_name][comp];
268  }
269 
270  MooseVariableFEBase * var = getFEVar(var_name, comp);
271  switch (var->kind())
272  {
274  return var->number();
276  return std::numeric_limits<unsigned int>::max() - var->number();
277  default:
278  mooseError(_c_name, ": Unknown variable kind. Corrupted binary?");
279  }
280 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
unsigned int number() const
Get variable number coming from libMesh.
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
Moose::VarKindType kind() const
Kind of the variable (Nonlinear, Auxiliary, ...)
std::map< std::string, std::vector< unsigned int > > _optional_var_index
Unique indices for optionally coupled vars that weren&#39;t provided.
Definition: Coupleable.h:937
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
MooseVariableFEBase * getFEVar(const std::string &var_name, unsigned int comp)
Extract pointer to a base finite element coupled variable.
Definition: Coupleable.C:199

◆ coupledCallback()

void Coupleable::coupledCallback ( const std::string &  var_name,
bool  is_old 
)
protectedvirtual

◆ coupledComponents()

unsigned int Coupleable::coupledComponents ( const std::string &  var_name)
protected

Number of coupled components.

Parameters
var_nameName of the variable
Returns
number of components this variable has (usually 1)

Definition at line 166 of file Coupleable.C.

Referenced by KernelBase::KernelBase(), NodalEqualValueConstraint::NodalEqualValueConstraint(), SpatialAverageBase::SpatialAverageBase(), and VolumeHistogram::VolumeHistogram().

167 {
168  if (isCoupled(var_name))
169  return _coupled_vars[var_name].size();
170  else
171  {
173  return _c_parameters.numberDefaultCoupledValues(var_name);
174  else
175  return 0;
176  }
177 }
unsigned int numberDefaultCoupledValues(const std::string &coupling_name) const
Get the number of defaulted coupled value entries.
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
bool hasDefaultCoupledValue(const std::string &coupling_name) const
Return whether or not the requested parameter has a default coupled value.
std::map< std::string, std::vector< MooseVariableFEBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:738
const InputParameters & _c_parameters
Definition: Coupleable.h:729

◆ coupledCurl()

const VectorVariableCurl & Coupleable::coupledCurl ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns curl of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VectorVariableCurl containing the curl of the coupled variable
See also
Kernel::_curl_u

Definition at line 1078 of file Coupleable.C.

1079 {
1080  if (!isCoupled(var_name)) // Return default 0
1081  return _default_vector_curl;
1082 
1083  coupledCallback(var_name, false);
1084  if (_c_nodal)
1085  mooseError("Nodal variables do not have curls");
1086 
1087  VectorMooseVariable * var = getVectorVar(var_name, comp);
1088  if (var == NULL)
1089  mooseError("Call corresponding scalar field variable method");
1090 
1091  if (!_coupleable_neighbor)
1092  return (_c_is_implicit) ? var->curlSln() : var->curlSlnOld();
1093  else
1094  return (_c_is_implicit) ? var->curlSlnNeighbor() : var->curlSlnOldNeighbor();
1095 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:819
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:30
const FieldVariableCurl & curlSlnOld()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
const FieldVariableCurl & curlSlnOldNeighbor()
const FieldVariableCurl & curlSln()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const FieldVariableCurl & curlSlnNeighbor()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867

◆ coupledCurlOld()

const VectorVariableCurl & Coupleable::coupledCurlOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns an old curl from previous time step of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VectorVariableCurl containing the old curl of the coupled variable
See also
Kernel::_curl_u_old

Definition at line 1098 of file Coupleable.C.

1099 {
1100  if (!isCoupled(var_name)) // Return default 0
1101  return _default_vector_curl;
1102 
1103  coupledCallback(var_name, true);
1104  if (_c_nodal)
1105  mooseError("Nodal variables do not have curls");
1106 
1107  validateExecutionerType(var_name, "coupledCurlOld");
1108  VectorMooseVariable * var = getVectorVar(var_name, comp);
1109  if (var == NULL)
1110  mooseError("Call corresponding scalar field variable method");
1111 
1112  if (!_coupleable_neighbor)
1113  return (_c_is_implicit) ? var->curlSlnOld() : var->curlSlnOlder();
1114  else
1115  return (_c_is_implicit) ? var->curlSlnOldNeighbor() : var->curlSlnOlderNeighbor();
1116 }
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 co...
Definition: Coupleable.C:1467
const FieldVariableCurl & curlSlnOlder()
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:819
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:30
const FieldVariableCurl & curlSlnOld()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
const FieldVariableCurl & curlSlnOldNeighbor()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const FieldVariableCurl & curlSlnOlderNeighbor()

◆ coupledCurlOlder()

const VectorVariableCurl & Coupleable::coupledCurlOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns an old curl from two time steps previous of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VectorVariableCurl containing the older curl of the coupled variable
See also
Kernel::_curl_u_older

Definition at line 1119 of file Coupleable.C.

1120 {
1121  if (!isCoupled(var_name)) // Return default 0
1122  return _default_vector_curl;
1123 
1124  coupledCallback(var_name, true);
1125  if (_c_nodal)
1126  mooseError("Nodal variables do not have curls");
1127 
1128  validateExecutionerType(var_name, "coupledCurlOlder");
1129  VectorMooseVariable * var = getVectorVar(var_name, comp);
1130  if (var == NULL)
1131  mooseError("Call corresponding scalar field variable method");
1132 
1133  if (_c_is_implicit)
1134  {
1135  if (!_coupleable_neighbor)
1136  return var->curlSlnOlder();
1137  else
1138  return var->curlSlnOlderNeighbor();
1139  }
1140  else
1141  mooseError("Older values not available for explicit schemes");
1142 }
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 co...
Definition: Coupleable.C:1467
const FieldVariableCurl & curlSlnOlder()
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:819
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:30
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const FieldVariableCurl & curlSlnOlderNeighbor()

◆ coupledDofValues()

const VariableValue & Coupleable::coupledDofValues ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns DoFs in the current solution vector of a coupled variable for the local element.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue for the DoFs of the coupled variable

Definition at line 1410 of file Coupleable.C.

1411 {
1412  checkVar(var_name);
1413 
1414  if (!isCoupled(var_name))
1415  return *getDefaultValue(var_name, comp);
1416 
1417  coupledCallback(var_name, false);
1418  MooseVariableFEBase * var = getFEVar(var_name, comp);
1419 
1420  if (!_coupleable_neighbor)
1421  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
1422  else
1423  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
1424 }
VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:283
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
virtual const MooseArray< Number > & dofValues()=0
Returns dof solution on element.
virtual const MooseArray< Number > & dofValuesOld()=0
Returns old dof solution on element.
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
virtual const MooseArray< Number > & dofValuesOldNeighbor()=0
Returns old dof solution on neighbor element.
MooseVariableFEBase * getFEVar(const std::string &var_name, unsigned int comp)
Extract pointer to a base finite element coupled variable.
Definition: Coupleable.C:199
virtual const MooseArray< Number > & dofValuesNeighbor()=0
Returns dof solution on neighbor element.

◆ coupledDofValuesOld()

const VariableValue & Coupleable::coupledDofValuesOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns DoFs in the old solution vector of a coupled variable for the local element.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue for the old DoFs of the coupled variable

Definition at line 1427 of file Coupleable.C.

1428 {
1429  checkVar(var_name);
1430 
1431  if (!isCoupled(var_name))
1432  return *getDefaultValue(var_name, comp);
1433 
1434  validateExecutionerType(var_name, "coupledDofValuesOld");
1435  coupledCallback(var_name, true);
1436  MooseVariableFEBase * var = getFEVar(var_name, comp);
1437 
1438  if (!_coupleable_neighbor)
1439  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
1440  else
1441  return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
1442 }
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 co...
Definition: Coupleable.C:1467
VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:283
virtual const MooseArray< Number > & dofValuesOlderNeighbor()=0
Returns older dof solution on neighbor element.
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
virtual const MooseArray< Number > & dofValuesOld()=0
Returns old dof solution on element.
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
virtual const MooseArray< Number > & dofValuesOldNeighbor()=0
Returns old dof solution on neighbor element.
virtual const MooseArray< Number > & dofValuesOlder()=0
Returns older dof solution on element.
MooseVariableFEBase * getFEVar(const std::string &var_name, unsigned int comp)
Extract pointer to a base finite element coupled variable.
Definition: Coupleable.C:199

◆ coupledDofValuesOlder()

const VariableValue & Coupleable::coupledDofValuesOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns DoFs in the older solution vector of a coupled variable for the local element.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue for the older DoFs of the coupled variable

Definition at line 1445 of file Coupleable.C.

1446 {
1447  checkVar(var_name);
1448 
1449  if (!isCoupled(var_name))
1450  return *getDefaultValue(var_name, comp);
1451 
1452  validateExecutionerType(var_name, "coupledDofValuesOlder");
1453  coupledCallback(var_name, true);
1454  MooseVariableFEBase * var = getFEVar(var_name, comp);
1455  if (_c_is_implicit)
1456  {
1457  if (!_coupleable_neighbor)
1458  return var->dofValuesOlder();
1459  else
1460  return var->dofValuesOlderNeighbor();
1461  }
1462  else
1463  mooseError(_c_name, ": Older values not available for explicit schemes");
1464 }
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 co...
Definition: Coupleable.C:1467
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:283
virtual const MooseArray< Number > & dofValuesOlderNeighbor()=0
Returns older dof solution on neighbor element.
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
virtual const MooseArray< Number > & dofValuesOlder()=0
Returns older dof solution on element.
MooseVariableFEBase * getFEVar(const std::string &var_name, unsigned int comp)
Extract pointer to a base finite element coupled variable.
Definition: Coupleable.C:199

◆ coupledDot()

const VariableValue & Coupleable::coupledDot ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Time derivative of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the time derivative of the coupled variable

Reimplemented in AuxKernelTempl< ComputeValueType >.

Definition at line 624 of file Coupleable.C.

Referenced by AuxKernelTempl< ComputeValueType >::coupledDot().

625 {
626  checkVar(var_name);
627  if (!isCoupled(var_name)) // Return default 0
628  return _default_value_zero;
629 
630  validateExecutionerType(var_name, "coupledDot");
631  MooseVariable * var = getVar(var_name, comp);
632 
634  {
635  if (_c_nodal)
636  return var->dofValuesDot();
637  else
638  return var->uDot();
639  }
640  else
641  {
642  if (_c_nodal)
643  return var->dofValuesDotNeighbor();
644  else
645  return var->uDotNeighbor();
646  }
647 }
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
const MooseArray< Number > & dofValuesDot() override
Returns time derivative of degrees of freedom.
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:774
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
const MooseArray< Number > & dofValuesDotNeighbor() override
Returns time derivative of neighboring degrees of freedom.
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const FieldVariableValue & uDot()
const FieldVariableValue & uDotNeighbor()
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledDotDot()

const VariableValue & Coupleable::coupledDotDot ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Second time derivative of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the time derivative of the coupled variable

Definition at line 650 of file Coupleable.C.

651 {
652  checkVar(var_name);
653  if (!isCoupled(var_name)) // Return default 0
654  return _default_value_zero;
655 
656  validateExecutionerType(var_name, "coupledDotDot");
657  MooseVariable * var = getVar(var_name, comp);
658 
660  {
661  if (_c_nodal)
662  return var->dofValuesDotDot();
663  else
664  return var->uDotDot();
665  }
666  else
667  {
668  if (_c_nodal)
669  return var->dofValuesDotDotNeighbor();
670  else
671  return var->uDotDotNeighbor();
672  }
673 }
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
const FieldVariableValue & uDotDotNeighbor()
const MooseArray< Number > & dofValuesDotDot() override
Returns second time derivative of degrees of freedom.
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:774
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
const MooseArray< Number > & dofValuesDotDotNeighbor() override
Returns second time derivative of neighboring degrees of freedom.
const FieldVariableValue & uDotDot()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledDotDotDu()

const VariableValue & Coupleable::coupledDotDotDu ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Second time derivative of a coupled variable with respect to the coefficients.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the time derivative of the coupled variable with respect to the coefficients

Definition at line 866 of file Coupleable.C.

867 {
868  checkVar(var_name);
869  if (!isCoupled(var_name)) // Return default 0
870  return _default_value_zero;
871 
872  validateExecutionerType(var_name, "coupledDotDotDu");
873  MooseVariable * var = getVar(var_name, comp);
874 
876  {
877  if (_c_nodal)
878  return var->dofValuesDuDotDotDu();
879  else
880  return var->duDotDotDu();
881  }
882  else
883  {
884  if (_c_nodal)
885  return var->dofValuesDuDotDotDuNeighbor();
886  else
887  return var->duDotDotDu();
888  }
889 }
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:774
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const MooseArray< Number > & dofValuesDuDotDotDu() override
Returns derivative of second time derivative of degrees of freedom.
const MooseArray< Number > & dofValuesDuDotDotDuNeighbor() override
Returns derivative of second time derivative of neighboring degrees of freedom.
const VariableValue & duDotDotDu()
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledDotDotOld()

const VariableValue & Coupleable::coupledDotDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Old second time derivative of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the time derivative of the coupled variable

Definition at line 702 of file Coupleable.C.

703 {
704  checkVar(var_name);
705  if (!isCoupled(var_name)) // Return default 0
706  return _default_value_zero;
707 
708  validateExecutionerType(var_name, "coupledDotDotOld");
709  MooseVariable * var = getVar(var_name, comp);
710 
712  {
713  if (_c_nodal)
714  return var->dofValuesDotDotOld();
715  else
716  return var->uDotDotOld();
717  }
718  else
719  {
720  if (_c_nodal)
721  return var->dofValuesDotDotOldNeighbor();
722  else
723  return var->uDotDotOldNeighbor();
724  }
725 }
const MooseArray< Number > & dofValuesDotDotOldNeighbor() override
Returns old second time derivative of neighboring degrees of freedom.
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
const FieldVariableValue & uDotDotOldNeighbor()
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:774
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
const MooseArray< Number > & dofValuesDotDotOld() override
Returns old second time derivative of degrees of freedom.
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const FieldVariableValue & uDotDotOld()
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledDotDu()

const VariableValue & Coupleable::coupledDotDu ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Time derivative of a coupled variable with respect to the coefficients.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the time derivative of the coupled variable with respect to the coefficients

Reimplemented in AuxKernelTempl< ComputeValueType >.

Definition at line 840 of file Coupleable.C.

Referenced by AuxKernelTempl< ComputeValueType >::coupledDotDu().

841 {
842  checkVar(var_name);
843  if (!isCoupled(var_name)) // Return default 0
844  return _default_value_zero;
845 
846  validateExecutionerType(var_name, "coupledDotDu");
847  MooseVariable * var = getVar(var_name, comp);
848 
850  {
851  if (_c_nodal)
852  return var->dofValuesDuDotDu();
853  else
854  return var->duDotDu();
855  }
856  else
857  {
858  if (_c_nodal)
859  return var->dofValuesDuDotDuNeighbor();
860  else
861  return var->duDotDuNeighbor();
862  }
863 }
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
const VariableValue & duDotDu()
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:774
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
const MooseArray< Number > & dofValuesDuDotDu() override
Returns derivative of time derivative of degrees of freedom.
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const MooseArray< Number > & dofValuesDuDotDuNeighbor() override
Returns derivative of time derivative of neighboring degrees of freedom.
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
const VariableValue & duDotDuNeighbor()

◆ coupledDotOld()

const VariableValue & Coupleable::coupledDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Old time derivative of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the time derivative of the coupled variable

Definition at line 676 of file Coupleable.C.

677 {
678  checkVar(var_name);
679  if (!isCoupled(var_name)) // Return default 0
680  return _default_value_zero;
681 
682  validateExecutionerType(var_name, "coupledDotOld");
683  MooseVariable * var = getVar(var_name, comp);
684 
686  {
687  if (_c_nodal)
688  return var->dofValuesDotOld();
689  else
690  return var->uDotOld();
691  }
692  else
693  {
694  if (_c_nodal)
695  return var->dofValuesDotOldNeighbor();
696  else
697  return var->uDotOldNeighbor();
698  }
699 }
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
const MooseArray< Number > & dofValuesDotOld() override
Returns old time derivative of degrees of freedom.
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:774
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
const MooseArray< Number > & dofValuesDotOldNeighbor() override
Returns old time derivative of neighboring degrees of freedom.
const FieldVariableValue & uDotOldNeighbor()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
const FieldVariableValue & uDotOld()

◆ coupledGradient()

const VariableGradient & Coupleable::coupledGradient ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns gradient of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableGradient containing the gradient of the coupled variable
See also
Kernel::gradient

Definition at line 892 of file Coupleable.C.

Referenced by NodeElemConstraint::coupledSlaveGradient(), and NodeFaceConstraint::coupledSlaveGradient().

893 {
894  checkVar(var_name);
895  if (!isCoupled(var_name)) // Return default 0
896  return _default_gradient;
897 
898  coupledCallback(var_name, false);
899  if (_c_nodal)
900  mooseError(_c_name, ": Nodal variables do not have gradients");
901 
902  MooseVariable * var = getVar(var_name, comp);
903 
905  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
906  else
907  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
908 }
const FieldVariableGradient & gradSlnOld()
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
const FieldVariableGradient & gradSln()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
const FieldVariableGradient & gradSlnNeighbor()
const FieldVariableGradient & gradSlnOldNeighbor()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:777
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledGradientDot()

const VariableGradient & Coupleable::coupledGradientDot ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Time derivative of the gradient of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableGradient containing the time derivative of the gradient of a coupled variable

Definition at line 976 of file Coupleable.C.

977 {
978  checkVar(var_name);
979  if (!isCoupled(var_name)) // Return default 0
980  return _default_gradient;
981 
982  coupledCallback(var_name, false);
983  if (_c_nodal)
984  mooseError(_c_name, ": Nodal variables do not have gradients");
985 
986  MooseVariable * var = getVar(var_name, comp);
987 
989  return var->gradSlnDot();
990  else
991  return var->gradSlnNeighborDot();
992 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
const FieldVariableGradient & gradSlnNeighborDot()
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
const FieldVariableGradient & gradSlnDot()
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:777
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledGradientDotDot()

const VariableGradient & Coupleable::coupledGradientDotDot ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Second time derivative of the gradient of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableGradient containing the time derivative of the gradient of a coupled variable

Definition at line 995 of file Coupleable.C.

996 {
997  checkVar(var_name);
998  if (!isCoupled(var_name)) // Return default 0
999  return _default_gradient;
1000 
1001  coupledCallback(var_name, false);
1002  if (_c_nodal)
1003  mooseError(_c_name, ": Nodal variables do not have gradients");
1004 
1005  MooseVariable * var = getVar(var_name, comp);
1006 
1007  if (!_coupleable_neighbor)
1008  return var->gradSlnDotDot();
1009  else
1010  return var->gradSlnNeighborDotDot();
1011 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
const FieldVariableGradient & gradSlnDotDot()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:777
const FieldVariableGradient & gradSlnNeighborDotDot()
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledGradientOld()

const VariableGradient & Coupleable::coupledGradientOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns an old gradient from previous time step of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableGradient containing the old gradient of the coupled variable
See also
Kernel::gradientOld

Definition at line 911 of file Coupleable.C.

Referenced by NodeElemConstraint::coupledSlaveGradientOld(), and NodeFaceConstraint::coupledSlaveGradientOld().

912 {
913  checkVar(var_name);
914  if (!isCoupled(var_name)) // Return default 0
915  return _default_gradient;
916 
917  coupledCallback(var_name, true);
918  if (_c_nodal)
919  mooseError(_c_name, ": Nodal compute objects do not support gradients");
920 
921  validateExecutionerType(var_name, "coupledGradientOld");
922  MooseVariable * var = getVar(var_name, comp);
923 
925  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
926  else
927  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
928 }
const FieldVariableGradient & gradSlnOld()
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
const FieldVariableGradient & gradSlnOlder()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
const FieldVariableGradient & gradSlnOlderNeighbor()
const FieldVariableGradient & gradSlnOldNeighbor()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:777
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledGradientOlder()

const VariableGradient & Coupleable::coupledGradientOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns an old gradient from two time steps previous of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableGradient containing the older gradient of the coupled variable
See also
Kernel::gradientOlder

Definition at line 931 of file Coupleable.C.

Referenced by NodeElemConstraint::coupledSlaveGradientOlder(), and NodeFaceConstraint::coupledSlaveGradientOlder().

932 {
933  checkVar(var_name);
934  if (!isCoupled(var_name)) // Return default 0
935  return _default_gradient;
936 
937  coupledCallback(var_name, true);
938  if (_c_nodal)
939  mooseError(_c_name, ": Nodal compute objects do not support gradients");
940 
941  validateExecutionerType(var_name, "coupledGradientOlder");
942  MooseVariable * var = getVar(var_name, comp);
943 
944  if (_c_is_implicit)
945  {
947  return var->gradSlnOlder();
948  else
949  return var->gradSlnOlderNeighbor();
950  }
951  else
952  mooseError(_c_name, ": Older values not available for explicit schemes");
953 }
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
const FieldVariableGradient & gradSlnOlder()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
const FieldVariableGradient & gradSlnOlderNeighbor()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:777
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledGradientPreviousNL()

const VariableGradient & Coupleable::coupledGradientPreviousNL ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns gradient of a coupled variable for previous Newton iterate.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableGradient containing the gradient of the coupled variable

Definition at line 956 of file Coupleable.C.

957 {
958  checkVar(var_name);
959  if (!isCoupled(var_name)) // Return default 0
960  return _default_gradient;
961 
963  coupledCallback(var_name, true);
964  if (_c_nodal)
965  mooseError(_c_name, ": Nodal compute objects do not support gradients");
966 
967  MooseVariable * var = getVar(var_name, comp);
968 
970  return var->gradSlnPreviousNL();
971  else
972  return var->gradSlnPreviousNLNeighbor();
973 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:735
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const FieldVariableGradient & gradSlnPreviousNLNeighbor()
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:777
void needsPreviousNewtonIteration(bool state)
Set a flag that indicated that user required values for the previous Newton iterate.
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const FieldVariableGradient & gradSlnPreviousNL()
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledMatrixTagValue()

const VariableValue & Coupleable::coupledMatrixTagValue ( const std::string &  var_name,
TagID  tag,
unsigned int  comp = 0 
)
protectedvirtual

Returns value of a coupled variable for a given tag.

This couples the diag vector of matrix

Parameters
var_nameName of coupled variable
tagmatrix tag ID
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue for the coupled variable
See also
Kernel::_u

Definition at line 406 of file Coupleable.C.

407 {
408  checkVar(var_name);
409  if (!isCoupled(var_name))
410  mooseError(var_name, ": invalid variable name for coupledMatrixTagValue");
411 
413 
414  coupledCallback(var_name, false);
415  MooseVariable * var = getVar(var_name, comp);
416 
417  if (_c_nodal)
418  return var->nodalMatrixTagValue(tag);
419  else
420  return var->matrixTagValue(tag);
421 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const FieldVariableValue & matrixTagValue(TagID tag)
void addFEVariableCoupleableMatrixTag(TagID tag)
Definition: Coupleable.h:116
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
const MooseArray< Real > & nodalMatrixTagValue(TagID tag)

◆ coupledNodalDot()

template<typename T >
template const RealVectorValue & Coupleable::coupledNodalDot< RealVectorValue > ( const std::string &  var_name,
unsigned int  comp = 0 
)
protected

Nodal values of time derivative of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the nodal values of time derivative of the coupled variable

Definition at line 1333 of file Coupleable.C.

1334 {
1335  checkVar(var_name);
1336  static const T zero = 0;
1337  if (!isCoupled(var_name)) // Return default 0
1338  return zero;
1339 
1340  validateExecutionerType(var_name, "coupledNodalDot");
1341  coupledCallback(var_name, false);
1342  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1343  if (var == NULL)
1344  mooseError("Call corresponding vector variable method");
1345 
1346  if (!_coupleable_neighbor)
1347  return var->nodalValueDot();
1348  else
1349  mooseError("Neighbor version not implemented");
1350 }
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 co...
Definition: Coupleable.C:1467
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
const OutputType & nodalValueDot()
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledNodalDotDot()

const VariableValue & Coupleable::coupledNodalDotDot ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Nodal values of second time derivative of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the nodal values of second time derivative of the coupled variable

Definition at line 1353 of file Coupleable.C.

1354 {
1355  checkVar(var_name);
1356  if (!isCoupled(var_name)) // Return default 0
1357  return _default_value_zero;
1358 
1359  validateExecutionerType(var_name, "coupledNodalDotDot");
1360  coupledCallback(var_name, false);
1361  MooseVariable * var = getVar(var_name, comp);
1362  if (var == NULL)
1363  mooseError("Call corresponding vector variable method");
1364 
1365  if (!_coupleable_neighbor)
1366  return var->dofValuesDotDot();
1367  else
1368  return var->dofValuesDotDotNeighbor();
1369 }
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 co...
Definition: Coupleable.C:1467
const MooseArray< Number > & dofValuesDotDot() override
Returns second time derivative of degrees of freedom.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:774
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const MooseArray< Number > & dofValuesDotDotNeighbor() override
Returns second time derivative of neighboring degrees of freedom.
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledNodalDotDotOld()

const VariableValue & Coupleable::coupledNodalDotDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Nodal values of old second time derivative of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the nodal values of second time derivative of the coupled variable

Definition at line 1391 of file Coupleable.C.

1392 {
1393  checkVar(var_name);
1394  if (!isCoupled(var_name)) // Return default 0
1395  return _default_value_zero;
1396 
1397  validateExecutionerType(var_name, "coupledNodalDotDotOld");
1398  coupledCallback(var_name, false);
1399  MooseVariable * var = getVar(var_name, comp);
1400  if (var == NULL)
1401  mooseError("Call corresponding vector variable method");
1402 
1403  if (!_coupleable_neighbor)
1404  return var->dofValuesDotDotOld();
1405  else
1406  return var->dofValuesDotDotOldNeighbor();
1407 }
const MooseArray< Number > & dofValuesDotDotOldNeighbor() override
Returns old second time derivative of neighboring degrees of freedom.
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 co...
Definition: Coupleable.C:1467
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:774
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
const MooseArray< Number > & dofValuesDotDotOld() override
Returns old second time derivative of degrees of freedom.
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledNodalDotOld()

const VariableValue & Coupleable::coupledNodalDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Nodal values of old time derivative of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the nodal values of time derivative of the coupled variable

Definition at line 1372 of file Coupleable.C.

1373 {
1374  checkVar(var_name);
1375  if (!isCoupled(var_name)) // Return default 0
1376  return _default_value_zero;
1377 
1378  validateExecutionerType(var_name, "coupledNodalDotOld");
1379  coupledCallback(var_name, false);
1380  MooseVariable * var = getVar(var_name, comp);
1381  if (var == NULL)
1382  mooseError("Call corresponding vector variable method");
1383 
1384  if (!_coupleable_neighbor)
1385  return var->dofValuesDotOld();
1386  else
1387  return var->dofValuesDotOldNeighbor();
1388 }
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 co...
Definition: Coupleable.C:1467
const MooseArray< Number > & dofValuesDotOld() override
Returns old time derivative of degrees of freedom.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:774
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const MooseArray< Number > & dofValuesDotOldNeighbor() override
Returns old time derivative of neighboring degrees of freedom.
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledNodalValue()

template<typename T >
template const RealVectorValue & Coupleable::coupledNodalValue< RealVectorValue > ( const std::string &  var_name,
unsigned int  comp = 0 
)
protected

Returns nodal values of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue for the coupled variable

Definition at line 1235 of file Coupleable.C.

1236 {
1237  checkVar(var_name);
1238  if (!isCoupled(var_name))
1239  return getNodalDefaultValue<T>(var_name, comp);
1240 
1241  coupledCallback(var_name, false);
1242  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1243  if (var == NULL)
1244  mooseError("Call corresponding vector variable method");
1245  if (!var->isNodal())
1247  ": Trying to get nodal values of variable '",
1248  var->name(),
1249  "', but it is not nodal.");
1250 
1251  if (!_coupleable_neighbor)
1252  return (_c_is_implicit) ? var->nodalValue() : var->nodalValueOld();
1253  else
1254  return (_c_is_implicit) ? var->nodalValueNeighbor() : var->nodalValueOldNeighbor();
1255 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
const OutputType & nodalValueOld()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const OutputType & nodalValueNeighbor()
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
const OutputType & nodalValue()
Methods for retrieving values of variables at the nodes.
const OutputType & nodalValueOldNeighbor()
bool isNodal() const override
Is this variable nodal.
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const std::string & name() const
Get the variable name.
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledNodalValueOld()

template<typename T >
template const RealVectorValue & Coupleable::coupledNodalValueOld< RealVectorValue > ( const std::string &  var_name,
unsigned int  comp = 0 
)
protected

Returns an old nodal value from previous time step of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the old value of the coupled variable

Definition at line 1259 of file Coupleable.C.

1260 {
1261  checkVar(var_name);
1262  if (!isCoupled(var_name))
1263  return getNodalDefaultValue<T>(var_name, comp);
1264 
1265  validateExecutionerType(var_name, "coupledNodalValueOld");
1266  coupledCallback(var_name, true);
1267  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1268  if (var == NULL)
1269  mooseError("Call corresponding vector variable method");
1270  if (!var->isNodal())
1272  ": Trying to get old nodal values of variable '",
1273  var->name(),
1274  "', but it is not nodal.");
1275 
1276  if (!_coupleable_neighbor)
1277  return (_c_is_implicit) ? var->nodalValueOld() : var->nodalValueOlder();
1278  else
1280 }
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 co...
Definition: Coupleable.C:1467
const OutputType & nodalValueOlderNeighbor()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
const OutputType & nodalValueOld()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
const OutputType & nodalValueOldNeighbor()
bool isNodal() const override
Is this variable nodal.
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const std::string & name() const
Get the variable name.
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
const OutputType & nodalValueOlder()

◆ coupledNodalValueOlder()

template<typename T >
template const RealVectorValue & Coupleable::coupledNodalValueOlder< RealVectorValue > ( const std::string &  var_name,
unsigned int  comp = 0 
)
protected

Returns an old nodal value from two time steps previous of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the older value of the coupled variable

Definition at line 1284 of file Coupleable.C.

1285 {
1286  checkVar(var_name);
1287  if (!isCoupled(var_name))
1288  return getNodalDefaultValue<T>(var_name, comp);
1289 
1290  validateExecutionerType(var_name, "coupledNodalValueOlder");
1291  coupledCallback(var_name, true);
1292  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1293  if (var == NULL)
1294  mooseError("Call corresponding vector variable method");
1295  if (!var->isNodal())
1297  ": Trying to get older nodal values of variable '",
1298  var->name(),
1299  "', but it is not nodal.");
1300  if (_c_is_implicit)
1301  {
1302  if (!_coupleable_neighbor)
1303  return var->nodalValueOlder();
1304  else
1305  return var->nodalValueOlderNeighbor();
1306  }
1307  else
1308  mooseError(_c_name, ": Older values not available for explicit schemes");
1309 }
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 co...
Definition: Coupleable.C:1467
const OutputType & nodalValueOlderNeighbor()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
bool isNodal() const override
Is this variable nodal.
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const std::string & name() const
Get the variable name.
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
const OutputType & nodalValueOlder()

◆ coupledNodalValuePreviousNL()

template<typename T >
template const RealVectorValue & Coupleable::coupledNodalValuePreviousNL< RealVectorValue > ( const std::string &  var_name,
unsigned int  comp = 0 
)
protected

Returns nodal values of a coupled variable for previous Newton iterate.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue for the coupled variable

Definition at line 1313 of file Coupleable.C.

1314 {
1315  checkVar(var_name);
1316  if (!isCoupled(var_name))
1317  return getNodalDefaultValue<T>(var_name, comp);
1318 
1320  coupledCallback(var_name, true);
1321  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1322  if (var == NULL)
1323  mooseError("Call corresponding vector variable method");
1324 
1325  if (!_coupleable_neighbor)
1326  return var->nodalValuePreviousNL();
1327  else
1328  return var->nodalValuePreviousNLNeighbor();
1329 }
const OutputType & nodalValuePreviousNL()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
const OutputType & nodalValuePreviousNLNeighbor()
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:735
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
void needsPreviousNewtonIteration(bool state)
Set a flag that indicated that user required values for the previous Newton iterate.
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledSecond()

const VariableSecond & Coupleable::coupledSecond ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns second derivative of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableSecond containing the second derivative of the coupled variable
See also
Kernel::second

Definition at line 1145 of file Coupleable.C.

Referenced by NodeElemConstraint::coupledSlaveSecond(), and NodeFaceConstraint::coupledSlaveSecond().

1146 {
1147  checkVar(var_name);
1148  if (!isCoupled(var_name)) // Return default 0
1149  return _default_second;
1150 
1151  coupledCallback(var_name, false);
1152  if (_c_nodal)
1153  mooseError(_c_name, ": Nodal variables do not have second derivatives");
1154 
1155  MooseVariable * var = getVar(var_name, comp);
1156  if (var == NULL)
1157  mooseError("Call corresponding vector variable method");
1158 
1159  if (!_coupleable_neighbor)
1160  return (_c_is_implicit) ? var->secondSln() : var->secondSlnOlder();
1161  else
1162  return (_c_is_implicit) ? var->secondSlnNeighbor() : var->secondSlnOlderNeighbor();
1163 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
const FieldVariableSecond & secondSlnOlderNeighbor()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:786
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
const FieldVariableSecond & secondSlnOlder()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const FieldVariableSecond & secondSlnNeighbor()
const FieldVariableSecond & secondSln()
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledSecondOld()

const VariableSecond & Coupleable::coupledSecondOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns an old second derivative from previous time step of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableSecond containing the old second derivative of the coupled variable
See also
Kernel::secondOld

Definition at line 1166 of file Coupleable.C.

1167 {
1168  checkVar(var_name);
1169  if (!isCoupled(var_name)) // Return default 0
1170  return _default_second;
1171 
1172  coupledCallback(var_name, true);
1173  if (_c_nodal)
1174  mooseError(_c_name, ": Nodal variables do not have second derivatives");
1175 
1176  validateExecutionerType(var_name, "coupledSecondOld");
1177  MooseVariable * var = getVar(var_name, comp);
1178  if (var == NULL)
1179  mooseError("Call corresponding vector variable method");
1180  if (!_coupleable_neighbor)
1181  return (_c_is_implicit) ? var->secondSlnOld() : var->secondSlnOlder();
1182  else
1183  return (_c_is_implicit) ? var->secondSlnOldNeighbor() : var->secondSlnOlderNeighbor();
1184 }
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
const FieldVariableSecond & secondSlnOlderNeighbor()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:786
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
const FieldVariableSecond & secondSlnOlder()
const FieldVariableSecond & secondSlnOld()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const FieldVariableSecond & secondSlnOldNeighbor()
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledSecondOlder()

const VariableSecond & Coupleable::coupledSecondOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns an old second derivative from two time steps previous of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableSecond containing the older second derivative of the coupled variable
See also
Kernel::secondOlder

Definition at line 1187 of file Coupleable.C.

1188 {
1189  checkVar(var_name);
1190  if (!isCoupled(var_name)) // Return default 0
1191  return _default_second;
1192 
1193  coupledCallback(var_name, true);
1194  if (_c_nodal)
1195  mooseError(_c_name, ": Nodal variables do not have second derivatives");
1196 
1197  validateExecutionerType(var_name, "coupledSecondOlder");
1198  MooseVariable * var = getVar(var_name, comp);
1199  if (var == NULL)
1200  mooseError("Call corresponding vector variable method");
1201  if (_c_is_implicit)
1202  {
1203  if (!_coupleable_neighbor)
1204  return var->secondSlnOlder();
1205  else
1206  return var->secondSlnOlderNeighbor();
1207  }
1208  else
1209  mooseError(_c_name, ": Older values not available for explicit schemes");
1210 }
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
const FieldVariableSecond & secondSlnOlderNeighbor()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:786
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
const FieldVariableSecond & secondSlnOlder()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledSecondPreviousNL()

const VariableSecond & Coupleable::coupledSecondPreviousNL ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns second derivative of a coupled variable for the previous Newton iterate.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableSecond containing the second derivative of the coupled variable

Definition at line 1213 of file Coupleable.C.

1214 {
1215  checkVar(var_name);
1216  if (!isCoupled(var_name)) // Return default 0
1217  return _default_second;
1218 
1220  coupledCallback(var_name, true);
1221  if (_c_nodal)
1222  mooseError(_c_name, ": Nodal variables do not have second derivatives");
1223 
1224  MooseVariable * var = getVar(var_name, comp);
1225  if (var == NULL)
1226  mooseError("Call corresponding vector variable method");
1227  if (!_coupleable_neighbor)
1228  return var->secondSlnPreviousNL();
1229  else
1230  return var->secondSlnPreviousNLNeighbor();
1231 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:735
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:786
void needsPreviousNewtonIteration(bool state)
Set a flag that indicated that user required values for the previous Newton iterate.
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const FieldVariableSecond & secondSlnPreviousNLNeighbor()
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
const FieldVariableSecond & secondSlnPreviousNL()

◆ coupledValue()

const VariableValue & Coupleable::coupledValue ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns value of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue for the coupled variable
See also
Kernel::_u

Definition at line 361 of file Coupleable.C.

Referenced by NodeElemConstraint::coupledSlaveValue(), NodeFaceConstraint::coupledSlaveValue(), FunctionMaterialBase::FunctionMaterialBase(), NodalEqualValueConstraint::NodalEqualValueConstraint(), ParsedAux::ParsedAux(), SpatialAverageBase::SpatialAverageBase(), VariableTimeIntegrationAux::VariableTimeIntegrationAux(), and writableCoupledValue().

362 {
363  checkVar(var_name);
364  if (!isCoupled(var_name))
365  return *getDefaultValue(var_name, comp);
366 
367  coupledCallback(var_name, false);
368  MooseVariable * var = getVar(var_name, comp);
369  // var should be a valid pointer at this point, otherwise an error has been thrown in getVar
370 
372  {
373  if (_c_nodal)
374  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
375  else
376  return (_c_is_implicit) ? var->sln() : var->slnOld();
377  }
378  else
379  {
380  if (_c_nodal)
381  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
382  else
383  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
384  }
385 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
const FieldVariableValue & sln()
const FieldVariableValue & slnOldNeighbor()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:283
const FieldVariableValue & slnNeighbor()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const MooseArray< Number > & dofValuesOld() override
Returns old dof solution on element.
const FieldVariableValue & slnOld()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const MooseArray< Number > & dofValuesNeighbor() override
Returns dof solution on neighbor element.
const MooseArray< Number > & dofValuesOldNeighbor() override
Returns old dof solution on neighbor element.
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
const MooseArray< Number > & dofValues() override
Returns dof solution on element.

◆ coupledValueOld()

const VariableValue & Coupleable::coupledValueOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns an old value from previous time step of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the old value of the coupled variable
See also
Kernel::valueOld

Definition at line 457 of file Coupleable.C.

Referenced by NodeElemConstraint::coupledSlaveValueOld(), NodeFaceConstraint::coupledSlaveValueOld(), and VariableTimeIntegrationAux::VariableTimeIntegrationAux().

458 {
459  checkVar(var_name);
460  if (!isCoupled(var_name))
461  return *getDefaultValue(var_name, comp);
462 
463  validateExecutionerType(var_name, "coupledValueOld");
464  coupledCallback(var_name, true);
465  MooseVariable * var = getVar(var_name, comp);
466 
468  {
469  if (_c_nodal)
470  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
471  else
472  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
473  }
474  else
475  {
476  if (_c_nodal)
478  else
479  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
480  }
481 }
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
const MooseArray< Number > & dofValuesOlder() override
Returns older dof solution on element.
const FieldVariableValue & slnOldNeighbor()
const FieldVariableValue & slnOlderNeighbor()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:283
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const MooseArray< Number > & dofValuesOld() override
Returns old dof solution on element.
const FieldVariableValue & slnOld()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const MooseArray< Number > & dofValuesOlderNeighbor() override
Returns older dof solution on neighbor element.
const MooseArray< Number > & dofValuesOldNeighbor() override
Returns old dof solution on neighbor element.
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
const FieldVariableValue & slnOlder()

◆ coupledValueOlder()

const VariableValue & Coupleable::coupledValueOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns an old value from two time steps previous of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the older value of the coupled variable
See also
Kernel::valueOlder

Definition at line 484 of file Coupleable.C.

Referenced by NodeElemConstraint::coupledSlaveValueOlder(), NodeFaceConstraint::coupledSlaveValueOlder(), and VariableTimeIntegrationAux::VariableTimeIntegrationAux().

485 {
486  checkVar(var_name);
487  if (!isCoupled(var_name))
488  return *getDefaultValue(var_name, comp);
489 
490  validateExecutionerType(var_name, "coupledValueOlder");
491  coupledCallback(var_name, true);
492  MooseVariable * var = getVar(var_name, comp);
493 
495  {
496  if (_c_nodal)
497  {
498  if (_c_is_implicit)
499  return var->dofValuesOlder();
500  else
501  mooseError(_c_name, ": Older values not available for explicit schemes");
502  }
503  else
504  {
505  if (_c_is_implicit)
506  return var->slnOlder();
507  else
508  mooseError(_c_name, ": Older values not available for explicit schemes");
509  }
510  }
511  else
512  {
513  if (_c_nodal)
514  {
515  if (_c_is_implicit)
516  return var->dofValuesOlderNeighbor();
517  else
518  mooseError(_c_name, ": Older values not available for explicit schemes");
519  }
520  else
521  {
522  if (_c_is_implicit)
523  return var->slnOlderNeighbor();
524  else
525  mooseError(_c_name, ": Older values not available for explicit schemes");
526  }
527  }
528 }
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
const MooseArray< Number > & dofValuesOlder() override
Returns older dof solution on element.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
const FieldVariableValue & slnOlderNeighbor()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:283
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const MooseArray< Number > & dofValuesOlderNeighbor() override
Returns older dof solution on neighbor element.
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
const FieldVariableValue & slnOlder()

◆ coupledValuePreviousNL()

const VariableValue & Coupleable::coupledValuePreviousNL ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns value of previous Newton iterate of a coupled variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue containing the older value of the coupled variable

Definition at line 531 of file Coupleable.C.

532 {
533  checkVar(var_name);
534  if (!isCoupled(var_name))
535  return *getDefaultValue(var_name, comp);
536 
538  coupledCallback(var_name, true);
539  MooseVariable * var = getVar(var_name, comp);
540 
542  {
543  if (_c_nodal)
544  return var->dofValuesPreviousNL();
545  else
546  return var->slnPreviousNL();
547  }
548  else
549  {
550  if (_c_nodal)
551  return var->dofValuesPreviousNLNeighbor();
552  else
553  return var->slnPreviousNLNeighbor();
554  }
555 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
const FieldVariableValue & slnPreviousNLNeighbor()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:283
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:735
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
const MooseArray< Number > & dofValuesPreviousNL() override
Returns previous nl solution on element.
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const FieldVariableValue & slnPreviousNL()
void needsPreviousNewtonIteration(bool state)
Set a flag that indicated that user required values for the previous Newton iterate.
const MooseArray< Number > & dofValuesPreviousNLNeighbor() override
Returns previous nl solution on neighbor element.
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledVectorDot()

const VectorVariableValue & Coupleable::coupledVectorDot ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Time derivative of a coupled vector variable.

Parameters
var_nameName of coupled vector variable
compComponent number for vector of coupled vector variables
Returns
Reference to a VectorVariableValue containing the time derivative of the coupled variable

Definition at line 728 of file Coupleable.C.

729 {
730  checkVar(var_name);
731  if (!isCoupled(var_name)) // Return default 0
733 
734  validateExecutionerType(var_name, "coupledVectorDot");
735  VectorMooseVariable * var = getVectorVar(var_name, comp);
736 
738  {
739  if (_c_nodal)
740  mooseError("Vector variables are not required to be continuous and so should not be used "
741  "with nodal compute objects");
742  else
743  return var->uDot();
744  }
745  else
746  {
747  if (_c_nodal)
748  mooseError("Vector variables are not required to be continuous and so should not be used "
749  "with nodal compute objects");
750  else
751  return var->uDotNeighbor();
752  }
753 }
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:30
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:813
const FieldVariableValue & uDot()
const FieldVariableValue & uDotNeighbor()
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledVectorDotDot()

const VectorVariableValue & Coupleable::coupledVectorDotDot ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Second time derivative of a coupled vector variable.

Parameters
var_nameName of coupled vector variable
compComponent number for vector of coupled vector variables
Returns
Reference to a VectorVariableValue containing the time derivative of the coupled variable

Definition at line 756 of file Coupleable.C.

757 {
758  checkVar(var_name);
759  if (!isCoupled(var_name)) // Return default 0
761 
762  validateExecutionerType(var_name, "coupledVectorDotDot");
763  VectorMooseVariable * var = getVectorVar(var_name, comp);
764 
766  {
767  if (_c_nodal)
768  mooseError("Vector variables are not required to be continuous and so should not be used "
769  "with nodal compute objects");
770  else
771  return var->uDotDot();
772  }
773  else
774  {
775  if (_c_nodal)
776  mooseError("Vector variables are not required to be continuous and so should not be used "
777  "with nodal compute objects");
778  else
779  return var->uDotDotNeighbor();
780  }
781 }
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
const FieldVariableValue & uDotDotNeighbor()
Class for stuff related to variables.
Definition: Adaptivity.h:30
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
const FieldVariableValue & uDotDot()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:813
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledVectorDotDotOld()

const VectorVariableValue & Coupleable::coupledVectorDotDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Old second time derivative of a coupled vector variable.

Parameters
var_nameName of coupled vector variable
compComponent number for vector of coupled vector variables
Returns
Reference to a VectorVariableValue containing the time derivative of the coupled variable

Definition at line 812 of file Coupleable.C.

813 {
814  checkVar(var_name);
815  if (!isCoupled(var_name)) // Return default 0
817 
818  validateExecutionerType(var_name, "coupledVectorDotDotOld");
819  VectorMooseVariable * var = getVectorVar(var_name, comp);
820 
822  {
823  if (_c_nodal)
824  mooseError("Vector variables are not required to be continuous and so should not be used "
825  "with nodal compute objects");
826  else
827  return var->uDotDotOld();
828  }
829  else
830  {
831  if (_c_nodal)
832  mooseError("Vector variables are not required to be continuous and so should not be used "
833  "with nodal compute objects");
834  else
835  return var->uDotDotOldNeighbor();
836  }
837 }
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
const FieldVariableValue & uDotDotOldNeighbor()
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:30
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:813
const FieldVariableValue & uDotDotOld()
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledVectorDotOld()

const VectorVariableValue & Coupleable::coupledVectorDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Old time derivative of a coupled vector variable.

Parameters
var_nameName of coupled vector variable
compComponent number for vector of coupled vector variables
Returns
Reference to a VectorVariableValue containing the time derivative of the coupled variable

Definition at line 784 of file Coupleable.C.

785 {
786  checkVar(var_name);
787  if (!isCoupled(var_name)) // Return default 0
789 
790  validateExecutionerType(var_name, "coupledVectorDotOld");
791  VectorMooseVariable * var = getVectorVar(var_name, comp);
792 
794  {
795  if (_c_nodal)
796  mooseError("Vector variables are not required to be continuous and so should not be used "
797  "with nodal compute objects");
798  else
799  return var->uDotOld();
800  }
801  else
802  {
803  if (_c_nodal)
804  mooseError("Vector variables are not required to be continuous and so should not be used "
805  "with nodal compute objects");
806  else
807  return var->uDotOldNeighbor();
808  }
809 }
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:30
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
const FieldVariableValue & uDotOldNeighbor()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:813
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180
const FieldVariableValue & uDotOld()

◆ coupledVectorGradient()

const VectorVariableGradient & Coupleable::coupledVectorGradient ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns gradient of a coupled vector variable.

Parameters
var_nameName of coupled vector variable
compComponent number for vector of coupled vector variables
Returns
Reference to a VectorVariableGradient containing the gradient of the coupled vector variable

Definition at line 1014 of file Coupleable.C.

1015 {
1016  checkVar(var_name);
1017  if (!isCoupled(var_name)) // Return default 0
1018  return _default_vector_gradient;
1019 
1020  coupledCallback(var_name, false);
1021  if (_c_nodal)
1022  mooseError(_c_name, ": Gradients are non-sensical with nodal compute objects");
1023 
1024  VectorMooseVariable * var = getVectorVar(var_name, comp);
1025 
1026  if (!_coupleable_neighbor)
1027  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
1028  else
1029  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
1030 }
const FieldVariableGradient & gradSlnOld()
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
const FieldVariableGradient & gradSln()
Class for stuff related to variables.
Definition: Adaptivity.h:30
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
const FieldVariableGradient & gradSlnNeighbor()
const FieldVariableGradient & gradSlnOldNeighbor()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:816
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledVectorGradientOld()

const VectorVariableGradient & Coupleable::coupledVectorGradientOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns an old gradient from previous time step of a coupled vector variable.

Parameters
var_nameName of coupled vector variable
compComponent number for vector of coupled vector variables
Returns
Reference to a VectorVariableGradient containing the old gradient of the coupled vector variable

Definition at line 1033 of file Coupleable.C.

1034 {
1035  checkVar(var_name);
1036  if (!isCoupled(var_name)) // Return default 0
1037  return _default_vector_gradient;
1038 
1039  coupledCallback(var_name, true);
1040  if (_c_nodal)
1041  mooseError(_c_name, ": Gradients are non-sensical with nodal compute objects");
1042 
1043  validateExecutionerType(var_name, "coupledGradientOld");
1044  VectorMooseVariable * var = getVectorVar(var_name, comp);
1045 
1046  if (!_coupleable_neighbor)
1047  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
1048  else
1049  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
1050 }
const FieldVariableGradient & gradSlnOld()
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
const FieldVariableGradient & gradSlnOlder()
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:30
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
const FieldVariableGradient & gradSlnOlderNeighbor()
const FieldVariableGradient & gradSlnOldNeighbor()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:816
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledVectorGradientOlder()

const VectorVariableGradient & Coupleable::coupledVectorGradientOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns an old gradient from two time steps previous of a coupled vector variable.

Parameters
var_nameName of coupled vector variable
compComponent number for vector of coupled vector variables
Returns
Reference to a VectorVariableGradient containing the older gradient of the coupled vector variable

Definition at line 1053 of file Coupleable.C.

1054 {
1055  checkVar(var_name);
1056  if (!isCoupled(var_name)) // Return default 0
1057  return _default_vector_gradient;
1058 
1059  coupledCallback(var_name, true);
1060  if (_c_nodal)
1061  mooseError(_c_name, ": Gradients are non-sensical with nodal compute objects");
1062 
1063  validateExecutionerType(var_name, "coupledGradientOlder");
1064  VectorMooseVariable * var = getVectorVar(var_name, comp);
1065 
1066  if (_c_is_implicit)
1067  {
1068  if (!_coupleable_neighbor)
1069  return var->gradSlnOlder();
1070  else
1071  return var->gradSlnOlderNeighbor();
1072  }
1073  else
1074  mooseError(_c_name, ": Older values not available for explicit schemes");
1075 }
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
const FieldVariableGradient & gradSlnOlder()
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:30
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
const FieldVariableGradient & gradSlnOlderNeighbor()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:816
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledVectorTagValue()

const VariableValue & Coupleable::coupledVectorTagValue ( const std::string &  var_name,
TagID  tag,
unsigned int  comp = 0 
)
protectedvirtual

Returns value of a coupled variable for a given tag.

Parameters
var_nameName of coupled variable
tagvector tag ID
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue for the coupled variable
See also
Kernel::_u

Definition at line 388 of file Coupleable.C.

389 {
390  checkVar(var_name);
391  if (!isCoupled(var_name))
392  mooseError(var_name, ": invalid variable name for coupledVectorTagValue");
393 
395 
396  coupledCallback(var_name, false);
397  MooseVariable * var = getVar(var_name, comp);
398 
399  if (_c_nodal)
400  return var->nodalVectorTagValue(tag);
401  else
402  return var->vectorTagValue(tag);
403 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:241
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
const FieldVariableValue & vectorTagValue(TagID tag)
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
void addFEVariableCoupleableVectorTag(TagID tag)
Definition: Coupleable.h:114
const MooseArray< Real > & nodalVectorTagValue(TagID tag)
void checkVar(const std::string &var_name)
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:180

◆ coupledVectorValue()

const VectorVariableValue & Coupleable::coupledVectorValue ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns value of a coupled vector variable.

Parameters
var_nameName of coupled vector variable
compComponent number for vector of coupled vector variables
Returns
Reference to a VectorVariableValue for the coupled vector variable
See also
VectorKernel::_u

Definition at line 424 of file Coupleable.C.

425 {
426  if (!isCoupled(var_name))
427  return *getDefaultVectorValue(var_name);
428 
429  coupledCallback(var_name, false);
430  VectorMooseVariable * var = getVectorVar(var_name, comp);
431 
433  {
434  if (_c_nodal)
435  mooseError("Vector variables are not required to be continuous and so should not be used "
436  "with nodal compute objects");
437  else
438  return (_c_is_implicit) ? var->sln() : var->slnOld();
439  }
440  else
441  {
442  if (_c_nodal)
443  mooseError("Vector variables are not required to be continuous and so should not be used "
444  "with nodal compute objects");
445  else
446  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
447  }
448 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:30
const FieldVariableValue & sln()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
const FieldVariableValue & slnOldNeighbor()
VectorVariableValue * getDefaultVectorValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled vector variable...
Definition: Coupleable.C:310
const FieldVariableValue & slnNeighbor()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const FieldVariableValue & slnOld()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867

◆ coupledVectorValueOld()

const VectorVariableValue & Coupleable::coupledVectorValueOld ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns an old value from previous time step of a coupled vector variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VectorVariableValue containing the old value of the coupled variable
See also
Kernel::_u_old

Definition at line 558 of file Coupleable.C.

559 {
560  if (!isCoupled(var_name))
561  return *getDefaultVectorValue(var_name);
562 
563  validateExecutionerType(var_name, "coupledVectorValueOld");
564  coupledCallback(var_name, true);
565  VectorMooseVariable * var = getVectorVar(var_name, comp);
566 
568  {
569  if (_c_nodal)
570  mooseError("Vector variables are not required to be continuous and so should not be used "
571  "with nodal compute objects");
572  else
573  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
574  }
575  else
576  {
577  if (_c_nodal)
578  mooseError("Vector variables are not required to be continuous and so should not be used "
579  "with nodal compute objects");
580  else
581  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
582  }
583 }
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:30
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
const FieldVariableValue & slnOldNeighbor()
const FieldVariableValue & slnOlderNeighbor()
VectorVariableValue * getDefaultVectorValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled vector variable...
Definition: Coupleable.C:310
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
const FieldVariableValue & slnOld()
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const FieldVariableValue & slnOlder()

◆ coupledVectorValueOlder()

const VectorVariableValue & Coupleable::coupledVectorValueOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns an old value from two time steps previous of a coupled vector variable.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VectorVariableValue containing the older value of the coupled variable
See also
Kernel::_u_older

Definition at line 586 of file Coupleable.C.

587 {
588  if (!isCoupled(var_name))
589  return *getDefaultVectorValue(var_name);
590 
591  validateExecutionerType(var_name, "coupledVectorValueOlder");
592  coupledCallback(var_name, true);
593  VectorMooseVariable * var = getVectorVar(var_name, comp);
594 
596  {
597  if (_c_nodal)
598  mooseError("Vector variables are not required to be continuous and so should not be used "
599  "with nodal compute objects");
600  else
601  {
602  if (_c_is_implicit)
603  return var->slnOlder();
604  else
605  mooseError("Older values not available for explicit schemes");
606  }
607  }
608  else
609  {
610  if (_c_nodal)
611  mooseError("Vector variables are not required to be continuous and so should not be used "
612  "with nodal compute objects");
613  else
614  {
615  if (_c_is_implicit)
616  return var->slnOlderNeighbor();
617  else
618  mooseError("Older values not available for explicit schemes");
619  }
620  }
621 }
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 co...
Definition: Coupleable.C:1467
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:247
Class for stuff related to variables.
Definition: Adaptivity.h:30
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
const FieldVariableValue & slnOlderNeighbor()
VectorVariableValue * getDefaultVectorValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled vector variable...
Definition: Coupleable.C:310
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:753
virtual bool isCoupled(const std::string &var_name, unsigned int i=0)
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:144
virtual void coupledCallback(const std::string &var_name, bool is_old)
Definition: Coupleable.C:139
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:867
const FieldVariableValue & slnOlder()

◆ getADDefaultGradient() [1/3]

template<ComputeStage compute_stage>
ADVariableGradient & Coupleable::getADDefaultGradient ( )

Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation for an uncoupled variable.

Parameters
var_namethe name of the variable for which to retrieve a default gradient
Returns
VariableGradient * a pointer to the associated VariableGradient.

Definition at line 1213 of file Coupleable.h.

1214 {
1215  return _ad_default_gradient;
1216 }
MooseArray< DualRealVectorValue > _ad_default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:780

◆ getADDefaultGradient() [2/3]

template<>
VariableGradient& Coupleable::getADDefaultGradient ( )

◆ getADDefaultGradient() [3/3]

template<>
VariableGradient& Coupleable::getADDefaultGradient ( )

Definition at line 1495 of file Coupleable.C.

1496 {
1497  return _default_gradient;
1498 }
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:777

◆ getADDefaultSecond() [1/3]

template<ComputeStage compute_stage>
ADVariableSecond & Coupleable::getADDefaultSecond ( )

Helper method to return (and insert if necessary) the default second derivatives for Automatic Differentiation for an uncoupled variable.

Parameters
var_namethe name of the variable for which to retrieve a default second derivative
Returns
VariableSecond * a pointer to the associated VariableSecond.

Definition at line 1233 of file Coupleable.h.

1234 {
1235  return _ad_default_second;
1236 }
MooseArray< DualRealTensorValue > _ad_default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:789

◆ getADDefaultSecond() [2/3]

template<>
VariableSecond& Coupleable::getADDefaultSecond ( )

◆ getADDefaultSecond() [3/3]

template<>
VariableSecond& Coupleable::getADDefaultSecond ( )

Definition at line 1509 of file Coupleable.C.

1510 {
1511  return _default_second;
1512 }
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:786

◆ getADDefaultValue() [1/3]

template<ComputeStage compute_stage>
ADVariableValue * Coupleable::getADDefaultValue ( const std::string &  var_name)

Helper method to return (and insert if necessary) the default value for Automatic Differentiation for an uncoupled variable.

Parameters
var_namethe name of the variable for which to retrieve a default value
Returns
VariableValue * a pointer to the associated VarirableValue.

Definition at line 1173 of file Coupleable.h.

1174 {
1175  std::map<std::string, MooseArray<DualReal> *>::iterator default_value_it =
1176  _ad_default_value.find(var_name);
1177  if (default_value_it == _ad_default_value.end())
1178  {
1179  ADVariableValue * value =
1180  new ADVariableValue(_coupleable_max_qps, _c_parameters.defaultCoupledValue(var_name));
1181  default_value_it = _ad_default_value.insert(std::make_pair(var_name, value)).first;
1182  }
1183 
1184  return default_value_it->second;
1185 }
Real defaultCoupledValue(const std::string &coupling_name, unsigned int i=0) const
Get the default value for an optionally coupled variable.
std::map< std::string, MooseArray< DualReal > * > _ad_default_value
Will hold the default value for optional coupled variables for automatic differentiation.
Definition: Coupleable.h:762
const InputParameters & _c_parameters
Definition: Coupleable.h:729
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:934

◆ getADDefaultValue() [2/3]

template<>
VariableValue* Coupleable::getADDefaultValue ( const std::string &  var_name)

◆ getADDefaultValue() [3/3]

template<>
VariableValue* Coupleable::getADDefaultValue ( const std::string &  var_name)

Definition at line 1481 of file Coupleable.C.

1482 {
1483  return getDefaultValue(var_name, 0);
1484 }
VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:283

◆ getADDefaultVectorGradient() [1/3]

template<ComputeStage compute_stage>
ADVectorVariableGradient & Coupleable::getADDefaultVectorGradient ( )

Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation for an uncoupled vector variable.

Parameters
var_namethe name of the vector variable for which to retrieve a default gradient
Returns
VariableGradient * a pointer to the associated VectorVariableGradient.

Definition at line 1223 of file Coupleable.h.

1224 {
1226 }
MooseArray< DualRealTensorValue > _ad_default_vector_gradient
This will always be zero because the default values for optionally coupled vector variables is always...
Definition: Coupleable.h:783

◆ getADDefaultVectorGradient() [2/3]

template<>
VectorVariableGradient& Coupleable::getADDefaultVectorGradient ( )

◆ getADDefaultVectorGradient() [3/3]

template<>
VectorVariableGradient& Coupleable::getADDefaultVectorGradient ( )

Definition at line 1502 of file Coupleable.C.

1503 {
1504  return _default_vector_gradient;
1505 }
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:816

◆ getADDefaultVectorValue() [1/3]

template<ComputeStage compute_stage>
ADVectorVariableValue * Coupleable::getADDefaultVectorValue ( const std::string &  var_name)

Helper method to return (and insert if necessary) the default vector value for Automatic Differentiation for an uncoupled variable.

Parameters
var_namethe name of the vector variable for which to retrieve a default value
Returns
VariableVectorValue * a pointer to the associated VarirableVectorValue.

Definition at line 1192 of file Coupleable.h.

1193 {
1194  std::map<std::string, MooseArray<DualRealVectorValue> *>::iterator default_value_it =
1195  _ad_default_vector_value.find(var_name);
1196  if (default_value_it == _ad_default_vector_value.end())
1197  {
1198  RealVectorValue default_vec;
1199  for (unsigned int i = 0; i < _c_parameters.numberDefaultCoupledValues(var_name); ++i)
1200  default_vec(i) = _c_parameters.defaultCoupledValue(var_name, i);
1201  ADVectorVariableValue * value = new ADVectorVariableValue(_coupleable_max_qps, default_vec);
1202  default_value_it = _ad_default_vector_value.insert(std::make_pair(var_name, value)).first;
1203  }
1204 
1205  return default_value_it->second;
1206 }
VectorValue< Real > RealVectorValue
Definition: Assembly.h:32
std::map< std::string, MooseArray< DualRealVectorValue > * > _ad_default_vector_value
Will hold the default value for optional vector coupled variables for automatic differentiation.
Definition: Coupleable.h:768
unsigned int numberDefaultCoupledValues(const std::string &coupling_name) const
Get the number of defaulted coupled value entries.
Real defaultCoupledValue(const std::string &coupling_name, unsigned int i=0) const
Get the default value for an optionally coupled variable.
const InputParameters & _c_parameters
Definition: Coupleable.h:729
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:934

◆ getADDefaultVectorValue() [2/3]

template<>
VectorVariableValue* Coupleable::getADDefaultVectorValue ( const std::string &  var_name)

◆ getADDefaultVectorValue() [3/3]

template<>
VectorVariableValue* Coupleable::getADDefaultVectorValue ( const std::string &  var_name)

Definition at line 1488 of file Coupleable.C.

1489 {
1490  return getDefaultVectorValue(var_name);
1491 }
VectorVariableValue * getDefaultVectorValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled vector variable...
Definition: Coupleable.C:310

◆ getCoupledMooseVars()

const std::vector<MooseVariableFEBase *>& Coupleable::getCoupledMooseVars ( ) const
inline

◆ getCoupledStandardMooseVars()

const std::vector<MooseVariable *>& Coupleable::getCoupledStandardMooseVars ( ) const
inline

Get the list of standard coupled variables.

Returns
The list of standard coupled variables

Definition at line 100 of file Coupleable.h.

101  {
103  }
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Definition: Coupleable.h:744

◆ getCoupledVars()

const std::map<std::string, std::vector<MooseVariableFEBase *> >& Coupleable::getCoupledVars ( )
inline

Get the list of coupled variables.

Returns
The list of coupled variables

Definition at line 82 of file Coupleable.h.

Referenced by AuxKernelTempl< ComputeValueType >::AuxKernelTempl(), and InitialConditionBase::InitialConditionBase().

83  {
84  return _coupled_vars;
85  }
std::map< std::string, std::vector< MooseVariableFEBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:738

◆ getCoupledVectorMooseVars()

const std::vector<VectorMooseVariable *>& Coupleable::getCoupledVectorMooseVars ( ) const
inline

Get the list of vector coupled variables.

Returns
The list of vector coupled variables

Definition at line 109 of file Coupleable.h.

110  {
112  }
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
Definition: Coupleable.h:747

◆ getDefaultValue()

VariableValue * Coupleable::getDefaultValue ( const std::string &  var_name,
unsigned int  comp 
)
private

Helper method to return (and insert if necessary) the default value for an uncoupled variable.

Parameters
var_namethe name of the variable for which to retrieve a default value
Returns
a pointer to the associated VariableValue.

Definition at line 283 of file Coupleable.C.

Referenced by coupledDofValues(), coupledDofValuesOld(), coupledDofValuesOlder(), coupledValue(), coupledValueOld(), coupledValueOlder(), coupledValuePreviousNL(), and getNodalDefaultValue().

284 {
285  // make sure we don't access values that were not provided
286  if (comp + 1 > _c_parameters.numberDefaultCoupledValues(var_name))
288  ": Requested component ",
289  comp,
290  " of coupled value ",
291  var_name,
292  " is out of range.");
293 
294  std::map<std::string, std::vector<VariableValue *>>::iterator default_value_it =
295  _default_value.find(var_name);
296  if (default_value_it == _default_value.end())
297  {
298  _default_value[var_name] = {
300  for (unsigned int j = 1; j < _c_parameters.numberDefaultCoupledValues(var_name); ++j)
301  _default_value[var_name].push_back(
303  default_value_it = _default_value.find(var_name);
304  }
305 
306  return default_value_it->second[comp];
307 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
unsigned int numberDefaultCoupledValues(const std::string &coupling_name) const
Get the number of defaulted coupled value entries.
std::map< std::string, std::vector< VariableValue * > > _default_value
Will hold the default value for optional coupled variables.
Definition: Coupleable.h:759
Real defaultCoupledValue(const std::string &coupling_name, unsigned int i=0) const
Get the default value for an optionally coupled variable.
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
OutputTools< Real >::VariableValue VariableValue
Definition: MooseTypes.h:198
const InputParameters & _c_parameters
Definition: Coupleable.h:729
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:934

◆ getDefaultVectorValue()

VectorVariableValue * Coupleable::getDefaultVectorValue ( const std::string &  var_name)
private

Helper method to return (and insert if necessary) the default value for an uncoupled vector variable.

Parameters
var_namethe name of the vector variable for which to retrieve a default value
Returns
a pointer to the associated VectorVariableValue.

Definition at line 310 of file Coupleable.C.

Referenced by coupledVectorValue(), coupledVectorValueOld(), and coupledVectorValueOlder().

311 {
312  std::map<std::string, VectorVariableValue *>::iterator default_value_it =
313  _default_vector_value.find(var_name);
314  if (default_value_it == _default_vector_value.end())
315  {
317  bool already_warned = false;
318  for (unsigned int qp = 0; qp < _coupleable_max_qps; ++qp)
319  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
320  {
321  try
322  {
323  (*value)[qp](i) = _c_parameters.defaultCoupledValue(var_name, i);
324  }
325  catch (const std::out_of_range &)
326  {
327  if (!already_warned)
328  mooseWarning(
329  "You supplied less than 3 arguments for the default vector value for variable ",
330  var_name,
331  ". Did you accidently leave something off? We are going to assign 0s, assuming "
332  "this "
333  "was intentional.");
334  already_warned = true;
335  (*value)[qp](i) = 0;
336  }
337  }
338  default_value_it = _default_vector_value.insert(std::make_pair(var_name, value)).first;
339  }
340 
341  return default_value_it->second;
342 }
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:220
OutputTools< RealVectorValue >::VariableValue VectorVariableValue
Definition: MooseTypes.h:212
std::map< std::string, VectorVariableValue * > _default_vector_value
Will hold the default value for optional vector coupled variables.
Definition: Coupleable.h:765
Real defaultCoupledValue(const std::string &coupling_name, unsigned int i=0) const
Get the default value for an optionally coupled variable.
const InputParameters & _c_parameters
Definition: Coupleable.h:729
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:934

◆ getFEVar()

MooseVariableFEBase * Coupleable::getFEVar ( const std::string &  var_name,
unsigned int  comp 
)
protected

Extract pointer to a base finite element coupled variable.

Parameters
var_nameName of parameter desired
compComponent number of multiple coupled variables
Returns
Pointer to the desired variable

Definition at line 199 of file Coupleable.C.

Referenced by coupled(), coupledDofValues(), coupledDofValuesOld(), and coupledDofValuesOlder().

200 {
201  if (comp < _coupled_vars[var_name].size())
202  {
203  // Error check - don't couple elemental to nodal
204  if (!(_coupled_vars[var_name][comp])->isNodal() && _c_nodal)
205  mooseError(_c_name, ": You cannot couple an elemental variable to a nodal variable");
206  return _coupled_vars[var_name][comp];
207  }
208  else
209  mooseError(_c_name, ": Trying to get a non-existent component of variable '", var_name, "'");
210 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, std::vector< MooseVariableFEBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:738
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732

◆ getFEVariableCoupleableMatrixTags()

std::set<TagID>& Coupleable::getFEVariableCoupleableMatrixTags ( )
inline

Definition at line 120 of file Coupleable.h.

120 { return _fe_coupleable_matrix_tags; }
std::set< TagID > _fe_coupleable_matrix_tags
Definition: Coupleable.h:944

◆ getFEVariableCoupleableVectorTags()

std::set<TagID>& Coupleable::getFEVariableCoupleableVectorTags ( )
inline

Definition at line 118 of file Coupleable.h.

118 { return _fe_coupleable_vector_tags; }
std::set< TagID > _fe_coupleable_vector_tags
Definition: Coupleable.h:942

◆ getNodalDefaultValue() [1/2]

template<>
const RealVectorValue& Coupleable::getNodalDefaultValue ( const std::string &  var_name,
unsigned int   
)
protected

Definition at line 354 of file Coupleable.C.

355 {
356  auto && default_variable_value = getDefaultVectorValue(var_name);
357  return *default_variable_value->data();
358 }
VectorVariableValue * getDefaultVectorValue(const std::string &var_name)
Helper method to return (and insert if necessary) the default value for an uncoupled vector variable...
Definition: Coupleable.C:310

◆ getNodalDefaultValue() [2/2]

template<typename T >
const T & Coupleable::getNodalDefaultValue ( const std::string &  var_name,
unsigned int  comp = 0 
)
protected

Get nodal default value.

Definition at line 346 of file Coupleable.C.

347 {
348  auto && default_variable_value = getDefaultValue(var_name, comp);
349  return *default_variable_value->data();
350 }
VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp)
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:283

◆ getVar()

MooseVariable * Coupleable::getVar ( const std::string &  var_name,
unsigned int  comp 
)
protected

Extract pointer to a coupled variable.

Parameters
var_nameName of parameter desired
compComponent number of multiple coupled variables
Returns
Pointer to the desired variable

Definition at line 241 of file Coupleable.C.

Referenced by adCoupledDotTemplate(), adCoupledGradientTemplate(), adCoupledSecondTemplate(), adCoupledValueTemplate(), ShapeUserObject< SideUserObject >::coupled(), coupledDot(), coupledDotDot(), coupledDotDotDu(), coupledDotDotOld(), coupledDotDu(), coupledDotOld(), coupledGradient(), coupledGradientDot(), coupledGradientDotDot(), coupledGradientOld(), coupledGradientOlder(), coupledGradientPreviousNL(), coupledMatrixTagValue(), NeighborCoupleable::coupledNeighborDofValues(), NeighborCoupleable::coupledNeighborDofValuesOld(), NeighborCoupleable::coupledNeighborDofValuesOlder(), NeighborCoupleable::coupledNeighborGradient(), NeighborCoupleable::coupledNeighborGradientOld(), NeighborCoupleable::coupledNeighborGradientOlder(), NeighborCoupleable::coupledNeighborSecond(), NeighborCoupleable::coupledNeighborValue(), NeighborCoupleable::coupledNeighborValueDot(), NeighborCoupleable::coupledNeighborValueDotDu(), NeighborCoupleable::coupledNeighborValueOld(), NeighborCoupleable::coupledNeighborValueOlder(), coupledNodalDotDot(), coupledNodalDotDotOld(), coupledNodalDotOld(), coupledSecond(), coupledSecondOld(), coupledSecondOlder(), coupledSecondPreviousNL(), coupledValue(), coupledValueOld(), coupledValueOlder(), coupledValuePreviousNL(), coupledVectorTagValue(), ParsedAux::ParsedAux(), and SpatialAverageBase::SpatialAverageBase().

242 {
243  return getVarHelper<Real>(var_name, comp);
244 }

◆ getVarHelper()

template<typename T >
template MooseVariableFE< RealVectorValue > * Coupleable::getVarHelper< RealVectorValue > ( const std::string &  var_name,
unsigned int  comp 
)
protected

Helper that segues off to either getVar of getVectorVar depending on template paramter.

Definition at line 214 of file Coupleable.C.

215 {
216  if (comp < _coupled_vars[var_name].size())
217  {
218  // Error check - don't couple elemental to nodal
219  if (!(_coupled_vars[var_name][comp])->isNodal() && _c_nodal)
220  mooseError(_c_name, ": You cannot couple an elemental variable to a nodal variable");
221  if (auto * coupled_var = dynamic_cast<MooseVariableFE<T> *>(_coupled_vars[var_name][comp]))
222  return coupled_var;
223  else
224  {
225  for (auto & var : _coupled_standard_moose_vars)
226  if (var->name() == var_name)
227  mooseError("The coupled call is not for coupled standard variables");
228  for (auto & var : _coupled_vector_moose_vars)
229  if (var->name() == var_name)
230  mooseError("The coupled call is not for coupled vector variables");
231  mooseError("Error for coupling variable ", var_name);
232  }
233  }
234  else
235  mooseError(_c_name, ": Trying to get a non-existent component of variable '", var_name, "'");
236 
237  return nullptr;
238 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:750
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Definition: Coupleable.h:744
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
Definition: Coupleable.h:747
std::map< std::string, std::vector< MooseVariableFEBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:738
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732

◆ getVectorVar()

VectorMooseVariable * Coupleable::getVectorVar ( const std::string &  var_name,
unsigned int  comp 
)
protected

◆ isCoupled()

bool Coupleable::isCoupled ( const std::string &  var_name,
unsigned int  i = 0 
)
protectedvirtual

Returns true if a variables has been coupled as name.

Parameters
var_nameThe name the kernel wants to refer to the variable as.
iBy default 0, in general the index to test in a vector of MooseVariable pointers.
Returns
True if a coupled variable has the supplied name

Definition at line 144 of file Coupleable.C.

Referenced by adCoupledDotTemplate(), adCoupledGradientTemplate(), adCoupledNodalValueTemplate(), adCoupledSecondTemplate(), adCoupledValueTemplate(), adCoupledVectorDotTemplate(), adCoupledVectorGradientTemplate(), adCoupledVectorValueTemplate(), coupled(), coupledComponents(), coupledCurl(), coupledCurlOld(), coupledCurlOlder(), coupledDofValues(), coupledDofValuesOld(), coupledDofValuesOlder(), coupledDot(), coupledDotDot(), coupledDotDotDu(), coupledDotDotOld(), coupledDotDu(), coupledDotOld(), coupledGradient(), coupledGradientDot(), coupledGradientDotDot(), coupledGradientOld(), coupledGradientOlder(), coupledGradientPreviousNL(), coupledMatrixTagValue(), coupledNodalDot(), coupledNodalDotDot(), coupledNodalDotDotOld(), coupledNodalDotOld(), coupledNodalValue(), coupledNodalValueOld(), coupledNodalValueOlder(), coupledNodalValuePreviousNL(), coupledSecond(), coupledSecondOld(), coupledSecondOlder(), coupledSecondPreviousNL(), coupledValue(), coupledValueOld(), coupledValueOlder(), coupledValuePreviousNL(), coupledVectorDot(), coupledVectorDotDot(), coupledVectorDotDotOld(), coupledVectorDotOld(), coupledVectorGradient(), coupledVectorGradientOld(), coupledVectorGradientOlder(), coupledVectorTagValue(), coupledVectorValue(), coupledVectorValueOld(), and coupledVectorValueOlder().

145 {
146  std::map<std::string, std::vector<MooseVariableFEBase *>>::iterator it =
147  _coupled_vars.find(var_name);
148  if (it != _coupled_vars.end())
149  return (i < it->second.size());
150  else
151  {
152  // Make sure the user originally requested this value in the InputParameter syntax
153  if (!_c_parameters.hasCoupledValue(var_name))
155  ": The coupled variable \"",
156  var_name,
157  "\" was never added to this objects's "
158  "InputParameters, please double-check your "
159  "spelling");
160 
161  return false;
162  }
163 }
bool hasCoupledValue(const std::string &coupling_name) const
Return whether or not the coupled variable exists.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, std::vector< MooseVariableFEBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:738
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
const InputParameters & _c_parameters
Definition: Coupleable.h:729

◆ validateExecutionerType()

void Coupleable::validateExecutionerType ( const std::string &  name,
const std::string &  fn_name 
) const
protected

Checks to make sure that the current Executioner has set "_is_transient" when old/older values are coupled in.

Parameters
namethe name of the variable
fn_nameThe name of the function that called this method - used in the error message

Definition at line 1467 of file Coupleable.C.

Referenced by coupledCurlOld(), coupledCurlOlder(), coupledDofValuesOld(), coupledDofValuesOlder(), coupledDot(), coupledDotDot(), coupledDotDotDu(), coupledDotDotOld(), coupledDotDu(), coupledDotOld(), coupledGradientOld(), coupledGradientOlder(), NeighborCoupleable::coupledNeighborDofValuesOld(), NeighborCoupleable::coupledNeighborDofValuesOlder(), NeighborCoupleable::coupledNeighborGradientOld(), NeighborCoupleable::coupledNeighborGradientOlder(), NeighborCoupleable::coupledNeighborValueOld(), NeighborCoupleable::coupledNeighborValueOlder(), coupledNodalDot(), coupledNodalDotDot(), coupledNodalDotDotOld(), coupledNodalDotOld(), coupledNodalValueOld(), coupledNodalValueOlder(), coupledSecondOld(), coupledSecondOlder(), coupledValueOld(), coupledValueOlder(), coupledVectorDot(), coupledVectorDotDot(), coupledVectorDotDotOld(), coupledVectorDotOld(), coupledVectorGradientOld(), coupledVectorGradientOlder(), NeighborCoupleable::coupledVectorNeighborGradientOld(), NeighborCoupleable::coupledVectorNeighborGradientOlder(), coupledVectorValueOld(), and coupledVectorValueOlder().

1468 {
1469  if (!_c_fe_problem.isTransient())
1471  ": Calling '",
1472  fn_name,
1473  "' on variable \"",
1474  name,
1475  "\" when using a \"Steady\" executioner is not allowed. This value is available "
1476  "only in transient simulations.");
1477 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:735
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:732
virtual bool isTransient() const override

◆ writableCoupledValue()

VariableValue & Coupleable::writableCoupledValue ( const std::string &  var_name,
unsigned int  comp = 0 
)
protectedvirtual

Returns a writable reference to a coupled variable.

Note: you should not have to use this very often (use coupledValue() instead) but there are situations, such as writing to multiple AuxVariables from a single AuxKernel, where it is required.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to a VariableValue for the coupled variable
See also
Kernel::value

Definition at line 451 of file Coupleable.C.

452 {
453  return const_cast<VariableValue &>(coupledValue(var_name, comp));
454 }
virtual const VariableValue & coupledValue(const std::string &var_name, unsigned int comp=0)
Returns value of a coupled variable.
Definition: Coupleable.C:361
OutputTools< Real >::VariableValue VariableValue
Definition: MooseTypes.h:198

Member Data Documentation

◆ _ad_default_gradient

MooseArray<DualRealVectorValue> Coupleable::_ad_default_gradient
protected

This will always be zero because the default values for optionally coupled variables is always constant.

Definition at line 780 of file Coupleable.h.

Referenced by Coupleable(), getADDefaultGradient(), and ~Coupleable().

◆ _ad_default_second

MooseArray<DualRealTensorValue> Coupleable::_ad_default_second
protected

This will always be zero because the default values for optionally coupled variables is always constant.

Definition at line 789 of file Coupleable.h.

Referenced by Coupleable(), getADDefaultSecond(), and ~Coupleable().

◆ _ad_default_value

std::map<std::string, MooseArray<DualReal> *> Coupleable::_ad_default_value
protected

Will hold the default value for optional coupled variables for automatic differentiation.

Definition at line 762 of file Coupleable.h.

Referenced by getADDefaultValue(), and ~Coupleable().

◆ _ad_default_vector_gradient

MooseArray<DualRealTensorValue> Coupleable::_ad_default_vector_gradient
protected

This will always be zero because the default values for optionally coupled vector variables is always constant.

Definition at line 783 of file Coupleable.h.

Referenced by Coupleable(), getADDefaultVectorGradient(), and ~Coupleable().

◆ _ad_default_vector_value

std::map<std::string, MooseArray<DualRealVectorValue> *> Coupleable::_ad_default_vector_value
protected

Will hold the default value for optional vector coupled variables for automatic differentiation.

Definition at line 768 of file Coupleable.h.

Referenced by getADDefaultVectorValue(), and ~Coupleable().

◆ _ad_grad_zero

const MooseArray<DualRealVectorValue>& Coupleable::_ad_grad_zero
protected

Definition at line 797 of file Coupleable.h.

Referenced by adZeroGradientTemplate().

◆ _ad_second_zero

const MooseArray<DualRealTensorValue>& Coupleable::_ad_second_zero
protected

Definition at line 801 of file Coupleable.h.

Referenced by adZeroSecondTemplate().

◆ _ad_zero

const MooseArray<DualReal>& Coupleable::_ad_zero
protected

Definition at line 793 of file Coupleable.h.

Referenced by adZeroValueTemplate().

◆ _c_coupled_scalar_vars

std::map<std::string, std::vector<MooseVariableScalar *> > Coupleable::_c_coupled_scalar_vars
private

Scalar variables coupled into this object (for error checking)

Definition at line 940 of file Coupleable.h.

Referenced by checkVar(), and Coupleable().

◆ _c_fe_problem

FEProblemBase& Coupleable::_c_fe_problem
protected

◆ _c_is_implicit

bool Coupleable::_c_is_implicit
protected

◆ _c_name

const std::string& Coupleable::_c_name
protected

◆ _c_nodal

bool Coupleable::_c_nodal
protected

◆ _c_parameters

const InputParameters& Coupleable::_c_parameters
protected

◆ _c_tid

THREAD_ID Coupleable::_c_tid
protected

Thread ID of the thread using this object.

Definition at line 756 of file Coupleable.h.

Referenced by Coupleable().

◆ _coupleable_max_qps

unsigned int Coupleable::_coupleable_max_qps
private

Maximum qps for any element in this system.

Definition at line 934 of file Coupleable.h.

Referenced by Coupleable(), getADDefaultValue(), getADDefaultVectorValue(), getDefaultValue(), and getDefaultVectorValue().

◆ _coupleable_neighbor

bool Coupleable::_coupleable_neighbor
protected

◆ _coupled_moose_vars

std::vector<MooseVariableFEBase *> Coupleable::_coupled_moose_vars
protected

◆ _coupled_standard_moose_vars

std::vector<MooseVariable *> Coupleable::_coupled_standard_moose_vars
protected

Vector of standard coupled variables.

Definition at line 744 of file Coupleable.h.

Referenced by Coupleable(), getCoupledStandardMooseVars(), and getVarHelper().

◆ _coupled_vars

std::map<std::string, std::vector<MooseVariableFEBase *> > Coupleable::_coupled_vars
protected

Coupled vars whose values we provide.

Definition at line 738 of file Coupleable.h.

Referenced by Coupleable(), coupledComponents(), FunctionMaterialBase::FunctionMaterialBase(), getCoupledVars(), getFEVar(), getVarHelper(), and isCoupled().

◆ _coupled_vector_moose_vars

std::vector<VectorMooseVariable *> Coupleable::_coupled_vector_moose_vars
protected

Vector of vector coupled variables.

Definition at line 747 of file Coupleable.h.

Referenced by Coupleable(), getCoupledVectorMooseVars(), and getVarHelper().

◆ _default_gradient

VariableGradient Coupleable::_default_gradient
protected

This will always be zero because the default values for optionally coupled variables is always constant.

Definition at line 777 of file Coupleable.h.

Referenced by Coupleable(), coupledGradient(), coupledGradientDot(), coupledGradientDotDot(), coupledGradientOld(), coupledGradientOlder(), coupledGradientPreviousNL(), and ~Coupleable().

◆ _default_second

VariableSecond Coupleable::_default_second
protected

This will always be zero because the default values for optionally coupled variables is always constant.

Definition at line 786 of file Coupleable.h.

Referenced by Coupleable(), coupledSecond(), coupledSecondOld(), coupledSecondOlder(), coupledSecondPreviousNL(), and ~Coupleable().

◆ _default_value

std::map<std::string, std::vector<VariableValue *> > Coupleable::_default_value
protected

Will hold the default value for optional coupled variables.

Definition at line 759 of file Coupleable.h.

Referenced by getDefaultValue(), and ~Coupleable().

◆ _default_value_zero

VariableValue Coupleable::_default_value_zero
protected

This will always be zero because the default values for optionally coupled variables is always constant and this is used for time derivative info.

Definition at line 774 of file Coupleable.h.

Referenced by Coupleable(), coupledDot(), coupledDotDot(), coupledDotDotDu(), coupledDotDotOld(), coupledDotDu(), coupledDotOld(), coupledNodalDotDot(), coupledNodalDotDotOld(), coupledNodalDotOld(), and ~Coupleable().

◆ _default_vector_curl

VectorVariableCurl Coupleable::_default_vector_curl
protected

This will always be zero because the default values for optionally coupled variables is always constant.

Definition at line 819 of file Coupleable.h.

Referenced by Coupleable(), coupledCurl(), coupledCurlOld(), coupledCurlOlder(), and ~Coupleable().

◆ _default_vector_gradient

VectorVariableGradient Coupleable::_default_vector_gradient
protected

This will always be zero because the default values for optionally coupled variables is always constant.

Definition at line 816 of file Coupleable.h.

Referenced by Coupleable(), coupledVectorGradient(), coupledVectorGradientOld(), coupledVectorGradientOlder(), and ~Coupleable().

◆ _default_vector_value

std::map<std::string, VectorVariableValue *> Coupleable::_default_vector_value
protected

Will hold the default value for optional vector coupled variables.

Definition at line 765 of file Coupleable.h.

Referenced by getDefaultVectorValue(), and ~Coupleable().

◆ _default_vector_value_zero

VectorVariableValue Coupleable::_default_vector_value_zero
protected

This will always be zero because the default values for optionally coupled variables is always constant and this is used for time derivative info.

Definition at line 813 of file Coupleable.h.

Referenced by Coupleable(), coupledVectorDot(), coupledVectorDotDot(), coupledVectorDotDotOld(), coupledVectorDotOld(), and ~Coupleable().

◆ _fe_coupleable_matrix_tags

std::set<TagID> Coupleable::_fe_coupleable_matrix_tags
private

◆ _fe_coupleable_vector_tags

std::set<TagID> Coupleable::_fe_coupleable_vector_tags
private

◆ _grad_zero

const VariableGradient& Coupleable::_grad_zero
protected

Zero gradient of a variable.

Definition at line 796 of file Coupleable.h.

◆ _optional_var_index

std::map<std::string, std::vector<unsigned int> > Coupleable::_optional_var_index
private

Unique indices for optionally coupled vars that weren't provided.

Definition at line 937 of file Coupleable.h.

Referenced by Coupleable(), and coupled().

◆ _second_phi_zero

const VariablePhiSecond& Coupleable::_second_phi_zero
protected

Zero second derivative of a test function.

Definition at line 803 of file Coupleable.h.

◆ _second_zero

const VariableSecond& Coupleable::_second_zero
protected

Zero second derivative of a variable.

Definition at line 800 of file Coupleable.h.

◆ _vector_curl_zero

const VectorVariableCurl& Coupleable::_vector_curl_zero
protected

Zero value of the curl of a vector variable.

Definition at line 807 of file Coupleable.h.

◆ _vector_zero

const VectorVariableValue& Coupleable::_vector_zero
protected

Zero value of a vector variable.

Definition at line 805 of file Coupleable.h.

◆ _zero

const VariableValue& Coupleable::_zero
protected

Zero value of a variable.

Definition at line 792 of file Coupleable.h.


The documentation for this class was generated from the following files: