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...
 
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 comp)
 
template<>
MooseVariableFE< RealVectorValue > * getVarHelper (const std::string &var_name, unsigned int comp)
 
template<>
MooseVariableFE< RealVectorValue > * getVarHelper (const std::string &var_name, unsigned int comp)
 
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 60 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  // Coupling
46  for (std::set<std::string>::const_iterator iter = _c_parameters.coupledVarsBegin();
47  iter != _c_parameters.coupledVarsEnd();
48  ++iter)
49  {
50  std::string name = *iter;
51  if (_c_parameters.getVecMooseType(name) != std::vector<std::string>())
52  {
53  std::vector<std::string> vars = _c_parameters.getVecMooseType(*iter);
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:735
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:804
const VariableValue & _zero
Zero value of a variable.
Definition: Coupleable.h:777
const VariablePhiSecond & _second_phi_zero
Zero second derivative of a test function.
Definition: Coupleable.h:788
MooseArray< DualRealTensorValue > _ad_default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:774
const VectorVariableValue & _vector_zero
Zero value of a vector variable.
Definition: Coupleable.h:790
const VariableGradient & _grad_zero
Zero gradient of a variable.
Definition: Coupleable.h:781
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
void resize(const unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:205
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:768
const VariableSecond & _second_zero
Zero second derivative of a variable.
Definition: Coupleable.h:785
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:741
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:759
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:729
unsigned int numberDefaultCoupledValues(const std::string &coupling_name) const
Get the number of defaulted coupled value entries.
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:720
const MooseArray< DualReal > & _ad_zero
Definition: Coupleable.h:778
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
const MooseArray< DualRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:786
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
Definition: Coupleable.h:732
std::map< std::string, std::vector< MooseVariableScalar * > > _c_coupled_scalar_vars
Scalar variables coupled into this object (for error checking)
Definition: Coupleable.h:925
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:762
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:771
MooseArray< DualRealVectorValue > _ad_default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:765
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:723
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:717
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:792
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:801
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:852
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:798
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:726
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:714
const MooseArray< DualRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:782
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:922
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:919
std::vector< std::string > getVecMooseType(const std::string &name) const
unsigned int THREAD_ID
Definition: MooseTypes.h:126
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 
136 }
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:804
MooseArray< DualRealTensorValue > _ad_default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:774
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:768
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:759
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:753
std::map< std::string, std::vector< VariableValue * > > _default_value
Will hold the default value for optional coupled variables.
Definition: Coupleable.h:744
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:762
std::map< std::string, VectorVariableValue * > _default_vector_value
Will hold the default value for optional vector coupled variables.
Definition: Coupleable.h:750
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:771
MooseArray< DualRealVectorValue > _ad_default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:765
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:801
std::map< std::string, MooseArray< DualReal > * > _ad_default_value
Will hold the default value for optional coupled variables for automatic differentiation.
Definition: Coupleable.h:747
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:798
void release()
Manually deallocates the data pointer.
Definition: MooseArray.h:51

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 1036 of file Coupleable.h.

1037 {
1038  checkVar(var_name);
1039  if (!isCoupled(var_name)) // Return default 0
1040  return *getADDefaultValue<compute_stage>(var_name);
1041 
1042  MooseVariable * var = getVar(var_name, comp);
1043  if (var == nullptr)
1044  mooseError("Call corresponding vector variable method");
1045 
1046  if (!_coupleable_neighbor)
1047  {
1048  if (_c_nodal)
1049  mooseError("Not implemented");
1050  else
1051  return var->adUDot<compute_stage>();
1052  }
1053  else
1054  {
1055  if (_c_nodal)
1056  mooseError("Not implemented");
1057  else
1058  return var->adUDotNeighbor<compute_stage>();
1059  }
1060 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:227
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:852
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 970 of file Coupleable.h.

971 {
972  if (!isCoupled(var_name)) // Return default 0
973  return getADDefaultGradient<compute_stage>();
974 
975  coupledCallback(var_name, false);
976  if (_c_nodal)
977  mooseError("Nodal variables do not have gradients");
978 
979  MooseVariable * var = getVar(var_name, comp);
980 
982  {
983  if (_c_is_implicit)
984  return var->adGradSln<compute_stage>();
985  else
986  mooseError("Not implemented");
987  }
988  else
989  {
990  if (_c_is_implicit)
991  return var->adGradSlnNeighbor<compute_stage>();
992  else
993  mooseError("Not implemented");
994  }
995 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:227
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:852
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 1600 of file Coupleable.C.

1601 {
1602  static const typename Moose::ValueType<T, compute_stage>::type zero = 0;
1603  if (!isCoupled(var_name))
1604  return zero;
1605 
1606  if (!_c_nodal)
1607  mooseError("The adCoupledNodalValue method should only be called for nodal computing objects");
1609  mooseError(
1610  "The adCoupledNodalValue method shouldn't be called for neighbor computing objects. I "
1611  "don't even know what that would mean, although maybe someone could explain it to me.");
1612  if (!_c_is_implicit)
1613  mooseError("If you're going to use an explicit scheme, then use coupledNodalValue instead of "
1614  "adCoupledNodalValue");
1615 
1616  coupledCallback(var_name, false);
1617  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1618 
1619  return var->template adNodalValue<compute_stage>();
1620 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:738
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:852

◆ 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 999 of file Coupleable.h.

1000 {
1001  if (!isCoupled(var_name)) // Return default 0
1002  return getADDefaultSecond<compute_stage>();
1003 
1004  coupledCallback(var_name, false);
1005  if (_c_nodal)
1006  mooseError("Nodal variables do not have second derivatives");
1007 
1008  MooseVariable * var = getVar(var_name, comp);
1009 
1010  if (!_coupleable_neighbor)
1011  {
1012  if (_c_is_implicit)
1013  return var->adSecondSln<compute_stage>();
1014  else
1015  mooseError("Not implemented");
1016  }
1017  else
1018  {
1019  if (_c_is_implicit)
1020  return var->adSecondSlnNeighbor<compute_stage>();
1021  else
1022  mooseError("Not implemented");
1023  }
1024 }
const VariableSecondType< OutputType, compute_stage >::type & adSecondSlnNeighbor()
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:227
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:852

◆ 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 934 of file Coupleable.h.

935 {
936  if (!isCoupled(var_name))
937  return *getADDefaultValue<compute_stage>(var_name);
938 
939  coupledCallback(var_name, false);
940  MooseVariable * var = getVar(var_name, comp);
941 
943  {
944  if (_c_nodal)
945  mooseError("Not implemented");
946  else
947  {
948  if (_c_is_implicit)
949  return var->adSln<compute_stage>();
950  else
951  mooseError("Not implemented");
952  }
953  }
954  else
955  {
956  if (_c_nodal)
957  mooseError("Not implemented");
958  else
959  {
960  if (_c_is_implicit)
961  return var->adSlnNeighbor<compute_stage>();
962  else
963  mooseError("Not implemented");
964  }
965  }
966 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:227
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:852
const VariableValueType< OutputType, compute_stage >::type & adSlnNeighbor()

◆ 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 1100 of file Coupleable.h.

1101 {
1102 
1103  if (!isCoupled(var_name)) // Return default 0
1104  return getADDefaultVectorGradient<compute_stage>();
1105 
1106  coupledCallback(var_name, false);
1107  if (_c_nodal)
1108  mooseError("Nodal variables do not have gradients");
1109 
1110  VectorMooseVariable * var = getVectorVar(var_name, comp);
1111 
1112  if (!_coupleable_neighbor)
1113  {
1114  if (_c_is_implicit)
1115  return var->adGradSln<compute_stage>();
1116  else
1117  mooseError("Not implemented");
1118  }
1119  else
1120  {
1121  if (_c_is_implicit)
1122  return var->adGradSlnNeighbor<compute_stage>();
1123  else
1124  mooseError("Not implemented");
1125  }
1126 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:244
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:738
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:852
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 1064 of file Coupleable.h.

1065 {
1066  if (!isCoupled(var_name))
1067  return *getADDefaultVectorValue<compute_stage>(var_name);
1068 
1069  coupledCallback(var_name, false);
1070  VectorMooseVariable * var = getVectorVar(var_name, comp);
1071 
1072  if (!_coupleable_neighbor)
1073  {
1074  if (_c_nodal)
1075  mooseError("Not implemented");
1076  else
1077  {
1078  if (_c_is_implicit)
1079  return var->adSln<compute_stage>();
1080  else
1081  mooseError("Not implemented");
1082  }
1083  }
1084  else
1085  {
1086  if (_c_nodal)
1087  mooseError("Not implemented");
1088  else
1089  {
1090  if (_c_is_implicit)
1091  return var->adSlnNeighbor<compute_stage>();
1092  else
1093  mooseError("Not implemented");
1094  }
1095  }
1096 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:244
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:738
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:852
const VariableValueType< OutputType, compute_stage >::type & adSlnNeighbor()

◆ addFEVariableCoupleableMatrixTag()

void Coupleable::addFEVariableCoupleableMatrixTag ( TagID  tag)
inline

Definition at line 113 of file Coupleable.h.

Referenced by coupledMatrixTagValue().

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

◆ addFEVariableCoupleableVectorTag()

void Coupleable::addFEVariableCoupleableVectorTag ( TagID  tag)
inline

Definition at line 111 of file Coupleable.h.

Referenced by coupledVectorTagValue().

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

◆ 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 1207 of file Coupleable.h.

1208 {
1209  return _ad_grad_zero;
1210 }
const MooseArray< DualRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:782

◆ adZeroGradientTemplate() [2/3]

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

◆ adZeroGradientTemplate() [3/3]

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

Definition at line 1586 of file Coupleable.C.

1587 {
1588  return _grad_zero;
1589 }
const VariableGradient & _grad_zero
Zero gradient of a variable.
Definition: Coupleable.h:781

◆ adZeroSecondTemplate() [1/3]

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

Retrieve a zero second for automatic differentiation.

Definition at line 1214 of file Coupleable.h.

1215 {
1216  return _ad_second_zero;
1217 }
const MooseArray< DualRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:786

◆ adZeroSecondTemplate() [2/3]

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

◆ adZeroSecondTemplate() [3/3]

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

Definition at line 1593 of file Coupleable.C.

1594 {
1595  return _second_zero;
1596 }
const VariableSecond & _second_zero
Zero second derivative of a variable.
Definition: Coupleable.h:785

◆ 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 1200 of file Coupleable.h.

1201 {
1202  return _ad_zero;
1203 }
const MooseArray< DualReal > & _ad_zero
Definition: Coupleable.h:778

◆ adZeroValueTemplate() [2/3]

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

◆ adZeroValueTemplate() [3/3]

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

Definition at line 1579 of file Coupleable.C.

1580 {
1581  return _zero;
1582 }
const VariableValue & _zero
Zero value of a variable.
Definition: Coupleable.h:777

◆ 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(), 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:925
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:717

◆ 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 261 of file Coupleable.C.

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

262 {
263  checkVar(var_name);
264 
265  if (!isCoupled(var_name))
266  {
267  // make sure we don't try to access default var ids that were not provided
268  if (comp + 1 > _optional_var_index[var_name].size())
270  ": Requested component ",
271  comp,
272  " of coupled value ",
273  var_name,
274  " is out of range.");
275  return _optional_var_index[var_name][comp];
276  }
277 
278  MooseVariableFEBase * var = getFEVar(var_name, comp);
279  switch (var->kind())
280  {
282  return var->number();
284  return std::numeric_limits<unsigned int>::max() - var->number();
285  default:
286  mooseError(_c_name, ": Unknown variable kind. Corrupted binary?");
287  }
288 }
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:717
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:922
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(), SphericalAverage::SphericalAverage(), 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:723
const InputParameters & _c_parameters
Definition: Coupleable.h:714

◆ 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 1141 of file Coupleable.C.

1142 {
1143  if (!isCoupled(var_name)) // Return default 0
1144  return _default_vector_curl;
1145 
1146  coupledCallback(var_name, false);
1147  if (_c_nodal)
1148  mooseError("Nodal variables do not have curls");
1149 
1150  VectorMooseVariable * var = getVectorVar(var_name, comp);
1151  if (var == NULL)
1152  mooseError("Call corresponding scalar field variable method");
1153 
1154  if (!_coupleable_neighbor)
1155  return (_c_is_implicit) ? var->curlSln() : var->curlSlnOld();
1156  else
1157  return (_c_is_implicit) ? var->curlSlnNeighbor() : var->curlSlnOldNeighbor();
1158 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:804
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:244
Class for stuff related to variables.
Definition: Adaptivity.h:30
const FieldVariableValue & curlSln()
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 FieldVariableValue & curlSlnOld()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:852

◆ 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 1161 of file Coupleable.C.

1162 {
1163  if (!isCoupled(var_name)) // Return default 0
1164  return _default_vector_curl;
1165 
1166  coupledCallback(var_name, true);
1167  if (_c_nodal)
1168  mooseError("Nodal variables do not have curls");
1169 
1170  validateExecutionerType(var_name, "coupledCurlOld");
1171  VectorMooseVariable * var = getVectorVar(var_name, comp);
1172  if (var == NULL)
1173  mooseError("Call corresponding scalar field variable method");
1174 
1175  if (!_coupleable_neighbor)
1176  return (_c_is_implicit) ? var->curlSlnOld() : var->curlSlnOlder();
1177  else
1178  return (_c_is_implicit) ? var->curlSlnOldNeighbor() : var->curlSlnOlderNeighbor();
1179 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:804
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:244
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 FieldVariableCurl & curlSlnOldNeighbor()
const FieldVariableValue & curlSlnOld()
const FieldVariableValue & curlSlnOlder()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:852
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 1182 of file Coupleable.C.

1183 {
1184  if (!isCoupled(var_name)) // Return default 0
1185  return _default_vector_curl;
1186 
1187  coupledCallback(var_name, true);
1188  if (_c_nodal)
1189  mooseError("Nodal variables do not have curls");
1190 
1191  validateExecutionerType(var_name, "coupledCurlOlder");
1192  VectorMooseVariable * var = getVectorVar(var_name, comp);
1193  if (var == NULL)
1194  mooseError("Call corresponding scalar field variable method");
1195 
1196  if (_c_is_implicit)
1197  {
1198  if (!_coupleable_neighbor)
1199  return var->curlSlnOlder();
1200  else
1201  return var->curlSlnOlderNeighbor();
1202  }
1203  else
1204  mooseError("Older values not available for explicit schemes");
1205 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:804
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:244
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 & curlSlnOlder()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:852
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 1473 of file Coupleable.C.

1474 {
1475  checkVar(var_name);
1476 
1477  if (!isCoupled(var_name))
1478  return *getDefaultValue(var_name, comp);
1479 
1480  coupledCallback(var_name, false);
1481  MooseVariableFEBase * var = getFEVar(var_name, comp);
1482 
1483  if (!_coupleable_neighbor)
1484  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
1485  else
1486  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
1487 }
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:291
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:852
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 1490 of file Coupleable.C.

1491 {
1492  checkVar(var_name);
1493 
1494  if (!isCoupled(var_name))
1495  return *getDefaultValue(var_name, comp);
1496 
1497  validateExecutionerType(var_name, "coupledDofValuesOld");
1498  coupledCallback(var_name, true);
1499  MooseVariableFEBase * var = getFEVar(var_name, comp);
1500 
1501  if (!_coupleable_neighbor)
1502  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
1503  else
1504  return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
1505 }
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:1530
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:291
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:738
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:852
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 1508 of file Coupleable.C.

1509 {
1510  checkVar(var_name);
1511 
1512  if (!isCoupled(var_name))
1513  return *getDefaultValue(var_name, comp);
1514 
1515  validateExecutionerType(var_name, "coupledDofValuesOlder");
1516  coupledCallback(var_name, true);
1517  MooseVariableFEBase * var = getFEVar(var_name, comp);
1518  if (_c_is_implicit)
1519  {
1520  if (!_coupleable_neighbor)
1521  return var->dofValuesOlder();
1522  else
1523  return var->dofValuesOlderNeighbor();
1524  }
1525  else
1526  mooseError(_c_name, ": Older values not available for explicit schemes");
1527 }
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:1530
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:291
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:738
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:717
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:852
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 AuxKernel.

Definition at line 649 of file Coupleable.C.

Referenced by AuxKernel::coupledDot().

650 {
651  checkVar(var_name);
652  if (!isCoupled(var_name)) // Return default 0
653  return _default_value_zero;
654 
655  validateExecutionerType(var_name, "coupledDot");
656  MooseVariable * var = getVar(var_name, comp);
657  if (var == NULL)
658  mooseError("Call corresponding vector variable method");
659 
661  {
662  if (_c_nodal)
663  return var->dofValuesDot();
664  else
665  return var->uDot();
666  }
667  else
668  {
669  if (_c_nodal)
670  return var->dofValuesDotNeighbor();
671  else
672  return var->uDotNeighbor();
673  }
674 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
const MooseArray< Number > & dofValuesDot() override
Returns 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:759
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:227
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:852
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 677 of file Coupleable.C.

678 {
679  checkVar(var_name);
680  if (!isCoupled(var_name)) // Return default 0
681  return _default_value_zero;
682 
683  validateExecutionerType(var_name, "coupledDotDot");
684  MooseVariable * var = getVar(var_name, comp);
685  if (var == NULL)
686  mooseError("Call corresponding vector variable method");
687 
689  {
690  if (_c_nodal)
691  return var->dofValuesDotDot();
692  else
693  return var->uDotDot();
694  }
695  else
696  {
697  if (_c_nodal)
698  return var->dofValuesDotDotNeighbor();
699  else
700  return var->uDotDotNeighbor();
701  }
702 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
const FieldVariableValue & uDotDotNeighbor()
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:759
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:227
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:852
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 909 of file Coupleable.C.

910 {
911  checkVar(var_name);
912  if (!isCoupled(var_name)) // Return default 0
913  return _default_value_zero;
914 
915  validateExecutionerType(var_name, "coupledDotDotDu");
916  MooseVariable * var = getVar(var_name, comp);
917  if (var == NULL)
918  mooseError("Call corresponding vector variable method");
919 
921  {
922  if (_c_nodal)
923  return var->dofValuesDuDotDotDu();
924  else
925  return var->duDotDotDu();
926  }
927  else
928  {
929  if (_c_nodal)
930  return var->dofValuesDuDotDotDuNeighbor();
931  else
932  return var->duDotDotDu();
933  }
934 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:759
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:227
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:852
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 733 of file Coupleable.C.

734 {
735  checkVar(var_name);
736  if (!isCoupled(var_name)) // Return default 0
737  return _default_value_zero;
738 
739  validateExecutionerType(var_name, "coupledDotDotOld");
740  MooseVariable * var = getVar(var_name, comp);
741  if (var == NULL)
742  mooseError("Call corresponding vector variable method");
743 
745  {
746  if (_c_nodal)
747  return var->dofValuesDotDotOld();
748  else
749  return var->uDotDotOld();
750  }
751  else
752  {
753  if (_c_nodal)
754  return var->dofValuesDotDotOldNeighbor();
755  else
756  return var->uDotDotOldNeighbor();
757  }
758 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
const FieldVariableValue & uDotDotOldNeighbor()
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:759
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:227
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:852
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 AuxKernel.

Definition at line 881 of file Coupleable.C.

Referenced by AuxKernel::coupledDotDu().

882 {
883  checkVar(var_name);
884  if (!isCoupled(var_name)) // Return default 0
885  return _default_value_zero;
886 
887  validateExecutionerType(var_name, "coupledDotDu");
888  MooseVariable * var = getVar(var_name, comp);
889  if (var == NULL)
890  mooseError("Call corresponding vector variable method");
891 
893  {
894  if (_c_nodal)
895  return var->dofValuesDuDotDu();
896  else
897  return var->duDotDu();
898  }
899  else
900  {
901  if (_c_nodal)
902  return var->dofValuesDuDotDuNeighbor();
903  else
904  return var->duDotDuNeighbor();
905  }
906 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
const VariableValue & duDotDu()
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:759
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:227
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:852
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 705 of file Coupleable.C.

706 {
707  checkVar(var_name);
708  if (!isCoupled(var_name)) // Return default 0
709  return _default_value_zero;
710 
711  validateExecutionerType(var_name, "coupledDotOld");
712  MooseVariable * var = getVar(var_name, comp);
713  if (var == NULL)
714  mooseError("Call corresponding vector variable method");
715 
717  {
718  if (_c_nodal)
719  return var->dofValuesDotOld();
720  else
721  return var->uDotOld();
722  }
723  else
724  {
725  if (_c_nodal)
726  return var->dofValuesDotOldNeighbor();
727  else
728  return var->uDotOldNeighbor();
729  }
730 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:759
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:227
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:852
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 937 of file Coupleable.C.

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

938 {
939  checkVar(var_name);
940  if (!isCoupled(var_name)) // Return default 0
941  return _default_gradient;
942 
943  coupledCallback(var_name, false);
944  if (_c_nodal)
945  mooseError(_c_name, ": Nodal variables do not have gradients");
946 
947  MooseVariable * var = getVar(var_name, comp);
948  if (var == NULL)
949  mooseError("Call corresponding vector variable method");
950 
952  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
953  else
954  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
955 }
const FieldVariableGradient & gradSlnOld()
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:227
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:762
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:717
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:852
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 1029 of file Coupleable.C.

1030 {
1031  checkVar(var_name);
1032  if (!isCoupled(var_name)) // Return default 0
1033  return _default_gradient;
1034 
1035  coupledCallback(var_name, false);
1036  if (_c_nodal)
1037  mooseError(_c_name, ": Nodal variables do not have gradients");
1038 
1039  MooseVariable * var = getVar(var_name, comp);
1040  if (var == NULL)
1041  mooseError("Call corresponding vector variable method");
1042 
1043  if (!_coupleable_neighbor)
1044  return var->gradSlnDot();
1045  else
1046  return var->gradSlnNeighborDot();
1047 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:227
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:762
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:717
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:852
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 1050 of file Coupleable.C.

1051 {
1052  checkVar(var_name);
1053  if (!isCoupled(var_name)) // Return default 0
1054  return _default_gradient;
1055 
1056  coupledCallback(var_name, false);
1057  if (_c_nodal)
1058  mooseError(_c_name, ": Nodal variables do not have gradients");
1059 
1060  MooseVariable * var = getVar(var_name, comp);
1061  if (var == NULL)
1062  mooseError("Call corresponding vector variable method");
1063 
1064  if (!_coupleable_neighbor)
1065  return var->gradSlnDotDot();
1066  else
1067  return var->gradSlnNeighborDotDot();
1068 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:227
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:762
const FieldVariableGradient & gradSlnNeighborDotDot()
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:717
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:852
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 958 of file Coupleable.C.

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

959 {
960  checkVar(var_name);
961  if (!isCoupled(var_name)) // Return default 0
962  return _default_gradient;
963 
964  coupledCallback(var_name, true);
965  if (_c_nodal)
966  mooseError(_c_name, ": Nodal compute objects do not support gradients");
967 
968  validateExecutionerType(var_name, "coupledGradientOld");
969  MooseVariable * var = getVar(var_name, comp);
970  if (var == NULL)
971  mooseError("Call corresponding vector variable method");
972 
974  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
975  else
976  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
977 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:227
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:762
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:717
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:852
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 980 of file Coupleable.C.

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

981 {
982  checkVar(var_name);
983  if (!isCoupled(var_name)) // Return default 0
984  return _default_gradient;
985 
986  coupledCallback(var_name, true);
987  if (_c_nodal)
988  mooseError(_c_name, ": Nodal compute objects do not support gradients");
989 
990  validateExecutionerType(var_name, "coupledGradientOlder");
991  MooseVariable * var = getVar(var_name, comp);
992  if (var == NULL)
993  mooseError("Call corresponding vector variable method");
994 
995  if (_c_is_implicit)
996  {
998  return var->gradSlnOlder();
999  else
1000  return var->gradSlnOlderNeighbor();
1001  }
1002  else
1003  mooseError(_c_name, ": Older values not available for explicit schemes");
1004 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:227
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:762
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:717
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:852
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 1007 of file Coupleable.C.

1008 {
1009  checkVar(var_name);
1010  if (!isCoupled(var_name)) // Return default 0
1011  return _default_gradient;
1012 
1014  coupledCallback(var_name, true);
1015  if (_c_nodal)
1016  mooseError(_c_name, ": Nodal compute objects do not support gradients");
1017 
1018  MooseVariable * var = getVar(var_name, comp);
1019  if (var == NULL)
1020  mooseError("Call corresponding vector variable method");
1021 
1022  if (!_coupleable_neighbor)
1023  return var->gradSlnPreviousNL();
1024  else
1025  return var->gradSlnPreviousNLNeighbor();
1026 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:227
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:720
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:762
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:717
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:852
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 417 of file Coupleable.C.

418 {
419  checkVar(var_name);
420  if (!isCoupled(var_name))
421  mooseError(var_name, ": invalid variable name for coupledMatrixTagValue");
422 
424 
425  coupledCallback(var_name, false);
426  MooseVariable * var = getVar(var_name, comp);
427  if (var == NULL)
428  mooseError("Call coupledVectorValue for coupled vector variables");
429 
430  if (_c_nodal)
431  return var->nodalMatrixTagValue(tag);
432  else
433  return var->matrixTagValue(tag);
434 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:227
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:113
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 1396 of file Coupleable.C.

1397 {
1398  checkVar(var_name);
1399  static const T zero = 0;
1400  if (!isCoupled(var_name)) // Return default 0
1401  return zero;
1402 
1403  validateExecutionerType(var_name, "coupledNodalDot");
1404  coupledCallback(var_name, false);
1405  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1406  if (var == NULL)
1407  mooseError("Call corresponding vector variable method");
1408 
1409  if (!_coupleable_neighbor)
1410  return var->nodalValueDot();
1411  else
1412  mooseError("Neighbor version not implemented");
1413 }
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:1530
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:852
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 1416 of file Coupleable.C.

1417 {
1418  checkVar(var_name);
1419  if (!isCoupled(var_name)) // Return default 0
1420  return _default_value_zero;
1421 
1422  validateExecutionerType(var_name, "coupledNodalDotDot");
1423  coupledCallback(var_name, false);
1424  MooseVariable * var = getVar(var_name, comp);
1425  if (var == NULL)
1426  mooseError("Call corresponding vector variable method");
1427 
1428  if (!_coupleable_neighbor)
1429  return var->dofValuesDotDot();
1430  else
1431  return var->dofValuesDotDotNeighbor();
1432 }
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:1530
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:759
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:227
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:852
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 1454 of file Coupleable.C.

1455 {
1456  checkVar(var_name);
1457  if (!isCoupled(var_name)) // Return default 0
1458  return _default_value_zero;
1459 
1460  validateExecutionerType(var_name, "coupledNodalDotDotOld");
1461  coupledCallback(var_name, false);
1462  MooseVariable * var = getVar(var_name, comp);
1463  if (var == NULL)
1464  mooseError("Call corresponding vector variable method");
1465 
1466  if (!_coupleable_neighbor)
1467  return var->dofValuesDotDotOld();
1468  else
1469  return var->dofValuesDotDotOldNeighbor();
1470 }
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:1530
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:759
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:227
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:852
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 1435 of file Coupleable.C.

1436 {
1437  checkVar(var_name);
1438  if (!isCoupled(var_name)) // Return default 0
1439  return _default_value_zero;
1440 
1441  validateExecutionerType(var_name, "coupledNodalDotOld");
1442  coupledCallback(var_name, false);
1443  MooseVariable * var = getVar(var_name, comp);
1444  if (var == NULL)
1445  mooseError("Call corresponding vector variable method");
1446 
1447  if (!_coupleable_neighbor)
1448  return var->dofValuesDotOld();
1449  else
1450  return var->dofValuesDotOldNeighbor();
1451 }
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:1530
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:759
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:227
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:852
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 1298 of file Coupleable.C.

1299 {
1300  checkVar(var_name);
1301  if (!isCoupled(var_name))
1302  return getNodalDefaultValue<T>(var_name, comp);
1303 
1304  coupledCallback(var_name, false);
1305  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1306  if (var == NULL)
1307  mooseError("Call corresponding vector variable method");
1308  if (!var->isNodal())
1310  ": Trying to get nodal values of variable '",
1311  var->name(),
1312  "', but it is not nodal.");
1313 
1314  if (!_coupleable_neighbor)
1315  return (_c_is_implicit) ? var->nodalValue() : var->nodalValueOld();
1316  else
1317  return (_c_is_implicit) ? var->nodalValueNeighbor() : var->nodalValueOldNeighbor();
1318 }
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:738
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:717
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:852
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 1322 of file Coupleable.C.

1323 {
1324  checkVar(var_name);
1325  if (!isCoupled(var_name))
1326  return getNodalDefaultValue<T>(var_name, comp);
1327 
1328  validateExecutionerType(var_name, "coupledNodalValueOld");
1329  coupledCallback(var_name, true);
1330  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1331  if (var == NULL)
1332  mooseError("Call corresponding vector variable method");
1333  if (!var->isNodal())
1335  ": Trying to get old nodal values of variable '",
1336  var->name(),
1337  "', but it is not nodal.");
1338 
1339  if (!_coupleable_neighbor)
1340  return (_c_is_implicit) ? var->nodalValueOld() : var->nodalValueOlder();
1341  else
1343 }
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:1530
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:738
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:717
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:852
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 1347 of file Coupleable.C.

1348 {
1349  checkVar(var_name);
1350  if (!isCoupled(var_name))
1351  return getNodalDefaultValue<T>(var_name, comp);
1352 
1353  validateExecutionerType(var_name, "coupledNodalValueOlder");
1354  coupledCallback(var_name, true);
1355  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1356  if (var == NULL)
1357  mooseError("Call corresponding vector variable method");
1358  if (!var->isNodal())
1360  ": Trying to get older nodal values of variable '",
1361  var->name(),
1362  "', but it is not nodal.");
1363  if (_c_is_implicit)
1364  {
1365  if (!_coupleable_neighbor)
1366  return var->nodalValueOlder();
1367  else
1368  return var->nodalValueOlderNeighbor();
1369  }
1370  else
1371  mooseError(_c_name, ": Older values not available for explicit schemes");
1372 }
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:1530
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:738
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:717
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:852
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 1376 of file Coupleable.C.

1377 {
1378  checkVar(var_name);
1379  if (!isCoupled(var_name))
1380  return getNodalDefaultValue<T>(var_name, comp);
1381 
1383  coupledCallback(var_name, true);
1384  MooseVariableFE<T> * var = getVarHelper<T>(var_name, comp);
1385  if (var == NULL)
1386  mooseError("Call corresponding vector variable method");
1387 
1388  if (!_coupleable_neighbor)
1389  return var->nodalValuePreviousNL();
1390  else
1391  return var->nodalValuePreviousNLNeighbor();
1392 }
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:720
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:852
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 1208 of file Coupleable.C.

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

1209 {
1210  checkVar(var_name);
1211  if (!isCoupled(var_name)) // Return default 0
1212  return _default_second;
1213 
1214  coupledCallback(var_name, false);
1215  if (_c_nodal)
1216  mooseError(_c_name, ": Nodal variables do not have second derivatives");
1217 
1218  MooseVariable * var = getVar(var_name, comp);
1219  if (var == NULL)
1220  mooseError("Call corresponding vector variable method");
1221 
1222  if (!_coupleable_neighbor)
1223  return (_c_is_implicit) ? var->secondSln() : var->secondSlnOlder();
1224  else
1225  return (_c_is_implicit) ? var->secondSlnNeighbor() : var->secondSlnOlderNeighbor();
1226 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:227
const FieldVariableSecond & secondSlnOlderNeighbor()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:771
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:717
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:852
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 1229 of file Coupleable.C.

1230 {
1231  checkVar(var_name);
1232  if (!isCoupled(var_name)) // Return default 0
1233  return _default_second;
1234 
1235  coupledCallback(var_name, true);
1236  if (_c_nodal)
1237  mooseError(_c_name, ": Nodal variables do not have second derivatives");
1238 
1239  validateExecutionerType(var_name, "coupledSecondOld");
1240  MooseVariable * var = getVar(var_name, comp);
1241  if (var == NULL)
1242  mooseError("Call corresponding vector variable method");
1243  if (!_coupleable_neighbor)
1244  return (_c_is_implicit) ? var->secondSlnOld() : var->secondSlnOlder();
1245  else
1246  return (_c_is_implicit) ? var->secondSlnOldNeighbor() : var->secondSlnOlderNeighbor();
1247 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:227
const FieldVariableSecond & secondSlnOlderNeighbor()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:771
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:717
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:852
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 1250 of file Coupleable.C.

1251 {
1252  checkVar(var_name);
1253  if (!isCoupled(var_name)) // Return default 0
1254  return _default_second;
1255 
1256  coupledCallback(var_name, true);
1257  if (_c_nodal)
1258  mooseError(_c_name, ": Nodal variables do not have second derivatives");
1259 
1260  validateExecutionerType(var_name, "coupledSecondOlder");
1261  MooseVariable * var = getVar(var_name, comp);
1262  if (var == NULL)
1263  mooseError("Call corresponding vector variable method");
1264  if (_c_is_implicit)
1265  {
1266  if (!_coupleable_neighbor)
1267  return var->secondSlnOlder();
1268  else
1269  return var->secondSlnOlderNeighbor();
1270  }
1271  else
1272  mooseError(_c_name, ": Older values not available for explicit schemes");
1273 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:227
const FieldVariableSecond & secondSlnOlderNeighbor()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:771
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:717
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:852
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 1276 of file Coupleable.C.

1277 {
1278  checkVar(var_name);
1279  if (!isCoupled(var_name)) // Return default 0
1280  return _default_second;
1281 
1283  coupledCallback(var_name, true);
1284  if (_c_nodal)
1285  mooseError(_c_name, ": Nodal variables do not have second derivatives");
1286 
1287  MooseVariable * var = getVar(var_name, comp);
1288  if (var == NULL)
1289  mooseError("Call corresponding vector variable method");
1290  if (!_coupleable_neighbor)
1291  return var->secondSlnPreviousNL();
1292  else
1293  return var->secondSlnPreviousNLNeighbor();
1294 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:227
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:720
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:771
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:717
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:852
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 369 of file Coupleable.C.

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

370 {
371  checkVar(var_name);
372  if (!isCoupled(var_name))
373  return *getDefaultValue(var_name, comp);
374 
375  coupledCallback(var_name, false);
376  MooseVariable * var = getVar(var_name, comp);
377  if (var == NULL)
378  mooseError("Call coupledVectorValue for coupled vector variables");
379 
381  {
382  if (_c_nodal)
383  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
384  else
385  return (_c_is_implicit) ? var->sln() : var->slnOld();
386  }
387  else
388  {
389  if (_c_nodal)
390  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
391  else
392  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
393  }
394 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:227
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:291
const FieldVariableValue & slnNeighbor()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:852
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 472 of file Coupleable.C.

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

473 {
474  checkVar(var_name);
475  if (!isCoupled(var_name))
476  return *getDefaultValue(var_name, comp);
477 
478  validateExecutionerType(var_name, "coupledValueOld");
479  coupledCallback(var_name, true);
480  MooseVariable * var = getVar(var_name, comp);
481  if (var == NULL)
482  mooseError("Call coupledVectorValueOld for coupled vector variables");
483 
485  {
486  if (_c_nodal)
487  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
488  else
489  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
490  }
491  else
492  {
493  if (_c_nodal)
495  else
496  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
497  }
498 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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 & slnOldNeighbor()
const FieldVariableValue & slnOlderNeighbor()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:227
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:291
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:852
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 501 of file Coupleable.C.

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

502 {
503  checkVar(var_name);
504  if (!isCoupled(var_name))
505  return *getDefaultValue(var_name, comp);
506 
507  validateExecutionerType(var_name, "coupledValueOlder");
508  coupledCallback(var_name, true);
509  MooseVariable * var = getVar(var_name, comp);
510  if (var == NULL)
511  mooseError("Call coupledVectorValueOlder for coupled vector variables");
512 
514  {
515  if (_c_nodal)
516  {
517  if (_c_is_implicit)
518  return var->dofValuesOlder();
519  else
520  mooseError(_c_name, ": Older values not available for explicit schemes");
521  }
522  else
523  {
524  if (_c_is_implicit)
525  return var->slnOlder();
526  else
527  mooseError(_c_name, ": Older values not available for explicit schemes");
528  }
529  }
530  else
531  {
532  if (_c_nodal)
533  {
534  if (_c_is_implicit)
535  return var->dofValuesOlderNeighbor();
536  else
537  mooseError(_c_name, ": Older values not available for explicit schemes");
538  }
539  else
540  {
541  if (_c_is_implicit)
542  return var->slnOlderNeighbor();
543  else
544  mooseError(_c_name, ": Older values not available for explicit schemes");
545  }
546  }
547 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:227
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:291
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:717
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:852
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 550 of file Coupleable.C.

551 {
552  checkVar(var_name);
553  if (!isCoupled(var_name))
554  return *getDefaultValue(var_name, comp);
555 
557  coupledCallback(var_name, true);
558  MooseVariable * var = getVar(var_name, comp);
559  if (var == NULL)
560  mooseError("Call corresponding vector variable method");
561 
563  {
564  if (_c_nodal)
565  return var->dofValuesPreviousNL();
566  else
567  return var->slnPreviousNL();
568  }
569  else
570  {
571  if (_c_nodal)
572  return var->dofValuesPreviousNLNeighbor();
573  else
574  return var->slnPreviousNLNeighbor();
575  }
576 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
const FieldVariableValue & slnPreviousNLNeighbor()
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:227
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:291
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:720
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:852
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 761 of file Coupleable.C.

762 {
763  checkVar(var_name);
764  if (!isCoupled(var_name)) // Return default 0
766 
767  validateExecutionerType(var_name, "coupledVectorDot");
768  VectorMooseVariable * var = getVectorVar(var_name, comp);
769  if (var == NULL)
770  mooseError("Call corresponding standard variable method");
771 
773  {
774  if (_c_nodal)
775  mooseError("Vector variables are not required to be continuous and so should not be used "
776  "with nodal compute objects");
777  else
778  return var->uDot();
779  }
780  else
781  {
782  if (_c_nodal)
783  mooseError("Vector variables are not required to be continuous and so should not be used "
784  "with nodal compute objects");
785  else
786  return var->uDotNeighbor();
787  }
788 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:244
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:852
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:798
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 791 of file Coupleable.C.

792 {
793  checkVar(var_name);
794  if (!isCoupled(var_name)) // Return default 0
796 
797  validateExecutionerType(var_name, "coupledVectorDotDot");
798  VectorMooseVariable * var = getVectorVar(var_name, comp);
799  if (var == NULL)
800  mooseError("Call corresponding standard variable method");
801 
803  {
804  if (_c_nodal)
805  mooseError("Vector variables are not required to be continuous and so should not be used "
806  "with nodal compute objects");
807  else
808  return var->uDotDot();
809  }
810  else
811  {
812  if (_c_nodal)
813  mooseError("Vector variables are not required to be continuous and so should not be used "
814  "with nodal compute objects");
815  else
816  return var->uDotDotNeighbor();
817  }
818 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:244
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:852
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:798
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 851 of file Coupleable.C.

852 {
853  checkVar(var_name);
854  if (!isCoupled(var_name)) // Return default 0
856 
857  validateExecutionerType(var_name, "coupledVectorDotDotOld");
858  VectorMooseVariable * var = getVectorVar(var_name, comp);
859  if (var == NULL)
860  mooseError("Call corresponding standard variable method");
861 
863  {
864  if (_c_nodal)
865  mooseError("Vector variables are not required to be continuous and so should not be used "
866  "with nodal compute objects");
867  else
868  return var->uDotDotOld();
869  }
870  else
871  {
872  if (_c_nodal)
873  mooseError("Vector variables are not required to be continuous and so should not be used "
874  "with nodal compute objects");
875  else
876  return var->uDotDotOldNeighbor();
877  }
878 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
const FieldVariableValue & uDotDotOldNeighbor()
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:244
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:852
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:798
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 821 of file Coupleable.C.

822 {
823  checkVar(var_name);
824  if (!isCoupled(var_name)) // Return default 0
826 
827  validateExecutionerType(var_name, "coupledVectorDotOld");
828  VectorMooseVariable * var = getVectorVar(var_name, comp);
829  if (var == NULL)
830  mooseError("Call corresponding standard variable method");
831 
833  {
834  if (_c_nodal)
835  mooseError("Vector variables are not required to be continuous and so should not be used "
836  "with nodal compute objects");
837  else
838  return var->uDotOld();
839  }
840  else
841  {
842  if (_c_nodal)
843  mooseError("Vector variables are not required to be continuous and so should not be used "
844  "with nodal compute objects");
845  else
846  return var->uDotOldNeighbor();
847  }
848 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:244
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:852
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:798
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 1071 of file Coupleable.C.

1072 {
1073  checkVar(var_name);
1074  if (!isCoupled(var_name)) // Return default 0
1075  return _default_vector_gradient;
1076 
1077  coupledCallback(var_name, false);
1078  if (_c_nodal)
1079  mooseError(_c_name, ": Gradients are non-sensical with nodal compute objects");
1080 
1081  VectorMooseVariable * var = getVectorVar(var_name, comp);
1082  if (var == NULL)
1083  mooseError("Call corresponding standard variable method");
1084 
1085  if (!_coupleable_neighbor)
1086  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
1087  else
1088  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
1089 }
const FieldVariableGradient & gradSlnOld()
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:244
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:738
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:717
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:801
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:852
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 1092 of file Coupleable.C.

1093 {
1094  checkVar(var_name);
1095  if (!isCoupled(var_name)) // Return default 0
1096  return _default_vector_gradient;
1097 
1098  coupledCallback(var_name, true);
1099  if (_c_nodal)
1100  mooseError(_c_name, ": Gradients are non-sensical with nodal compute objects");
1101 
1102  validateExecutionerType(var_name, "coupledGradientOld");
1103  VectorMooseVariable * var = getVectorVar(var_name, comp);
1104  if (var == NULL)
1105  mooseError("Call corresponding standard variable method");
1106 
1107  if (!_coupleable_neighbor)
1108  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
1109  else
1110  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
1111 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
const FieldVariableGradient & gradSlnOlder()
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:244
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:738
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:717
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:801
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:852
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 1114 of file Coupleable.C.

1115 {
1116  checkVar(var_name);
1117  if (!isCoupled(var_name)) // Return default 0
1118  return _default_vector_gradient;
1119 
1120  coupledCallback(var_name, true);
1121  if (_c_nodal)
1122  mooseError(_c_name, ": Gradients are non-sensical with nodal compute objects");
1123 
1124  validateExecutionerType(var_name, "coupledGradientOlder");
1125  VectorMooseVariable * var = getVectorVar(var_name, comp);
1126  if (var == NULL)
1127  mooseError("Call corresponding standard variable method");
1128 
1129  if (_c_is_implicit)
1130  {
1131  if (!_coupleable_neighbor)
1132  return var->gradSlnOlder();
1133  else
1134  return var->gradSlnOlderNeighbor();
1135  }
1136  else
1137  mooseError(_c_name, ": Older values not available for explicit schemes");
1138 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
const FieldVariableGradient & gradSlnOlder()
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:244
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:738
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:717
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:801
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:852
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 397 of file Coupleable.C.

398 {
399  checkVar(var_name);
400  if (!isCoupled(var_name))
401  mooseError(var_name, ": invalid variable name for coupledVectorTagValue");
402 
404 
405  coupledCallback(var_name, false);
406  MooseVariable * var = getVar(var_name, comp);
407  if (var == NULL)
408  mooseError("Call coupledVectorValue for coupled vector variables");
409 
410  if (_c_nodal)
411  return var->nodalVectorTagValue(tag);
412  else
413  return var->vectorTagValue(tag);
414 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:227
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:111
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 437 of file Coupleable.C.

438 {
439  if (!isCoupled(var_name))
440  return *getDefaultVectorValue(var_name);
441 
442  coupledCallback(var_name, false);
443  VectorMooseVariable * var = getVectorVar(var_name, comp);
444  if (var == NULL)
445  mooseError("Call coupledValue for coupled regular variables");
446 
448  {
449  if (_c_nodal)
450  mooseError("Vector variables are not required to be continuous and so should not be used "
451  "with nodal compute objects");
452  else
453  return (_c_is_implicit) ? var->sln() : var->slnOld();
454  }
455  else
456  {
457  if (_c_nodal)
458  mooseError("Vector variables are not required to be continuous and so should not be used "
459  "with nodal compute objects");
460  else
461  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
462  }
463 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:244
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:318
const FieldVariableValue & slnNeighbor()
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:852

◆ 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 579 of file Coupleable.C.

580 {
581  if (!isCoupled(var_name))
582  return *getDefaultVectorValue(var_name);
583 
584  validateExecutionerType(var_name, "coupledVectorValueOld");
585  coupledCallback(var_name, true);
586  VectorMooseVariable * var = getVectorVar(var_name, comp);
587  if (var == NULL)
588  mooseError("Call coupledValueOld for coupled scalar field variables");
589 
591  {
592  if (_c_nodal)
593  mooseError("Vector variables are not required to be continuous and so should not be used "
594  "with nodal compute objects");
595  else
596  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
597  }
598  else
599  {
600  if (_c_nodal)
601  mooseError("Vector variables are not required to be continuous and so should not be used "
602  "with nodal compute objects");
603  else
604  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
605  }
606 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:244
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:318
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:852
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 609 of file Coupleable.C.

610 {
611  if (!isCoupled(var_name))
612  return *getDefaultVectorValue(var_name);
613 
614  validateExecutionerType(var_name, "coupledVectorValueOlder");
615  coupledCallback(var_name, true);
616  VectorMooseVariable * var = getVectorVar(var_name, comp);
617  if (var == NULL)
618  mooseError("Call coupledValueOlder for coupled scalar field variables");
619 
621  {
622  if (_c_nodal)
623  mooseError("Vector variables are not required to be continuous and so should not be used "
624  "with nodal compute objects");
625  else
626  {
627  if (_c_is_implicit)
628  return var->slnOlder();
629  else
630  mooseError("Older values not available for explicit schemes");
631  }
632  }
633  else
634  {
635  if (_c_nodal)
636  mooseError("Vector variables are not required to be continuous and so should not be used "
637  "with nodal compute objects");
638  else
639  {
640  if (_c_is_implicit)
641  return var->slnOlderNeighbor();
642  else
643  mooseError("Older values not available for explicit schemes");
644  }
645  }
646 }
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:1530
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:244
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:318
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:738
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:852
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 1170 of file Coupleable.h.

1171 {
1172  return _ad_default_gradient;
1173 }
MooseArray< DualRealVectorValue > _ad_default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:765

◆ getADDefaultGradient() [2/3]

template<>
VariableGradient& Coupleable::getADDefaultGradient ( )

◆ getADDefaultGradient() [3/3]

template<>
VariableGradient& Coupleable::getADDefaultGradient ( )

Definition at line 1558 of file Coupleable.C.

1559 {
1560  return _default_gradient;
1561 }
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:762

◆ 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 1190 of file Coupleable.h.

1191 {
1192  return _ad_default_second;
1193 }
MooseArray< DualRealTensorValue > _ad_default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:774

◆ getADDefaultSecond() [2/3]

template<>
VariableSecond& Coupleable::getADDefaultSecond ( )

◆ getADDefaultSecond() [3/3]

template<>
VariableSecond& Coupleable::getADDefaultSecond ( )

Definition at line 1572 of file Coupleable.C.

1573 {
1574  return _default_second;
1575 }
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:771

◆ 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 1130 of file Coupleable.h.

1131 {
1132  std::map<std::string, MooseArray<DualReal> *>::iterator default_value_it =
1133  _ad_default_value.find(var_name);
1134  if (default_value_it == _ad_default_value.end())
1135  {
1136  ADVariableValue * value =
1137  new ADVariableValue(_coupleable_max_qps, _c_parameters.defaultCoupledValue(var_name));
1138  default_value_it = _ad_default_value.insert(std::make_pair(var_name, value)).first;
1139  }
1140 
1141  return default_value_it->second;
1142 }
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:747
const InputParameters & _c_parameters
Definition: Coupleable.h:714
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:919

◆ 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 1544 of file Coupleable.C.

1545 {
1546  return getDefaultValue(var_name, 0);
1547 }
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:291

◆ 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 1180 of file Coupleable.h.

1181 {
1183 }
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:768

◆ getADDefaultVectorGradient() [2/3]

template<>
VectorVariableGradient& Coupleable::getADDefaultVectorGradient ( )

◆ getADDefaultVectorGradient() [3/3]

template<>
VectorVariableGradient& Coupleable::getADDefaultVectorGradient ( )

Definition at line 1565 of file Coupleable.C.

1566 {
1567  return _default_vector_gradient;
1568 }
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:801

◆ 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 1149 of file Coupleable.h.

1150 {
1151  std::map<std::string, MooseArray<DualRealVectorValue> *>::iterator default_value_it =
1152  _ad_default_vector_value.find(var_name);
1153  if (default_value_it == _ad_default_vector_value.end())
1154  {
1155  RealVectorValue default_vec;
1156  for (unsigned int i = 0; i < _c_parameters.numberDefaultCoupledValues(var_name); ++i)
1157  default_vec(i) = _c_parameters.defaultCoupledValue(var_name, i);
1158  ADVectorVariableValue * value = new ADVectorVariableValue(_coupleable_max_qps, default_vec);
1159  default_value_it = _ad_default_vector_value.insert(std::make_pair(var_name, value)).first;
1160  }
1161 
1162  return default_value_it->second;
1163 }
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:753
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:714
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:919

◆ 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 1551 of file Coupleable.C.

1552 {
1553  return getDefaultVectorValue(var_name);
1554 }
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:318

◆ 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 97 of file Coupleable.h.

98  {
100  }
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Definition: Coupleable.h:729

◆ 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 79 of file Coupleable.h.

Referenced by AuxKernel::AuxKernel(), and InitialConditionBase::InitialConditionBase().

80  {
81  return _coupled_vars;
82  }
std::map< std::string, std::vector< MooseVariableFEBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:723

◆ 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 106 of file Coupleable.h.

107  {
109  }
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
Definition: Coupleable.h:732

◆ 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 291 of file Coupleable.C.

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

292 {
293  // make sure we don't access values that were not provided
294  if (comp + 1 > _c_parameters.numberDefaultCoupledValues(var_name))
296  ": Requested component ",
297  comp,
298  " of coupled value ",
299  var_name,
300  " is out of range.");
301 
302  std::map<std::string, std::vector<VariableValue *>>::iterator default_value_it =
303  _default_value.find(var_name);
304  if (default_value_it == _default_value.end())
305  {
306  _default_value[var_name] = {
308  for (unsigned int j = 1; j < _c_parameters.numberDefaultCoupledValues(var_name); ++j)
309  _default_value[var_name].push_back(
311  default_value_it = _default_value.find(var_name);
312  }
313 
314  return default_value_it->second[comp];
315 }
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:744
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:717
const InputParameters & _c_parameters
Definition: Coupleable.h:714
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:919
MooseArray< Real > VariableValue
Definition: MooseTypes.h:161

◆ 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 318 of file Coupleable.C.

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

319 {
320  std::map<std::string, VectorVariableValue *>::iterator default_value_it =
321  _default_vector_value.find(var_name);
322  if (default_value_it == _default_vector_value.end())
323  {
325  bool already_warned = false;
326  for (unsigned int qp = 0; qp < _coupleable_max_qps; ++qp)
327  for (unsigned int i = 0; i < LIBMESH_DIM; ++i)
328  {
329  try
330  {
331  (*value)[qp](i) = _c_parameters.defaultCoupledValue(var_name, i);
332  }
333  catch (const std::out_of_range &)
334  {
335  if (!already_warned)
336  mooseWarning(
337  "You supplied less than 3 arguments for the default vector value for variable ",
338  var_name,
339  ". Did you accidently leave something off? We are going to assign 0s, assuming "
340  "this "
341  "was intentional.");
342  already_warned = true;
343  (*value)[qp](i) = 0;
344  }
345  }
346  default_value_it = _default_vector_value.insert(std::make_pair(var_name, value)).first;
347  }
348 
349  return default_value_it->second;
350 }
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:220
MooseArray< libMesh::VectorValue< Real > > VectorVariableValue
Definition: MooseTypes.h:176
std::map< std::string, VectorVariableValue * > _default_vector_value
Will hold the default value for optional vector coupled variables.
Definition: Coupleable.h:750
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:714
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:919

◆ 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:735
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:723
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:717

◆ getFEVariableCoupleableMatrixTags()

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

Definition at line 117 of file Coupleable.h.

117 { return _fe_coupleable_matrix_tags; }
std::set< TagID > _fe_coupleable_matrix_tags
Definition: Coupleable.h:929

◆ getFEVariableCoupleableVectorTags()

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

Definition at line 115 of file Coupleable.h.

115 { return _fe_coupleable_vector_tags; }
std::set< TagID > _fe_coupleable_vector_tags
Definition: Coupleable.h:927

◆ getNodalDefaultValue() [1/3]

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

Definition at line 362 of file Coupleable.C.

363 {
364  auto && default_variable_value = getDefaultVectorValue(var_name);
365  return *default_variable_value->data();
366 }
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:318

◆ getNodalDefaultValue() [2/3]

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

Get nodal default value.

Definition at line 354 of file Coupleable.C.

355 {
356  auto && default_variable_value = getDefaultValue(var_name, comp);
357  return *default_variable_value->data();
358 }
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:291

◆ getNodalDefaultValue() [3/3]

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

◆ 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 227 of file Coupleable.C.

Referenced by adCoupledDotTemplate(), adCoupledGradientTemplate(), adCoupledSecondTemplate(), adCoupledValueTemplate(), ShapeUserObject< SideUserObject >::coupled(), AuxKernel::coupledDot(), coupledDot(), coupledDotDot(), coupledDotDotDu(), coupledDotDotOld(), AuxKernel::coupledDotDu(), 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(), getVarHelper(), ParsedAux::ParsedAux(), PiecewiseLinearInterpolationMaterial::PiecewiseLinearInterpolationMaterial(), and SphericalAverage::SphericalAverage().

228 {
229  if (comp < _coupled_vars[var_name].size())
230  {
231  // Error check - don't couple elemental to nodal
232  if (!(_coupled_vars[var_name][comp])->isNodal() && _c_nodal)
233  mooseError(_c_name, ": You cannot couple an elemental variable to a nodal variable");
234  if (auto * coupled_var = dynamic_cast<MooseVariable *>(_coupled_vars[var_name][comp]))
235  return coupled_var;
236  else
237  mooseError("Variable of wrong type");
238  }
239  else
240  mooseError(_c_name, ": Trying to get a non-existent component of variable '", var_name, "'");
241 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:723
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:717

◆ getVarHelper() [1/3]

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

Definition at line 221 of file Coupleable.C.

222 {
223  return getVectorVar(var_name, comp);
224 }
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:244

◆ getVarHelper() [2/3]

template<typename T >
MooseVariableFE< T > * Coupleable::getVarHelper ( 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  return getVar(var_name, comp);
217 }
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:227

◆ getVarHelper() [3/3]

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

◆ getVectorVar()

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

Extract pointer to a coupled vector variable.

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

Definition at line 244 of file Coupleable.C.

Referenced by adCoupledVectorGradientTemplate(), adCoupledVectorValueTemplate(), coupledCurl(), coupledCurlOld(), coupledCurlOlder(), coupledVectorDot(), coupledVectorDotDot(), coupledVectorDotDotOld(), coupledVectorDotOld(), coupledVectorGradient(), coupledVectorGradientOld(), coupledVectorGradientOlder(), NeighborCoupleable::coupledVectorNeighborGradient(), NeighborCoupleable::coupledVectorNeighborGradientOld(), NeighborCoupleable::coupledVectorNeighborGradientOlder(), coupledVectorValue(), coupledVectorValueOld(), and coupledVectorValueOlder().

245 {
246  if (comp < _coupled_vars[var_name].size())
247  {
248  // Error check - don't couple elemental to nodal
249  if (!(_coupled_vars[var_name][comp])->isNodal() && _c_nodal)
250  mooseError(_c_name, ": You cannot couple an elemental variable to a nodal variable");
251  if (auto * coupled_var = dynamic_cast<VectorMooseVariable *>(_coupled_vars[var_name][comp]))
252  return coupled_var;
253  else
254  mooseError("Variable of wrong type");
255  }
256  else
257  mooseError(_c_name, ": Trying to get a non-existent component of variable '", var_name, "'");
258 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:735
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:723
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:717

◆ 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(), 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:723
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:717
const InputParameters & _c_parameters
Definition: Coupleable.h:714

◆ 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 1530 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().

1531 {
1532  if (!_c_fe_problem.isTransient())
1534  ": Calling '",
1535  fn_name,
1536  "' on variable \"",
1537  name,
1538  "\" when using a \"Steady\" executioner is not allowed. This value is available "
1539  "only in transient simulations.");
1540 }
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:720
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:717
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 466 of file Coupleable.C.

467 {
468  return const_cast<VariableValue &>(coupledValue(var_name, comp));
469 }
virtual const VariableValue & coupledValue(const std::string &var_name, unsigned int comp=0)
Returns value of a coupled variable.
Definition: Coupleable.C:369

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 765 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 774 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 747 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 768 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 753 of file Coupleable.h.

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

◆ _ad_grad_zero

const MooseArray<DualRealVectorValue>& Coupleable::_ad_grad_zero
protected

Definition at line 782 of file Coupleable.h.

Referenced by adZeroGradientTemplate().

◆ _ad_second_zero

const MooseArray<DualRealTensorValue>& Coupleable::_ad_second_zero
protected

Definition at line 786 of file Coupleable.h.

Referenced by adZeroSecondTemplate().

◆ _ad_zero

const MooseArray<DualReal>& Coupleable::_ad_zero
protected

Definition at line 778 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 925 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 741 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 919 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 729 of file Coupleable.h.

Referenced by Coupleable(), and getCoupledStandardMooseVars().

◆ _coupled_vars

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

Coupled vars whose values we provide.

Definition at line 723 of file Coupleable.h.

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

◆ _coupled_vector_moose_vars

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

Vector of vector coupled variables.

Definition at line 732 of file Coupleable.h.

Referenced by Coupleable(), and getCoupledVectorMooseVars().

◆ _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 762 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 771 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 744 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 759 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 804 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 801 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 750 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 798 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 781 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 922 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 788 of file Coupleable.h.

◆ _second_zero

const VariableSecond& Coupleable::_second_zero
protected

Zero second derivative of a variable.

Definition at line 785 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 792 of file Coupleable.h.

◆ _vector_zero

const VectorVariableValue& Coupleable::_vector_zero
protected

Zero value of a vector variable.

Definition at line 790 of file Coupleable.h.

◆ _zero

const VariableValue& Coupleable::_zero
protected

Zero value of a variable.

Definition at line 777 of file Coupleable.h.


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