www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | 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, bool is_fv=false)
 Constructing the object. More...
 
const std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > & getCoupledVars () const
 Get the list of coupled variables. More...
 
const std::vector< MooseVariableFieldBase * > & 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...
 
const std::vector< ArrayMooseVariable * > & getCoupledArrayMooseVars () const
 Get the list of array coupled variables. More...
 
void addFEVariableCoupleableVectorTag (TagID tag)
 
void addFEVariableCoupleableMatrixTag (TagID tag)
 
std::set< TagID > & getFEVariableCoupleableVectorTags ()
 
std::set< TagID > & getFEVariableCoupleableMatrixTags ()
 
const std::set< TagID > & getFEVariableCoupleableVectorTags () const
 
const std::set< TagID > & getFEVariableCoupleableMatrixTags () const
 
auto & getWritableCoupledVariables () const
 returns a reference to the set of writable coupled variables More...
 
bool hasWritableCoupledVariables () const
 Checks whether the object has any writable coupled variables. More...
 
const ADVariableValuegetADDefaultValue (const std::string &var_name) const
 Helper method to return (and insert if necessary) the default value for Automatic Differentiation for an uncoupled variable. More...
 
const ADVectorVariableValuegetADDefaultVectorValue (const std::string &var_name) const
 Helper method to return (and insert if necessary) the default vector value for Automatic Differentiation for an uncoupled variable. More...
 
const ADVariableGradientgetADDefaultGradient () const
 Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation for an uncoupled variable. More...
 
const ADVectorVariableGradientgetADDefaultVectorGradient () const
 Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation for an uncoupled vector variable. More...
 
const ADVariableSecondgetADDefaultSecond () const
 Helper method to return (and insert if necessary) the default second derivatives for Automatic Differentiation for an uncoupled variable. More...
 

Protected Member Functions

virtual void coupledCallback (const std::string &, bool) const
 A call-back function provided by the derived object for actions before coupling a variable with functions such as coupledValue. More...
 
virtual bool isCoupled (const std::string &var_name, unsigned int i=0) const
 Returns true if a variables has been coupled as name. More...
 
virtual bool isCoupledConstant (const std::string &var_name) const
 Returns true if a variable passed as a coupled value is really a constant. More...
 
unsigned int coupledComponents (const std::string &var_name) const
 Number of coupled components. More...
 
VariableName coupledName (const std::string &var_name, unsigned int comp=0) const
 Names of the variable in the Coupleable interface. More...
 
std::vector< VariableName > coupledNames (const std::string &var_name) const
 Names of the variables in the Coupleable interface. More...
 
virtual unsigned int coupled (const std::string &var_name, unsigned int comp=0) const
 Returns the index for a coupled variable by name. More...
 
std::vector< unsigned intcoupledIndices (const std::string &var_name) const
 Returns the indices for a coupled variable's components. More...
 
virtual const VariableValuecoupledValue (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled variable. More...
 
std::vector< const VariableValue * > coupledValues (const std::string &var_name) const
 Returns the values for all of a coupled variable components. More...
 
std::vector< const VectorVariableValue * > coupledVectorValues (const std::string &var_name) const
 Returns the values for all of a coupled vector variable's components. More...
 
template<bool is_ad>
const GenericVariableValue< is_ad > & coupledGenericValue (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled variable for use in templated automatic differentiation classes. More...
 
template<bool is_ad>
std::vector< const GenericVariableValue< is_ad > * > coupledGenericValues (const std::string &var_name) const
 Returns the values for all of a coupled variable's components for use in templated automatic differentiation classes. More...
 
template<bool is_ad>
const GenericVariableValue< is_ad > & coupledGenericDofValue (const std::string &var_name, unsigned int comp=0) const
 Returns DOF value of a coupled variable for use in templated automatic differentiation classes. More...
 
virtual const VariableValuecoupledValueLower (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled lower-dimensional variable. More...
 
const ADVariableValueadCoupledValue (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled variable for use in Automatic Differentiation. More...
 
std::vector< const ADVariableValue * > adCoupledValues (const std::string &var_name) const
 Returns the values for all of a coupled variable's components for use in Automatic Differentiation. More...
 
const ADVariableValueadCoupledLowerValue (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled lower-dimensional variable for use in Automatic Differentiation. More...
 
const ADVectorVariableValueadCoupledVectorValue (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled vector variable for use in Automatic Differentiation. More...
 
std::vector< const ADVectorVariableValue * > adCoupledVectorValues (const std::string &var_name) const
 Returns the values for all of a coupled vector variable's components for use in Automatic Differentiation. More...
 
virtual const VariableValuecoupledVectorTagValue (const std::string &var_names, TagID tag, unsigned int index=0) const
 Returns value of a coupled variable for a given tag. More...
 
virtual const VariableValuecoupledVectorTagValue (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
std::vector< const VariableValue * > coupledVectorTagValues (const std::string &var_names, TagID tag) const
 Returns the values for all the coupled variables desired for a given tag. More...
 
std::vector< const VariableValue * > coupledVectorTagValues (const std::string &var_names, const std::string &tag_name) const
 
virtual const ArrayVariableValuecoupledVectorTagArrayValue (const std::string &var_names, TagID tag, unsigned int index=0) const
 Returns value of a coupled array variable for a given tag. More...
 
virtual const ArrayVariableValuecoupledVectorTagArrayValue (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
std::vector< const ArrayVariableValue * > coupledVectorTagArrayValues (const std::string &var_names, TagID tag) const
 Returns the values for all the coupled variables desired for a given tag. More...
 
std::vector< const ArrayVariableValue * > coupledVectorTagArrayValues (const std::string &var_names, const std::string &tag_name) const
 
virtual const VariableGradientcoupledVectorTagGradient (const std::string &var_names, TagID tag, unsigned int index=0) const
 Returns gradient of a coupled variable for a given tag. More...
 
virtual const VariableGradientcoupledVectorTagGradient (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
std::vector< const VariableGradient * > coupledVectorTagGradients (const std::string &var_names, TagID tag) const
 Returns gradients for all the coupled variables desired for a given tag. More...
 
std::vector< const VariableGradient * > coupledVectorTagGradients (const std::string &var_names, const std::string &tag_name) const
 
virtual const ArrayVariableGradientcoupledVectorTagArrayGradient (const std::string &var_names, TagID tag, unsigned int index=0) const
 Returns gradient of a coupled array variable for a given tag. More...
 
virtual const ArrayVariableGradientcoupledVectorTagArrayGradient (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
std::vector< const ArrayVariableGradient * > coupledVectorTagArrayGradients (const std::string &var_names, TagID tag) const
 Returns gradients for all the coupled variables desired for a given tag. More...
 
std::vector< const ArrayVariableGradient * > coupledVectorTagArrayGradients (const std::string &var_names, const std::string &tag_name) const
 
virtual const VariableValuecoupledVectorTagDofValue (const std::string &var_name, TagID tag, unsigned int index=0) const
 Returns dof value of a coupled variable for a given tag. More...
 
virtual const VariableValuecoupledVectorTagDofValue (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
const ArrayVariableValuecoupledVectorTagArrayDofValue (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 Returns evaluations of a tagged vector at the requested variable's degree of freedom indices. More...
 
std::vector< const VariableValue * > coupledVectorTagDofValues (const std::string &var_names, TagID tag) const
 Returns the dof values for all the coupled variables desired for a given tag. More...
 
std::vector< const VariableValue * > coupledVectorTagDofValues (const std::string &var_names, const std::string &tag_name) const
 
virtual const VariableValuecoupledMatrixTagValue (const std::string &var_names, TagID tag, unsigned int index=0) const
 Returns value of a coupled variable for a given tag. More...
 
virtual const VariableValuecoupledMatrixTagValue (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
std::vector< const VariableValue * > coupledMatrixTagValues (const std::string &var_names, TagID tag) const
 Returns the diagonal matrix values for all the coupled variables desired for a given tag. More...
 
std::vector< const VariableValue * > coupledMatrixTagValues (const std::string &var_names, const std::string &tag_name) const
 
virtual const VectorVariableValuecoupledVectorValue (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled vector variable. More...
 
virtual const ArrayVariableValuecoupledArrayValue (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled array variable. More...
 
std::vector< const ArrayVariableValue * > coupledArrayValues (const std::string &var_name) const
 Returns the values for all of a coupled array variable's components. More...
 
MooseWritableVariablewritableVariable (const std::string &var_name, unsigned int comp=0)
 Returns a writable MooseVariable object for a nodal or elemental variable. More...
 
virtual VariableValuewritableCoupledValue (const std::string &var_name, unsigned int comp=0)
 Returns a writable reference to a coupled variable for writing to multiple AuxVariables from a single AuxKernel or a UserObject. More...
 
void checkWritableVar (MooseWritableVariable *var)
 Checks that the passed in variable is only accessed writable by one object in a given subdomain. More...
 
virtual const VariableValuecoupledValueOld (const std::string &var_name, unsigned int comp=0) const
 Returns an old value from previous time step of a coupled variable. More...
 
std::vector< const VariableValue * > coupledValuesOld (const std::string &var_name) const
 Returns the old values for all of a coupled variable's components. More...
 
virtual const VariableValuecoupledValueOlder (const std::string &var_name, unsigned int comp=0) const
 Returns an old value from two time steps previous of a coupled variable. More...
 
std::vector< const VariableValue * > coupledValuesOlder (const std::string &var_name) const
 Returns the older values for all of a coupled variable's components. More...
 
virtual const VariableValuecoupledValuePreviousNL (const std::string &var_name, unsigned int comp=0) const
 Returns value of previous Newton iterate of a coupled variable. More...
 
virtual const VectorVariableValuecoupledVectorValueOld (const std::string &var_name, unsigned int comp=0) const
 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) const
 Returns an old value from two time steps previous of a coupled vector variable. More...
 
virtual const ArrayVariableValuecoupledArrayValueOld (const std::string &var_name, unsigned int comp=0) const
 Returns an old value from previous time step of a coupled array variable. More...
 
virtual const ArrayVariableValuecoupledArrayValueOlder (const std::string &var_name, unsigned int comp=0) const
 Returns an old value from two time steps previous of a coupled array variable. More...
 
virtual const VariableGradientcoupledGradient (const std::string &var_name, unsigned int comp=0) const
 Returns gradient of a coupled variable. More...
 
std::vector< const VariableGradient * > coupledGradients (const std::string &var_name) const
 Returns the gradients for all of a coupled variable's components. More...
 
const ADVariableGradientadCoupledGradient (const std::string &var_name, unsigned int comp=0) const
 Returns gradient of a coupled variable for use in Automatic Differentiation. More...
 
const ADVariableGradientadCoupledGradientDot (const std::string &var_name, unsigned int comp=0) const
 Returns gradient of a coupled variable's time derivative for use in Automatic Differentiation. More...
 
std::vector< const ADVariableGradient * > adCoupledGradients (const std::string &var_name) const
 Returns the gradients for all of a coupled variable's components for use in Automatic Differentiation. More...
 
template<bool is_ad>
const GenericVariableGradient< is_ad > & coupledGenericGradient (const std::string &var_name, unsigned int comp=0) const
 Returns gradient of a coupled variable for use in templated automatic differentiation. More...
 
template<bool is_ad>
std::vector< const GenericVariableGradient< is_ad > * > coupledGenericGradients (const std::string &var_name) const
 Returns the gradients for all of a coupled variable's components for use in templated automatic differentiation. More...
 
const ADVectorVariableGradientadCoupledVectorGradient (const std::string &var_name, unsigned int comp=0) const
 Returns gradient of a coupled vector variable for use in Automatic Differentiation. More...
 
const ADVariableSecondadCoupledSecond (const std::string &var_name, unsigned int comp=0) const
 Returns second derivatives of a coupled variable for use in Automatic Differentiation. More...
 
const ADVectorVariableSecondadCoupledVectorSecond (const std::string &var_name, unsigned int comp=0) const
 Returns second derivatives of a coupled vector variable for use in Automatic Differentiation. More...
 
virtual const VariableGradientcoupledGradientOld (const std::string &var_name, unsigned int comp=0) const
 Returns an old gradient from previous time step of a coupled variable. More...
 
std::vector< const VariableGradient * > coupledGradientsOld (const std::string &var_name) const
 Returns the old gradients for all of a coupled variable's components. More...
 
virtual const VariableGradientcoupledGradientOlder (const std::string &var_name, unsigned int comp=0) const
 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) const
 Returns gradient of a coupled variable for previous Newton iterate. More...
 
virtual const VariableGradientcoupledGradientDot (const std::string &var_name, unsigned int comp=0) const
 Time derivative of the gradient of a coupled variable. More...
 
virtual const VariableGradientcoupledGradientDotDot (const std::string &var_name, unsigned int comp=0) const
 Second time derivative of the gradient of a coupled variable. More...
 
virtual const VectorVariableGradientcoupledVectorGradient (const std::string &var_name, unsigned int comp=0) const
 Returns gradient of a coupled vector variable. More...
 
virtual const VectorVariableGradientcoupledVectorGradientOld (const std::string &var_name, unsigned int comp=0) const
 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) const
 Returns an old gradient from two time steps previous of a coupled vector variable. More...
 
virtual const ArrayVariableGradientcoupledArrayGradient (const std::string &var_name, unsigned int comp=0) const
 Returns gradient of a coupled array variable. More...
 
virtual const ArrayVariableGradientcoupledArrayGradientOld (const std::string &var_name, unsigned int comp=0) const
 Returns an old gradient from previous time step of a coupled array variable. More...
 
virtual const ArrayVariableGradientcoupledArrayGradientOlder (const std::string &var_name, unsigned int comp=0) const
 Returns an old gradient from two time steps previous of a coupled array variable. More...
 
virtual const ArrayVariableGradientcoupledArrayGradientDot (const std::string &var_name, unsigned int comp=0) const
 Retun a gradient of a coupled array variable's time derivative. More...
 
virtual const VectorVariableCurlcoupledCurl (const std::string &var_name, unsigned int comp=0) const
 Returns curl of a coupled variable. More...
 
virtual const VectorVariableCurlcoupledCurlOld (const std::string &var_name, unsigned int comp=0) const
 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) const
 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) const
 Returns second spatial derivatives of a coupled variable. More...
 
virtual const VariableSecondcoupledSecondOld (const std::string &var_name, unsigned int comp=0) const
 Returns an old second spatial derivatives from previous time step of a coupled variable. More...
 
virtual const VariableSecondcoupledSecondOlder (const std::string &var_name, unsigned int comp=0) const
 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) const
 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) const
 Time derivative of a coupled variable. More...
 
std::vector< const VariableValue * > coupledDots (const std::string &var_name) const
 Returns the time derivatives for all of a coupled variable's components. More...
 
virtual const VariableValuecoupledDotDot (const std::string &var_name, unsigned int comp=0) const
 Second time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledDotOld (const std::string &var_name, unsigned int comp=0) const
 Old time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledDotDotOld (const std::string &var_name, unsigned int comp=0) const
 Old second time derivative of a coupled variable. More...
 
const ADVariableValueadCoupledDot (const std::string &var_name, unsigned int comp=0) const
 Time derivative of a coupled variable for ad simulations. More...
 
std::vector< const ADVariableValue * > adCoupledDots (const std::string &var_name) const
 Returns the time derivatives for all of a coupled variable's components for ad simulations. More...
 
const ADVariableValueadCoupledDotDot (const std::string &var_name, unsigned int comp=0) const
 Second time derivative of a coupled variable for ad simulations. More...
 
const ADVectorVariableValueadCoupledVectorDot (const std::string &var_name, unsigned int comp=0) const
 Time derivative of a vector coupled variable for ad simulations. More...
 
virtual const VectorVariableValuecoupledVectorDot (const std::string &var_name, unsigned int comp=0) const
 Time derivative of a coupled vector variable. More...
 
virtual const VectorVariableValuecoupledVectorDotDot (const std::string &var_name, unsigned int comp=0) const
 Second time derivative of a coupled vector variable. More...
 
virtual const VectorVariableValuecoupledVectorDotOld (const std::string &var_name, unsigned int comp=0) const
 Old time derivative of a coupled vector variable. More...
 
virtual const VectorVariableValuecoupledVectorDotDotOld (const std::string &var_name, unsigned int comp=0) const
 Old second time derivative of a coupled vector variable. More...
 
virtual const VariableValuecoupledVectorDotDu (const std::string &var_name, unsigned int comp=0) const
 Time derivative of a coupled vector variable with respect to the coefficients. More...
 
virtual const VariableValuecoupledVectorDotDotDu (const std::string &var_name, unsigned int comp=0) const
 Second time derivative of a coupled vector variable with respect to the coefficients. More...
 
virtual const ArrayVariableValuecoupledArrayDot (const std::string &var_name, unsigned int comp=0) const
 Time derivative of a coupled array variable. More...
 
virtual const ArrayVariableValuecoupledArrayDotDot (const std::string &var_name, unsigned int comp=0) const
 Second time derivative of a coupled array variable. More...
 
virtual const ArrayVariableValuecoupledArrayDotOld (const std::string &var_name, unsigned int comp=0) const
 Old time derivative of a coupled array variable. More...
 
virtual const ArrayVariableValuecoupledArrayDotDotOld (const std::string &var_name, unsigned int comp=0) const
 Old second time derivative of a coupled array variable. More...
 
virtual const VariableValuecoupledDotDu (const std::string &var_name, unsigned int comp=0) const
 Time derivative of a coupled variable with respect to the coefficients. More...
 
virtual const VariableValuecoupledDotDotDu (const std::string &var_name, unsigned int comp=0) const
 Second time derivative of a coupled variable with respect to the coefficients. More...
 
const VariableValuecoupledArrayDotDu (const std::string &var_name, unsigned int comp=0) const
 Time derivative of a coupled array variable with respect to the coefficients. More...
 
template<typename T >
const T & coupledNodalValue (const std::string &var_name, unsigned int comp=0) const
 Returns nodal values of a coupled variable. More...
 
template<typename T >
const Moose::ADType< T >::type & adCoupledNodalValue (const std::string &var_name, unsigned int comp=0) const
 Returns AD nodal values of a coupled variable. More...
 
template<typename T >
const T & coupledNodalValueOld (const std::string &var_name, unsigned int comp=0) const
 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) const
 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) const
 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) const
 Nodal values of time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledNodalDotDot (const std::string &var_name, unsigned int comp=0) const
 Nodal values of second time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledNodalDotOld (const std::string &var_name, unsigned int comp=0) const
 Nodal values of old time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledNodalDotDotOld (const std::string &var_name, unsigned int comp=0) const
 Nodal values of old second time derivative of a coupled variable. More...
 
virtual const VariableValuecoupledDofValues (const std::string &var_name, unsigned int comp=0) const
 Returns DoFs in the current solution vector of a coupled variable for the local element. More...
 
std::vector< const VariableValue * > coupledAllDofValues (const std::string &var_name) const
 Returns DoFs in the current solution vector of all of a coupled variable's components for the local element. More...
 
virtual const VariableValuecoupledDofValuesOld (const std::string &var_name, unsigned int comp=0) const
 Returns DoFs in the old solution vector of a coupled variable for the local element. More...
 
std::vector< const VariableValue * > coupledAllDofValuesOld (const std::string &var_name) const
 Returns DoFs in the old solution vector of all of a coupled variable's components for the local element. More...
 
virtual const VariableValuecoupledDofValuesOlder (const std::string &var_name, unsigned int comp=0) const
 Returns DoFs in the older solution vector of a coupled variable for the local element. More...
 
std::vector< const VariableValue * > coupledAllDofValuesOlder (const std::string &var_name) const
 Returns DoFs in the older solution vector of all of a coupled variable's components for the local element. More...
 
virtual const ArrayVariableValuecoupledArrayDofValues (const std::string &var_name, unsigned int comp=0) const
 Returns DoFs in the current solution vector of a coupled array variable for the local element. More...
 
virtual const ADVariableValueadCoupledDofValues (const std::string &var_name, unsigned int comp=0) const
 Returns DOF value of a coupled variable for use in Automatic Differentiation. More...
 
const ADVariableValueadZeroValue () const
 method that returns _zero to RESIDUAL computing objects and _ad_zero to JACOBIAN computing objects More...
 
const ADVariableGradientadZeroGradient () const
 method that returns _grad_zero to RESIDUAL computing objects and _ad_grad_zero to JACOBIAN computing objects More...
 
const ADVariableSecondadZeroSecond () const
 Retrieve a zero second for automatic differentiation. More...
 
template<bool is_ad>
const GenericVariableValue< is_ad > & genericZeroValue ()
 Returns zero value templated with automatic differentiation boolean. More...
 
template<bool is_ad>
const GenericVariableGradient< is_ad > & genericZeroGradient ()
 Returns zero gradient templated with automatic differentiation boolean. More...
 
template<bool is_ad>
const GenericVariableSecond< is_ad > & genericZeroSecond ()
 Returns zero second derivative templated with automatic differentiation boolean. More...
 
bool checkVar (const std::string &var_name, unsigned int comp=0, unsigned int comp_bound=0) const
 Check that the right kind of variable is being coupled in. More...
 
const MooseVariableFieldBasegetFEVar (const std::string &var_name, unsigned int comp) const
 Deprecated method. More...
 
const MooseVariableFieldBasegetFieldVar (const std::string &var_name, unsigned int comp) const
 
MooseVariableFieldBasegetFieldVar (const std::string &var_name, unsigned int comp)
 
template<typename T >
const T * getVarHelper (const std::string &var_name, unsigned int comp) const
 Helper that that be used to retrieve a variable of arbitrary type T. More...
 
template<typename T >
T * getVarHelper (const std::string &var_name, unsigned int comp)
 Helper that can be used to retrieve a variable of arbitrary type T. 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...
 
ArrayMooseVariablegetArrayVar (const std::string &var_name, unsigned int comp)
 Extract pointer to a coupled array variable. More...
 
const MooseVariablegetVar (const std::string &var_name, unsigned int comp) const
 Extract pointer to a coupled variable. More...
 
const VectorMooseVariablegetVectorVar (const std::string &var_name, unsigned int comp) const
 Extract pointer to a coupled vector variable. More...
 
const ArrayMooseVariablegetArrayVar (const std::string &var_name, unsigned int comp) const
 Extract pointer to a coupled array 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<typename T , typename Func >
std::vector< T > coupledVectorHelper (const std::string &var_name, const Func &func) const
 
template<>
const GenericVariableValue< false > & coupledGenericValue (const std::string &var_name, unsigned int comp) const
 
template<>
const GenericVariableValue< true > & coupledGenericValue (const std::string &var_name, unsigned int comp) const
 
template<>
const GenericVariableValue< false > & coupledGenericDofValue (const std::string &var_name, unsigned int comp) const
 
template<>
const GenericVariableValue< true > & coupledGenericDofValue (const std::string &var_name, unsigned int comp) const
 
template<>
const GenericVariableValue< false > & genericZeroValue ()
 
template<>
const GenericVariableValue< true > & genericZeroValue ()
 
template<>
const GenericVariableGradient< false > & genericZeroGradient ()
 
template<>
const GenericVariableGradient< true > & genericZeroGradient ()
 
template<>
const GenericVariableSecond< false > & genericZeroSecond ()
 
template<>
const GenericVariableSecond< true > & genericZeroSecond ()
 
template<>
const GenericVariableGradient< false > & coupledGenericGradient (const std::string &var_name, unsigned int comp) const
 
template<>
const GenericVariableGradient< true > & coupledGenericGradient (const std::string &var_name, unsigned int comp) const
 
template<>
std::vector< const GenericVariableValue< false > * > coupledGenericValues (const std::string &var_name) const
 
template<>
std::vector< const GenericVariableValue< true > * > coupledGenericValues (const std::string &var_name) const
 
template<>
std::vector< const GenericVariableGradient< false > * > coupledGenericGradients (const std::string &var_name) const
 
template<>
std::vector< const GenericVariableGradient< true > * > coupledGenericGradients (const std::string &var_name) const
 

Protected Attributes

const InputParameters_c_parameters
 
const std::string & _c_name
 The name of the object this interface is part of. More...
 
const std::string & _c_type
 The type of the object this interface is part of. More...
 
FEProblemBase_c_fe_problem
 
const SystemBase *const _c_sys
 Pointer to the system object if the moose object this is an interface for has one. More...
 
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
 Coupled vars whose values we provide. More...
 
std::vector< MooseVariableFieldBase * > _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...
 
std::vector< ArrayMooseVariable * > _coupled_array_moose_vars
 Vector of array coupled variables. More...
 
std::vector< MooseVariableFV< Real > * > _coupled_standard_fv_moose_vars
 Vector of standard finite volume coupled variables. More...
 
const std::unordered_map< std::string, std::string > & _new_to_deprecated_coupled_vars
 map from new to deprecated variable names More...
 
bool _c_nodal
 True if we provide coupling to nodal values. More...
 
bool _c_is_implicit
 True if implicit value is required. More...
 
const bool _c_allow_element_to_nodal_coupling
 
THREAD_ID _c_tid
 Thread ID of the thread using this object. More...
 
std::unordered_map< std::string, std::vector< std::unique_ptr< VariableValue > > > _default_value
 Will hold the default value for optional coupled variables. More...
 
std::unordered_map< std::string, std::unique_ptr< MooseArray< DualReal > > > _ad_default_value
 Will hold the default value for optional coupled variables for automatic differentiation. More...
 
std::unordered_map< std::string, std::unique_ptr< VectorVariableValue > > _default_vector_value
 Will hold the default value for optional vector coupled variables. More...
 
std::unordered_map< std::string, std::unique_ptr< ArrayVariableValue > > _default_array_value
 Will hold the default value for optional array coupled variables. More...
 
std::unordered_map< std::string, std::unique_ptr< MooseArray< ADRealVectorValue > > > _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< ADRealVectorValue_ad_default_gradient
 This will always be zero because the default values for optionally coupled variables is always constant. More...
 
MooseArray< ADRealTensorValue_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< ADRealTensorValue_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 VariablePhiValue_phi_zero
 
const MooseArray< DualReal > & _ad_zero
 
const VariableGradient_grad_zero
 Zero gradient of a variable. More...
 
const MooseArray< ADRealVectorValue > & _ad_grad_zero
 
const VariablePhiGradient_grad_phi_zero
 Zero gradient of trial function. More...
 
const VariableSecond_second_zero
 Zero second derivative of a variable. More...
 
const MooseArray< ADRealTensorValue > & _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...
 
ArrayVariableValue _default_array_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...
 
ArrayVariableGradient _default_array_gradient
 This will always be zero because the default values for optionally coupled variables is always constant. More...
 
ArrayVariableCurl _default_array_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 Types

enum  FuncAge { FuncAge::Curr, FuncAge::Old, FuncAge::Older }
 
enum  VarType {
  VarType::Ignore, VarType::Gradient, VarType::Second, VarType::GradientDot,
  VarType::Dot
}
 

Private Member Functions

template<typename T >
const OutputTools< T >::VariableValuevectorTagValueHelper (const std::string &var_names, TagID tag, unsigned int index=0) const
 Generic helper method to get vector tag values based on tag ID. More...
 
template<typename T >
const OutputTools< T >::VariableValuevectorTagValueHelper (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 Generic helper method to get vector tag values based on tag name. More...
 
template<typename T >
const OutputTools< T >::VariableValuevectorTagDofValueHelper (const std::string &var_name, TagID tag, unsigned int comp=0) const
 Generic helper method to get vector tag degree of freedom values based on tag ID. More...
 
template<typename T >
const OutputTools< T >::VariableValuevectorTagDofValueHelper (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 Generic helper method to get vector tag degree of freedom values based on tag name. More...
 
template<typename T >
void requestStates (const std::string &var_name, const TagName &tag_name, const unsigned int comp)
 Method that may request additional solution states from the variable's system depending on the value of tag_name. More...
 
void checkFuncType (const std::string var_name, VarType t, FuncAge age) const
 
const VariableValuegetDefaultValue (const std::string &var_name, unsigned int comp) const
 Helper method to return (and insert if necessary) the default value for an uncoupled variable. More...
 
const VectorVariableValuegetDefaultVectorValue (const std::string &var_name) const
 Helper method to return (and insert if necessary) the default value for an uncoupled vector variable. More...
 
const ArrayVariableValuegetDefaultArrayValue (const std::string &var_name) const
 Helper method to return (and insert if necessary) the default value for an uncoupled array variable. More...
 
template<typename T >
const T & getDefaultNodalValue (const std::string &var_name, unsigned int comp=0) const
 Get nodal default value. More...
 
template<typename T >
const Moose::Functor< T > & getDefaultFunctor (const std::string &var_name) const
 
template<>
const RealVectorValuegetDefaultNodalValue (const std::string &var_name, unsigned int) const
 
template<>
const RealEigenVector & getDefaultNodalValue (const std::string &var_name, unsigned int) const
 

Private Attributes

unsigned int _coupleable_max_qps
 Maximum qps for any element in this system. More...
 
std::unordered_map< std::string, std::vector< unsigned int > > _optional_var_index
 Unique indices for optionally coupled vars that weren't provided. More...
 
std::unordered_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
 
const bool _is_fv
 Whether the MooseObject is a finite volume object. More...
 
const MooseObject *const _obj
 
const std::set< std::string > _older_state_tags
 vector tag names for which we need to request older solution states from the system More...
 
std::vector< std::set< MooseWritableVariable * > > _writable_coupled_variables
 keep a set of allocated writable variable references to make sure only one object can obtain them per thread More...
 

Detailed Description

Interface for objects that needs coupling capabilities.

Definition at line 44 of file Coupleable.h.

Member Enumeration Documentation

◆ FuncAge

enum Coupleable::FuncAge
strongprivate
Enumerator
Curr 
Old 
Older 

Definition at line 1488 of file Coupleable.h.

1489  {
1490  Curr,
1491  Old,
1492  Older,
1493  };

◆ VarType

enum Coupleable::VarType
strongprivate
Enumerator
Ignore 
Gradient 
Second 
GradientDot 
Dot 

Definition at line 1495 of file Coupleable.h.

1496  {
1497  Ignore,
1498  Gradient,
1499  Second,
1500  GradientDot,
1501  Dot,
1502  };
NumberVectorValue Gradient

Constructor & Destructor Documentation

◆ Coupleable()

Coupleable::Coupleable ( const MooseObject moose_object,
bool  nodal,
bool  is_fv = false 
)

Constructing the object.

Parameters
parametersParameters that come from constructing the object
nodaltrue if we need to couple with nodal values, otherwise false
is_fvWhether the MooseObject is a finite volume object

Definition at line 26 of file Coupleable.C.

27  : _c_parameters(moose_object->parameters()),
28  _c_name(_c_parameters.get<std::string>("_object_name")),
29  _c_type(_c_parameters.get<std::string>("_type")),
31  _c_sys(_c_parameters.isParamValid("_sys") ? _c_parameters.get<SystemBase *>("_sys") : nullptr),
33  _c_nodal(nodal),
35  ? _c_parameters.get<bool>("implicit")
36  : true),
38  _c_parameters.have_parameter<bool>("_allow_nodal_to_elemental_coupling")
39  ? _c_parameters.get<bool>("_allow_nodal_to_elemental_coupling")
40  : false),
54  ? _c_parameters.get<bool>("_neighbor")
55  : false),
57  _is_fv(is_fv),
58  _obj(moose_object),
60 {
61  SubProblem & problem = *_c_parameters.getCheckedPointerParam<SubProblem *>("_subproblem");
63 
64  unsigned int optional_var_index_counter = 0;
65 
66  // Coupling
67  for (auto iter = _c_parameters.coupledVarsBegin(); iter != _c_parameters.coupledVarsEnd(); ++iter)
68  {
69  std::string name = *iter;
70 
71  std::vector<std::string> vars = _c_parameters.getVecMooseType(name);
72  if (vars.size() > 0)
73  {
74  for (const auto & coupled_var_name : vars)
75  {
76  if (problem.hasVariable(coupled_var_name))
77  {
78  MooseVariableFieldBase * moose_var =
79  &problem.getVariable(_c_tid,
80  coupled_var_name,
83  _coupled_vars[name].push_back(moose_var);
84  _coupled_moose_vars.push_back(moose_var);
85  if (auto * tmp_var = dynamic_cast<MooseVariable *>(moose_var))
86  _coupled_standard_moose_vars.push_back(tmp_var);
87  else if (auto * tmp_var = dynamic_cast<VectorMooseVariable *>(moose_var))
88  _coupled_vector_moose_vars.push_back(tmp_var);
89  else if (auto * tmp_var = dynamic_cast<ArrayMooseVariable *>(moose_var))
90  _coupled_array_moose_vars.push_back(tmp_var);
91  else if (auto * tmp_var = dynamic_cast<MooseVariableFV<Real> *>(moose_var))
92  {
93  // We are using a finite volume variable through add*CoupledVar as opposed to getFunctor
94  // so we can be reasonably confident that the variable values will be obtained using
95  // traditional pre-evaluation and quadrature point indexing
96  tmp_var->requireQpComputations();
97  _coupled_standard_fv_moose_vars.push_back(tmp_var);
98  }
99  else
100  _obj->paramError(name, "provided c++ type for variable parameter is not supported");
101  }
102  else if (problem.hasScalarVariable(coupled_var_name))
103  {
104  MooseVariableScalar * moose_scalar_var =
105  &problem.getScalarVariable(_c_tid, coupled_var_name);
106  _c_coupled_scalar_vars[name].push_back(moose_scalar_var);
107  }
108  else
109  _obj->paramError(name, "coupled variable '", coupled_var_name, "' was not found");
110  }
111  }
112  else // This means it was optional coupling. Let's assign a unique id to this variable
113  {
115  for (unsigned int j = 0; j < _optional_var_index[name].size(); ++j)
116  _optional_var_index[name][j] =
117  std::numeric_limits<unsigned int>::max() - optional_var_index_counter;
118  ++optional_var_index_counter;
119  }
120  }
121 }
std::string name(const ElemQuality q)
virtual MooseVariableScalar & getScalarVariable(const THREAD_ID tid, const std::string &var_name)=0
Returns the scalar variable reference from whichever system contains it.
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
std::vector< MooseArray< ADRealTensorValue > > _ad_second_zero
const VariableValue & _zero
Zero value of a variable.
Definition: Coupleable.h:1396
const VariablePhiGradient & _grad_phi_zero
Zero gradient of trial function.
Definition: Coupleable.h:1405
const VariablePhiSecond & _second_phi_zero
Zero second derivative of a test function.
Definition: Coupleable.h:1411
unsigned int n_threads()
const VectorVariableValue & _vector_zero
Zero value of a vector variable.
Definition: Coupleable.h:1413
const VariableGradient & _grad_zero
Zero gradient of a variable.
Definition: Coupleable.h:1401
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1324
std::vector< MooseVariableFV< Real > * > _coupled_standard_fv_moose_vars
Vector of standard finite volume coupled variables.
Definition: Coupleable.h:1339
const MooseArray< ADRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:1402
const bool _is_fv
Whether the MooseObject is a finite volume object.
Definition: Coupleable.h:1705
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
std::vector< MooseArray< ADRealVectorValue > > _ad_grad_zero
std::vector< ArrayMooseVariable * > _coupled_array_moose_vars
Vector of array coupled variables.
Definition: Coupleable.h:1336
const VariableSecond & _second_zero
Zero second derivative of a variable.
Definition: Coupleable.h:1408
constexpr std::size_t constMaxQpsPerElem
This is used for places where we initialize some qp-sized data structures that would end up being siz...
Definition: MooseTypes.h:218
const bool _c_allow_element_to_nodal_coupling
Definition: Coupleable.h:1351
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:1354
std::set< std::string >::const_iterator coupledVarsBegin() const
Methods returning iterators to the coupled variables names stored in this InputParameters object...
std::vector< std::set< MooseWritableVariable * > > _writable_coupled_variables
keep a set of allocated writable variable references to make sure only one object can obtain them per...
Definition: Coupleable.h:1714
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _c_coupled_scalar_vars
Scalar variables coupled into this object (for error checking)
Definition: Coupleable.h:1698
std::vector< VariableSecond > _second_zero
std::vector< MooseArray< ADReal > > _ad_zero
std::vector< VectorVariableCurl > _vector_curl_zero
This class provides an interface for common operations on field variables of both FE and FV types wit...
const std::unordered_map< std::string, std::string > & getNewToDeprecatedVarMap() const
Return the new to deprecated variable name map.
Base class for a system (of equations)
Definition: SystemBase.h:84
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Definition: MooseBase.h:45
auto max(const L &left, const R &right)
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Definition: Coupleable.h:1330
unsigned int numberDefaultCoupledValues(const std::string &coupling_name) const
Get the number of defaulted coupled value entries.
const SystemBase *const _c_sys
Pointer to the system object if the moose object this is an interface for has one.
Definition: Coupleable.h:1321
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
const MooseArray< DualReal > & _ad_zero
Definition: Coupleable.h:1398
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
std::vector< VariablePhiGradient > _grad_phi_zero
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
Definition: Coupleable.h:1333
std::set< std::string >::const_iterator coupledVarsEnd() const
virtual bool hasScalarVariable(const std::string &var_name) const =0
Returns a Boolean indicating whether any system contains a variable with the name provided...
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1313
std::vector< VariablePhiSecond > _second_phi_zero
void paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
virtual const MooseVariableFieldBase & getVariable(const 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) const =0
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
virtual bool hasVariable(const std::string &var_name) const =0
Whether or not this problem has the variable.
const VectorVariableCurl & _vector_curl_zero
Zero value of the curl of a vector variable.
Definition: Coupleable.h:1415
const MooseObject *const _obj
Definition: Coupleable.h:1707
bool have_parameter(std::string_view name) const
A wrapper around the Parameters base class method.
std::vector< MooseVariableFieldBase * > _coupled_moose_vars
Vector of all coupled variables.
Definition: Coupleable.h:1327
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:1614
std::vector< VariablePhiValue > _phi_zero
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:75
const std::string & _c_type
The type of the object this interface is part of.
Definition: Coupleable.h:1315
const MooseArray< ADRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:1409
std::vector< VariableGradient > _grad_zero
const VariablePhiValue & _phi_zero
Definition: Coupleable.h:1397
Class for scalar variables (they are different).
std::vector< VariableValue > _zero
std::unordered_map< std::string, std::vector< unsigned int > > _optional_var_index
Unique indices for optionally coupled vars that weren&#39;t provided.
Definition: Coupleable.h:1695
const InputParameters & parameters() const
Get the parameters of the object.
std::vector< VectorVariableValue > _vector_zero
const InputParameters & _c_parameters
Definition: Coupleable.h:1310
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692
std::vector< std::string > getVecMooseType(const std::string &name) const
void registerInterfaceObject(T &interface)
Registers an interface object for accessing with getInterfaceObjects.
Definition: MooseApp.h:1504
unsigned int THREAD_ID
Definition: MooseTypes.h:198
const std::unordered_map< std::string, std::string > & _new_to_deprecated_coupled_vars
map from new to deprecated variable names
Definition: Coupleable.h:1342
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

Member Function Documentation

◆ adCoupledDofValues()

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

Returns DOF 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 an ADVariableValue for the DoFs of the coupled variable

Definition at line 2000 of file Coupleable.C.

2001 {
2002  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2003 
2004  if (!var)
2005  return *getADDefaultValue(var_name);
2007 
2008  if (!_c_is_implicit)
2009  mooseError("Not implemented");
2010 
2011  if (!_coupleable_neighbor)
2012  return var->adDofValues();
2013  return var->adDofValuesNeighbor();
2014 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
const ADVariableValue * getADDefaultValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for Automatic Differentiation for...
Definition: Coupleable.C:2234
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:1614

◆ adCoupledDot()

const ADVariableValue & Coupleable::adCoupledDot ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 2150 of file Coupleable.C.

Referenced by adCoupledDots().

2151 {
2152  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2153 
2154  if (!var)
2155  return *getADDefaultValue(var_name);
2157 
2158  if (_c_nodal)
2159  mooseError("Not implemented");
2160 
2161  if (!_coupleable_neighbor)
2162  return var->adUDot();
2163  return var->adUDotNeighbor();
2164 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
const ADVariableValue * getADDefaultValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for Automatic Differentiation for...
Definition: Coupleable.C:2234
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:1614

◆ adCoupledDotDot()

const ADVariableValue & Coupleable::adCoupledDotDot ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protected

Second 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 an ADVariableValue containing the second time derivative of the coupled variable

Definition at line 2167 of file Coupleable.C.

2168 {
2169  const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2170 
2171  if (!var)
2172  return *getADDefaultValue(var_name);
2174 
2175  if (_c_nodal)
2176  mooseError("Not implemented");
2177 
2178  if (!_coupleable_neighbor)
2179  return var->adUDotDot();
2180  return var->adUDotDotNeighbor();
2181 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
const ADVariableValue * getADDefaultValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for Automatic Differentiation for...
Definition: Coupleable.C:2234
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:1614

◆ adCoupledDots()

std::vector< const ADVariableValue * > Coupleable::adCoupledDots ( const std::string &  var_name) const
protected

Returns the time derivatives for all of a coupled variable's components for ad simulations.

Parameters
var_nameName of coupled variable
Returns
Vector of VariableValue pointers for each component of var_name

Definition at line 2632 of file Coupleable.C.

2633 {
2634  auto func = [this, &var_name](unsigned int comp) { return &adCoupledDot(var_name, comp); };
2635  return coupledVectorHelper<const ADVariableValue *>(var_name, func);
2636 }
const ADVariableValue & adCoupledDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled variable for ad simulations.
Definition: Coupleable.C:2150

◆ adCoupledGradient()

const ADVariableGradient & Coupleable::adCoupledGradient ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protected

Returns gradient 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 an ADVariableGradient containing the gradient of the coupled variable
See also
Kernel::gradient

Definition at line 2091 of file Coupleable.C.

Referenced by adCoupledGradients().

2092 {
2093  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2094 
2095  if (!var)
2096  return getADDefaultGradient();
2098 
2099  if (!_c_is_implicit)
2100  mooseError("Not implemented");
2101 
2102  if (!_coupleable_neighbor)
2103  return var->adGradSln();
2104  return var->adGradSlnNeighbor();
2105 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
const ADVariableGradient & getADDefaultGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
Definition: Coupleable.C:2265
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
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:1614

◆ adCoupledGradientDot()

const ADVariableGradient & Coupleable::adCoupledGradientDot ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protected

Returns gradient of a coupled variable's time derivative for use in Automatic Differentiation.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to an ADVariableGradient containing the gradient of the coupled variable's time derivative

Definition at line 2108 of file Coupleable.C.

2109 {
2110  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2111 
2112  if (!var)
2113  return getADDefaultGradient();
2115 
2116  if (!_c_is_implicit)
2117  mooseError("Not implemented");
2118 
2119  if (!_coupleable_neighbor)
2120  return var->adGradSlnDot();
2121  return var->adGradSlnNeighborDot();
2122 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
const ADVariableGradient & getADDefaultGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
Definition: Coupleable.C:2265
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
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:1614

◆ adCoupledGradients()

std::vector< const ADVariableGradient * > Coupleable::adCoupledGradients ( const std::string &  var_name) const
protected

Returns the gradients for all of a coupled variable's components for use in Automatic Differentiation.

Parameters
var_nameName of coupled variable
Returns
Vector of ADVariableGradient pointers for each component of var_name

Definition at line 2611 of file Coupleable.C.

2612 {
2613  auto func = [this, &var_name](unsigned int comp) { return &adCoupledGradient(var_name, comp); };
2614  return coupledVectorHelper<const ADVariableGradient *>(var_name, func);
2615 }
const ADVariableGradient & adCoupledGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable for use in Automatic Differentiation.
Definition: Coupleable.C:2091

◆ adCoupledLowerValue()

const ADVariableValue & Coupleable::adCoupledLowerValue ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protected

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

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

Definition at line 2073 of file Coupleable.C.

2074 {
2075  auto var = getVarHelper<MooseVariableFE<Real>>(var_name, comp);
2076 
2077  if (!var)
2078  return *getADDefaultValue(var_name);
2080 
2081  if (!_c_is_implicit)
2082  mooseError("adCoupledLowerValue cannot be called in a coupleable neighbor object");
2083 
2084  if (_c_nodal)
2085  return var->adDofValues();
2086  else
2087  return var->adSlnLower();
2088 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
const ADVariableValue * getADDefaultValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for Automatic Differentiation for...
Definition: Coupleable.C:2234

◆ adCoupledNodalValue()

template<typename T >
template const ADRealVectorValue & Coupleable::adCoupledNodalValue< RealVectorValue > ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 2031 of file Coupleable.C.

2032 {
2033  static const typename Moose::ADType<T>::type zero = 0;
2034  if (!isCoupled(var_name))
2035  return zero;
2036 
2037  if (!_c_nodal)
2038  mooseError("The adCoupledNodalValue method should only be called for nodal computing objects");
2040  mooseError(
2041  "The adCoupledNodalValue method shouldn't be called for neighbor computing objects. I "
2042  "don't even know what that would mean, although maybe someone could explain it to me.");
2043  if (!_c_is_implicit)
2044  mooseError("If you're going to use an explicit scheme, then use coupledNodalValue instead of "
2045  "adCoupledNodalValue");
2046 
2047  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
2048 
2049  return var->adNodalValue();
2050 }
virtual bool isCoupled(const std::string &var_name, unsigned int i=0) const
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:124
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
const Number zero
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
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:1614

◆ adCoupledSecond()

const ADVariableSecond & Coupleable::adCoupledSecond ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protected

Returns second derivatives 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 VariableSecond containing the second derivatives of the coupled variable

Definition at line 2125 of file Coupleable.C.

2126 {
2127  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2128 
2129  if (!var)
2130  return getADDefaultSecond();
2132 
2133  if (!_c_is_implicit)
2134  mooseError("Not implemented");
2135 
2136  if (!_coupleable_neighbor)
2137  return var->adSecondSln();
2138  else
2139  return var->adSecondSlnNeighbor();
2140 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
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:1614
const ADVariableSecond & getADDefaultSecond() const
Helper method to return (and insert if necessary) the default second derivatives for Automatic Differ...
Definition: Coupleable.C:2279

◆ adCoupledValue()

const ADVariableValue & Coupleable::adCoupledValue ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 ADVariableValue for the coupled variable

Definition at line 2053 of file Coupleable.C.

Referenced by adCoupledValues().

2054 {
2055  const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2056 
2057  if (!var)
2058  return *getADDefaultValue(var_name);
2060 
2061  if (!_c_is_implicit)
2062  mooseError("Not implemented");
2063 
2064  if (_c_nodal)
2065  return var->adDofValues();
2066 
2067  if (!_coupleable_neighbor)
2068  return var->adSln();
2069  return var->adSlnNeighbor();
2070 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
const ADVariableValue * getADDefaultValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for Automatic Differentiation for...
Definition: Coupleable.C:2234
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:1614

◆ adCoupledValues()

std::vector< const ADVariableValue * > Coupleable::adCoupledValues ( const std::string &  var_name) const
protected

Returns the values for all of a coupled variable's components for use in Automatic Differentiation.

Parameters
var_nameName of coupled variable
Returns
Vector of ADVariableValue pointers for each component of var_name

Definition at line 2422 of file Coupleable.C.

2423 {
2424  auto func = [this, &var_name](unsigned int comp) { return &adCoupledValue(var_name, comp); };
2425  return coupledVectorHelper<const ADVariableValue *>(var_name, func);
2426 }
const ADVariableValue & adCoupledValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled variable for use in Automatic Differentiation.
Definition: Coupleable.C:2053

◆ adCoupledVectorDot()

const ADVectorVariableValue & Coupleable::adCoupledVectorDot ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protected

Time derivative of a vector coupled variable for ad simulations.

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

Definition at line 2184 of file Coupleable.C.

2185 {
2186  const auto * var = getVectorVar(var_name, comp);
2187  if (!var)
2188  return *getADDefaultVectorValue(var_name);
2190 
2191  if (_c_nodal)
2192  mooseError("Not implemented");
2193 
2194  if (!_coupleable_neighbor)
2195  return var->adUDot();
2196  return var->adUDotNeighbor();
2197 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
const ADVectorVariableValue * getADDefaultVectorValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default vector value for Automatic Differentiat...
Definition: Coupleable.C:2248
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
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:1614

◆ adCoupledVectorGradient()

const ADVectorVariableGradient & Coupleable::adCoupledVectorGradient ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protected

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

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

2219 {
2220  const auto * var = getVectorVar(var_name, comp);
2221  if (!var)
2222  return getADDefaultVectorGradient();
2224 
2225  if (!_c_is_implicit)
2226  mooseError("Not implemented");
2227 
2228  if (!_coupleable_neighbor)
2229  return var->adGradSln();
2230  return var->adGradSlnNeighbor();
2231 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
const ADVectorVariableGradient & getADDefaultVectorGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
Definition: Coupleable.C:2272
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:1614

◆ adCoupledVectorSecond()

const ADVectorVariableSecond& Coupleable::adCoupledVectorSecond ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protected

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

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

◆ adCoupledVectorValue()

const ADVectorVariableValue & Coupleable::adCoupledVectorValue ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 2200 of file Coupleable.C.

Referenced by adCoupledVectorValues().

2201 {
2202  const auto * var = getVectorVar(var_name, comp);
2203  if (!var)
2204  return *getADDefaultVectorValue(var_name);
2206 
2207  if (_c_nodal)
2208  mooseError("Not implemented");
2209  if (!_c_is_implicit)
2210  mooseError("Not implemented");
2211 
2212  if (!_coupleable_neighbor)
2213  return var->adSln();
2214  return var->adSlnNeighbor();
2215 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
const ADVectorVariableValue * getADDefaultVectorValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default vector value for Automatic Differentiat...
Definition: Coupleable.C:2248
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
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:1614

◆ adCoupledVectorValues()

std::vector< const ADVectorVariableValue * > Coupleable::adCoupledVectorValues ( const std::string &  var_name) const
protected

Returns the values for all of a coupled vector variable's components for use in Automatic Differentiation.

Parameters
var_nameName of coupled variable
Returns
Vector of ADVariableValue pointers for each component of var_name

Definition at line 2429 of file Coupleable.C.

2430 {
2431  auto func = [this, &var_name](unsigned int comp)
2432  { return &adCoupledVectorValue(var_name, comp); };
2433  return coupledVectorHelper<const ADVectorVariableValue *>(var_name, func);
2434 }
const ADVectorVariableValue & adCoupledVectorValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled vector variable for use in Automatic Differentiation.
Definition: Coupleable.C:2200

◆ addFEVariableCoupleableMatrixTag()

void Coupleable::addFEVariableCoupleableMatrixTag ( TagID  tag)
inline

Definition at line 103 of file Coupleable.h.

Referenced by coupledMatrixTagValue().

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

◆ addFEVariableCoupleableVectorTag()

void Coupleable::addFEVariableCoupleableVectorTag ( TagID  tag)
inline

Definition at line 101 of file Coupleable.h.

Referenced by coupledVectorTagArrayGradient(), coupledVectorTagGradient(), vectorTagDofValueHelper(), and vectorTagValueHelper().

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

◆ adZeroGradient()

const ADVariableGradient & Coupleable::adZeroGradient ( ) const
protected

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

Definition at line 2293 of file Coupleable.C.

2294 {
2295  mooseDeprecated("Method adZeroGradient() is deprecated. Use '_ad_grad_zero' instead.");
2296  return _ad_grad_zero;
2297 }
const MooseArray< ADRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:1402
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:313

◆ adZeroSecond()

const ADVariableSecond & Coupleable::adZeroSecond ( ) const
protected

Retrieve a zero second for automatic differentiation.

Definition at line 2300 of file Coupleable.C.

2301 {
2302  mooseDeprecated("Method adZeroSecond() is deprecated. Use '_ad_second_zero' instead.");
2303  return _ad_second_zero;
2304 }
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:313
const MooseArray< ADRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:1409

◆ adZeroValue()

const ADVariableValue & Coupleable::adZeroValue ( ) const
protected

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

Definition at line 2286 of file Coupleable.C.

2287 {
2288  mooseDeprecated("Method adZeroValue() is deprecated. Use '_ad_zero' instead.");
2289  return _ad_zero;
2290 }
const MooseArray< DualReal > & _ad_zero
Definition: Coupleable.h:1398
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:313

◆ checkFuncType()

void Coupleable::checkFuncType ( const std::string  var_name,
VarType  t,
FuncAge  age 
) const
private

Definition at line 187 of file Coupleable.C.

Referenced by adCoupledDofValues(), adCoupledDot(), adCoupledDotDot(), adCoupledGradient(), adCoupledGradientDot(), adCoupledLowerValue(), adCoupledSecond(), adCoupledValue(), adCoupledVectorDot(), adCoupledVectorGradient(), adCoupledVectorValue(), coupled(), coupledArrayDofValues(), coupledArrayDot(), coupledArrayDotDot(), coupledArrayDotDotOld(), coupledArrayDotDu(), coupledArrayDotOld(), coupledArrayGradient(), coupledArrayGradientDot(), coupledArrayGradientOld(), coupledArrayGradientOlder(), coupledArrayValue(), coupledArrayValueOld(), coupledArrayValueOlder(), 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(), coupledValueLower(), coupledValueOld(), coupledValueOlder(), coupledValuePreviousNL(), coupledVectorDot(), coupledVectorDotDot(), coupledVectorDotDotDu(), coupledVectorDotDotOld(), coupledVectorDotDu(), coupledVectorDotOld(), coupledVectorGradient(), coupledVectorGradientOld(), coupledVectorGradientOlder(), coupledVectorTagArrayGradient(), coupledVectorTagGradient(), coupledVectorValue(), coupledVectorValueOld(), coupledVectorValueOlder(), vectorTagDofValueHelper(), and vectorTagValueHelper().

188 {
189  if (t == VarType::Gradient && _c_nodal)
190  mooseError(_c_name, ": nodal variables do not have gradients at nodes");
191 
192  if (age == FuncAge::Old || age == FuncAge::Older || t == VarType::GradientDot ||
193  t == VarType::Dot)
194  validateExecutionerType(var_name, "coupled[Vector][Gradient/Dot]Old[er]");
195  if (age == FuncAge::Older && !_c_is_implicit)
196  mooseError("object '",
197  _c_name,
198  "' uses older variable values that are unavailable with explicit schemes");
199 
200  coupledCallback(var_name, age == FuncAge::Old || age == FuncAge::Older);
201 }
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:2017
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
virtual void coupledCallback(const std::string &, bool) const
A call-back function provided by the derived object for actions before coupling a variable with funct...
Definition: Coupleable.h:134
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1313

◆ checkVar()

bool Coupleable::checkVar ( const std::string &  var_name,
unsigned int  comp = 0,
unsigned int  comp_bound = 0 
) const
protected

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

Parameters
var_nameThe name of the coupled variable

Definition at line 204 of file Coupleable.C.

Referenced by getVarHelper().

207 {
208  const auto var_name = _c_parameters.checkForRename(var_name_in);
209  auto it = _c_coupled_scalar_vars.find(var_name);
210  if (it != _c_coupled_scalar_vars.end())
211  {
212  std::string cvars;
213  for (auto jt : it->second)
214  cvars += " " + jt->name();
215 
216  _obj->paramError(var_name,
217  "cannot couple '",
218  var_name,
219  "' to a scalar variable (",
220  cvars,
221  ") where field variable is expected");
222  }
223 
224  if (!isCoupled(var_name, comp))
225  return false; // return false since variable is *not* coupled
226 
227  auto vars_vector_it = _coupled_vars.find(var_name);
228  if (vars_vector_it == _coupled_vars.end())
229  mooseError(_c_name, ": Trying to get a coupled var ", var_name, " that doesn't exist");
230 
231  const auto & vars_vector = vars_vector_it->second;
232 
233  auto bound = comp_bound ? comp_bound : vars_vector.size();
234  checkComponent(_obj, comp, bound, var_name);
235 
236  // We should know we have a variable now
237  const auto * var = vars_vector[comp];
238  if (!var)
239  mooseError(
240  _c_name,
241  ": We did all our checks for the existence of a var, yet we still don't have a var!?");
242 
243  // Only perform the following checks for objects that feed into residuals/Jacobians, e.g. objects
244  // that inherit from the TaggingInterface
245  if (_c_parameters.have_parameter<MultiMooseEnum>("vector_tags"))
246  {
247  // Are we attempting to couple to a non-FV var in an FV object?
248  if (!var->isFV() && _is_fv)
249  mooseError("Attempting to couple non-FV variable ",
250  var->name(),
251  " into an FV object ",
252  _c_name,
253  ". This is not currently supported");
254  }
255 
256  if (!(vars_vector[comp])->isNodal() && _c_nodal && !_c_allow_element_to_nodal_coupling)
257  mooseError(_c_name, ": cannot couple elemental variables into nodal objects");
258 
259  return true;
260 }
virtual bool isCoupled(const std::string &var_name, unsigned int i=0) const
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:124
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1324
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
const bool _is_fv
Whether the MooseObject is a finite volume object.
Definition: Coupleable.h:1705
const bool _c_allow_element_to_nodal_coupling
Definition: Coupleable.h:1351
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _c_coupled_scalar_vars
Scalar variables coupled into this object (for error checking)
Definition: Coupleable.h:1698
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1313
void paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
const MooseObject *const _obj
Definition: Coupleable.h:1707
bool have_parameter(std::string_view name) const
A wrapper around the Parameters base class method.
void checkComponent(const MooseObject *obj, unsigned int comp, unsigned int bound, const std::string &var_name)
Definition: Coupleable.C:173
std::string checkForRename(const std::string &name) const
Checks whether the provided name is a renamed parameter name.
const InputParameters & _c_parameters
Definition: Coupleable.h:1310
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...

◆ checkWritableVar()

void Coupleable::checkWritableVar ( MooseWritableVariable var)
protected

Checks that the passed in variable is only accessed writable by one object in a given subdomain.

Definition at line 932 of file Coupleable.C.

Referenced by writableCoupledValue(), and writableVariable().

933 {
934  // check domain restrictions for compatibility
935  const auto * br = dynamic_cast<const BlockRestrictable *>(this);
936  const auto * nfc = dynamic_cast<const NodeFaceConstraint *>(this);
937 
938  if (br && !var->hasBlocks(br->blockIDs()))
939  mooseError("The variable '",
940  var->name(),
941  "' must be defined on all blocks '",
942  _obj->name(),
943  "' is defined on.");
944 
945  if (nfc && !var->hasBlocks(nfc->getSecondaryConnectedBlocks()))
946  mooseError("The variable '",
947  var->name(),
948  " must be defined on all blocks '",
949  _obj->name(),
950  "'s secondary surface is defined on.");
951 
952  // make sure only one object can access a variable
953  for (const auto & ci : _obj->getMooseApp().getInterfaceObjects<Coupleable>())
954  if (ci != this && ci->_writable_coupled_variables[_c_tid].count(var))
955  {
956  // if both this and ci are block restrictable then we check if the block restrictions
957  // are not overlapping. If they don't we permit the call.
958  const auto * br_other = dynamic_cast<const BlockRestrictable *>(ci);
959  if (br && br_other && br->blockRestricted() && br_other->blockRestricted() &&
960  !MooseUtils::setsIntersect(br->blockIDs(), br_other->blockIDs()))
961  continue;
962  else if (nfc)
963  continue;
964 
965  mooseError("'",
966  ci->_obj->name(),
967  "' already obtained a writable reference to '",
968  var->name(),
969  "'. Only one object can obtain such a reference per variable and subdomain in a "
970  "simulation.");
971  }
972 
973  // var is unique across threads, so we could forego having a separate set per thread, but we
974  // need quick access to the list of all variables that need to be inserted into the solution
975  // vector by a given thread.
976 
977  _writable_coupled_variables[_c_tid].insert(var);
978 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
bool setsIntersect(InputIterator first1, InputIterator last1, InputIterator first2, InputIterator last2)
This method detects whether two sets intersect without building a result set.
Definition: MooseUtils.h:1172
const std::string & name() const override
Get the variable name.
THREAD_ID _c_tid
Thread ID of the thread using this object.
Definition: Coupleable.h:1354
std::vector< std::set< MooseWritableVariable * > > _writable_coupled_variables
keep a set of allocated writable variable references to make sure only one object can obtain them per...
Definition: Coupleable.h:1714
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Definition: MooseBase.h:45
A NodeFaceConstraint is used when you need to create constraints between two surfaces in a mesh...
const MooseObject *const _obj
Definition: Coupleable.h:1707
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:44
bool hasBlocks(const SubdomainID id) const override
Returns whether the functor is defined on this block.
An interface that restricts an object to subdomains via the &#39;blocks&#39; input parameter.
const std::vector< T * > & getInterfaceObjects() const
Gets the registered interface objects for a given interface.
Definition: MooseApp.h:1526

◆ coupled()

unsigned int Coupleable::coupled ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 437 of file Coupleable.C.

Referenced by coupledIndices(), FunctionMaterialBase< is_ad >::FunctionMaterialBase(), and KernelBase::KernelBase().

438 {
439  const auto * var = getFieldVar(var_name, comp);
440  if (!var)
441  {
442  mooseAssert(_optional_var_index.find(var_name) != _optional_var_index.end(),
443  "optional var index for " << var_name << " does not exist!");
444  // make sure we don't try to access default var ids that were not provided
445  checkComponent(_obj, comp, _optional_var_index.at(var_name).size(), var_name);
446  return _optional_var_index.at(var_name)[comp];
447  }
449 
450  if (var->kind() == Moose::VAR_NONLINEAR &&
451  // are we not an object that feeds into the nonlinear system?
453  // are we an object that impacts the nonlinear system and this variable is within our
454  // nonlinear system?
455  var->sys().number() == _c_sys->number()))
456  return var->number();
457  else
458  // Avoid registering coupling to variables outside of our system (e.g. avoid potentially
459  // creating bad Jacobians)
460  return std::numeric_limits<unsigned int>::max() - var->number();
461 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
auto max(const L &left, const R &right)
const SystemBase *const _c_sys
Pointer to the system object if the moose object this is an interface for has one.
Definition: Coupleable.h:1321
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1125
const MooseObject *const _obj
Definition: Coupleable.h:1707
void checkComponent(const MooseObject *obj, unsigned int comp, unsigned int bound, const std::string &var_name)
Definition: Coupleable.C:173
std::unordered_map< std::string, std::vector< unsigned int > > _optional_var_index
Unique indices for optionally coupled vars that weren&#39;t provided.
Definition: Coupleable.h:1695
Moose::VarKindType varKind() const
Definition: SystemBase.h:916
const MooseVariableFieldBase * getFieldVar(const std::string &var_name, unsigned int comp) const
Definition: Coupleable.C:277

◆ coupledAllDofValues()

std::vector< const VariableValue * > Coupleable::coupledAllDofValues ( const std::string &  var_name) const
protected

Returns DoFs in the current solution vector of all of a coupled variable's components for the local element.

Parameters
var_nameName of coupled variable
Returns
Vector of VariableValue pointers for each component of the coupled variable

Definition at line 1939 of file Coupleable.C.

1940 {
1941  auto func = [this, &var_name](unsigned int comp) { return &coupledDofValues(var_name, comp); };
1942  return coupledVectorHelper<const VariableValue *>(var_name, func);
1943 }
virtual const VariableValue & coupledDofValues(const std::string &var_name, unsigned int comp=0) const
Returns DoFs in the current solution vector of a coupled variable for the local element.
Definition: Coupleable.C:1926

◆ coupledAllDofValuesOld()

std::vector< const VariableValue * > Coupleable::coupledAllDofValuesOld ( const std::string &  var_name) const
protected

Returns DoFs in the old solution vector of all of a coupled variable's components for the local element.

Parameters
var_nameName of coupled variable
Returns
Vector of VariableValue pointers for each compontnet of the coupled variable

Definition at line 1959 of file Coupleable.C.

1960 {
1961  auto func = [this, &var_name](unsigned int comp) { return &coupledDofValuesOld(var_name, comp); };
1962  return coupledVectorHelper<const VariableValue *>(var_name, func);
1963 }
virtual const VariableValue & coupledDofValuesOld(const std::string &var_name, unsigned int comp=0) const
Returns DoFs in the old solution vector of a coupled variable for the local element.
Definition: Coupleable.C:1946

◆ coupledAllDofValuesOlder()

std::vector< const VariableValue * > Coupleable::coupledAllDofValuesOlder ( const std::string &  var_name) const
protected

Returns DoFs in the older solution vector of all of a coupled variable's components for the local element.

Parameters
var_nameName of coupled variable
Returns
Vector of VariableValue pointers for each component of the coupled variable

Definition at line 1979 of file Coupleable.C.

1980 {
1981  auto func = [this, &var_name](unsigned int comp)
1982  { return &coupledDofValuesOlder(var_name, comp); };
1983  return coupledVectorHelper<const VariableValue *>(var_name, func);
1984 }
virtual const VariableValue & coupledDofValuesOlder(const std::string &var_name, unsigned int comp=0) const
Returns DoFs in the older solution vector of a coupled variable for the local element.
Definition: Coupleable.C:1966

◆ coupledArrayDofValues()

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

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

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

Definition at line 1987 of file Coupleable.C.

1988 {
1989  const auto * var = getArrayVar(var_name, comp);
1990  if (!var)
1991  return *getDefaultArrayValue(var_name);
1993 
1994  if (!_coupleable_neighbor)
1995  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
1996  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
1997 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
const ArrayVariableValue * getDefaultArrayValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for an uncoupled array variable...
Definition: Coupleable.C:392
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
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:1614
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:301

◆ coupledArrayDot()

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

Time derivative of a coupled array variable.

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

Definition at line 1314 of file Coupleable.C.

1315 {
1316  const auto * var = getArrayVar(var_name, comp);
1317  if (!var)
1320 
1321  if (!_coupleable_neighbor)
1322  {
1323  if (_c_nodal)
1324  return var->dofValuesDot();
1325  return var->uDot();
1326  }
1327  else
1328  {
1329  if (_c_nodal)
1330  return var->dofValuesDotNeighbor();
1331  return var->uDotNeighbor();
1332  }
1333 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
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:1614
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:301
ArrayVariableValue _default_array_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1433

◆ coupledArrayDotDot()

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

Second time derivative of a coupled array variable.

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

Definition at line 1336 of file Coupleable.C.

1337 {
1338  const auto * var = getArrayVar(var_name, comp);
1339  if (!var)
1342 
1343  if (!_coupleable_neighbor)
1344  {
1345  if (_c_nodal)
1346  return var->dofValuesDotDot();
1347  return var->uDotDot();
1348  }
1349  else
1350  {
1351  if (_c_nodal)
1352  return var->dofValuesDotDotNeighbor();
1353  return var->uDotDotNeighbor();
1354  }
1355 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
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:1614
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:301
ArrayVariableValue _default_array_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1433

◆ coupledArrayDotDotOld()

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

Old second time derivative of a coupled array variable.

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

Definition at line 1380 of file Coupleable.C.

1381 {
1382  const auto * var = getArrayVar(var_name, comp);
1383  if (!var)
1386 
1387  if (!_coupleable_neighbor)
1388  {
1389  if (_c_nodal)
1390  return var->dofValuesDotDotOld();
1391  return var->uDotDotOld();
1392  }
1393  else
1394  {
1395  if (_c_nodal)
1396  return var->dofValuesDotDotOldNeighbor();
1397  return var->uDotDotOldNeighbor();
1398  }
1399 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
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:1614
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:301
ArrayVariableValue _default_array_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1433

◆ coupledArrayDotDu()

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

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

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

Definition at line 1452 of file Coupleable.C.

1453 {
1454  const auto * const var = getArrayVar(var_name, comp);
1455  if (!var)
1456  {
1458  return _default_value_zero;
1459  }
1461 
1462  if (!_coupleable_neighbor)
1463  {
1464  if (_c_nodal)
1465  return var->dofValuesDuDotDu();
1466  return var->duDotDu();
1467  }
1468  else
1469  {
1470  if (_c_nodal)
1471  return var->dofValuesDuDotDuNeighbor();
1472  return var->duDotDuNeighbor();
1473  }
1474 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1378
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:1614
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:301
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:213
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledArrayDotOld()

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

Old time derivative of a coupled array variable.

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

Definition at line 1358 of file Coupleable.C.

1359 {
1360  const auto * var = getArrayVar(var_name, comp);
1361  if (!var)
1364 
1365  if (!_coupleable_neighbor)
1366  {
1367  if (_c_nodal)
1368  return var->dofValuesDotOld();
1369  return var->uDotOld();
1370  }
1371  else
1372  {
1373  if (_c_nodal)
1374  return var->dofValuesDotOldNeighbor();
1375  return var->uDotOldNeighbor();
1376  }
1377 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
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:1614
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:301
ArrayVariableValue _default_array_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1433

◆ coupledArrayGradient()

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

Returns gradient of a coupled array variable.

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

Definition at line 1622 of file Coupleable.C.

1623 {
1624  const auto * var = getArrayVar(var_name, comp);
1625  if (!var)
1626  return _default_array_gradient;
1628 
1629  if (!_coupleable_neighbor)
1630  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
1631  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
1632 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
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:1614
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:301
ArrayVariableGradient _default_array_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1436

◆ coupledArrayGradientDot()

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

Retun a gradient of a coupled array variable's time derivative.

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

Definition at line 1661 of file Coupleable.C.

1662 {
1663  const auto * const var = getArrayVar(var_name, comp);
1664  if (!var)
1665  return _default_array_gradient;
1667 
1668  if (!_coupleable_neighbor)
1669  return var->gradSlnDot();
1670  return var->gradSlnNeighborDot();
1671 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
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:1614
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:301
ArrayVariableGradient _default_array_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1436

◆ coupledArrayGradientOld()

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

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

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

Definition at line 1635 of file Coupleable.C.

1636 {
1637  const auto * var = getArrayVar(var_name, comp);
1638  if (!var)
1639  return _default_array_gradient;
1641 
1642  if (!_coupleable_neighbor)
1643  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
1644  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
1645 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
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:1614
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:301
ArrayVariableGradient _default_array_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1436

◆ coupledArrayGradientOlder()

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

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

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

Definition at line 1648 of file Coupleable.C.

1649 {
1650  const auto * var = getArrayVar(var_name, comp);
1651  if (!var)
1652  return _default_array_gradient;
1654 
1655  if (!_coupleable_neighbor)
1656  return var->gradSlnOlder();
1657  return var->gradSlnOlderNeighbor();
1658 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
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:1614
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:301
ArrayVariableGradient _default_array_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1436

◆ coupledArrayValue()

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

Returns value of a coupled array variable.

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

Definition at line 830 of file Coupleable.C.

Referenced by coupledArrayValues().

831 {
832  const auto * var = getArrayVar(var_name, comp);
833  if (!var)
834  return *getDefaultArrayValue(var_name);
836 
838  {
839  if (_c_nodal)
840  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
841  return (_c_is_implicit) ? var->sln() : var->slnOld();
842  }
843  else
844  {
845  if (_c_nodal)
846  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
847  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
848  }
849 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
const ArrayVariableValue * getDefaultArrayValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for an uncoupled array variable...
Definition: Coupleable.C:392
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
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:1614
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:301

◆ coupledArrayValueOld()

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

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

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

Definition at line 1074 of file Coupleable.C.

1075 {
1076  const auto * var = getArrayVar(var_name, comp);
1077  if (!var)
1078  return *getDefaultArrayValue(var_name);
1080 
1081  if (!_coupleable_neighbor)
1082  {
1083  if (_c_nodal)
1084  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
1085  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
1086  }
1087  else
1088  {
1089  if (_c_nodal)
1090  return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
1091  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
1092  }
1093 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
const ArrayVariableValue * getDefaultArrayValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for an uncoupled array variable...
Definition: Coupleable.C:392
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
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:1614
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:301

◆ coupledArrayValueOlder()

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

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

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

Definition at line 1096 of file Coupleable.C.

1097 {
1098  const auto * var = getArrayVar(var_name, comp);
1099  if (!var)
1100  return *getDefaultArrayValue(var_name);
1102 
1103  if (!_coupleable_neighbor)
1104  {
1105  if (_c_nodal)
1106  return var->dofValuesOlder();
1107  return var->slnOlder();
1108  }
1109  else
1110  {
1111  if (_c_nodal)
1112  return var->dofValuesOlderNeighbor();
1113  return var->slnOlderNeighbor();
1114  }
1115 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
const ArrayVariableValue * getDefaultArrayValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for an uncoupled array variable...
Definition: Coupleable.C:392
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:1614
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:301

◆ coupledArrayValues()

std::vector< const ArrayVariableValue * > Coupleable::coupledArrayValues ( const std::string &  var_name) const
protected

Returns the values for all of a coupled array variable's components.

Parameters
var_nameName of coupled array variable
Returns
Vector of ArrayVariableValue pointers for each component of var_name

Definition at line 852 of file Coupleable.C.

853 {
854  auto func = [this, &var_name](unsigned int comp) { return &coupledArrayValue(var_name, comp); };
855  return coupledVectorHelper<const ArrayVariableValue *>(var_name, func);
856 }
virtual const ArrayVariableValue & coupledArrayValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled array variable.
Definition: Coupleable.C:830

◆ coupledCallback()

virtual void Coupleable::coupledCallback ( const std::string &  ,
bool   
) const
inlineprotectedvirtual

A call-back function provided by the derived object for actions before coupling a variable with functions such as coupledValue.

Reimplemented in AuxKernelTempl< ComputeValueType >, AuxKernelTempl< RT >, AuxKernelTempl< RealVectorValue >, and AuxKernelTempl< Real >.

Definition at line 134 of file Coupleable.h.

Referenced by checkFuncType().

134 {}

◆ coupledComponents()

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

Number of coupled components.

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

Definition at line 153 of file Coupleable.C.

Referenced by coupledVectorHelper(), KernelBase::KernelBase(), SpatialAverageBase::SpatialAverageBase(), and VariableValueVolumeHistogram::VariableValueVolumeHistogram().

154 {
155  const auto var_name = _c_parameters.checkForRename(var_name_in);
156 
157  if (isCoupled(var_name))
158  {
159  mooseAssert(_coupled_vars.find(var_name) != _coupled_vars.end(),
160  var_name << " must not actually be coupled!");
161  return _coupled_vars.at(var_name).size();
162  }
163  else
164  {
166  return _c_parameters.numberDefaultCoupledValues(var_name);
167  else
168  return 0;
169  }
170 }
virtual bool isCoupled(const std::string &var_name, unsigned int i=0) const
Returns true if a variables has been coupled as name.
Definition: Coupleable.C:124
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1324
unsigned int numberDefaultCoupledValues(const std::string &coupling_name) const
Get the number of defaulted coupled value entries.
bool hasDefaultCoupledValue(const std::string &coupling_name) const
Return whether or not the requested parameter has a default coupled value.
std::string checkForRename(const std::string &name) const
Checks whether the provided name is a renamed parameter name.
const InputParameters & _c_parameters
Definition: Coupleable.h:1310

◆ coupledCurl()

const VectorVariableCurl & Coupleable::coupledCurl ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1674 of file Coupleable.C.

1675 {
1676  const auto * var = getVectorVar(var_name, comp);
1677  if (!var)
1678  {
1680  return _default_vector_curl;
1681  }
1683 
1684  if (!_coupleable_neighbor)
1685  return (_c_is_implicit) ? var->curlSln() : var->curlSlnOld();
1686  return (_c_is_implicit) ? var->curlSlnNeighbor() : var->curlSlnOldNeighbor();
1687 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1427
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
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:1614
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledCurlOld()

const VectorVariableCurl & Coupleable::coupledCurlOld ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1690 of file Coupleable.C.

1691 {
1692  const auto * var = getVectorVar(var_name, comp);
1693  if (!var)
1694  {
1696  return _default_vector_curl;
1697  }
1699 
1700  if (!_coupleable_neighbor)
1701  return (_c_is_implicit) ? var->curlSlnOld() : var->curlSlnOlder();
1702  return (_c_is_implicit) ? var->curlSlnOldNeighbor() : var->curlSlnOlderNeighbor();
1703 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1427
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
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:1614
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledCurlOlder()

const VectorVariableCurl & Coupleable::coupledCurlOlder ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1706 of file Coupleable.C.

1707 {
1708  const auto * var = getVectorVar(var_name, comp);
1709  if (!var)
1710  {
1712  return _default_vector_curl;
1713  }
1715 
1716  if (!_coupleable_neighbor)
1717  return var->curlSlnOlder();
1718  return var->curlSlnOlderNeighbor();
1719 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1427
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
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:1614
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledDofValues()

const VariableValue & Coupleable::coupledDofValues ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1926 of file Coupleable.C.

Referenced by coupledAllDofValues().

1927 {
1928  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
1929  if (!var)
1930  return *getDefaultValue(var_name, comp);
1932 
1933  if (!_coupleable_neighbor)
1934  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
1935  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
1936 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
const VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp) const
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:330
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:1614

◆ coupledDofValuesOld()

const VariableValue & Coupleable::coupledDofValuesOld ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1946 of file Coupleable.C.

Referenced by coupledAllDofValuesOld().

1947 {
1948  const auto * var = getVar(var_name, comp);
1949  if (!var)
1950  return *getDefaultValue(var_name, comp);
1952 
1953  if (!_coupleable_neighbor)
1954  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
1955  return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
1956 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
const VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp) const
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:330
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:1614

◆ coupledDofValuesOlder()

const VariableValue & Coupleable::coupledDofValuesOlder ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1966 of file Coupleable.C.

Referenced by coupledAllDofValuesOlder().

1967 {
1968  const auto * var = getVar(var_name, comp);
1969  if (!var)
1970  return *getDefaultValue(var_name, comp);
1972 
1973  if (!_coupleable_neighbor)
1974  return var->dofValuesOlder();
1975  return var->dofValuesOlderNeighbor();
1976 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
const VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp) const
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:330
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:1614

◆ coupledDot()

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

Time derivative of a coupled variable.

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

Reimplemented in AuxKernelTempl< ComputeValueType >, AuxKernelTempl< RT >, AuxKernelTempl< RealVectorValue >, and AuxKernelTempl< Real >.

Definition at line 1118 of file Coupleable.C.

Referenced by AuxKernelTempl< Real >::coupledDot(), and coupledDots().

1119 {
1120  const auto * var = getVar(var_name, comp);
1121  if (!var)
1122  {
1124  return _default_value_zero;
1125  }
1127 
1128  if (!_coupleable_neighbor)
1129  {
1130  if (_c_nodal)
1131  return var->dofValuesDot();
1132  return var->uDot();
1133  }
1134  else
1135  {
1136  if (_c_nodal)
1137  return var->dofValuesDotNeighbor();
1138  return var->uDotNeighbor();
1139  }
1140 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1378
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
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:1614
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:213
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledDotDot()

const VariableValue & Coupleable::coupledDotDot ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 second time derivative of the coupled variable

Definition at line 1143 of file Coupleable.C.

1144 {
1145  const auto * var = getVar(var_name, comp);
1146  if (!var)
1147  {
1149  return _default_value_zero;
1150  }
1152 
1153  if (!_coupleable_neighbor)
1154  {
1155  if (_c_nodal)
1156  return var->dofValuesDotDot();
1157  return var->uDotDot();
1158  }
1159  else
1160  {
1161  if (_c_nodal)
1162  return var->dofValuesDotDotNeighbor();
1163  return var->uDotDotNeighbor();
1164  }
1165 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1378
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
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:1614
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:213
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledDotDotDu()

const VariableValue & Coupleable::coupledDotDotDu ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1427 of file Coupleable.C.

1428 {
1429  const auto * var = getVar(var_name, comp);
1430  if (!var)
1431  {
1433  return _default_value_zero;
1434  }
1436 
1437  if (!_coupleable_neighbor)
1438  {
1439  if (_c_nodal)
1440  return var->dofValuesDuDotDotDu();
1441  return var->duDotDotDu();
1442  }
1443  else
1444  {
1445  if (_c_nodal)
1446  return var->dofValuesDuDotDotDuNeighbor();
1447  return var->duDotDotDuNeighbor();
1448  }
1449 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1378
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
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:1614
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:213
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledDotDotOld()

const VariableValue & Coupleable::coupledDotDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 old second time derivative of the coupled variable

Definition at line 1193 of file Coupleable.C.

1194 {
1195  const auto * var = getVar(var_name, comp);
1196  if (!var)
1197  {
1199  return _default_value_zero;
1200  }
1202 
1203  if (!_coupleable_neighbor)
1204  {
1205  if (_c_nodal)
1206  return var->dofValuesDotDotOld();
1207  return var->uDotDotOld();
1208  }
1209  else
1210  {
1211  if (_c_nodal)
1212  return var->dofValuesDotDotOldNeighbor();
1213  return var->uDotDotOldNeighbor();
1214  }
1215 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1378
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
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:1614
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:213
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledDotDu()

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

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

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

Reimplemented in AuxKernelTempl< ComputeValueType >, AuxKernelTempl< RT >, AuxKernelTempl< RealVectorValue >, and AuxKernelTempl< Real >.

Definition at line 1402 of file Coupleable.C.

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

1403 {
1404  const auto * var = getVar(var_name, comp);
1405  if (!var)
1406  {
1408  return _default_value_zero;
1409  }
1411 
1412  if (!_coupleable_neighbor)
1413  {
1414  if (_c_nodal)
1415  return var->dofValuesDuDotDu();
1416  return var->duDotDu();
1417  }
1418  else
1419  {
1420  if (_c_nodal)
1421  return var->dofValuesDuDotDuNeighbor();
1422  return var->duDotDuNeighbor();
1423  }
1424 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1378
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
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:1614
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:213
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledDotOld()

const VariableValue & Coupleable::coupledDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 old time derivative of the coupled variable

Definition at line 1168 of file Coupleable.C.

1169 {
1170  const auto * var = getVar(var_name, comp);
1171  if (!var)
1172  {
1174  return _default_value_zero;
1175  }
1177 
1178  if (!_coupleable_neighbor)
1179  {
1180  if (_c_nodal)
1181  return var->dofValuesDotOld();
1182  return var->uDotOld();
1183  }
1184  else
1185  {
1186  if (_c_nodal)
1187  return var->dofValuesDotOldNeighbor();
1188  return var->uDotOldNeighbor();
1189  }
1190 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1378
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
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:1614
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:213
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledDots()

std::vector< const VariableValue * > Coupleable::coupledDots ( const std::string &  var_name) const
protected

Returns the time derivatives for all of a coupled variable's components.

Parameters
var_nameName of coupled variable
Returns
Vector of VariableValue pointers for each component of var_name

Definition at line 2625 of file Coupleable.C.

2626 {
2627  auto func = [this, &var_name](unsigned int comp) { return &coupledDot(var_name, comp); };
2628  return coupledVectorHelper<const VariableValue *>(var_name, func);
2629 }
virtual const VariableValue & coupledDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled variable.
Definition: Coupleable.C:1118

◆ coupledGenericDofValue() [1/3]

template<bool is_ad>
const GenericVariableValue<is_ad>& Coupleable::coupledGenericDofValue ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protected

Returns DOF value of a coupled variable for use in templated automatic differentiation classes.

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

◆ coupledGenericDofValue() [2/3]

template<>
const GenericVariableValue<false>& Coupleable::coupledGenericDofValue ( const std::string &  var_name,
unsigned int  comp 
) const
protected

Definition at line 570 of file Coupleable.C.

571 {
572  return coupledDofValues(var_name, comp);
573 }
virtual const VariableValue & coupledDofValues(const std::string &var_name, unsigned int comp=0) const
Returns DoFs in the current solution vector of a coupled variable for the local element.
Definition: Coupleable.C:1926

◆ coupledGenericDofValue() [3/3]

template<>
const GenericVariableValue<true>& Coupleable::coupledGenericDofValue ( const std::string &  var_name,
unsigned int  comp 
) const
protected

Definition at line 577 of file Coupleable.C.

578 {
579  return adCoupledDofValues(var_name, comp);
580 }
virtual const ADVariableValue & adCoupledDofValues(const std::string &var_name, unsigned int comp=0) const
Returns DOF value of a coupled variable for use in Automatic Differentiation.
Definition: Coupleable.C:2000

◆ coupledGenericGradient() [1/3]

template<bool is_ad>
const GenericVariableGradient<is_ad>& Coupleable::coupledGenericGradient ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protected

Returns gradient of a coupled variable for use in templated automatic differentiation.

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

◆ coupledGenericGradient() [2/3]

template<>
const GenericVariableGradient<false>& Coupleable::coupledGenericGradient ( const std::string &  var_name,
unsigned int  comp 
) const
protected

Definition at line 2350 of file Coupleable.C.

2351 {
2352  return coupledGradient(var_name, comp);
2353 }
virtual const VariableGradient & coupledGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable.
Definition: Coupleable.C:1477

◆ coupledGenericGradient() [3/3]

template<>
const GenericVariableGradient<true>& Coupleable::coupledGenericGradient ( const std::string &  var_name,
unsigned int  comp 
) const
protected

Definition at line 2357 of file Coupleable.C.

2358 {
2359  return adCoupledGradient(var_name, comp);
2360 }
const ADVariableGradient & adCoupledGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable for use in Automatic Differentiation.
Definition: Coupleable.C:2091

◆ coupledGenericGradients() [1/3]

template<bool is_ad>
std::vector<const GenericVariableGradient<is_ad> *> Coupleable::coupledGenericGradients ( const std::string &  var_name) const
protected

Returns the gradients for all of a coupled variable's components for use in templated automatic differentiation.

Parameters
var_nameName of coupled variable
Returns
Vector of VariableGradient pointers for each component of var_name

◆ coupledGenericGradients() [2/3]

template<>
std::vector<const GenericVariableGradient<false> *> Coupleable::coupledGenericGradients ( const std::string &  var_name) const
protected

Definition at line 2597 of file Coupleable.C.

2598 {
2599  return coupledGradients(var_name);
2600 }
std::vector< const VariableGradient * > coupledGradients(const std::string &var_name) const
Returns the gradients for all of a coupled variable&#39;s components.
Definition: Coupleable.C:2589

◆ coupledGenericGradients() [3/3]

template<>
std::vector<const GenericVariableGradient<true> *> Coupleable::coupledGenericGradients ( const std::string &  var_name) const
protected

Definition at line 2604 of file Coupleable.C.

2605 {
2606  auto func = [this, &var_name](unsigned int comp) { return &adCoupledGradient(var_name, comp); };
2607  return coupledVectorHelper<const GenericVariableGradient<true> *>(var_name, func);
2608 }
const ADVariableGradient & adCoupledGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable for use in Automatic Differentiation.
Definition: Coupleable.C:2091

◆ coupledGenericValue() [1/3]

template<bool is_ad>
const GenericVariableValue<is_ad>& Coupleable::coupledGenericValue ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protected

Returns value of a coupled variable for use in templated automatic differentiation classes.

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

◆ coupledGenericValue() [2/3]

template<>
const GenericVariableValue<false>& Coupleable::coupledGenericValue ( const std::string &  var_name,
unsigned int  comp 
) const
protected

Definition at line 465 of file Coupleable.C.

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

◆ coupledGenericValue() [3/3]

template<>
const GenericVariableValue<true>& Coupleable::coupledGenericValue ( const std::string &  var_name,
unsigned int  comp 
) const
protected

Definition at line 472 of file Coupleable.C.

473 {
474  return adCoupledValue(var_name, comp);
475 }
const ADVariableValue & adCoupledValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled variable for use in Automatic Differentiation.
Definition: Coupleable.C:2053

◆ coupledGenericValues() [1/3]

template<bool is_ad>
std::vector<const GenericVariableValue<is_ad> *> Coupleable::coupledGenericValues ( const std::string &  var_name) const
protected

Returns the values for all of a coupled variable's components for use in templated automatic differentiation classes.

Parameters
var_nameName of coupled variable
Returns
Vector of GenericVariableValue pointers for each component of var_name

◆ coupledGenericValues() [2/3]

template<>
std::vector<const GenericVariableValue<false> *> Coupleable::coupledGenericValues ( const std::string &  var_name) const
protected

Definition at line 2409 of file Coupleable.C.

2410 {
2411  return coupledValues(var_name);
2412 }
std::vector< const VariableValue * > coupledValues(const std::string &var_name) const
Returns the values for all of a coupled variable components.
Definition: Coupleable.C:2394

◆ coupledGenericValues() [3/3]

template<>
std::vector<const GenericVariableValue<true> *> Coupleable::coupledGenericValues ( const std::string &  var_name) const
protected

Definition at line 2416 of file Coupleable.C.

2417 {
2418  return adCoupledValues(var_name);
2419 }
std::vector< const ADVariableValue * > adCoupledValues(const std::string &var_name) const
Returns the values for all of a coupled variable&#39;s components for use in Automatic Differentiation...
Definition: Coupleable.C:2422

◆ coupledGradient()

const VariableGradient & Coupleable::coupledGradient ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1477 of file Coupleable.C.

Referenced by coupledGradients(), NodeElemConstraint::coupledSecondaryGradient(), and NodeFaceConstraint::coupledSecondaryGradient().

1478 {
1479  const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
1480  if (!var)
1481  {
1483  return _default_gradient;
1484  }
1486 
1487  if (!_coupleable_neighbor)
1488  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
1489  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
1490 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1381
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:1614
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledGradientDot()

const VariableGradient & Coupleable::coupledGradientDot ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1542 of file Coupleable.C.

1543 {
1544  const auto * var = getVar(var_name, comp);
1545  if (!var)
1546  {
1548  return _default_gradient;
1549  }
1551 
1552  if (!_coupleable_neighbor)
1553  return var->gradSlnDot();
1554  return var->gradSlnNeighborDot();
1555 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1381
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:1614
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledGradientDotDot()

const VariableGradient & Coupleable::coupledGradientDotDot ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1558 of file Coupleable.C.

1559 {
1560  const auto * var = getVar(var_name, comp);
1561  if (!var)
1562  {
1564  return _default_gradient;
1565  }
1567 
1568  if (!_coupleable_neighbor)
1569  return var->gradSlnDotDot();
1570  return var->gradSlnNeighborDotDot();
1571 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1381
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:1614
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledGradientOld()

const VariableGradient & Coupleable::coupledGradientOld ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1493 of file Coupleable.C.

Referenced by coupledGradientsOld(), NodeElemConstraint::coupledSecondaryGradientOld(), and NodeFaceConstraint::coupledSecondaryGradientOld().

1494 {
1495  const auto * var = getVar(var_name, comp);
1496  if (!var)
1497  {
1499  return _default_gradient;
1500  }
1502 
1503  if (!_coupleable_neighbor)
1504  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
1505  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
1506 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1381
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:1614
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledGradientOlder()

const VariableGradient & Coupleable::coupledGradientOlder ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1509 of file Coupleable.C.

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

1510 {
1511  const auto * var = getVar(var_name, comp);
1512  if (!var)
1513  {
1515  return _default_gradient;
1516  }
1518 
1519  if (!_coupleable_neighbor)
1520  return var->gradSlnOlder();
1521  return var->gradSlnOlderNeighbor();
1522 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1381
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:1614
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledGradientPreviousNL()

const VariableGradient & Coupleable::coupledGradientPreviousNL ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1525 of file Coupleable.C.

1526 {
1527  const auto * var = getVar(var_name, comp);
1529  if (!var)
1530  {
1532  return _default_gradient;
1533  }
1535 
1536  if (!_coupleable_neighbor)
1537  return var->gradSlnPreviousNL();
1538  return var->gradSlnPreviousNLNeighbor();
1539 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1381
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:1614
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledGradients()

std::vector< const VariableGradient * > Coupleable::coupledGradients ( const std::string &  var_name) const
protected

Returns the gradients for all of a coupled variable's components.

Parameters
var_nameName of coupled variable
Returns
Vector of VariableGradient pointers for each component of var_name

Definition at line 2589 of file Coupleable.C.

2590 {
2591  auto func = [this, &var_name](unsigned int comp) { return &coupledGradient(var_name, comp); };
2592  return coupledVectorHelper<const VariableGradient *>(var_name, func);
2593 }
virtual const VariableGradient & coupledGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable.
Definition: Coupleable.C:1477

◆ coupledGradientsOld()

std::vector< const VariableGradient * > Coupleable::coupledGradientsOld ( const std::string &  var_name) const
protected

Returns the old gradients for all of a coupled variable's components.

Parameters
var_nameName of coupled variable
Returns
Vector of VariableGradient pointers for each component of var_name

Definition at line 2618 of file Coupleable.C.

2619 {
2620  auto func = [this, &var_name](unsigned int comp) { return &coupledGradientOld(var_name, comp); };
2621  return coupledVectorHelper<const VariableGradient *>(var_name, func);
2622 }
virtual const VariableGradient & coupledGradientOld(const std::string &var_name, unsigned int comp=0) const
Returns an old gradient from previous time step of a coupled variable.
Definition: Coupleable.C:1493

◆ coupledIndices()

std::vector< unsigned int > Coupleable::coupledIndices ( const std::string &  var_name) const
protected

Returns the indices for a coupled variable's components.

Parameters
var_nameName of coupled variable
Returns
Vector of the indices for all components of the coupled variable var_name.

Definition at line 2363 of file Coupleable.C.

2364 {
2365  auto func = [this, &var_name](unsigned int comp) { return coupled(var_name, comp); };
2366  return coupledVectorHelper<unsigned int>(var_name, func);
2367 }
virtual unsigned int coupled(const std::string &var_name, unsigned int comp=0) const
Returns the index for a coupled variable by name.
Definition: Coupleable.C:437

◆ coupledMatrixTagValue() [1/2]

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

Returns value of a coupled variable for a given tag.

This couples the diag vector of matrix

Parameters
var_namesName(s) of coupled variable(s)
tagmatrix tag ID
indexIndex of the desired variable in the vector of coupled variables
Returns
Reference to a VariableValue for the coupled variable
See also
Kernel::_u

Definition at line 772 of file Coupleable.C.

Referenced by coupledMatrixTagValue(), and coupledMatrixTagValues().

775 {
776  const auto * var = getVarHelper<MooseVariableField<Real>>(var_names, index);
777  if (!var)
778  mooseError(var_names, ": invalid variable name for coupledMatrixTagValue");
780 
781  const_cast<Coupleable *>(this)->addFEVariableCoupleableMatrixTag(tag);
782 
783  if (_c_nodal)
784  return var->nodalMatrixTagValue(tag);
785  return var->matrixTagValue(tag);
786 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:44
void addFEVariableCoupleableMatrixTag(TagID tag)
Definition: Coupleable.h:103

◆ coupledMatrixTagValue() [2/2]

const VariableValue & Coupleable::coupledMatrixTagValue ( const std::string &  var_names,
const std::string &  tag_name,
unsigned int  index = 0 
) const
protectedvirtual

Definition at line 789 of file Coupleable.C.

792 {
793  if (!_c_parameters.isParamValid(tag_name))
794  mooseError("Tag name parameter '", tag_name, "' is invalid");
795 
796  TagName tagname = _c_parameters.get<TagName>(tag_name);
797  if (!_c_fe_problem.matrixTagExists(tagname))
798  mooseError("Matrix tag name '", tagname, "' does not exist");
799 
800  TagID tag = _c_fe_problem.getMatrixTagID(tagname);
801  return coupledMatrixTagValue(var_names, tag, index);
802 }
unsigned int TagID
Definition: MooseTypes.h:199
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
virtual const VariableValue & coupledMatrixTagValue(const std::string &var_names, TagID tag, unsigned int index=0) const
Returns value of a coupled variable for a given tag.
Definition: Coupleable.C:772
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
virtual TagID getMatrixTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:308
const InputParameters & _c_parameters
Definition: Coupleable.h:1310
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:294
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledMatrixTagValues() [1/2]

std::vector< const VariableValue * > Coupleable::coupledMatrixTagValues ( const std::string &  var_names,
TagID  tag 
) const
protected

Returns the diagonal matrix values for all the coupled variables desired for a given tag.

Parameters
var_namesName(s) of coupled variable(s)
tagmatrix tag ID
Returns
Vector of VariableValue pointers for each variable in var_name

Definition at line 2552 of file Coupleable.C.

Referenced by coupledMatrixTagValues().

2553 {
2554  auto func = [this, &var_names, &tag](unsigned int comp)
2555  { return &coupledMatrixTagValue(var_names, tag, comp); };
2556  return coupledVectorHelper<const VariableValue *>(var_names, func);
2557 }
virtual const VariableValue & coupledMatrixTagValue(const std::string &var_names, TagID tag, unsigned int index=0) const
Returns value of a coupled variable for a given tag.
Definition: Coupleable.C:772

◆ coupledMatrixTagValues() [2/2]

std::vector< const VariableValue * > Coupleable::coupledMatrixTagValues ( const std::string &  var_names,
const std::string &  tag_name 
) const
protected

Definition at line 2560 of file Coupleable.C.

2562 {
2563  if (!_c_parameters.isParamValid(tag_name))
2564  mooseError("Tag name parameter '", tag_name, "' is invalid");
2565 
2566  TagName tagname = _c_parameters.get<TagName>(tag_name);
2567  if (!_c_fe_problem.matrixTagExists(tagname))
2568  mooseError("Matrix tag name '", tagname, "' does not exist");
2569 
2570  TagID tag = _c_fe_problem.getMatrixTagID(tagname);
2571  return coupledMatrixTagValues(var_names, tag);
2572 }
unsigned int TagID
Definition: MooseTypes.h:199
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
virtual TagID getMatrixTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:308
std::vector< const VariableValue * > coupledMatrixTagValues(const std::string &var_names, TagID tag) const
Returns the diagonal matrix values for all the coupled variables desired for a given tag...
Definition: Coupleable.C:2552
const InputParameters & _c_parameters
Definition: Coupleable.h:1310
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:294
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledName()

VariableName Coupleable::coupledName ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protected

Names of the variable in the Coupleable interface.

Parameters
var_nameName of the variable
compthe component of the variable
Returns
name the variable has been coupled as. For constants, returns the constant

Definition at line 2370 of file Coupleable.C.

Referenced by coupledNames(), SecondTimeDerivativeAux::SecondTimeDerivativeAux(), and SpatialAverageBase::SpatialAverageBase().

2371 {
2372  if (getFieldVar(var_name, comp))
2373  return getFieldVar(var_name, comp)->name();
2374  // Detect if we are in the case where a constant was passed in lieu of a variable
2375  else if (isCoupledConstant(var_name))
2377  ": a variable name was queried but a constant was passed for parameter '",
2378  var_name,
2379  "Either pass a true variable or contact a developer to shield the call to "
2380  "'coupledName' with 'isCoupledConstant'");
2381  else
2382  mooseError(
2383  _c_name, ": Variable '", var_name, "' does not exist, yet its coupled name is requested");
2384 }
virtual bool isCoupledConstant(const std::string &var_name) const
Returns true if a variable passed as a coupled value is really a constant.
Definition: Coupleable.C:147
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
const std::string & name() const override
Get the variable name.
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1313
const MooseVariableFieldBase * getFieldVar(const std::string &var_name, unsigned int comp) const
Definition: Coupleable.C:277

◆ coupledNames()

std::vector< VariableName > Coupleable::coupledNames ( const std::string &  var_name) const
protected

Names of the variables in the Coupleable interface.

Parameters
var_nameNames of the variables
Returns
names the variables have been coupled as

Definition at line 2387 of file Coupleable.C.

2388 {
2389  auto func = [this, &var_name](unsigned int comp) { return coupledName(var_name, comp); };
2390  return coupledVectorHelper<VariableName>(var_name, func);
2391 }
VariableName coupledName(const std::string &var_name, unsigned int comp=0) const
Names of the variable in the Coupleable interface.
Definition: Coupleable.C:2370

◆ coupledNodalDot()

template<typename T >
template const RealVectorValue & Coupleable::coupledNodalDot< RealVectorValue > ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1864 of file Coupleable.C.

1865 {
1866  static const T zero = 0;
1867  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1868  if (!var)
1869  return zero;
1871 
1872  if (!_coupleable_neighbor)
1873  return var->nodalValueDot();
1874  mooseError("Neighbor version not implemented");
1875 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
const Number zero
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:1614

◆ coupledNodalDotDot()

const VariableValue & Coupleable::coupledNodalDotDot ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1878 of file Coupleable.C.

1879 {
1880  const auto * var = getVar(var_name, comp);
1881  if (!var)
1882  {
1884  return _default_value_zero;
1885  }
1887 
1888  if (!_coupleable_neighbor)
1889  return var->dofValuesDotDot();
1890  return var->dofValuesDotDotNeighbor();
1891 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1378
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
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:1614
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:213
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledNodalDotDotOld()

const VariableValue & Coupleable::coupledNodalDotDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1910 of file Coupleable.C.

1911 {
1912  const auto * var = getVar(var_name, comp);
1913  if (!var)
1914  {
1916  return _default_value_zero;
1917  }
1919 
1920  if (!_coupleable_neighbor)
1921  return var->dofValuesDotDotOld();
1922  return var->dofValuesDotDotOldNeighbor();
1923 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1378
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
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:1614
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:213
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledNodalDotOld()

const VariableValue & Coupleable::coupledNodalDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1894 of file Coupleable.C.

1895 {
1896  const auto * var = getVar(var_name, comp);
1897  if (!var)
1898  {
1900  return _default_value_zero;
1901  }
1903 
1904  if (!_coupleable_neighbor)
1905  return var->dofValuesDotOld();
1906  return var->dofValuesDotOldNeighbor();
1907 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1378
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
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:1614
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:213
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledNodalValue()

template<typename T >
template const RealVectorValue & Coupleable::coupledNodalValue< RealVectorValue > ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1788 of file Coupleable.C.

1789 {
1790  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1791  if (!var)
1792  return getDefaultNodalValue<T>(var_name, comp);
1794 
1795  if (!var->isNodal())
1797  ": Trying to get nodal values of variable '",
1798  var->name(),
1799  "', but it is not nodal.");
1800 
1801  if (!_coupleable_neighbor)
1802  return (_c_is_implicit) ? var->nodalValue() : var->nodalValueOld();
1803  return (_c_is_implicit) ? var->nodalValueNeighbor() : var->nodalValueOldNeighbor();
1804 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1313
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:1614

◆ coupledNodalValueOld()

template<typename T >
template const RealVectorValue & Coupleable::coupledNodalValueOld< RealVectorValue > ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1808 of file Coupleable.C.

1809 {
1810  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1811  if (!var)
1812  return getDefaultNodalValue<T>(var_name, comp);
1814 
1815  if (!var->isNodal())
1817  ": Trying to get old nodal values of variable '",
1818  var->name(),
1819  "', but it is not nodal.");
1820 
1821  if (!_coupleable_neighbor)
1822  return (_c_is_implicit) ? var->nodalValueOld() : var->nodalValueOlder();
1823  return (_c_is_implicit) ? var->nodalValueOldNeighbor() : var->nodalValueOlderNeighbor();
1824 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1313
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:1614

◆ coupledNodalValueOlder()

template<typename T >
template const RealVectorValue & Coupleable::coupledNodalValueOlder< RealVectorValue > ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1828 of file Coupleable.C.

1829 {
1830  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1831  if (!var)
1832  return getDefaultNodalValue<T>(var_name, comp);
1834 
1835  if (!var->isNodal())
1837  ": Trying to get older nodal values of variable '",
1838  var->name(),
1839  "', but it is not nodal.");
1840 
1841  if (!_coupleable_neighbor)
1842  return var->nodalValueOlder();
1843  return var->nodalValueOlderNeighbor();
1844 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1313
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:1614

◆ coupledNodalValuePreviousNL()

template<typename T >
template const RealVectorValue & Coupleable::coupledNodalValuePreviousNL< RealVectorValue > ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1848 of file Coupleable.C.

1849 {
1850  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1851  if (!var)
1852  return getDefaultNodalValue<T>(var_name, comp);
1854 
1856 
1857  if (!_coupleable_neighbor)
1858  return var->nodalValuePreviousNL();
1859  return var->nodalValuePreviousNLNeighbor();
1860 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
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:1614

◆ coupledSecond()

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

Returns second spatial derivatives 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 1722 of file Coupleable.C.

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

1723 {
1724  const auto * var = getVar(var_name, comp);
1725  if (!var)
1726  {
1728  return _default_second;
1729  }
1731 
1732  if (!_coupleable_neighbor)
1733  return (_c_is_implicit) ? var->secondSln() : var->secondSlnOlder();
1734  return (_c_is_implicit) ? var->secondSlnNeighbor() : var->secondSlnOlderNeighbor();
1735 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1390
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:1614
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledSecondOld()

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

Returns an old second spatial derivatives 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 1738 of file Coupleable.C.

1739 {
1740  const auto * var = getVar(var_name, comp);
1741  if (!var)
1742  {
1744  return _default_second;
1745  }
1747 
1748  if (!_coupleable_neighbor)
1749  return (_c_is_implicit) ? var->secondSlnOld() : var->secondSlnOlder();
1750  return (_c_is_implicit) ? var->secondSlnOldNeighbor() : var->secondSlnOlderNeighbor();
1751 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1390
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:1614
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledSecondOlder()

const VariableSecond & Coupleable::coupledSecondOlder ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1754 of file Coupleable.C.

1755 {
1756  const auto * var = getVar(var_name, comp);
1757  if (!var)
1758  {
1760  return _default_second;
1761  }
1763 
1764  if (!_coupleable_neighbor)
1765  return var->secondSlnOlder();
1766  return var->secondSlnOlderNeighbor();
1767 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1390
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:1614
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledSecondPreviousNL()

const VariableSecond & Coupleable::coupledSecondPreviousNL ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1770 of file Coupleable.C.

1771 {
1772  const auto * var = getVar(var_name, comp);
1774  if (!var)
1775  {
1777  return _default_second;
1778  }
1780 
1781  if (!_coupleable_neighbor)
1782  return var->secondSlnPreviousNL();
1783  return var->secondSlnPreviousNLNeighbor();
1784 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1390
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:1614
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledValue()

const VariableValue & Coupleable::coupledValue ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 478 of file Coupleable.C.

Referenced by NodeElemConstraint::coupledSecondaryValue(), NodeFaceConstraint::coupledSecondaryValue(), coupledValues(), ExtraIDIntegralVectorPostprocessor::ExtraIDIntegralVectorPostprocessor(), VariableTimeIntegrationAux::VariableTimeIntegrationAux(), and writableCoupledValue().

479 {
480  const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
481  if (!var)
482  return *getDefaultValue(var_name, comp);
484 
486  {
487  if (_c_nodal)
488  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
489  else
490  return (_c_is_implicit) ? var->sln() : var->slnOld();
491  }
492  else
493  {
494  if (_c_nodal)
495  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
496  else
497  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
498  }
499 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
const VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp) const
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:330
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:1614

◆ coupledValueLower()

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

Returns value of a coupled lower-dimensional 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 583 of file Coupleable.C.

584 {
585  const auto * var = getVar(var_name, comp);
586  if (!var)
587  return *getDefaultValue(var_name, comp);
589 
591  mooseError(_c_name, ":coupledValueLower cannot be called in a coupleable neighbor object");
592 
593  if (_c_nodal)
594  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
595  else
596  return (_c_is_implicit) ? var->slnLower() : var->slnLowerOld();
597 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
const VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp) const
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:330
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1313
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:1614

◆ coupledValueOld()

const VariableValue & Coupleable::coupledValueOld ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 981 of file Coupleable.C.

Referenced by NodeElemConstraint::coupledSecondaryValueOld(), NodeFaceConstraint::coupledSecondaryValueOld(), coupledValuesOld(), and VariableTimeIntegrationAux::VariableTimeIntegrationAux().

982 {
983  const auto * var = getVar(var_name, comp);
984  if (!var)
985  return *getDefaultValue(var_name, comp);
987 
989  {
990  if (_c_nodal)
991  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
992  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
993  }
994  else
995  {
996  if (_c_nodal)
997  return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
998  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
999  }
1000 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
const VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp) const
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:330
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:1614

◆ coupledValueOlder()

const VariableValue & Coupleable::coupledValueOlder ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1003 of file Coupleable.C.

Referenced by NodeElemConstraint::coupledSecondaryValueOlder(), NodeFaceConstraint::coupledSecondaryValueOlder(), coupledValuesOlder(), and VariableTimeIntegrationAux::VariableTimeIntegrationAux().

1004 {
1005  const auto * var = getVar(var_name, comp);
1006  if (!var)
1007  return *getDefaultValue(var_name, comp);
1009 
1010  if (!_coupleable_neighbor)
1011  {
1012  if (_c_nodal)
1013  return var->dofValuesOlder();
1014  return var->slnOlder();
1015  }
1016  else
1017  {
1018  if (_c_nodal)
1019  return var->dofValuesOlderNeighbor();
1020  return var->slnOlderNeighbor();
1021  }
1022 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
const VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp) const
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:330
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:1614

◆ coupledValuePreviousNL()

const VariableValue & Coupleable::coupledValuePreviousNL ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1025 of file Coupleable.C.

1026 {
1027  const auto * var = getVar(var_name, comp);
1028  if (!var)
1029  return *getDefaultValue(var_name, comp);
1031 
1033  if (!_coupleable_neighbor)
1034  {
1035  if (_c_nodal)
1036  return var->dofValuesPreviousNL();
1037  return var->slnPreviousNL();
1038  }
1039  else
1040  {
1041  if (_c_nodal)
1042  return var->dofValuesPreviousNLNeighbor();
1043  return var->slnPreviousNLNeighbor();
1044  }
1045 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
const VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp) const
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:330
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:1614

◆ coupledValues()

std::vector< const VariableValue * > Coupleable::coupledValues ( const std::string &  var_name) const
protected

Returns the values for all of a coupled variable components.

Parameters
var_nameName of coupled variable
Returns
Vector of VariableValue pointers for each component of var_name

Definition at line 2394 of file Coupleable.C.

2395 {
2396  auto func = [this, &var_name](unsigned int comp) { return &coupledValue(var_name, comp); };
2397  return coupledVectorHelper<const VariableValue *>(var_name, func);
2398 }
virtual const VariableValue & coupledValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled variable.
Definition: Coupleable.C:478

◆ coupledValuesOld()

std::vector< const VariableValue * > Coupleable::coupledValuesOld ( const std::string &  var_name) const
protected

Returns the old values for all of a coupled variable's components.

Parameters
var_nameName of coupled variable
Returns
Vector of VariableValue pointers for each component of var_name

Definition at line 2575 of file Coupleable.C.

2576 {
2577  auto func = [this, &var_name](unsigned int comp) { return &coupledValueOld(var_name, comp); };
2578  return coupledVectorHelper<const VariableValue *>(var_name, func);
2579 }
virtual const VariableValue & coupledValueOld(const std::string &var_name, unsigned int comp=0) const
Returns an old value from previous time step of a coupled variable.
Definition: Coupleable.C:981

◆ coupledValuesOlder()

std::vector< const VariableValue * > Coupleable::coupledValuesOlder ( const std::string &  var_name) const
protected

Returns the older values for all of a coupled variable's components.

Parameters
var_nameName of coupled variable
Returns
Vector of VariableValue pointers for each component of var_name

Definition at line 2582 of file Coupleable.C.

2583 {
2584  auto func = [this, &var_name](unsigned int comp) { return &coupledValueOlder(var_name, comp); };
2585  return coupledVectorHelper<const VariableValue *>(var_name, func);
2586 }
virtual const VariableValue & coupledValueOlder(const std::string &var_name, unsigned int comp=0) const
Returns an old value from two time steps previous of a coupled variable.
Definition: Coupleable.C:1003

◆ coupledVectorDot()

const VectorVariableValue & Coupleable::coupledVectorDot ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1218 of file Coupleable.C.

1219 {
1220  const auto * var = getVectorVar(var_name, comp);
1221  if (!var)
1222  {
1225  }
1227 
1228  if (!_coupleable_neighbor)
1229  return var->uDot();
1230  return var->uDotNeighbor();
1231 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
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:1614
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1421
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledVectorDotDot()

const VectorVariableValue & Coupleable::coupledVectorDotDot ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1234 of file Coupleable.C.

1235 {
1236  const auto * var = getVectorVar(var_name, comp);
1237  if (!var)
1238  {
1241  }
1243 
1244  if (!_coupleable_neighbor)
1245  return var->uDotDot();
1246  return var->uDotDotNeighbor();
1247 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
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:1614
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1421
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledVectorDotDotDu()

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

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

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

Definition at line 1298 of file Coupleable.C.

1299 {
1300  const auto * var = getVectorVar(var_name, comp);
1301  if (!var)
1302  {
1304  return _default_value_zero;
1305  }
1307 
1308  if (!_coupleable_neighbor)
1309  return var->duDotDotDu();
1310  return var->duDotDotDuNeighbor();
1311 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1378
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:1614
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:213
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledVectorDotDotOld()

const VectorVariableValue & Coupleable::coupledVectorDotDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1266 of file Coupleable.C.

1267 {
1268  const auto * var = getVectorVar(var_name, comp);
1269  if (!var)
1270  {
1273  }
1275 
1276  if (!_coupleable_neighbor)
1277  return var->uDotDotOld();
1278  return var->uDotDotOldNeighbor();
1279 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
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:1614
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1421
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledVectorDotDu()

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

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

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

Definition at line 1282 of file Coupleable.C.

1283 {
1284  const auto * var = getVectorVar(var_name, comp);
1285  if (!var)
1286  {
1288  return _default_value_zero;
1289  }
1291 
1292  if (!_coupleable_neighbor)
1293  return var->duDotDu();
1294  return var->duDotDuNeighbor();
1295 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1378
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:1614
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:213
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledVectorDotOld()

const VectorVariableValue & Coupleable::coupledVectorDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1250 of file Coupleable.C.

1251 {
1252  const auto * var = getVectorVar(var_name, comp);
1253  if (!var)
1254  {
1257  }
1259 
1260  if (!_coupleable_neighbor)
1261  return var->uDotOld();
1262  return var->uDotOldNeighbor();
1263 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
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:1614
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1421
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledVectorGradient()

const VectorVariableGradient & Coupleable::coupledVectorGradient ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1574 of file Coupleable.C.

1575 {
1576  const auto * var = getVectorVar(var_name, comp);
1577  if (!var)
1578  {
1580  return _default_vector_gradient;
1581  }
1583 
1584  if (!_coupleable_neighbor)
1585  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
1586  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
1587 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1424
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:1614
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledVectorGradientOld()

const VectorVariableGradient & Coupleable::coupledVectorGradientOld ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1590 of file Coupleable.C.

1591 {
1592  const auto * var = getVectorVar(var_name, comp);
1593  if (!var)
1594  {
1596  return _default_vector_gradient;
1597  }
1599 
1600  if (!_coupleable_neighbor)
1601  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
1602  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
1603 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1424
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:1614
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledVectorGradientOlder()

const VectorVariableGradient & Coupleable::coupledVectorGradientOlder ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 1606 of file Coupleable.C.

1607 {
1608  const auto * var = getVectorVar(var_name, comp);
1609  if (!var)
1610  {
1612  return _default_vector_gradient;
1613  }
1615 
1616  if (!_coupleable_neighbor)
1617  return var->gradSlnOlder();
1618  return var->gradSlnOlderNeighbor();
1619 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1424
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:1614
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ coupledVectorHelper()

template<typename T , typename Func >
std::vector<T> Coupleable::coupledVectorHelper ( const std::string &  var_name,
const Func &  func 
) const
inlineprotected

Definition at line 1604 of file Coupleable.h.

1605  {
1606  const auto components = coupledComponents(var_name);
1607  std::vector<T> vals(components);
1608  for (MooseIndex(components) comp = 0; comp < components; ++comp)
1609  vals[comp] = func(comp);
1610  return vals;
1611  }
unsigned int coupledComponents(const std::string &var_name) const
Number of coupled components.
Definition: Coupleable.C:153

◆ coupledVectorTagArrayDofValue()

const ArrayVariableValue & Coupleable::coupledVectorTagArrayDofValue ( const std::string &  var_name,
const std::string &  tag_name,
unsigned int  comp = 0 
) const
protected

Returns evaluations of a tagged vector at the requested variable's degree of freedom indices.

Parameters
var_nameName of coupled variable
tag_namevector tag name
Returns
Reference to a ArrayVariableValue for the coupled variable

Definition at line 764 of file Coupleable.C.

767 {
768  return vectorTagDofValueHelper<RealEigenVector>(var_name, tag_name, comp);
769 }

◆ coupledVectorTagArrayGradient() [1/2]

const ArrayVariableGradient & Coupleable::coupledVectorTagArrayGradient ( const std::string &  var_names,
TagID  tag,
unsigned int  index = 0 
) const
protectedvirtual

Returns gradient of a coupled array variable for a given tag.

Parameters
var_namesName(s) of coupled array variable(s)
tagvector tag ID
indexIndex of the desired variable in the vector of coupled variables
Returns
Reference to a ArrayVariableGradient containing the gradient of the coupled array variable
See also
Kernel::gradient

Definition at line 670 of file Coupleable.C.

Referenced by coupledVectorTagArrayGradient(), and coupledVectorTagArrayGradients().

673 {
674  const auto * var = getArrayVar(var_names, index);
675  if (!var)
676  mooseError(var_names, ": invalid variable name for coupledVectorTagArrayGradient");
678 
679  if (!_c_fe_problem.vectorTagExists(tag))
680  mooseError("Attempting to couple to vector tag with ID ",
681  tag,
682  "in ",
683  _c_name,
684  ", but a vector tag with that ID does not exist");
685 
686  const_cast<Coupleable *>(this)->addFEVariableCoupleableVectorTag(tag);
687 
688  return var->vectorTagGradient(tag);
689 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
void addFEVariableCoupleableVectorTag(TagID tag)
Definition: Coupleable.h:101
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1313
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:44
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:301

◆ coupledVectorTagArrayGradient() [2/2]

const ArrayVariableGradient & Coupleable::coupledVectorTagArrayGradient ( const std::string &  var_names,
const std::string &  tag_name,
unsigned int  index = 0 
) const
protectedvirtual

Definition at line 692 of file Coupleable.C.

695 {
696  if (!_c_parameters.isParamValid(tag_name))
697  mooseError("Tag name parameter '", tag_name, "' is invalid");
698 
699  TagName tagname = _c_parameters.get<TagName>(tag_name);
700  if (!_c_fe_problem.vectorTagExists(tagname))
701  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
702 
703  TagID tag = _c_fe_problem.getVectorTagID(tagname);
704  return coupledVectorTagArrayGradient(var_names, tag, index);
705 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:180
unsigned int TagID
Definition: MooseTypes.h:199
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
virtual const ArrayVariableGradient & coupledVectorTagArrayGradient(const std::string &var_names, TagID tag, unsigned int index=0) const
Returns gradient of a coupled array variable for a given tag.
Definition: Coupleable.C:670
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
const InputParameters & _c_parameters
Definition: Coupleable.h:1310
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledVectorTagArrayGradients() [1/2]

std::vector< const ArrayVariableGradient * > Coupleable::coupledVectorTagArrayGradients ( const std::string &  var_names,
TagID  tag 
) const
protected

Returns gradients for all the coupled variables desired for a given tag.

Parameters
var_namesName(s) of coupled array variable(s)
tagvector tag ID
Returns
Vector of ArrayVariableGradient pointers for each variable in var_name

Definition at line 2506 of file Coupleable.C.

Referenced by coupledVectorTagArrayGradients().

2507 {
2508  auto func = [this, &var_names, &tag](unsigned int index)
2509  { return &coupledVectorTagArrayGradient(var_names, tag, index); };
2510  return coupledVectorHelper<const ArrayVariableGradient *>(var_names, func);
2511 }
virtual const ArrayVariableGradient & coupledVectorTagArrayGradient(const std::string &var_names, TagID tag, unsigned int index=0) const
Returns gradient of a coupled array variable for a given tag.
Definition: Coupleable.C:670

◆ coupledVectorTagArrayGradients() [2/2]

std::vector< const ArrayVariableGradient * > Coupleable::coupledVectorTagArrayGradients ( const std::string &  var_names,
const std::string &  tag_name 
) const
protected

Definition at line 2514 of file Coupleable.C.

2516 {
2517  if (!_c_parameters.isParamValid(tag_name))
2518  mooseError("Tag name parameter '", tag_name, "' is invalid");
2519 
2520  TagName tagname = _c_parameters.get<TagName>(tag_name);
2521  if (!_c_fe_problem.vectorTagExists(tagname))
2522  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2523 
2524  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2525  return coupledVectorTagArrayGradients(var_names, tag);
2526 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:180
unsigned int TagID
Definition: MooseTypes.h:199
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
std::vector< const ArrayVariableGradient * > coupledVectorTagArrayGradients(const std::string &var_names, TagID tag) const
Returns gradients for all the coupled variables desired for a given tag.
Definition: Coupleable.C:2506
const InputParameters & _c_parameters
Definition: Coupleable.h:1310
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledVectorTagArrayValue() [1/2]

const ArrayVariableValue & Coupleable::coupledVectorTagArrayValue ( const std::string &  var_names,
TagID  tag,
unsigned int  index = 0 
) const
protectedvirtual

Returns value of a coupled array variable for a given tag.

Parameters
var_namesName(s) of coupled array variable(s)
tagvector tag ID
indexIndex of the desired variable in the vector of coupled variables
Returns
Reference to a VariableValue for the coupled array variable
See also
Kernel::_u

Definition at line 616 of file Coupleable.C.

Referenced by coupledVectorTagArrayValues().

619 {
620  return vectorTagValueHelper<RealEigenVector>(var_names, tag, index);
621 }

◆ coupledVectorTagArrayValue() [2/2]

const ArrayVariableValue & Coupleable::coupledVectorTagArrayValue ( const std::string &  var_names,
const std::string &  tag_name,
unsigned int  index = 0 
) const
protectedvirtual

Definition at line 624 of file Coupleable.C.

627 {
628  return vectorTagValueHelper<RealEigenVector>(var_names, tag_name, index);
629 }

◆ coupledVectorTagArrayValues() [1/2]

std::vector< const ArrayVariableValue * > Coupleable::coupledVectorTagArrayValues ( const std::string &  var_names,
TagID  tag 
) const
protected

Returns the values for all the coupled variables desired for a given tag.

Parameters
var_nameName of array coupled variable
tagvector tag ID
Returns
Vector of ArrayVariableValue pointers for each variable in var_names

Definition at line 2460 of file Coupleable.C.

Referenced by coupledVectorTagArrayValues().

2461 {
2462  auto func = [this, &var_names, &tag](unsigned int index)
2463  { return &coupledVectorTagArrayValue(var_names, tag, index); };
2464  return coupledVectorHelper<const ArrayVariableValue *>(var_names, func);
2465 }
virtual const ArrayVariableValue & coupledVectorTagArrayValue(const std::string &var_names, TagID tag, unsigned int index=0) const
Returns value of a coupled array variable for a given tag.
Definition: Coupleable.C:616

◆ coupledVectorTagArrayValues() [2/2]

std::vector< const ArrayVariableValue * > Coupleable::coupledVectorTagArrayValues ( const std::string &  var_names,
const std::string &  tag_name 
) const
protected

Definition at line 2468 of file Coupleable.C.

2470 {
2471  if (!_c_parameters.isParamValid(tag_name))
2472  mooseError("Tag name parameter '", tag_name, "' is invalid");
2473 
2474  TagName tagname = _c_parameters.get<TagName>(tag_name);
2475  if (!_c_fe_problem.vectorTagExists(tagname))
2476  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2477 
2478  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2479  return coupledVectorTagArrayValues(var_names, tag);
2480 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:180
unsigned int TagID
Definition: MooseTypes.h:199
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
std::vector< const ArrayVariableValue * > coupledVectorTagArrayValues(const std::string &var_names, TagID tag) const
Returns the values for all the coupled variables desired for a given tag.
Definition: Coupleable.C:2460
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
const InputParameters & _c_parameters
Definition: Coupleable.h:1310
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledVectorTagDofValue() [1/2]

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

Returns dof value of a coupled variable for a given tag.

Parameters
var_namesName(s) of coupled variable(s)
tagvector tag ID
indexIndex of the desired variable in the vector of coupled variables
Returns
Reference to a DofValue for the coupled variable

Definition at line 748 of file Coupleable.C.

Referenced by coupledVectorTagDofValues().

751 {
752  return vectorTagDofValueHelper<Real>(var_name, tag, comp);
753 }

◆ coupledVectorTagDofValue() [2/2]

const VariableValue & Coupleable::coupledVectorTagDofValue ( const std::string &  var_names,
const std::string &  tag_name,
unsigned int  index = 0 
) const
protectedvirtual

Definition at line 756 of file Coupleable.C.

759 {
760  return vectorTagDofValueHelper<Real>(var_name, tag_name, comp);
761 }

◆ coupledVectorTagDofValues() [1/2]

std::vector< const VariableValue * > Coupleable::coupledVectorTagDofValues ( const std::string &  var_names,
TagID  tag 
) const
protected

Returns the dof values for all the coupled variables desired for a given tag.

Parameters
var_namesName(s) of coupled variable(s)
tagvector tag ID
Returns
Vector of VariableValue pointers for each variable in var_name

Definition at line 2529 of file Coupleable.C.

Referenced by coupledVectorTagDofValues().

2530 {
2531  auto func = [this, &var_names, &tag](unsigned int comp)
2532  { return &coupledVectorTagDofValue(var_names, tag, comp); };
2533  return coupledVectorHelper<const VariableValue *>(var_names, func);
2534 }
virtual const VariableValue & coupledVectorTagDofValue(const std::string &var_name, TagID tag, unsigned int index=0) const
Returns dof value of a coupled variable for a given tag.
Definition: Coupleable.C:748

◆ coupledVectorTagDofValues() [2/2]

std::vector< const VariableValue * > Coupleable::coupledVectorTagDofValues ( const std::string &  var_names,
const std::string &  tag_name 
) const
protected

Definition at line 2537 of file Coupleable.C.

2539 {
2540  if (!_c_parameters.isParamValid(tag_name))
2541  mooseError("Tag name parameter '", tag_name, "' is invalid");
2542 
2543  TagName tagname = _c_parameters.get<TagName>(tag_name);
2544  if (!_c_fe_problem.vectorTagExists(tagname))
2545  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2546 
2547  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2548  return coupledVectorTagDofValues(var_names, tag);
2549 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:180
unsigned int TagID
Definition: MooseTypes.h:199
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
std::vector< const VariableValue * > coupledVectorTagDofValues(const std::string &var_names, TagID tag) const
Returns the dof values for all the coupled variables desired for a given tag.
Definition: Coupleable.C:2529
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
const InputParameters & _c_parameters
Definition: Coupleable.h:1310
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledVectorTagGradient() [1/2]

const VariableGradient & Coupleable::coupledVectorTagGradient ( const std::string &  var_names,
TagID  tag,
unsigned int  index = 0 
) const
protectedvirtual

Returns gradient of a coupled variable for a given tag.

Parameters
var_namesName(s) of coupled variable(s)
tagvector tag ID
indexIndex of the desired variable in the vector of coupled variables
Returns
Reference to a VariableGradient containing the gradient of the coupled variable
See also
Kernel::gradient

Definition at line 632 of file Coupleable.C.

Referenced by coupledVectorTagGradient(), and coupledVectorTagGradients().

635 {
636  const auto * var = getVar(var_names, index);
637  if (!var)
638  mooseError(var_names, ": invalid variable name for coupledVectorTagGradient");
640 
641  if (!_c_fe_problem.vectorTagExists(tag))
642  mooseError("Attempting to couple to vector tag with ID ",
643  tag,
644  "in ",
645  _c_name,
646  ", but a vector tag with that ID does not exist");
647 
648  const_cast<Coupleable *>(this)->addFEVariableCoupleableVectorTag(tag);
649 
650  return var->vectorTagGradient(tag);
651 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
void addFEVariableCoupleableVectorTag(TagID tag)
Definition: Coupleable.h:101
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1313
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:44

◆ coupledVectorTagGradient() [2/2]

const VariableGradient & Coupleable::coupledVectorTagGradient ( const std::string &  var_names,
const std::string &  tag_name,
unsigned int  index = 0 
) const
protectedvirtual

Definition at line 654 of file Coupleable.C.

657 {
658  if (!_c_parameters.isParamValid(tag_name))
659  mooseError("Tag name parameter '", tag_name, "' is invalid");
660 
661  TagName tagname = _c_parameters.get<TagName>(tag_name);
662  if (!_c_fe_problem.vectorTagExists(tagname))
663  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
664 
665  TagID tag = _c_fe_problem.getVectorTagID(tagname);
666  return coupledVectorTagGradient(var_names, tag, index);
667 }
virtual const VariableGradient & coupledVectorTagGradient(const std::string &var_names, TagID tag, unsigned int index=0) const
Returns gradient of a coupled variable for a given tag.
Definition: Coupleable.C:632
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:180
unsigned int TagID
Definition: MooseTypes.h:199
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
const InputParameters & _c_parameters
Definition: Coupleable.h:1310
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledVectorTagGradients() [1/2]

std::vector< const VariableGradient * > Coupleable::coupledVectorTagGradients ( const std::string &  var_names,
TagID  tag 
) const
protected

Returns gradients for all the coupled variables desired for a given tag.

Parameters
var_namesName(s) of coupled array variable(s)
tagvector tag ID
Returns
Vector of VariableGradient pointers for each variables in var_name

Definition at line 2483 of file Coupleable.C.

Referenced by coupledVectorTagGradients().

2484 {
2485  auto func = [this, &var_names, &tag](unsigned int index)
2486  { return &coupledVectorTagGradient(var_names, tag, index); };
2487  return coupledVectorHelper<const VariableGradient *>(var_names, func);
2488 }
virtual const VariableGradient & coupledVectorTagGradient(const std::string &var_names, TagID tag, unsigned int index=0) const
Returns gradient of a coupled variable for a given tag.
Definition: Coupleable.C:632

◆ coupledVectorTagGradients() [2/2]

std::vector< const VariableGradient * > Coupleable::coupledVectorTagGradients ( const std::string &  var_names,
const std::string &  tag_name 
) const
protected

Definition at line 2491 of file Coupleable.C.

2493 {
2494  if (!_c_parameters.isParamValid(tag_name))
2495  mooseError("Tag name parameter '", tag_name, "' is invalid");
2496 
2497  TagName tagname = _c_parameters.get<TagName>(tag_name);
2498  if (!_c_fe_problem.vectorTagExists(tagname))
2499  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2500 
2501  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2502  return coupledVectorTagGradients(var_names, tag);
2503 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:180
unsigned int TagID
Definition: MooseTypes.h:199
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
std::vector< const VariableGradient * > coupledVectorTagGradients(const std::string &var_names, TagID tag) const
Returns gradients for all the coupled variables desired for a given tag.
Definition: Coupleable.C:2483
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
const InputParameters & _c_parameters
Definition: Coupleable.h:1310
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledVectorTagValue() [1/2]

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

Returns value of a coupled variable for a given tag.

Parameters
var_namesName(s) of coupled variable(s)
tagvector tag ID
indexIndex of the desired variable in the vector of coupled variables
Returns
Reference to a VariableValue for the coupled variable
See also
Kernel::_u

Definition at line 600 of file Coupleable.C.

Referenced by coupledVectorTagValues().

603 {
604  return vectorTagValueHelper<Real>(var_names, tag, index);
605 }

◆ coupledVectorTagValue() [2/2]

const VariableValue & Coupleable::coupledVectorTagValue ( const std::string &  var_names,
const std::string &  tag_name,
unsigned int  index = 0 
) const
protectedvirtual

Definition at line 608 of file Coupleable.C.

611 {
612  return vectorTagValueHelper<Real>(var_names, tag_name, index);
613 }

◆ coupledVectorTagValues() [1/2]

std::vector< const VariableValue * > Coupleable::coupledVectorTagValues ( const std::string &  var_names,
TagID  tag 
) const
protected

Returns the values for all the coupled variables desired for a given tag.

Parameters
var_namesName(s) of coupled variable(s)
tagvector tag ID
Returns
Vector of VariableValue pointers for each variable in var_names

Definition at line 2437 of file Coupleable.C.

Referenced by coupledVectorTagValues().

2438 {
2439  auto func = [this, &var_names, &tag](unsigned int comp)
2440  { return &coupledVectorTagValue(var_names, tag, comp); };
2441  return coupledVectorHelper<const VariableValue *>(var_names, func);
2442 }
virtual const VariableValue & coupledVectorTagValue(const std::string &var_names, TagID tag, unsigned int index=0) const
Returns value of a coupled variable for a given tag.
Definition: Coupleable.C:600

◆ coupledVectorTagValues() [2/2]

std::vector< const VariableValue * > Coupleable::coupledVectorTagValues ( const std::string &  var_names,
const std::string &  tag_name 
) const
protected

Definition at line 2445 of file Coupleable.C.

2447 {
2448  if (!_c_parameters.isParamValid(tag_name))
2449  mooseError("Tag name parameter '", tag_name, "' is invalid");
2450 
2451  TagName tagname = _c_parameters.get<TagName>(tag_name);
2452  if (!_c_fe_problem.vectorTagExists(tagname))
2453  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2454 
2455  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2456  return coupledVectorTagValues(var_names, tag);
2457 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:180
unsigned int TagID
Definition: MooseTypes.h:199
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
std::vector< const VariableValue * > coupledVectorTagValues(const std::string &var_names, TagID tag) const
Returns the values for all the coupled variables desired for a given tag.
Definition: Coupleable.C:2437
const InputParameters & _c_parameters
Definition: Coupleable.h:1310
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledVectorValue()

const VectorVariableValue & Coupleable::coupledVectorValue ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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 805 of file Coupleable.C.

Referenced by coupledVectorValues().

806 {
807  const auto * var = getVectorVar(var_name, comp);
808  if (!var)
809  return *getDefaultVectorValue(var_name);
811 
813  {
814  if (_c_nodal)
815  return _c_is_implicit ? var->nodalValueArray() : var->nodalValueOldArray();
816  else
817  return _c_is_implicit ? var->sln() : var->slnOld();
818  }
819  else
820  {
821  if (_c_nodal)
822  // Since this is at a node, I don't feel like there should be any "neighbor" logic
823  return _c_is_implicit ? var->nodalValueArray() : var->nodalValueOldArray();
824  else
825  return _c_is_implicit ? var->slnNeighbor() : var->slnOldNeighbor();
826  }
827 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
const VectorVariableValue * getDefaultVectorValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for an uncoupled vector variable...
Definition: Coupleable.C:357
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
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:1614

◆ coupledVectorValueOld()

const VectorVariableValue & Coupleable::coupledVectorValueOld ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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
VectorKernel::_u_old

Definition at line 1048 of file Coupleable.C.

1049 {
1050  const auto * var = getVectorVar(var_name, comp);
1051  if (!var)
1052  return *getDefaultVectorValue(var_name);
1054 
1055  if (!_coupleable_neighbor)
1056  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
1057  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
1058 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
const VectorVariableValue * getDefaultVectorValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for an uncoupled vector variable...
Definition: Coupleable.C:357
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1348
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:1614

◆ coupledVectorValueOlder()

const VectorVariableValue & Coupleable::coupledVectorValueOlder ( const std::string &  var_name,
unsigned int  comp = 0 
) const
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
VectorKernel::_u_older

Definition at line 1061 of file Coupleable.C.

1062 {
1063  const auto * var = getVectorVar(var_name, comp);
1064  if (!var)
1065  return *getDefaultVectorValue(var_name);
1067 
1068  if (!_coupleable_neighbor)
1069  return var->slnOlder();
1070  return var->slnOlderNeighbor();
1071 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:289
const VectorVariableValue * getDefaultVectorValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for an uncoupled vector variable...
Definition: Coupleable.C:357
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:1614

◆ coupledVectorValues()

std::vector< const VectorVariableValue * > Coupleable::coupledVectorValues ( const std::string &  var_name) const
protected

Returns the values for all of a coupled vector variable's components.

Parameters
var_nameName of coupled variable
Returns
Vector of VectorVariableValue pointers for each component of var_name

Definition at line 2401 of file Coupleable.C.

2402 {
2403  auto func = [this, &var_name](unsigned int comp) { return &coupledVectorValue(var_name, comp); };
2404  return coupledVectorHelper<const VectorVariableValue *>(var_name, func);
2405 }
virtual const VectorVariableValue & coupledVectorValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled vector variable.
Definition: Coupleable.C:805

◆ genericZeroGradient() [1/3]

template<bool is_ad>
const GenericVariableGradient<is_ad>& Coupleable::genericZeroGradient ( )
protected

Returns zero gradient templated with automatic differentiation boolean.

Returns
Reference to a const GenericVariableValue

◆ genericZeroGradient() [2/3]

template<>
const GenericVariableGradient<false>& Coupleable::genericZeroGradient ( )
protected

Definition at line 2322 of file Coupleable.C.

2323 {
2324  return _grad_zero;
2325 }
const VariableGradient & _grad_zero
Zero gradient of a variable.
Definition: Coupleable.h:1401

◆ genericZeroGradient() [3/3]

template<>
const GenericVariableGradient<true>& Coupleable::genericZeroGradient ( )
protected

Definition at line 2329 of file Coupleable.C.

2330 {
2331  return _ad_grad_zero;
2332 }
const MooseArray< ADRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:1402

◆ genericZeroSecond() [1/3]

template<bool is_ad>
const GenericVariableSecond<is_ad>& Coupleable::genericZeroSecond ( )
protected

Returns zero second derivative templated with automatic differentiation boolean.

Returns
Reference to a const GenericVariableValue

◆ genericZeroSecond() [2/3]

template<>
const GenericVariableSecond<false>& Coupleable::genericZeroSecond ( )
protected

Definition at line 2336 of file Coupleable.C.

2337 {
2338  return _second_zero;
2339 }
const VariableSecond & _second_zero
Zero second derivative of a variable.
Definition: Coupleable.h:1408

◆ genericZeroSecond() [3/3]

template<>
const GenericVariableSecond<true>& Coupleable::genericZeroSecond ( )
protected

Definition at line 2343 of file Coupleable.C.

2344 {
2345  return _ad_second_zero;
2346 }
const MooseArray< ADRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:1409

◆ genericZeroValue() [1/3]

template<bool is_ad>
const GenericVariableValue<is_ad>& Coupleable::genericZeroValue ( )
protected

Returns zero value templated with automatic differentiation boolean.

Returns
Reference to a const GenericVariableValue

◆ genericZeroValue() [2/3]

template<>
const GenericVariableValue<false>& Coupleable::genericZeroValue ( )
protected

Definition at line 2308 of file Coupleable.C.

2309 {
2310  return _zero;
2311 }
const VariableValue & _zero
Zero value of a variable.
Definition: Coupleable.h:1396

◆ genericZeroValue() [3/3]

template<>
const GenericVariableValue<true>& Coupleable::genericZeroValue ( )
protected

Definition at line 2315 of file Coupleable.C.

2316 {
2317  return _ad_zero;
2318 }
const MooseArray< DualReal > & _ad_zero
Definition: Coupleable.h:1398

◆ getADDefaultGradient()

const ADVariableGradient & Coupleable::getADDefaultGradient ( ) const

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

Referenced by adCoupledGradient(), and adCoupledGradientDot().

2266 {
2268  return _ad_default_gradient;
2269 }
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692
MooseArray< ADRealVectorValue > _ad_default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1384

◆ getADDefaultSecond()

const ADVariableSecond & Coupleable::getADDefaultSecond ( ) const

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

Referenced by adCoupledSecond().

2280 {
2282  return _ad_default_second;
2283 }
MooseArray< ADRealTensorValue > _ad_default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1393
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ getADDefaultValue()

const ADVariableValue * Coupleable::getADDefaultValue ( const std::string &  var_name) const

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

Referenced by adCoupledDofValues(), adCoupledDot(), adCoupledDotDot(), adCoupledLowerValue(), NeighborCoupleable::adCoupledNeighborValue(), and adCoupledValue().

2235 {
2236  auto default_value_it = _ad_default_value.find(var_name);
2237  if (default_value_it == _ad_default_value.end())
2238  {
2239  auto value = std::make_unique<ADVariableValue>(_coupleable_max_qps,
2241  default_value_it = _ad_default_value.insert(std::make_pair(var_name, std::move(value))).first;
2242  }
2243 
2244  return default_value_it->second.get();
2245 }
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
Real defaultCoupledValue(const std::string &coupling_name, unsigned int i=0) const
Get the default value for an optionally coupled variable.
std::unordered_map< std::string, std::unique_ptr< MooseArray< DualReal > > > _ad_default_value
Will hold the default value for optional coupled variables for automatic differentiation.
Definition: Coupleable.h:1361
const InputParameters & _c_parameters
Definition: Coupleable.h:1310
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ getADDefaultVectorGradient()

const ADVectorVariableGradient & Coupleable::getADDefaultVectorGradient ( ) const

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

Referenced by adCoupledVectorGradient().

2273 {
2276 }
MooseArray< ADRealTensorValue > _ad_default_vector_gradient
This will always be zero because the default values for optionally coupled vector variables is always...
Definition: Coupleable.h:1387
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ getADDefaultVectorValue()

const ADVectorVariableValue * Coupleable::getADDefaultVectorValue ( const std::string &  var_name) const

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

Referenced by adCoupledVectorDot(), NeighborCoupleable::adCoupledVectorNeighborValue(), and adCoupledVectorValue().

2249 {
2250  auto default_value_it = _ad_default_vector_value.find(var_name);
2251  if (default_value_it == _ad_default_vector_value.end())
2252  {
2253  RealVectorValue default_vec;
2254  for (unsigned int i = 0; i < _c_parameters.numberDefaultCoupledValues(var_name); ++i)
2255  default_vec(i) = _c_parameters.defaultCoupledValue(var_name, i);
2256  auto value = std::make_unique<ADVectorVariableValue>(_coupleable_max_qps, default_vec);
2257  default_value_it =
2258  _ad_default_vector_value.insert(std::make_pair(var_name, std::move(value))).first;
2259  }
2260 
2261  return default_value_it->second.get();
2262 }
std::unordered_map< std::string, std::unique_ptr< MooseArray< ADRealVectorValue > > > _ad_default_vector_value
Will hold the default value for optional vector coupled variables for automatic differentiation.
Definition: Coupleable.h:1372
unsigned int numberDefaultCoupledValues(const std::string &coupling_name) const
Get the number of defaulted coupled value entries.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
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:1310
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ getArrayVar() [1/2]

ArrayMooseVariable * Coupleable::getArrayVar ( const std::string &  var_name,
unsigned int  comp 
)
protected

◆ getArrayVar() [2/2]

const ArrayMooseVariable * Coupleable::getArrayVar ( const std::string &  var_name,
unsigned int  comp 
) const
protected

Extract pointer to a coupled array variable.

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

Definition at line 324 of file Coupleable.C.

325 {
326  return getVarHelper<ArrayMooseVariable>(var_name, comp);
327 }

◆ getCoupledArrayMooseVars()

const std::vector<ArrayMooseVariable *>& Coupleable::getCoupledArrayMooseVars ( ) const
inline

Get the list of array coupled variables.

Returns
The list of array coupled variables

Definition at line 96 of file Coupleable.h.

97  {
99  }
std::vector< ArrayMooseVariable * > _coupled_array_moose_vars
Vector of array coupled variables.
Definition: Coupleable.h:1336

◆ getCoupledMooseVars()

const std::vector<MooseVariableFieldBase *>& 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 78 of file Coupleable.h.

79  {
81  }
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Definition: Coupleable.h:1330

◆ getCoupledVars()

const std::unordered_map<std::string, std::vector<MooseVariableFieldBase *> >& Coupleable::getCoupledVars ( ) const
inline

Get the list of coupled variables.

Returns
The list of coupled variables

Definition at line 60 of file Coupleable.h.

Referenced by InitialConditionBase::InitialConditionBase().

61  {
62  return _coupled_vars;
63  }
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1324

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

88  {
90  }
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
Definition: Coupleable.h:1333

◆ getDefaultArrayValue()

const ArrayVariableValue * Coupleable::getDefaultArrayValue ( const std::string &  var_name) const
private

Helper method to return (and insert if necessary) the default value for an uncoupled array 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 392 of file Coupleable.C.

Referenced by coupledArrayDofValues(), coupledArrayValue(), coupledArrayValueOld(), and coupledArrayValueOlder().

393 {
394  auto default_value_it = _default_array_value.find(var_name);
395  if (default_value_it == _default_array_value.end())
396  {
397  auto value = std::make_unique<ArrayVariableValue>(_coupleable_max_qps);
398  for (unsigned int qp = 0; qp < _coupleable_max_qps; ++qp)
399  {
400  auto n = _c_parameters.numberDefaultCoupledValues(var_name);
401  (*value)[qp].resize(n);
402  for (unsigned int i = 0; i < n; ++i)
403  (*value)[qp](i) = _c_parameters.defaultCoupledValue(var_name, i);
404  }
405  default_value_it =
406  _default_array_value.insert(std::make_pair(var_name, std::move(value))).first;
407  }
408 
409  return default_value_it->second.get();
410 }
unsigned int numberDefaultCoupledValues(const std::string &coupling_name) const
Get the number of defaulted coupled value entries.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
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:1310
std::unordered_map< std::string, std::unique_ptr< ArrayVariableValue > > _default_array_value
Will hold the default value for optional array coupled variables.
Definition: Coupleable.h:1368
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ getDefaultFunctor()

template<typename T >
const Moose::Functor<T>& Coupleable::getDefaultFunctor ( const std::string &  var_name) const
private

◆ getDefaultNodalValue() [1/3]

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

Definition at line 422 of file Coupleable.C.

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

◆ getDefaultNodalValue() [2/3]

template<>
const RealEigenVector& Coupleable::getDefaultNodalValue ( const std::string &  var_name,
unsigned int   
) const
private

Definition at line 430 of file Coupleable.C.

431 {
432  auto && default_variable_value = getDefaultArrayValue(var_name);
433  return *default_variable_value->data();
434 }
const ArrayVariableValue * getDefaultArrayValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for an uncoupled array variable...
Definition: Coupleable.C:392

◆ getDefaultNodalValue() [3/3]

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

Get nodal default value.

Definition at line 414 of file Coupleable.C.

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

◆ getDefaultValue()

const VariableValue * Coupleable::getDefaultValue ( const std::string &  var_name,
unsigned int  comp 
) const
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 330 of file Coupleable.C.

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

331 {
332  // make sure we don't access values that were not provided
333  checkComponent(_obj, comp, _c_parameters.numberDefaultCoupledValues(var_name), var_name);
334 
335  auto default_value_it = _default_value.find(var_name);
336  if (default_value_it == _default_value.end())
337  {
338  _default_value[var_name].emplace_back(std::make_unique<VariableValue>(
340  for (unsigned int j = 1; j < _c_parameters.numberDefaultCoupledValues(var_name); ++j)
341  _default_value[var_name].emplace_back(std::make_unique<VariableValue>(
343  default_value_it = _default_value.find(var_name);
344  }
345 
346  const auto & default_value_vec = default_value_it->second;
347  const auto n_default_vals = default_value_vec.size();
348  if (comp >= n_default_vals)
349  mooseError("Requested comp ",
350  comp,
351  " is equal to or greater than the number of default values ",
352  n_default_vals);
353  return default_value_vec[comp].get();
354 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
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 MooseObject *const _obj
Definition: Coupleable.h:1707
void checkComponent(const MooseObject *obj, unsigned int comp, unsigned int bound, const std::string &var_name)
Definition: Coupleable.C:173
std::unordered_map< std::string, std::vector< std::unique_ptr< VariableValue > > > _default_value
Will hold the default value for optional coupled variables.
Definition: Coupleable.h:1358
const InputParameters & _c_parameters
Definition: Coupleable.h:1310
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ getDefaultVectorValue()

const VectorVariableValue * Coupleable::getDefaultVectorValue ( const std::string &  var_name) const
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 357 of file Coupleable.C.

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

358 {
359  auto default_value_it = _default_vector_value.find(var_name);
360  if (default_value_it == _default_vector_value.end())
361  {
362  auto value = std::make_unique<VectorVariableValue>(_coupleable_max_qps, 0);
363  bool already_warned = false;
364  for (unsigned int qp = 0; qp < _coupleable_max_qps; ++qp)
365  for (const auto i : make_range(Moose::dim))
366  {
367  try
368  {
369  (*value)[qp](i) = _c_parameters.defaultCoupledValue(var_name, i);
370  }
371  catch (const std::out_of_range &)
372  {
373  if (!already_warned)
374  mooseWarning(
375  "You supplied less than 3 arguments for the default vector value for variable ",
376  var_name,
377  ". Did you accidently leave something off? We are going to assign 0s, assuming "
378  "this "
379  "was intentional.");
380  already_warned = true;
381  (*value)[qp](i) = 0;
382  }
383  }
384  default_value_it =
385  _default_vector_value.insert(std::make_pair(var_name, std::move(value))).first;
386  }
387 
388  return default_value_it->second.get();
389 }
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:296
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:148
std::unordered_map< std::string, std::unique_ptr< VectorVariableValue > > _default_vector_value
Will hold the default value for optional vector coupled variables.
Definition: Coupleable.h:1365
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
Real defaultCoupledValue(const std::string &coupling_name, unsigned int i=0) const
Get the default value for an optionally coupled variable.
IntRange< T > make_range(T beg, T end)
const InputParameters & _c_parameters
Definition: Coupleable.h:1310
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1692

◆ getFEVar()

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

Deprecated method.

Use getFieldVar instead Extract pointer to a base coupled field variable. Could be either a finite volume or finite element variable

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

Definition at line 263 of file Coupleable.C.

264 {
265  mooseDeprecated("Coupleable::getFEVar is deprecated. Please use Coupleable::getFieldVar instead. "
266  "Note that this method could potentially return a finite volume variable");
267  return getFieldVar(var_name, comp);
268 }
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:313
const MooseVariableFieldBase * getFieldVar(const std::string &var_name, unsigned int comp) const
Definition: Coupleable.C:277

◆ getFEVariableCoupleableMatrixTags() [1/2]

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

Definition at line 107 of file Coupleable.h.

107 { return _fe_coupleable_matrix_tags; }
std::set< TagID > _fe_coupleable_matrix_tags
Definition: Coupleable.h:1702

◆ getFEVariableCoupleableMatrixTags() [2/2]

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

Definition at line 114 of file Coupleable.h.

115  {
117  }
std::set< TagID > _fe_coupleable_matrix_tags
Definition: Coupleable.h:1702

◆ getFEVariableCoupleableVectorTags() [1/2]

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

◆ getFEVariableCoupleableVectorTags() [2/2]

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

Definition at line 109 of file Coupleable.h.

110  {
112  }
std::set< TagID > _fe_coupleable_vector_tags
Definition: Coupleable.h:1700

◆ getFieldVar() [1/2]

const MooseVariableFieldBase * Coupleable::getFieldVar ( const std::string &  var_name,
unsigned int  comp 
) const
protected

◆ getFieldVar() [2/2]

MooseVariableFieldBase * Coupleable::getFieldVar ( const std::string &  var_name,
unsigned int  comp 
)
protected

Definition at line 271 of file Coupleable.C.

272 {
273  return getVarHelper<MooseVariableFieldBase>(var_name, comp);
274 }

◆ getVar() [1/2]

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

Referenced by coupledDofValuesOld(), coupledDofValuesOlder(), coupledDot(), coupledDotDot(), coupledDotDotDu(), coupledDotDotOld(), coupledDotDu(), coupledDotOld(), coupledGradientDot(), coupledGradientDotDot(), coupledGradientOld(), coupledGradientOlder(), coupledGradientPreviousNL(), NeighborCoupleable::coupledNeighborDofValues(), NeighborCoupleable::coupledNeighborDofValuesOld(), NeighborCoupleable::coupledNeighborDofValuesOlder(), NeighborCoupleable::coupledNeighborGradientOld(), NeighborCoupleable::coupledNeighborGradientOlder(), NeighborCoupleable::coupledNeighborSecond(), NeighborCoupleable::coupledNeighborValueDot(), NeighborCoupleable::coupledNeighborValueDotDu(), NeighborCoupleable::coupledNeighborValueOld(), NeighborCoupleable::coupledNeighborValueOlder(), coupledNodalDotDot(), coupledNodalDotDotOld(), coupledNodalDotOld(), coupledSecond(), coupledSecondOld(), coupledSecondOlder(), coupledSecondPreviousNL(), coupledValueLower(), coupledValueOld(), coupledValueOlder(), coupledValuePreviousNL(), coupledVectorTagGradient(), ExtraIDIntegralVectorPostprocessor::ExtraIDIntegralVectorPostprocessor(), and writableCoupledValue().

284 {
285  return const_cast<MooseVariable *>(getVarHelper<MooseVariable>(var_name, comp));
286 }
Class for stuff related to variables.
Definition: Adaptivity.h:31

◆ getVar() [2/2]

const MooseVariable * Coupleable::getVar ( const std::string &  var_name,
unsigned int  comp 
) const
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 307 of file Coupleable.C.

308 {
309  return getVarHelper<MooseVariable>(var_name, comp);
310 }

◆ getVarHelper() [1/2]

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

Helper that that be used to retrieve a variable of arbitrary type T.

Definition at line 1773 of file Coupleable.h.

1774 {
1775  return const_cast<Coupleable *>(this)->getVarHelper<T>(var_name, comp);
1776 }
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:44

◆ getVarHelper() [2/2]

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

Helper that can be used to retrieve a variable of arbitrary type T.

Definition at line 1719 of file Coupleable.h.

1720 {
1721  const auto var_name = _c_parameters.checkForRename(var_name_in);
1722  auto name_to_use = var_name;
1723 
1724  // First check for supplied name
1725  if (!checkVar(var_name, comp, 0))
1726  {
1727  // See if there is an associated deprecated name that the user may have used instead
1728  auto it = _new_to_deprecated_coupled_vars.find(var_name);
1729  if (it == _new_to_deprecated_coupled_vars.end())
1730  return nullptr;
1731  else
1732  {
1733  auto deprecated_name = it->second;
1734  if (checkVar(deprecated_name, comp, 0))
1735  name_to_use = deprecated_name;
1736  else
1737  return nullptr;
1738  }
1739  }
1740 
1741  auto coupled_vars_it = _coupled_vars.find(name_to_use);
1742 
1743  mooseAssert(coupled_vars_it != _coupled_vars.end(),
1744  "Trying to get a coupled var " << name_to_use << " that doesn't exist");
1745 
1746  if (auto coupled_var = dynamic_cast<T *>(coupled_vars_it->second[comp]))
1747  return coupled_var;
1748  else
1749  {
1750  for (auto & var : _coupled_standard_moose_vars)
1751  if (var->name() == name_to_use)
1752  mooseError("The named variable is a standard variable, try a "
1753  "'coupled[Value/Gradient/Dot/etc]...' function instead");
1754  for (auto & var : _coupled_vector_moose_vars)
1755  if (var->name() == name_to_use)
1756  mooseError("The named variable is a vector variable, try a "
1757  "'coupledVector[Value/Gradient/Dot/etc]...' function instead");
1758  for (auto & var : _coupled_array_moose_vars)
1759  if (var->name() == name_to_use)
1760  mooseError("The named variable is an array variable, try a "
1761  "'coupledArray[Value/Gradient/Dot/etc]...' function instead");
1762  for (auto & var : _coupled_standard_fv_moose_vars)
1763  if (var->name() == name_to_use)
1764  mooseError("The named variable is a finite volume variable, which the coupled[...] routine "
1765  "used does not support. Try using the functor system routines instead.");
1766  mooseError(
1767  "Variable '", name_to_use, "' is of a different C++ type than you tried to fetch it as.");
1768  }
1769 }
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1324
std::vector< MooseVariableFV< Real > * > _coupled_standard_fv_moose_vars
Vector of standard finite volume coupled variables.
Definition: Coupleable.h:1339
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< ArrayMooseVariable * > _coupled_array_moose_vars
Vector of array coupled variables.
Definition: Coupleable.h:1336
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Definition: Coupleable.h:1330
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
Definition: Coupleable.h:1333
bool checkVar(const std::string &var_name, unsigned int comp=0, unsigned int comp_bound=0) const
Check that the right kind of variable is being coupled in.
Definition: Coupleable.C:204
std::string checkForRename(const std::string &name) const
Checks whether the provided name is a renamed parameter name.
const InputParameters & _c_parameters
Definition: Coupleable.h:1310
const std::unordered_map< std::string, std::string > & _new_to_deprecated_coupled_vars
map from new to deprecated variable names
Definition: Coupleable.h:1342

◆ getVectorVar() [1/2]

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

Referenced by adCoupledVectorDot(), adCoupledVectorGradient(), adCoupledVectorValue(), coupledCurl(), coupledCurlOld(), coupledCurlOlder(), coupledVectorDot(), coupledVectorDotDot(), coupledVectorDotDotDu(), coupledVectorDotDotOld(), coupledVectorDotDu(), coupledVectorDotOld(), coupledVectorGradient(), coupledVectorGradientOld(), coupledVectorGradientOlder(), NeighborCoupleable::coupledVectorNeighborGradient(), NeighborCoupleable::coupledVectorNeighborGradientOld(), NeighborCoupleable::coupledVectorNeighborGradientOlder(), coupledVectorValue(), coupledVectorValueOld(), and coupledVectorValueOlder().

290 {
291  auto * const var =
292  const_cast<VectorMooseVariable *>(getVarHelper<VectorMooseVariable>(var_name, comp));
293 
294  if (_c_nodal && var && var->feType().family != LAGRANGE_VEC)
295  mooseError(_c_name, ": Only LAGRANGE_VEC vector variables are defined at nodes");
296 
297  return var;
298 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
LAGRANGE_VEC
Class for stuff related to variables.
Definition: Adaptivity.h:31
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1313

◆ getVectorVar() [2/2]

const VectorMooseVariable * Coupleable::getVectorVar ( const std::string &  var_name,
unsigned int  comp 
) const
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 313 of file Coupleable.C.

314 {
315  const auto * const var = getVarHelper<VectorMooseVariable>(var_name, comp);
316 
317  if (_c_nodal && var && var->feType().family != LAGRANGE_VEC)
318  mooseError(_c_name, ": Only LAGRANGE_VEC vector variables are defined at nodes");
319 
320  return var;
321 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
LAGRANGE_VEC
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1313

◆ getWritableCoupledVariables()

auto& Coupleable::getWritableCoupledVariables ( ) const
inline

returns a reference to the set of writable coupled variables

Definition at line 122 of file Coupleable.h.

Referenced by hasWritableCoupledVariables().

THREAD_ID _c_tid
Thread ID of the thread using this object.
Definition: Coupleable.h:1354
std::vector< std::set< MooseWritableVariable * > > _writable_coupled_variables
keep a set of allocated writable variable references to make sure only one object can obtain them per...
Definition: Coupleable.h:1714

◆ hasWritableCoupledVariables()

bool Coupleable::hasWritableCoupledVariables ( ) const
inline

Checks whether the object has any writable coupled variables.

Definition at line 127 of file Coupleable.h.

127 { return !getWritableCoupledVariables().empty(); }
auto & getWritableCoupledVariables() const
returns a reference to the set of writable coupled variables
Definition: Coupleable.h:122

◆ isCoupled()

bool Coupleable::isCoupled ( const std::string &  var_name,
unsigned int  i = 0 
) const
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 124 of file Coupleable.C.

Referenced by adCoupledNodalValue(), checkVar(), coupledComponents(), and MatDiffusionBase< Real >::MatDiffusionBase().

125 {
126  const auto var_name = _c_parameters.checkForRename(var_name_in);
127 
128  auto it = _coupled_vars.find(var_name);
129  if (it != _coupled_vars.end())
130  return (i < it->second.size());
131  else
132  {
133  // Make sure the user originally requested this value in the InputParameter syntax
134  if (!_c_parameters.hasCoupledValue(var_name))
136  ": The coupled variable \"",
137  var_name,
138  "\" was never added to this object's "
139  "InputParameters, please double-check your "
140  "spelling");
141 
142  return false;
143  }
144 }
bool hasCoupledValue(const std::string &coupling_name) const
Return whether or not the coupled variable exists.
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1324
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1313
std::string checkForRename(const std::string &name) const
Checks whether the provided name is a renamed parameter name.
const InputParameters & _c_parameters
Definition: Coupleable.h:1310

◆ isCoupledConstant()

bool Coupleable::isCoupledConstant ( const std::string &  var_name) const
protectedvirtual

Returns true if a variable passed as a coupled value is really a constant.

Parameters
var_nameThe name the kernel wants to refer to the variable as.
Returns
True if the variable is actually a constant

Definition at line 147 of file Coupleable.C.

Referenced by coupledName(), and DerivativeFunctionMaterialBaseTempl< is_ad >::DerivativeFunctionMaterialBaseTempl().

148 {
149  return _c_parameters.hasDefaultCoupledValue(var_name);
150 }
bool hasDefaultCoupledValue(const std::string &coupling_name) const
Return whether or not the requested parameter has a default coupled value.
const InputParameters & _c_parameters
Definition: Coupleable.h:1310

◆ requestStates()

template<typename T >
void Coupleable::requestStates ( const std::string &  var_name,
const TagName &  tag_name,
const unsigned int  comp 
)
private

Method that may request additional solution states from the variable's system depending on the value of tag_name.

E.g. if the tag name corresponds to old or older variable solution values, then we must request more states

Definition at line 529 of file Coupleable.C.

532 {
533  auto var =
534  const_cast<MooseVariableField<T> *>(getVarHelper<MooseVariableField<T>>(var_name, comp));
535  if (!var)
536  mooseError(var_name, ": invalid variable name for tag coupling");
537 
538  auto & var_sys = var->sys();
539  if (tag_name == Moose::OLD_SOLUTION_TAG)
540  var_sys.needSolutionState(1);
541  else if (tag_name == Moose::OLDER_SOLUTION_TAG)
542  var_sys.needSolutionState(2);
543 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
const TagName OLDER_SOLUTION_TAG
Definition: MooseTypes.C:29
const TagName OLD_SOLUTION_TAG
Definition: MooseTypes.C:28

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

Referenced by checkFuncType(), NeighborCoupleable::coupledArrayNeighborGradientOld(), NeighborCoupleable::coupledArrayNeighborGradientOlder(), NeighborCoupleable::coupledNeighborDofValuesOld(), NeighborCoupleable::coupledNeighborDofValuesOlder(), NeighborCoupleable::coupledNeighborGradientOld(), NeighborCoupleable::coupledNeighborGradientOlder(), NeighborCoupleable::coupledNeighborValueOld(), NeighborCoupleable::coupledNeighborValueOlder(), NeighborCoupleable::coupledVectorNeighborGradientOld(), and NeighborCoupleable::coupledVectorNeighborGradientOlder().

2018 {
2019  if (!_c_fe_problem.isTransient())
2021  ": Calling \"",
2022  fn_name,
2023  "\" on variable \"",
2024  name,
2025  "\" when using a \"Steady\" executioner is not allowed. This value is available "
2026  "only in transient simulations.");
2027 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1313
virtual bool isTransient() const override

◆ vectorTagDofValueHelper() [1/2]

template<typename T >
const OutputTools< T >::VariableValue & Coupleable::vectorTagDofValueHelper ( const std::string &  var_name,
TagID  tag,
unsigned int  comp = 0 
) const
private

Generic helper method to get vector tag degree of freedom values based on tag ID.

Definition at line 709 of file Coupleable.C.

712 {
713  const auto * var = getVarHelper<MooseVariableField<T>>(var_name, comp);
714  if (!var)
715  mooseError(var_name, ": invalid variable name for coupledVectorTagDofValue");
717 
718  const_cast<Coupleable *>(this)->addFEVariableCoupleableVectorTag(tag);
719 
720  return var->vectorTagDofValue(tag);
721 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
void addFEVariableCoupleableVectorTag(TagID tag)
Definition: Coupleable.h:101
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:44

◆ vectorTagDofValueHelper() [2/2]

template<typename T >
const OutputTools< T >::VariableValue & Coupleable::vectorTagDofValueHelper ( const std::string &  var_name,
const std::string &  tag_name,
unsigned int  comp = 0 
) const
private

Generic helper method to get vector tag degree of freedom values based on tag name.

Definition at line 725 of file Coupleable.C.

728 {
729  if (!_c_parameters.isParamValid(tag_param_name))
730  mooseError("Tag name parameter '", tag_param_name, "' is invalid");
731 
732  const TagName tag_name = MooseUtils::toUpper(_c_parameters.get<TagName>(tag_param_name));
733 
734  const bool older_state_tag = _older_state_tags.count(tag_name);
735  if (older_state_tag)
736  // We may need to add solution states and create vector tags
737  const_cast<Coupleable *>(this)->requestStates<T>(var_name, tag_name, comp);
738 
739  if (!_c_fe_problem.vectorTagExists(tag_name))
740  mooseError("Tagged vector with tag name '", tag_name, "' does not exist");
741 
742  TagID tag = _c_fe_problem.getVectorTagID(tag_name);
743 
744  return vectorTagDofValueHelper<T>(var_name, tag, comp);
745 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:180
std::string toUpper(const std::string &name)
Convert supplied string to upper case.
Definition: MooseUtils.C:1040
unsigned int TagID
Definition: MooseTypes.h:199
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:44
const InputParameters & _c_parameters
Definition: Coupleable.h:1310
const std::set< std::string > _older_state_tags
vector tag names for which we need to request older solution states from the system ...
Definition: Coupleable.h:1710
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ vectorTagValueHelper() [1/2]

template<typename T >
const OutputTools< T >::VariableValue & Coupleable::vectorTagValueHelper ( const std::string &  var_names,
TagID  tag,
unsigned int  index = 0 
) const
private

Generic helper method to get vector tag values based on tag ID.

Definition at line 503 of file Coupleable.C.

506 {
507  const auto * const var = getVarHelper<MooseVariableField<T>>(var_names, index);
508  if (!var)
509  mooseError(var_names, ": invalid variable name for coupledVectorTagValue");
511 
512  if (!_c_fe_problem.vectorTagExists(tag))
513  mooseError("Attempting to couple to vector tag with ID ",
514  tag,
515  "in ",
516  _c_name,
517  ", but a vector tag with that ID does not exist");
518 
519  const_cast<Coupleable *>(this)->addFEVariableCoupleableVectorTag(tag);
520 
521  if (_c_nodal)
522  return var->nodalVectorTagValue(tag);
523  else
524  return var->vectorTagValue(tag);
525 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1345
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:187
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
void addFEVariableCoupleableVectorTag(TagID tag)
Definition: Coupleable.h:101
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1313
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:44

◆ vectorTagValueHelper() [2/2]

template<typename T >
const OutputTools< T >::VariableValue & Coupleable::vectorTagValueHelper ( const std::string &  var_names,
const std::string &  tag_name,
unsigned int  index = 0 
) const
private

Generic helper method to get vector tag values based on tag name.

Definition at line 547 of file Coupleable.C.

550 {
551  if (!_c_parameters.isParamValid(tag_param_name))
552  mooseError("Tag name parameter '", tag_param_name, "' is invalid");
553 
554  const TagName tag_name = MooseUtils::toUpper(_c_parameters.get<TagName>(tag_param_name));
555 
556  const bool older_state_tag = _older_state_tags.count(tag_name);
557  if (older_state_tag)
558  // We may need to add solution states and create vector tags
559  const_cast<Coupleable *>(this)->requestStates<T>(var_names, tag_name, index);
560 
561  if (!_c_fe_problem.vectorTagExists(tag_name))
562  mooseError("Tagged vector with tag name '", tag_name, "' does not exist");
563 
564  TagID tag = _c_fe_problem.getVectorTagID(tag_name);
565  return vectorTagValueHelper<T>(var_names, tag, index);
566 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:180
std::string toUpper(const std::string &name)
Convert supplied string to upper case.
Definition: MooseUtils.C:1040
unsigned int TagID
Definition: MooseTypes.h:199
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:44
const InputParameters & _c_parameters
Definition: Coupleable.h:1310
const std::set< std::string > _older_state_tags
vector tag names for which we need to request older solution states from the system ...
Definition: Coupleable.h:1710
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ writableCoupledValue()

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

Returns a writable reference to a coupled variable for writing to multiple AuxVariables from a single AuxKernel or a UserObject.

Only one object can obtain a writable reference in a simulation.

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

895 {
896  mooseDeprecated("Coupleable::writableCoupledValue is deprecated, please use "
897  "Coupleable::writableVariable instead. ");
898 
899  // check if the variable exists
900  auto * const var = getVar(var_name, comp);
901  if (!var)
902  mooseError(
903  "Unable to create a writable reference for '", var_name, "', is it a constant expression?");
904 
905  // is the requested variable an AuxiliaryVariable?
906  if (!_c_fe_problem.getAuxiliarySystem().hasVariable(var->name()))
907  mooseError(
908  "'", var->name(), "' must be an auxiliary variable in Coupleable::writableCoupledValue");
909 
910  // check that the variable type (elemental/nodal) is compatible with the object type
911  const auto * aux = dynamic_cast<const AuxKernel *>(this);
912 
913  if (!aux)
914  mooseError("writableCoupledValue() can only be called from AuxKernels, but '",
915  _obj->name(),
916  "' is not an AuxKernel.");
917 
918  if (!aux->isNodal() && var->isNodal())
919  mooseError("The elemental AuxKernel '",
920  _obj->name(),
921  "' cannot obtain a writable reference to the nodal variable '",
922  var->name(),
923  "'.");
924 
925  // make sure only one object can access a variable
926  checkWritableVar(var);
927 
928  return const_cast<VariableValue &>(coupledValue(var_name, comp));
929 }
void checkWritableVar(MooseWritableVariable *var)
Checks that the passed in variable is only accessed writable by one object in a given subdomain...
Definition: Coupleable.C:932
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:283
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1318
virtual const VariableValue & coupledValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled variable.
Definition: Coupleable.C:478
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:313
AuxiliarySystem & getAuxiliarySystem()
virtual bool hasVariable(const std::string &var_name) const
Query a system for a variable.
Definition: SystemBase.C:800
const MooseObject *const _obj
Definition: Coupleable.h:1707
OutputTools< Real >::VariableValue VariableValue
Definition: MooseTypes.h:302

◆ writableVariable()

MooseWritableVariable & Coupleable::writableVariable ( const std::string &  var_name,
unsigned int  comp = 0 
)
protected

Returns a writable MooseVariable object for a nodal or elemental variable.

Use var.setNodalValue(val[, idx]) in both cases (!) to set the solution DOF values. Only one object can obtain a writable reference in a simulation. Note that the written values will not ba available in the same system loop! E.g. values written using this API by a nodal AuxKernel will not be updated for other nodal AuxKernels during the same iteration over all nodes.

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

Definition at line 859 of file Coupleable.C.

860 {
861  auto * var = getVarHelper<MooseWritableVariable>(var_name, comp);
862 
863  const auto * aux = dynamic_cast<const AuxKernel *>(this);
864  const auto * euo = dynamic_cast<const ElementUserObject *>(this);
865  const auto * nuo = dynamic_cast<const NodalUserObject *>(this);
866  const auto * nfc = dynamic_cast<const NodeFaceConstraint *>(this);
867 
868  if (!aux && !euo && !nuo && !nfc)
869  mooseError("writableVariable() can only be called from AuxKernels, ElementUserObjects, "
870  "NodalUserObjects, or NodeFaceConstraints. '",
871  _obj->name(),
872  "' is none of those.");
873 
874  if (aux && !aux->isNodal() && var->isNodal())
875  mooseError("The elemental AuxKernel '",
876  _obj->name(),
877  "' cannot obtain a writable reference to the nodal variable '",
878  var->name(),
879  "'.");
880  if (euo && var->isNodal())
881  mooseError("The ElementUserObject '",
882  _obj->name(),
883  "' cannot obtain a writable reference to the nodal variable '",
884  var->name(),
885  "'.");
886 
887  // make sure only one object can access a variable
888  checkWritableVar(var);
889 
890  return *var;
891 }
void checkWritableVar(MooseWritableVariable *var)
Checks that the passed in variable is only accessed writable by one object in a given subdomain...
Definition: Coupleable.C:932
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
A user object that runs over all the nodes and does an aggregation step to compute a single value...
A NodeFaceConstraint is used when you need to create constraints between two surfaces in a mesh...
const MooseObject *const _obj
Definition: Coupleable.h:1707

Member Data Documentation

◆ _ad_default_gradient

MooseArray<ADRealVectorValue> Coupleable::_ad_default_gradient
mutableprotected

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

Definition at line 1384 of file Coupleable.h.

Referenced by getADDefaultGradient().

◆ _ad_default_second

MooseArray<ADRealTensorValue> Coupleable::_ad_default_second
mutableprotected

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

Definition at line 1393 of file Coupleable.h.

Referenced by getADDefaultSecond().

◆ _ad_default_value

std::unordered_map<std::string, std::unique_ptr<MooseArray<DualReal> > > Coupleable::_ad_default_value
mutableprotected

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

Definition at line 1361 of file Coupleable.h.

Referenced by getADDefaultValue().

◆ _ad_default_vector_gradient

MooseArray<ADRealTensorValue> Coupleable::_ad_default_vector_gradient
mutableprotected

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

Definition at line 1387 of file Coupleable.h.

Referenced by getADDefaultVectorGradient().

◆ _ad_default_vector_value

std::unordered_map<std::string, std::unique_ptr<MooseArray<ADRealVectorValue> > > Coupleable::_ad_default_vector_value
mutableprotected

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

Definition at line 1372 of file Coupleable.h.

Referenced by getADDefaultVectorValue().

◆ _ad_grad_zero

const MooseArray<ADRealVectorValue>& Coupleable::_ad_grad_zero
protected

Definition at line 1402 of file Coupleable.h.

Referenced by adZeroGradient().

◆ _ad_second_zero

const MooseArray<ADRealTensorValue>& Coupleable::_ad_second_zero
protected

Definition at line 1409 of file Coupleable.h.

Referenced by adZeroSecond().

◆ _ad_zero

const MooseArray<DualReal>& Coupleable::_ad_zero
protected

Definition at line 1398 of file Coupleable.h.

Referenced by adZeroValue().

◆ _c_allow_element_to_nodal_coupling

const bool Coupleable::_c_allow_element_to_nodal_coupling
protected

Definition at line 1351 of file Coupleable.h.

Referenced by checkVar().

◆ _c_coupled_scalar_vars

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

Scalar variables coupled into this object (for error checking)

Definition at line 1698 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

True if implicit value is required.

Definition at line 1348 of file Coupleable.h.

Referenced by adCoupledDofValues(), adCoupledGradient(), adCoupledGradientDot(), adCoupledLowerValue(), NeighborCoupleable::adCoupledNeighborGradient(), NeighborCoupleable::adCoupledNeighborValue(), NeighborCoupleable::adCoupledNeighborValueDot(), adCoupledNodalValue(), adCoupledSecond(), adCoupledValue(), adCoupledVectorGradient(), NeighborCoupleable::adCoupledVectorNeighborValue(), adCoupledVectorValue(), checkFuncType(), coupledArrayDofValues(), coupledArrayGradient(), coupledArrayGradientOld(), NeighborCoupleable::coupledArrayNeighborGradient(), NeighborCoupleable::coupledArrayNeighborGradientOld(), NeighborCoupleable::coupledArrayNeighborGradientOlder(), NeighborCoupleable::coupledArrayNeighborValue(), coupledArrayValue(), coupledArrayValueOld(), coupledCurl(), coupledCurlOld(), coupledDofValues(), coupledDofValuesOld(), coupledGradient(), coupledGradientOld(), NeighborCoupleable::coupledNeighborDofValues(), NeighborCoupleable::coupledNeighborDofValuesOld(), NeighborCoupleable::coupledNeighborDofValuesOlder(), NeighborCoupleable::coupledNeighborGradient(), NeighborCoupleable::coupledNeighborGradientOld(), NeighborCoupleable::coupledNeighborGradientOlder(), NeighborCoupleable::coupledNeighborSecond(), NeighborCoupleable::coupledNeighborValue(), NeighborCoupleable::coupledNeighborValueOld(), NeighborCoupleable::coupledNeighborValueOlder(), coupledNodalValue(), coupledNodalValueOld(), coupledSecond(), coupledSecondOld(), coupledValue(), coupledValueLower(), coupledValueOld(), coupledVectorGradient(), coupledVectorGradientOld(), NeighborCoupleable::coupledVectorNeighborGradient(), NeighborCoupleable::coupledVectorNeighborGradientOld(), NeighborCoupleable::coupledVectorNeighborGradientOlder(), coupledVectorValue(), and coupledVectorValueOld().

◆ _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_sys

const SystemBase* const Coupleable::_c_sys
protected

Pointer to the system object if the moose object this is an interface for has one.

Definition at line 1321 of file Coupleable.h.

Referenced by coupled().

◆ _c_tid

THREAD_ID Coupleable::_c_tid
protected

Thread ID of the thread using this object.

Definition at line 1354 of file Coupleable.h.

Referenced by checkWritableVar(), Coupleable(), and getWritableCoupledVariables().

◆ _c_type

const std::string& Coupleable::_c_type
protected

The type of the object this interface is part of.

Definition at line 1315 of file Coupleable.h.

◆ _coupleable_max_qps

unsigned int Coupleable::_coupleable_max_qps
private

◆ _coupleable_neighbor

bool Coupleable::_coupleable_neighbor
protected

Whether or not this object is a "neighbor" object: ie all of it's coupled values should be neighbor values.

Definition at line 1614 of file Coupleable.h.

Referenced by adCoupledDofValues(), adCoupledDot(), adCoupledDotDot(), adCoupledGradient(), adCoupledGradientDot(), adCoupledNodalValue(), adCoupledSecond(), adCoupledValue(), adCoupledVectorDot(), adCoupledVectorGradient(), adCoupledVectorValue(), coupledArrayDofValues(), coupledArrayDot(), coupledArrayDotDot(), coupledArrayDotDotOld(), coupledArrayDotDu(), coupledArrayDotOld(), coupledArrayGradient(), coupledArrayGradientDot(), coupledArrayGradientOld(), coupledArrayGradientOlder(), coupledArrayValue(), coupledArrayValueOld(), coupledArrayValueOlder(), coupledCurl(), coupledCurlOld(), coupledCurlOlder(), coupledDofValues(), coupledDofValuesOld(), coupledDofValuesOlder(), coupledDot(), coupledDotDot(), coupledDotDotDu(), coupledDotDotOld(), coupledDotDu(), coupledDotOld(), coupledGradient(), coupledGradientDot(), coupledGradientDotDot(), coupledGradientOld(), coupledGradientOlder(), coupledGradientPreviousNL(), coupledNodalDot(), coupledNodalDotDot(), coupledNodalDotDotOld(), coupledNodalDotOld(), coupledNodalValue(), coupledNodalValueOld(), coupledNodalValueOlder(), coupledNodalValuePreviousNL(), coupledSecond(), coupledSecondOld(), coupledSecondOlder(), coupledSecondPreviousNL(), coupledValue(), coupledValueLower(), coupledValueOld(), coupledValueOlder(), coupledValuePreviousNL(), coupledVectorDot(), coupledVectorDotDot(), coupledVectorDotDotDu(), coupledVectorDotDotOld(), coupledVectorDotDu(), coupledVectorDotOld(), coupledVectorGradient(), coupledVectorGradientOld(), coupledVectorGradientOlder(), coupledVectorValue(), coupledVectorValueOld(), and coupledVectorValueOlder().

◆ _coupled_array_moose_vars

std::vector<ArrayMooseVariable *> Coupleable::_coupled_array_moose_vars
protected

Vector of array coupled variables.

Definition at line 1336 of file Coupleable.h.

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

◆ _coupled_moose_vars

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

◆ _coupled_standard_fv_moose_vars

std::vector<MooseVariableFV<Real> *> Coupleable::_coupled_standard_fv_moose_vars
protected

Vector of standard finite volume coupled variables.

Definition at line 1339 of file Coupleable.h.

Referenced by Coupleable(), ElementValueSampler::execute(), and getVarHelper().

◆ _coupled_standard_moose_vars

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

Vector of standard coupled variables.

Definition at line 1330 of file Coupleable.h.

Referenced by Coupleable(), NodalValueSampler::execute(), ElementValueSampler::execute(), getCoupledStandardMooseVars(), and getVarHelper().

◆ _coupled_vars

std::unordered_map<std::string, std::vector<MooseVariableFieldBase *> > Coupleable::_coupled_vars
protected

Coupled vars whose values we provide.

Definition at line 1324 of file Coupleable.h.

Referenced by checkVar(), Coupleable(), coupledComponents(), FunctionMaterialBase< is_ad >::FunctionMaterialBase(), getCoupledVars(), getVarHelper(), and isCoupled().

◆ _coupled_vector_moose_vars

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

Vector of vector coupled variables.

Definition at line 1333 of file Coupleable.h.

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

◆ _default_array_curl

ArrayVariableCurl Coupleable::_default_array_curl
protected

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

Definition at line 1439 of file Coupleable.h.

◆ _default_array_gradient

ArrayVariableGradient Coupleable::_default_array_gradient
protected

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

Definition at line 1436 of file Coupleable.h.

Referenced by coupledArrayGradient(), coupledArrayGradientDot(), coupledArrayGradientOld(), and coupledArrayGradientOlder().

◆ _default_array_value

std::unordered_map<std::string, std::unique_ptr<ArrayVariableValue> > Coupleable::_default_array_value
mutableprotected

Will hold the default value for optional array coupled variables.

Definition at line 1368 of file Coupleable.h.

Referenced by getDefaultArrayValue().

◆ _default_array_value_zero

ArrayVariableValue Coupleable::_default_array_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 1433 of file Coupleable.h.

Referenced by coupledArrayDot(), coupledArrayDotDot(), coupledArrayDotDotOld(), and coupledArrayDotOld().

◆ _default_gradient

VariableGradient Coupleable::_default_gradient
mutableprotected

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

Definition at line 1381 of file Coupleable.h.

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

◆ _default_second

VariableSecond Coupleable::_default_second
mutableprotected

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

Definition at line 1390 of file Coupleable.h.

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

◆ _default_value

std::unordered_map<std::string, std::vector<std::unique_ptr<VariableValue> > > Coupleable::_default_value
mutableprotected

Will hold the default value for optional coupled variables.

Definition at line 1358 of file Coupleable.h.

Referenced by getDefaultValue().

◆ _default_value_zero

VariableValue Coupleable::_default_value_zero
mutableprotected

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

Referenced by coupledArrayDotDu(), coupledDot(), coupledDotDot(), coupledDotDotDu(), coupledDotDotOld(), coupledDotDu(), coupledDotOld(), coupledNodalDotDot(), coupledNodalDotDotOld(), coupledNodalDotOld(), coupledVectorDotDotDu(), and coupledVectorDotDu().

◆ _default_vector_curl

VectorVariableCurl Coupleable::_default_vector_curl
mutableprotected

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

Definition at line 1427 of file Coupleable.h.

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

◆ _default_vector_gradient

VectorVariableGradient Coupleable::_default_vector_gradient
mutableprotected

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

Definition at line 1424 of file Coupleable.h.

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

◆ _default_vector_value

std::unordered_map<std::string, std::unique_ptr<VectorVariableValue> > Coupleable::_default_vector_value
mutableprotected

Will hold the default value for optional vector coupled variables.

Definition at line 1365 of file Coupleable.h.

Referenced by getDefaultVectorValue().

◆ _default_vector_value_zero

VectorVariableValue Coupleable::_default_vector_value_zero
mutableprotected

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

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

◆ _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_phi_zero

const VariablePhiGradient& Coupleable::_grad_phi_zero
protected

Zero gradient of trial function.

Definition at line 1405 of file Coupleable.h.

◆ _grad_zero

const VariableGradient& Coupleable::_grad_zero
protected

Zero gradient of a variable.

Definition at line 1401 of file Coupleable.h.

◆ _is_fv

const bool Coupleable::_is_fv
private

Whether the MooseObject is a finite volume object.

Definition at line 1705 of file Coupleable.h.

Referenced by checkVar().

◆ _new_to_deprecated_coupled_vars

const std::unordered_map<std::string, std::string>& Coupleable::_new_to_deprecated_coupled_vars
protected

map from new to deprecated variable names

Definition at line 1342 of file Coupleable.h.

Referenced by getVarHelper().

◆ _obj

const MooseObject* const Coupleable::_obj
private

◆ _older_state_tags

const std::set<std::string> Coupleable::_older_state_tags
private
Initial value:

vector tag names for which we need to request older solution states from the system

Definition at line 1710 of file Coupleable.h.

Referenced by vectorTagDofValueHelper(), and vectorTagValueHelper().

◆ _optional_var_index

std::unordered_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 1695 of file Coupleable.h.

Referenced by Coupleable(), and coupled().

◆ _phi_zero

const VariablePhiValue& Coupleable::_phi_zero
protected

Definition at line 1397 of file Coupleable.h.

◆ _second_phi_zero

const VariablePhiSecond& Coupleable::_second_phi_zero
protected

Zero second derivative of a test function.

Definition at line 1411 of file Coupleable.h.

◆ _second_zero

const VariableSecond& Coupleable::_second_zero
protected

Zero second derivative of a variable.

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

◆ _vector_zero

const VectorVariableValue& Coupleable::_vector_zero
protected

Zero value of a vector variable.

Definition at line 1413 of file Coupleable.h.

◆ _writable_coupled_variables

std::vector<std::set<MooseWritableVariable *> > Coupleable::_writable_coupled_variables
private

keep a set of allocated writable variable references to make sure only one object can obtain them per thread

Definition at line 1714 of file Coupleable.h.

Referenced by checkWritableVar(), and getWritableCoupledVariables().

◆ _zero

const VariableValue& Coupleable::_zero
protected

Zero value of a variable.

Definition at line 1396 of file Coupleable.h.


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