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

Intermediate base class that ties together all the interfaces for getting MooseVariableFEBases with the MooseVariableDependencyInterface. More...

#include <CoupleableMooseVariableDependencyIntermediateInterface.h>

Inheritance diagram for CoupleableMooseVariableDependencyIntermediateInterface:
[legend]

Public Member Functions

 CoupleableMooseVariableDependencyIntermediateInterface (const MooseObject *moose_object, bool nodal, bool is_fv=false)
 
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 ()
 
const std::set< TagID > & getFEVariableCoupleableVectorTags () const
 
std::set< TagID > & getFEVariableCoupleableMatrixTags ()
 
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...
 
const std::vector< MooseVariableScalar * > & getCoupledMooseScalarVars ()
 Get the list of coupled scalar variables. More...
 
const std::set< TagID > & getScalarVariableCoupleableVectorTags () const
 
const std::set< TagID > & getScalarVariableCoupleableMatrixTags () const
 
const std::set< MooseVariableFieldBase * > & getMooseVariableDependencies () const
 Retrieve the set of MooseVariableFieldBase that this object depends on. More...
 
template<typename DofObjectType >
std::set< MooseVariableFieldBase * > checkAllVariables (const DofObjectType &dof_object, const std::set< MooseVariableFieldBase *> &vars_to_omit={})
 Check whether all of the variable dependencies have degree of freedom indices on the supplied degree of freedom object. More...
 
template<typename DofObjectType >
std::set< MooseVariableFieldBase * > checkVariables (const DofObjectType &dof_object, const std::set< MooseVariableFieldBase *> &vars_to_check)
 Check whether all of the supplied variables have degree of freedom indices on the supplied degree of freedom object. 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<>
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<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<>
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<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...
 
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
 
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<>
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<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...
 
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
 
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 VectorVariableDivergencecoupledDiv (const std::string &var_name, unsigned int comp=0) const
 Returns divergence of a coupled variable. More...
 
virtual const VectorVariableDivergencecoupledDivOld (const std::string &var_name, unsigned int comp=0) const
 Returns an old divergence from previous time step of a coupled variable. More...
 
virtual const VectorVariableDivergencecoupledDivOlder (const std::string &var_name, unsigned int comp=0) const
 Returns an old divergence 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<>
const GenericVariableValue< false > & genericZeroValue ()
 
template<>
const GenericVariableValue< true > & genericZeroValue ()
 
template<bool is_ad>
const GenericVariableGradient< is_ad > & genericZeroGradient ()
 Returns zero gradient templated with automatic differentiation boolean. More...
 
template<>
const GenericVariableGradient< false > & genericZeroGradient ()
 
template<>
const GenericVariableGradient< true > & genericZeroGradient ()
 
template<bool is_ad>
const GenericVariableSecond< is_ad > & genericZeroSecond ()
 Returns zero second derivative templated with automatic differentiation boolean. More...
 
template<>
const GenericVariableSecond< false > & genericZeroSecond ()
 
template<>
const GenericVariableSecond< true > & genericZeroSecond ()
 
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...
 
const MooseVariablegetVar (const std::string &var_name, unsigned int comp) const
 Extract pointer to a coupled variable. More...
 
VectorMooseVariablegetVectorVar (const std::string &var_name, unsigned int comp)
 Extract pointer to a coupled vector variable. More...
 
const VectorMooseVariablegetVectorVar (const std::string &var_name, unsigned int comp) const
 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 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
 
bool isCoupledScalar (const std::string &var_name, unsigned int i=0) const
 Returns true if a variables has been coupled_as name. More...
 
unsigned int coupledScalarComponents (const std::string &var_name) const
 Return the number of components to the coupled scalar variable. More...
 
unsigned int coupledScalar (const std::string &var_name, unsigned int comp=0) const
 Returns the index for a scalar coupled variable by name. More...
 
Order coupledScalarOrder (const std::string &var_name, unsigned int comp=0) const
 Returns the order for a scalar coupled variable by name. More...
 
const VariableValuecoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 Returns value of a scalar coupled variable. More...
 
const ADVariableValueadCoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 Returns AD value of a scalar coupled variable. More...
 
template<bool is_ad>
const GenericVariableValue< is_ad > & coupledGenericScalarValue (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled scalar variable for use in templated automatic differentiation classes. More...
 
template<>
const GenericVariableValue< false > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
template<>
const GenericVariableValue< true > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
const VariableValuecoupledVectorTagScalarValue (const std::string &var_name, TagID tag, unsigned int comp=0) const
 Returns value of a scalar coupled variable. More...
 
const VariableValuecoupledMatrixTagScalarValue (const std::string &var_name, TagID tag, unsigned int comp=0) const
 Returns value of a scalar coupled variable. More...
 
const VariableValuecoupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const
 Returns the old (previous time step) value of a scalar coupled variable. More...
 
const VariableValuecoupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const
 Returns the older (two time steps previous) value of a scalar coupled variable. More...
 
const VariableValuecoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 Returns the time derivative of a scalar coupled variable. More...
 
const ADVariableValueadCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 Returns the time derivative of a scalar coupled variable, including its dependence on the nonlinear degrees of freedom through automatic differentiation. More...
 
const VariableValuecoupledScalarDotDot (const std::string &var_name, unsigned int comp=0) const
 Returns the second time derivative of a scalar coupled variable. More...
 
const VariableValuecoupledScalarDotOld (const std::string &var_name, unsigned int comp=0) const
 Returns the old time derivative of a scalar coupled variable. More...
 
const VariableValuecoupledScalarDotDotOld (const std::string &var_name, unsigned int comp=0) const
 Returns the old second time derivative of a scalar coupled variable. More...
 
const VariableValuecoupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const
 Time derivative of a scalar coupled variable with respect to the coefficients. More...
 
const VariableValuecoupledScalarDotDotDu (const std::string &var_name, unsigned int comp=0) const
 Second time derivative of a scalar coupled variable with respect to the coefficients. More...
 
const MooseVariableScalargetScalarVar (const std::string &var_name, unsigned int comp) const
 Extract pointer to a scalar coupled variable. More...
 
void addMooseVariableDependency (MooseVariableFieldBase *var)
 Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends on. More...
 
void addMooseVariableDependency (const std::vector< MooseVariableFieldBase *> &vars)
 

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...
 
std::vector< MooseLinearVariableFV< Real > * > _coupled_standard_linear_fv_moose_vars
 Vector of standard linear 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...
 
VectorVariableDivergence _default_div
 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...
 
bool _coupleable_neighbor
 Whether or not this object is a "neighbor" object: ie all of it's coupled values should be neighbor values. More...
 
FEProblemBase_sc_fe_problem
 
const THREAD_ID _sc_tid
 Thread ID of the thread using this object. More...
 
const Real_real_zero
 Scalar zero. More...
 
const VariableValue_scalar_zero
 Zero value of a scalar variable. More...
 
const Point & _point_zero
 Zero point. More...
 

Detailed Description

Intermediate base class that ties together all the interfaces for getting MooseVariableFEBases with the MooseVariableDependencyInterface.

Definition at line 20 of file CoupleableMooseVariableDependencyIntermediateInterface.h.

Constructor & Destructor Documentation

◆ CoupleableMooseVariableDependencyIntermediateInterface()

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

Definition at line 13 of file CoupleableMooseVariableDependencyIntermediateInterface.C.

16  : Coupleable(moose_object, nodal, is_fv),
17  ScalarCoupleable(moose_object),
19 {
20  for (MooseVariableFEBase * coupled_var : getCoupledMooseVars())
21  addMooseVariableDependency(coupled_var);
22 }
This class provides an interface for common operations on field variables of both FE and FV types wit...
Coupleable(const MooseObject *moose_object, bool nodal, bool is_fv=false)
Constructing the object.
Definition: Coupleable.C:26
const std::vector< MooseVariableFieldBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
Definition: Coupleable.h:70
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
ScalarCoupleable(const MooseObject *moose_object)
Constructing the object.

Member Function Documentation

◆ adCoupledDofValues()

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

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

2053 {
2054  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2055 
2056  if (!var)
2057  return *getADDefaultValue(var_name);
2059 
2060  if (!_c_is_implicit)
2061  mooseError("Not implemented");
2062 
2063  if (!_coupleable_neighbor)
2064  return var->adDofValues();
2065  return var->adDofValuesNeighbor();
2066 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:2286
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:1651

◆ adCoupledDot()

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

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

Referenced by Coupleable::adCoupledDots().

2203 {
2204  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2205 
2206  if (!var)
2207  return *getADDefaultValue(var_name);
2209 
2210  if (_c_nodal)
2211  mooseError("Not implemented");
2212 
2213  if (!_coupleable_neighbor)
2214  return var->adUDot();
2215  return var->adUDotNeighbor();
2216 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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:2286
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:1651

◆ adCoupledDotDot()

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

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

2220 {
2221  const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2222 
2223  if (!var)
2224  return *getADDefaultValue(var_name);
2226 
2227  if (_c_nodal)
2228  mooseError("Not implemented");
2229 
2230  if (!_coupleable_neighbor)
2231  return var->adUDotDot();
2232  return var->adUDotDotNeighbor();
2233 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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:2286
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:1651

◆ adCoupledDots()

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

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

2685 {
2686  auto func = [this, &var_name](unsigned int comp) { return &adCoupledDot(var_name, comp); };
2687  return coupledVectorHelper<const ADVariableValue *>(var_name, func);
2688 }
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:2202

◆ adCoupledGradient()

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

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

Referenced by Coupleable::adCoupledGradients().

2144 {
2145  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2146 
2147  if (!var)
2148  return getADDefaultGradient();
2150 
2151  if (!_c_is_implicit)
2152  mooseError("Not implemented");
2153 
2154  if (!_coupleable_neighbor)
2155  return var->adGradSln();
2156  return var->adGradSlnNeighbor();
2157 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
const ADVariableGradient & getADDefaultGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
Definition: Coupleable.C:2317
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:1651

◆ adCoupledGradientDot()

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

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

2161 {
2162  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2163 
2164  if (!var)
2165  return getADDefaultGradient();
2167 
2168  if (!_c_is_implicit)
2169  mooseError("Not implemented");
2170 
2171  if (!_coupleable_neighbor)
2172  return var->adGradSlnDot();
2173  return var->adGradSlnNeighborDot();
2174 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
const ADVariableGradient & getADDefaultGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
Definition: Coupleable.C:2317
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:1651

◆ adCoupledGradients()

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

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

2664 {
2665  auto func = [this, &var_name](unsigned int comp) { return &adCoupledGradient(var_name, comp); };
2666  return coupledVectorHelper<const ADVariableGradient *>(var_name, func);
2667 }
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:2143

◆ adCoupledLowerValue()

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

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

2126 {
2127  auto var = getVarHelper<MooseVariableFE<Real>>(var_name, comp);
2128 
2129  if (!var)
2130  return *getADDefaultValue(var_name);
2132 
2133  if (!_c_is_implicit)
2134  mooseError("adCoupledLowerValue cannot be called in a coupleable neighbor object");
2135 
2136  if (_c_nodal)
2137  return var->adDofValues();
2138  else
2139  return var->adSlnLower();
2140 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:2286

◆ adCoupledNodalValue()

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

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

2084 {
2085  static const typename Moose::ADType<T>::type zero = 0;
2086  if (!isCoupled(var_name))
2087  return zero;
2088 
2089  if (!_c_nodal)
2090  mooseError("The adCoupledNodalValue method should only be called for nodal computing objects");
2092  mooseError(
2093  "The adCoupledNodalValue method shouldn't be called for neighbor computing objects. I "
2094  "don't even know what that would mean, although maybe someone could explain it to me.");
2095  if (!_c_is_implicit)
2096  mooseError("If you're going to use an explicit scheme, then use coupledNodalValue instead of "
2097  "adCoupledNodalValue");
2098 
2099  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
2100 
2101  return var->adNodalValue();
2102 }
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:128
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
const Number zero
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:1651

◆ adCoupledScalarDot()

const ADVariableValue & ScalarCoupleable::adCoupledScalarDot ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protectedinherited

Returns the time derivative of a scalar coupled variable, including its dependence on the nonlinear degrees of freedom through automatic differentiation.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to the time derivative at quadrature points for the coupled variable, including automatic differentiation information

Definition at line 252 of file ScalarCoupleable.C.

253 {
254  checkVar(var_name);
255  validateExecutionerType(var_name, "adCoupledScalarDot");
256  return getScalarVar(var_name, comp)->adUDot();
257 }
const ADVariableValue & adUDot() const
Return the first derivative of the solution with derivative information.
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...
void checkVar(const std::string &var_name) const
Check that the right kind of variable is being coupled in.
const MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp) const
Extract pointer to a scalar coupled variable.

◆ adCoupledScalarValue()

const ADVariableValue & ScalarCoupleable::adCoupledScalarValue ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protectedinherited

Returns AD value of a scalar coupled variable.

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 135 of file ScalarCoupleable.C.

136 {
137  checkVar(var_name);
138  if (!isCoupledScalar(var_name, comp))
139  return *getADDefaultValue(var_name);
140 
141  auto var = getScalarVar(var_name, comp);
142 
143  if (_sc_is_implicit)
144  return var->adSln();
145  else
146  mooseError("adCoupledValue for non-implicit calculations is not currently supported. Use "
147  "coupledValue instead for non-implicit");
148 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
const bool _sc_is_implicit
True if implicit value is required.
bool isCoupledScalar(const std::string &var_name, unsigned int i=0) const
Returns true if a variables has been coupled_as name.
void checkVar(const std::string &var_name) const
Check that the right kind of variable is being coupled in.
const MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp) const
Extract pointer to a scalar coupled variable.
const ADVariableValue * getADDefaultValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the AD default value for an uncoupled variable...

◆ adCoupledSecond()

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

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

2178 {
2179  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2180 
2181  if (!var)
2182  return getADDefaultSecond();
2184 
2185  if (!_c_is_implicit)
2186  mooseError("Not implemented");
2187 
2188  if (!_coupleable_neighbor)
2189  return var->adSecondSln();
2190  else
2191  return var->adSecondSlnNeighbor();
2192 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:1651
const ADVariableSecond & getADDefaultSecond() const
Helper method to return (and insert if necessary) the default second derivatives for Automatic Differ...
Definition: Coupleable.C:2331

◆ adCoupledValue()

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

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

Referenced by Coupleable::adCoupledValues().

2106 {
2107  const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2108 
2109  if (!var)
2110  return *getADDefaultValue(var_name);
2112 
2113  if (!_c_is_implicit)
2114  mooseError("Not implemented");
2115 
2116  if (_c_nodal)
2117  return var->adDofValues();
2118 
2119  if (!_coupleable_neighbor)
2120  return var->adSln();
2121  return var->adSlnNeighbor();
2122 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:2286
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:1651

◆ adCoupledValues()

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

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

2475 {
2476  auto func = [this, &var_name](unsigned int comp) { return &adCoupledValue(var_name, comp); };
2477  return coupledVectorHelper<const ADVariableValue *>(var_name, func);
2478 }
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:2105

◆ adCoupledVectorDot()

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

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

2237 {
2238  const auto * var = getVectorVar(var_name, comp);
2239  if (!var)
2240  return *getADDefaultVectorValue(var_name);
2242 
2243  if (_c_nodal)
2244  mooseError("Not implemented");
2245 
2246  if (!_coupleable_neighbor)
2247  return var->adUDot();
2248  return var->adUDotNeighbor();
2249 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
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:2300
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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:1651

◆ adCoupledVectorGradient()

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

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

2271 {
2272  const auto * var = getVectorVar(var_name, comp);
2273  if (!var)
2274  return getADDefaultVectorGradient();
2276 
2277  if (!_c_is_implicit)
2278  mooseError("Not implemented");
2279 
2280  if (!_coupleable_neighbor)
2281  return var->adGradSln();
2282  return var->adGradSlnNeighbor();
2283 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
const ADVectorVariableGradient & getADDefaultVectorGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
Definition: Coupleable.C:2324
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:1651

◆ adCoupledVectorSecond()

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

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
protectedinherited

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

Referenced by Coupleable::adCoupledVectorValues().

2253 {
2254  const auto * var = getVectorVar(var_name, comp);
2255  if (!var)
2256  return *getADDefaultVectorValue(var_name);
2258 
2259  if (_c_nodal)
2260  mooseError("Not implemented");
2261  if (!_c_is_implicit)
2262  mooseError("Not implemented");
2263 
2264  if (!_coupleable_neighbor)
2265  return var->adSln();
2266  return var->adSlnNeighbor();
2267 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
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:2300
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:1651

◆ adCoupledVectorValues()

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

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

2482 {
2483  auto func = [this, &var_name](unsigned int comp)
2484  { return &adCoupledVectorValue(var_name, comp); };
2485  return coupledVectorHelper<const ADVectorVariableValue *>(var_name, func);
2486 }
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:2252

◆ addFEVariableCoupleableMatrixTag()

void Coupleable::addFEVariableCoupleableMatrixTag ( TagID  tag)
inlineinherited

Definition at line 104 of file Coupleable.h.

Referenced by Coupleable::coupledMatrixTagValue().

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

◆ addFEVariableCoupleableVectorTag()

void Coupleable::addFEVariableCoupleableVectorTag ( TagID  tag)
inlineinherited

◆ addMooseVariableDependency() [1/2]

void MooseVariableDependencyInterface::addMooseVariableDependency ( MooseVariableFieldBase var)
inlineprotectedinherited

Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends on.

Definition at line 73 of file MooseVariableDependencyInterface.h.

Referenced by ADDGKernel::ADDGKernel(), ADIntegratedBCTempl< T >::ADIntegratedBCTempl(), ADInterfaceKernelTempl< T >::ADInterfaceKernelTempl(), ADKernelTempl< T >::ADKernelTempl(), ArrayDGKernel::ArrayDGKernel(), ArrayIntegratedBC::ArrayIntegratedBC(), ArrayKernel::ArrayKernel(), ArrayNodalBC::ArrayNodalBC(), AuxKernelTempl< Real >::AuxKernelTempl(), AuxNodalScalarKernel::AuxNodalScalarKernel(), CoupleableMooseVariableDependencyIntermediateInterface(), DGKernel::DGKernel(), DiracKernelTempl< T >::DiracKernelTempl(), DomainUserObject::DomainUserObject(), ElemElemConstraint::ElemElemConstraint(), ElementIndicator::ElementIndicator(), ElementIntegralArrayVariablePostprocessor::ElementIntegralArrayVariablePostprocessor(), ElementIntegralVariablePostprocessor::ElementIntegralVariablePostprocessor(), ElementIntegralVariableUserObject::ElementIntegralVariableUserObject(), ElementUserObject::ElementUserObject(), ElementVariablePostprocessor::ElementVariablePostprocessor(), FVBoundaryCondition::FVBoundaryCondition(), FVElementalKernel::FVElementalKernel(), FVInterfaceKernel::FVInterfaceKernel(), IntegratedBC::IntegratedBC(), InterfaceIntegralVariableValuePostprocessor::InterfaceIntegralVariableValuePostprocessor(), InterfaceKernelTempl< T >::InterfaceKernelTempl(), InterfaceMaterial::InterfaceMaterial(), InterfaceUserObjectBase::InterfaceUserObjectBase(), InternalSideIndicator::InternalSideIndicator(), InternalSideIntegralVariablePostprocessor::InternalSideIntegralVariablePostprocessor(), InternalSideUserObject::InternalSideUserObject(), Kernel::Kernel(), LinearFVBoundaryCondition::LinearFVBoundaryCondition(), LinearFVKernel::LinearFVKernel(), Marker::Marker(), Material::Material(), MortarConstraintBase::MortarConstraintBase(), NeighborCoupleableMooseVariableDependencyIntermediateInterface::NeighborCoupleableMooseVariableDependencyIntermediateInterface(), NodalBC::NodalBC(), NodalConstraint::NodalConstraint(), NodalKernel::NodalKernel(), NodalScalarKernel::NodalScalarKernel(), NodalUserObject::NodalUserObject(), NodeElemConstraint::NodeElemConstraint(), NodeFaceConstraint::NodeFaceConstraint(), PointVariableSamplerBase::PointVariableSamplerBase(), QuadraturePointMarker::QuadraturePointMarker(), SideIntegralVariablePostprocessor::SideIntegralVariablePostprocessor(), SideIntegralVariableUserObject::SideIntegralVariableUserObject(), SideUserObject::SideUserObject(), SideVariablePostprocessor::SideVariablePostprocessor(), VectorIntegratedBC::VectorIntegratedBC(), VectorKernel::VectorKernel(), and VectorNodalBC::VectorNodalBC().

74  {
75  _moose_variable_dependencies.insert(var);
76  }
std::set< MooseVariableFieldBase * > _moose_variable_dependencies

◆ addMooseVariableDependency() [2/2]

void MooseVariableDependencyInterface::addMooseVariableDependency ( const std::vector< MooseVariableFieldBase *> &  vars)
inlineprotectedinherited

Definition at line 77 of file MooseVariableDependencyInterface.h.

78  {
79  _moose_variable_dependencies.insert(vars.begin(), vars.end());
80  }
std::set< MooseVariableFieldBase * > _moose_variable_dependencies

◆ adZeroGradient()

const ADVariableGradient & Coupleable::adZeroGradient ( ) const
protectedinherited

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

Definition at line 2345 of file Coupleable.C.

2346 {
2347  mooseDeprecated("Method adZeroGradient() is deprecated. Use '_ad_grad_zero' instead.");
2348  return _ad_grad_zero;
2349 }
const MooseArray< ADRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:1439
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:350

◆ adZeroSecond()

const ADVariableSecond & Coupleable::adZeroSecond ( ) const
protectedinherited

Retrieve a zero second for automatic differentiation.

Definition at line 2352 of file Coupleable.C.

2353 {
2354  mooseDeprecated("Method adZeroSecond() is deprecated. Use '_ad_second_zero' instead.");
2355  return _ad_second_zero;
2356 }
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:350
const MooseArray< ADRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:1446

◆ adZeroValue()

const ADVariableValue & Coupleable::adZeroValue ( ) const
protectedinherited

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

Definition at line 2338 of file Coupleable.C.

2339 {
2340  mooseDeprecated("Method adZeroValue() is deprecated. Use '_ad_zero' instead.");
2341  return _ad_zero;
2342 }
const MooseArray< DualReal > & _ad_zero
Definition: Coupleable.h:1435
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:350

◆ checkAllVariables()

template<typename DofObjectType >
std::set< MooseVariableFieldBase * > MooseVariableDependencyInterface::checkAllVariables ( const DofObjectType &  dof_object,
const std::set< MooseVariableFieldBase *> &  vars_to_omit = {} 
)
inherited

Check whether all of the variable dependencies have degree of freedom indices on the supplied degree of freedom object.

Parameters
dof_objectThe degree of freedom object (an element or node) that we want to check for existence of variable degrees of freedom on
vars_to_omitVariables that we can omit from checking
Returns
Any variables that do not have degrees of freedom on the supplied degree of freedom object

Definition at line 91 of file MooseVariableDependencyInterface.h.

93 {
94  if (vars_to_omit.empty())
95  return checkVariables(dof_object, _moose_variable_dependencies);
96 
97  std::set<MooseVariableFieldBase *> vars_to_check;
98  std::set_difference(_moose_variable_dependencies.begin(),
100  vars_to_omit.begin(),
101  vars_to_omit.end(),
102  std::inserter(vars_to_check, vars_to_check.begin()));
103  return checkVariables(dof_object, vars_to_check);
104 }
std::set< MooseVariableFieldBase * > checkVariables(const DofObjectType &dof_object, const std::set< MooseVariableFieldBase *> &vars_to_check)
Check whether all of the supplied variables have degree of freedom indices on the supplied degree of ...
std::set< MooseVariableFieldBase * > _moose_variable_dependencies

◆ checkVar()

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

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

Parameters
var_nameThe name of the coupled variable

Definition at line 208 of file Coupleable.C.

Referenced by Coupleable::getVarHelper().

211 {
212  const auto var_name = _c_parameters.checkForRename(var_name_in);
213  auto it = _c_coupled_scalar_vars.find(var_name);
214  if (it != _c_coupled_scalar_vars.end())
215  {
216  std::string cvars;
217  for (auto jt : it->second)
218  cvars += " " + jt->name();
219 
220  _obj->paramError(var_name,
221  "cannot couple '",
222  var_name,
223  "' to a scalar variable (",
224  cvars,
225  ") where field variable is expected");
226  }
227 
228  if (!isCoupled(var_name, comp))
229  return false; // return false since variable is *not* coupled
230 
231  auto vars_vector_it = _coupled_vars.find(var_name);
232  if (vars_vector_it == _coupled_vars.end())
233  mooseError(_c_name, ": Trying to get a coupled var ", var_name, " that doesn't exist");
234 
235  const auto & vars_vector = vars_vector_it->second;
236 
237  auto bound = comp_bound ? comp_bound : vars_vector.size();
238  checkComponent(_obj, comp, bound, var_name);
239 
240  // We should know we have a variable now
241  const auto * var = vars_vector[comp];
242  if (!var)
243  mooseError(
244  _c_name,
245  ": We did all our checks for the existence of a var, yet we still don't have a var!?");
246 
247  // Only perform the following checks for objects that feed into residuals/Jacobians, e.g. objects
248  // that inherit from the TaggingInterface
249  if (_c_parameters.have_parameter<MultiMooseEnum>("vector_tags"))
250  {
251  // Are we attempting to couple to a non-FV var in an FV object?
252  if (!var->isFV() && _is_fv)
253  mooseError("Attempting to couple non-FV variable ",
254  var->name(),
255  " into an FV object ",
256  _c_name,
257  ". This is not currently supported");
258  }
259 
260  if (!(vars_vector[comp])->isNodal() && _c_nodal && !_c_allow_element_to_nodal_coupling)
261  mooseError(_c_name, ": cannot couple elemental variables into nodal objects");
262 
263  return true;
264 }
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:128
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1358
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
const bool _is_fv
Whether the MooseObject is a finite volume object.
Definition: Coupleable.h:1742
const bool _c_allow_element_to_nodal_coupling
Definition: Coupleable.h:1388
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _c_coupled_scalar_vars
Scalar variables coupled into this object (for error checking)
Definition: Coupleable.h:1735
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1347
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:1744
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:177
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:1344
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...

◆ checkVariables()

template<typename DofObjectType >
template std::set< MooseVariableFieldBase * > MooseVariableDependencyInterface::checkVariables ( const DofObjectType &  dof_object,
const std::set< MooseVariableFieldBase *> &  vars_to_check 
)
inherited

Check whether all of the supplied variables have degree of freedom indices on the supplied degree of freedom object.

Parameters
dof_objectThe degree of freedom object (an element or node) that we want to check for existence of variable degrees of freedom on
vars_to_checkthe variables to check
Returns
Any variables that do not have degrees of freedom on the supplied degree of freedom object

Definition at line 25 of file MooseVariableDependencyInterface.C.

Referenced by MooseVariableDependencyInterface::checkAllVariables().

27 {
28  std::set<MooseVariableFieldBase *> vars_without_indices;
29  for (auto * const var : vars_to_check)
30  {
31  var->sys().dofMap().dof_indices(&dof_object, _dof_indices, var->number());
32  if (_dof_indices.empty())
33  vars_without_indices.insert(var);
34  }
35 
36  return vars_without_indices;
37 }
std::vector< libMesh::dof_id_type > _dof_indices
A container for holding dof indices in order to avoid constant memory reallocation.

◆ checkWritableVar()

void Coupleable::checkWritableVar ( MooseWritableVariable var)
protectedinherited

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

Definition at line 936 of file Coupleable.C.

Referenced by Coupleable::writableCoupledValue(), and Coupleable::writableVariable().

937 {
938  // check domain restrictions for compatibility
939  const auto * br = dynamic_cast<const BlockRestrictable *>(this);
940  const auto * nfc = dynamic_cast<const NodeFaceConstraint *>(this);
941 
942  if (br && !var->hasBlocks(br->blockIDs()))
943  mooseError("The variable '",
944  var->name(),
945  "' must be defined on all blocks '",
946  _obj->name(),
947  "' is defined on.");
948 
949  if (nfc && !var->hasBlocks(nfc->getSecondaryConnectedBlocks()))
950  mooseError("The variable '",
951  var->name(),
952  " must be defined on all blocks '",
953  _obj->name(),
954  "'s secondary surface is defined on.");
955 
956  // make sure only one object can access a variable
957  for (const auto & ci : _obj->getMooseApp().getInterfaceObjects<Coupleable>())
958  if (ci != this && ci->_writable_coupled_variables[_c_tid].count(var))
959  {
960  // if both this and ci are block restrictable then we check if the block restrictions
961  // are not overlapping. If they don't we permit the call.
962  const auto * br_other = dynamic_cast<const BlockRestrictable *>(ci);
963  if (br && br_other && br->blockRestricted() && br_other->blockRestricted() &&
964  !MooseUtils::setsIntersect(br->blockIDs(), br_other->blockIDs()))
965  continue;
966  else if (nfc)
967  continue;
968 
969  mooseError("'",
970  ci->_obj->name(),
971  "' already obtained a writable reference to '",
972  var->name(),
973  "'. Only one object can obtain such a reference per variable and subdomain in a "
974  "simulation.");
975  }
976 
977  // var is unique across threads, so we could forego having a separate set per thread, but we
978  // need quick access to the list of all variables that need to be inserted into the solution
979  // vector by a given thread.
980 
981  _writable_coupled_variables[_c_tid].insert(var);
982 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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:1391
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:1751
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:1744
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:45
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
protectedvirtualinherited

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

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

442 {
443  const auto * var = getFieldVar(var_name, comp);
444  if (!var)
445  {
446  mooseAssert(_optional_var_index.find(var_name) != _optional_var_index.end(),
447  "optional var index for " << var_name << " does not exist!");
448  // make sure we don't try to access default var ids that were not provided
449  checkComponent(_obj, comp, _optional_var_index.at(var_name).size(), var_name);
450  return _optional_var_index.at(var_name)[comp];
451  }
453 
454  if (var->kind() == Moose::VAR_SOLVER &&
455  // are we not an object that feeds into the nonlinear system?
456  (!_c_sys || _c_sys->varKind() != Moose::VAR_SOLVER ||
457  // are we an object that impacts the nonlinear system and this variable is within our
458  // nonlinear system?
459  var->sys().number() == _c_sys->number()))
460  return var->number();
461  else
462  // Avoid registering coupling to variables outside of our system (e.g. avoid potentially
463  // creating bad Jacobians)
464  return std::numeric_limits<unsigned int>::max() - var->number();
465 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
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:1355
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1132
const MooseObject *const _obj
Definition: Coupleable.h:1744
void checkComponent(const MooseObject *obj, unsigned int comp, unsigned int bound, const std::string &var_name)
Definition: Coupleable.C:177
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:1732
Moose::VarKindType varKind() const
Definition: SystemBase.h:926
const MooseVariableFieldBase * getFieldVar(const std::string &var_name, unsigned int comp) const
Definition: Coupleable.C:281

◆ coupledAllDofValues()

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

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

1992 {
1993  auto func = [this, &var_name](unsigned int comp) { return &coupledDofValues(var_name, comp); };
1994  return coupledVectorHelper<const VariableValue *>(var_name, func);
1995 }
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:1978

◆ coupledAllDofValuesOld()

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

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

2012 {
2013  auto func = [this, &var_name](unsigned int comp) { return &coupledDofValuesOld(var_name, comp); };
2014  return coupledVectorHelper<const VariableValue *>(var_name, func);
2015 }
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:1998

◆ coupledAllDofValuesOlder()

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

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

2032 {
2033  auto func = [this, &var_name](unsigned int comp)
2034  { return &coupledDofValuesOlder(var_name, comp); };
2035  return coupledVectorHelper<const VariableValue *>(var_name, func);
2036 }
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:2018

◆ coupledArrayDofValues()

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

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

2040 {
2041  const auto * var = getArrayVar(var_name, comp);
2042  if (!var)
2043  return *getDefaultArrayValue(var_name);
2045 
2046  if (!_coupleable_neighbor)
2047  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
2048  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
2049 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
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:396
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:1651
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:305

◆ coupledArrayDot()

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

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

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

◆ coupledArrayDotDot()

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

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

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

◆ coupledArrayDotDotOld()

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

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

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

◆ coupledArrayDotDu()

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

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

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

1457 {
1458  const auto * const var = getArrayVar(var_name, comp);
1459  if (!var)
1460  {
1462  return _default_value_zero;
1463  }
1465 
1466  if (!_coupleable_neighbor)
1467  {
1468  if (_c_nodal)
1469  return var->dofValuesDuDotDu();
1470  return var->duDotDu();
1471  }
1472  else
1473  {
1474  if (_c_nodal)
1475  return var->dofValuesDuDotDuNeighbor();
1476  return var->duDotDuNeighbor();
1477  }
1478 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1415
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:1651
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:305
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:1729

◆ coupledArrayDotOld()

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

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

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

◆ coupledArrayGradient()

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

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

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

◆ coupledArrayGradientDot()

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

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

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

◆ coupledArrayGradientOld()

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

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

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

◆ coupledArrayGradientOlder()

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

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

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

◆ coupledArrayValue()

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

Returns value 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 for the coupled vector variable
See also
ArrayKernel::_u

Definition at line 834 of file Coupleable.C.

Referenced by Coupleable::coupledArrayValues().

835 {
836  const auto * var = getArrayVar(var_name, comp);
837  if (!var)
838  return *getDefaultArrayValue(var_name);
840 
842  {
843  if (_c_nodal)
844  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
845  return (_c_is_implicit) ? var->sln() : var->slnOld();
846  }
847  else
848  {
849  if (_c_nodal)
850  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
851  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
852  }
853 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
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:396
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:1651
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:305

◆ coupledArrayValueOld()

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

Returns an old value 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 ArrayVariableValue containing the old value of the coupled variable
See also
ArrayKernel::_u_old

Definition at line 1078 of file Coupleable.C.

1079 {
1080  const auto * var = getArrayVar(var_name, comp);
1081  if (!var)
1082  return *getDefaultArrayValue(var_name);
1084 
1085  if (!_coupleable_neighbor)
1086  {
1087  if (_c_nodal)
1088  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
1089  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
1090  }
1091  else
1092  {
1093  if (_c_nodal)
1094  return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
1095  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
1096  }
1097 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
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:396
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:1651
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:305

◆ coupledArrayValueOlder()

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

Returns an old value 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 ArrayVariableValue containing the older value of the coupled variable
See also
ArrayKernel::_u_older

Definition at line 1100 of file Coupleable.C.

1101 {
1102  const auto * var = getArrayVar(var_name, comp);
1103  if (!var)
1104  return *getDefaultArrayValue(var_name);
1106 
1107  if (!_coupleable_neighbor)
1108  {
1109  if (_c_nodal)
1110  return var->dofValuesOlder();
1111  return var->slnOlder();
1112  }
1113  else
1114  {
1115  if (_c_nodal)
1116  return var->dofValuesOlderNeighbor();
1117  return var->slnOlderNeighbor();
1118  }
1119 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
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:396
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:1651
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:305

◆ coupledArrayValues()

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

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

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

◆ coupledCallback()

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

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

Referenced by Coupleable::checkFuncType().

135 {}

◆ coupledComponents()

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

Number of coupled components.

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

Definition at line 157 of file Coupleable.C.

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

158 {
159  const auto var_name = _c_parameters.checkForRename(var_name_in);
160 
161  if (isCoupled(var_name))
162  {
163  mooseAssert(_coupled_vars.find(var_name) != _coupled_vars.end(),
164  var_name << " must not actually be coupled!");
165  return _coupled_vars.at(var_name).size();
166  }
167  else
168  {
170  return _c_parameters.numberDefaultCoupledValues(var_name);
171  else
172  return 0;
173  }
174 }
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:128
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1358
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:1344

◆ coupledCurl()

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

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

1679 {
1680  const auto * var = getVectorVar(var_name, comp);
1681  if (!var)
1682  {
1684  return _default_vector_curl;
1685  }
1687 
1688  if (!_coupleable_neighbor)
1689  return (_c_is_implicit) ? var->curlSln() : var->curlSlnOld();
1690  return (_c_is_implicit) ? var->curlSlnNeighbor() : var->curlSlnOldNeighbor();
1691 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1464
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledCurlOld()

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

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

1695 {
1696  const auto * var = getVectorVar(var_name, comp);
1697  if (!var)
1698  {
1700  return _default_vector_curl;
1701  }
1703 
1704  if (!_coupleable_neighbor)
1705  return (_c_is_implicit) ? var->curlSlnOld() : var->curlSlnOlder();
1706  return (_c_is_implicit) ? var->curlSlnOldNeighbor() : var->curlSlnOlderNeighbor();
1707 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1464
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledCurlOlder()

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

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

1711 {
1712  const auto * var = getVectorVar(var_name, comp);
1713  if (!var)
1714  {
1716  return _default_vector_curl;
1717  }
1719 
1720  if (!_coupleable_neighbor)
1721  return var->curlSlnOlder();
1722  return var->curlSlnOlderNeighbor();
1723 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1464
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledDiv()

const VectorVariableDivergence & Coupleable::coupledDiv ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protectedvirtualinherited

Returns divergence of a coupled variable.

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

Definition at line 1726 of file Coupleable.C.

1727 {
1728  const auto * var = getVectorVar(var_name, comp);
1729  if (!var)
1730  {
1732  return _default_div;
1733  }
1735 
1736  if (!_coupleable_neighbor)
1737  return (_c_is_implicit) ? var->divSln() : var->divSlnOld();
1738  return (_c_is_implicit) ? var->divSlnNeighbor() : var->divSlnOldNeighbor();
1739 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
VectorVariableDivergence _default_div
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1467
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledDivOld()

const VectorVariableDivergence & Coupleable::coupledDivOld ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protectedvirtualinherited

Returns an old divergence 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 VectorVariableDivergence containing the old divergence of the coupled variable
See also
Kernel::_div_u_old

Definition at line 1742 of file Coupleable.C.

1743 {
1744  const auto * var = getVectorVar(var_name, comp);
1745  if (!var)
1746  {
1748  return _default_div;
1749  }
1751 
1752  if (!_coupleable_neighbor)
1753  return (_c_is_implicit) ? var->divSlnOld() : var->divSlnOlder();
1754  return (_c_is_implicit) ? var->divSlnOldNeighbor() : var->divSlnOlderNeighbor();
1755 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
VectorVariableDivergence _default_div
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1467
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledDivOlder()

const VectorVariableDivergence & Coupleable::coupledDivOlder ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protectedvirtualinherited

Returns an old divergence 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 VectorVariableDivergence containing the older divergence of the coupled variable
See also
Kernel::_div_u_older

Definition at line 1758 of file Coupleable.C.

1759 {
1760  const auto * var = getVectorVar(var_name, comp);
1761  if (!var)
1762  {
1764  return _default_div;
1765  }
1767 
1768  if (!_coupleable_neighbor)
1769  return var->divSlnOlder();
1770  return var->divSlnOlderNeighbor();
1771 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
VectorVariableDivergence _default_div
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1467
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledDofValues()

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

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

Referenced by Coupleable::coupledAllDofValues().

1979 {
1980  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
1981  if (!var)
1982  return *getDefaultValue(var_name, comp);
1984 
1985  if (!_coupleable_neighbor)
1986  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
1987  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
1988 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:334
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:1651

◆ coupledDofValuesOld()

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

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

Referenced by Coupleable::coupledAllDofValuesOld().

1999 {
2000  const auto * var = getVar(var_name, comp);
2001  if (!var)
2002  return *getDefaultValue(var_name, comp);
2004 
2005  if (!_coupleable_neighbor)
2006  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
2007  return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
2008 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:334
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:1651

◆ coupledDofValuesOlder()

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

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

Referenced by Coupleable::coupledAllDofValuesOlder().

2019 {
2020  const auto * var = getVar(var_name, comp);
2021  if (!var)
2022  return *getDefaultValue(var_name, comp);
2024 
2025  if (!_coupleable_neighbor)
2026  return var->dofValuesOlder();
2027  return var->dofValuesOlderNeighbor();
2028 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
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:334
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:1651

◆ coupledDot()

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

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

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

1123 {
1124  const auto * var = getVar(var_name, comp);
1125  if (!var)
1126  {
1128  return _default_value_zero;
1129  }
1131 
1132  if (!_coupleable_neighbor)
1133  {
1134  if (_c_nodal)
1135  return var->dofValuesDot();
1136  return var->uDot();
1137  }
1138  else
1139  {
1140  if (_c_nodal)
1141  return var->dofValuesDotNeighbor();
1142  return var->uDotNeighbor();
1143  }
1144 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1415
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
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:1651
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:1729

◆ coupledDotDot()

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

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

1148 {
1149  const auto * var = getVar(var_name, comp);
1150  if (!var)
1151  {
1153  return _default_value_zero;
1154  }
1156 
1157  if (!_coupleable_neighbor)
1158  {
1159  if (_c_nodal)
1160  return var->dofValuesDotDot();
1161  return var->uDotDot();
1162  }
1163  else
1164  {
1165  if (_c_nodal)
1166  return var->dofValuesDotDotNeighbor();
1167  return var->uDotDotNeighbor();
1168  }
1169 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1415
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
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:1651
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:1729

◆ coupledDotDotDu()

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

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

1432 {
1433  const auto * var = getVar(var_name, comp);
1434  if (!var)
1435  {
1437  return _default_value_zero;
1438  }
1440 
1441  if (!_coupleable_neighbor)
1442  {
1443  if (_c_nodal)
1444  return var->dofValuesDuDotDotDu();
1445  return var->duDotDotDu();
1446  }
1447  else
1448  {
1449  if (_c_nodal)
1450  return var->dofValuesDuDotDotDuNeighbor();
1451  return var->duDotDotDuNeighbor();
1452  }
1453 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1415
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
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:1651
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:1729

◆ coupledDotDotOld()

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

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

1198 {
1199  const auto * var = getVar(var_name, comp);
1200  if (!var)
1201  {
1203  return _default_value_zero;
1204  }
1206 
1207  if (!_coupleable_neighbor)
1208  {
1209  if (_c_nodal)
1210  return var->dofValuesDotDotOld();
1211  return var->uDotDotOld();
1212  }
1213  else
1214  {
1215  if (_c_nodal)
1216  return var->dofValuesDotDotOldNeighbor();
1217  return var->uDotDotOldNeighbor();
1218  }
1219 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1415
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
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:1651
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:1729

◆ coupledDotDu()

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

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

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

1407 {
1408  const auto * var = getVar(var_name, comp);
1409  if (!var)
1410  {
1412  return _default_value_zero;
1413  }
1415 
1416  if (!_coupleable_neighbor)
1417  {
1418  if (_c_nodal)
1419  return var->dofValuesDuDotDu();
1420  return var->duDotDu();
1421  }
1422  else
1423  {
1424  if (_c_nodal)
1425  return var->dofValuesDuDotDuNeighbor();
1426  return var->duDotDuNeighbor();
1427  }
1428 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1415
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
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:1651
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:1729

◆ coupledDotOld()

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

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

1173 {
1174  const auto * var = getVar(var_name, comp);
1175  if (!var)
1176  {
1178  return _default_value_zero;
1179  }
1181 
1182  if (!_coupleable_neighbor)
1183  {
1184  if (_c_nodal)
1185  return var->dofValuesDotOld();
1186  return var->uDotOld();
1187  }
1188  else
1189  {
1190  if (_c_nodal)
1191  return var->dofValuesDotOldNeighbor();
1192  return var->uDotOldNeighbor();
1193  }
1194 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1415
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
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:1651
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:1729

◆ coupledDots()

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

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

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

◆ coupledGenericDofValue() [1/3]

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

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
protectedinherited

Definition at line 574 of file Coupleable.C.

575 {
576  return coupledDofValues(var_name, comp);
577 }
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:1978

◆ coupledGenericDofValue() [3/3]

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

Definition at line 581 of file Coupleable.C.

582 {
583  return adCoupledDofValues(var_name, comp);
584 }
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:2052

◆ coupledGenericGradient() [1/3]

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

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
protectedinherited

Definition at line 2402 of file Coupleable.C.

2403 {
2404  return coupledGradient(var_name, comp);
2405 }
virtual const VariableGradient & coupledGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable.
Definition: Coupleable.C:1481

◆ coupledGenericGradient() [3/3]

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

Definition at line 2409 of file Coupleable.C.

2410 {
2411  return adCoupledGradient(var_name, comp);
2412 }
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:2143

◆ coupledGenericGradients() [1/3]

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

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
protectedinherited

Definition at line 2649 of file Coupleable.C.

2650 {
2651  return coupledGradients(var_name);
2652 }
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:2641

◆ coupledGenericGradients() [3/3]

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

Definition at line 2656 of file Coupleable.C.

2657 {
2658  auto func = [this, &var_name](unsigned int comp) { return &adCoupledGradient(var_name, comp); };
2659  return coupledVectorHelper<const GenericVariableGradient<true> *>(var_name, func);
2660 }
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:2143

◆ coupledGenericScalarValue() [1/3]

template<bool is_ad>
const GenericVariableValue<is_ad>& ScalarCoupleable::coupledGenericScalarValue ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protectedinherited

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

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

◆ coupledGenericScalarValue() [2/3]

template<>
const GenericVariableValue<false>& ScalarCoupleable::coupledGenericScalarValue ( const std::string &  var_name,
const unsigned int  comp 
) const
protectedinherited

Definition at line 152 of file ScalarCoupleable.C.

154 {
155  return coupledScalarValue(var_name, comp);
156 }
const VariableValue & coupledScalarValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a scalar coupled variable.

◆ coupledGenericScalarValue() [3/3]

template<>
const GenericVariableValue<true>& ScalarCoupleable::coupledGenericScalarValue ( const std::string &  var_name,
const unsigned int  comp 
) const
protectedinherited

Definition at line 160 of file ScalarCoupleable.C.

162 {
163  return adCoupledScalarValue(var_name, comp);
164 }
const ADVariableValue & adCoupledScalarValue(const std::string &var_name, unsigned int comp=0) const
Returns AD value of a scalar coupled variable.

◆ coupledGenericValue() [1/3]

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

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
protectedinherited

Definition at line 469 of file Coupleable.C.

470 {
471  return coupledValue(var_name, comp);
472 }
virtual const VariableValue & coupledValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled variable.
Definition: Coupleable.C:482

◆ coupledGenericValue() [3/3]

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

Definition at line 476 of file Coupleable.C.

477 {
478  return adCoupledValue(var_name, comp);
479 }
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:2105

◆ coupledGenericValues() [1/3]

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

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
protectedinherited

Definition at line 2461 of file Coupleable.C.

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

◆ coupledGenericValues() [3/3]

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

Definition at line 2468 of file Coupleable.C.

2469 {
2470  return adCoupledValues(var_name);
2471 }
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:2474

◆ coupledGradient()

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

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

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

1482 {
1483  const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
1484  if (!var)
1485  {
1487  return _default_gradient;
1488  }
1490 
1491  if (!_coupleable_neighbor)
1492  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
1493  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
1494 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1418
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledGradientDot()

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

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

1547 {
1548  const auto * var = getVar(var_name, comp);
1549  if (!var)
1550  {
1552  return _default_gradient;
1553  }
1555 
1556  if (!_coupleable_neighbor)
1557  return var->gradSlnDot();
1558  return var->gradSlnNeighborDot();
1559 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1418
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledGradientDotDot()

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

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

1563 {
1564  const auto * var = getVar(var_name, comp);
1565  if (!var)
1566  {
1568  return _default_gradient;
1569  }
1571 
1572  if (!_coupleable_neighbor)
1573  return var->gradSlnDotDot();
1574  return var->gradSlnNeighborDotDot();
1575 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1418
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledGradientOld()

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

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

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

1498 {
1499  const auto * var = getVar(var_name, comp);
1500  if (!var)
1501  {
1503  return _default_gradient;
1504  }
1506 
1507  if (!_coupleable_neighbor)
1508  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
1509  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
1510 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1418
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledGradientOlder()

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

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

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

1514 {
1515  const auto * var = getVar(var_name, comp);
1516  if (!var)
1517  {
1519  return _default_gradient;
1520  }
1522 
1523  if (!_coupleable_neighbor)
1524  return var->gradSlnOlder();
1525  return var->gradSlnOlderNeighbor();
1526 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1418
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledGradientPreviousNL()

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

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

1530 {
1531  const auto * var = getVar(var_name, comp);
1533  if (!var)
1534  {
1536  return _default_gradient;
1537  }
1539 
1540  if (!_coupleable_neighbor)
1541  return var->gradSlnPreviousNL();
1542  return var->gradSlnPreviousNLNeighbor();
1543 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1352
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1418
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledGradients()

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

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

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

◆ coupledGradientsOld()

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

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

2671 {
2672  auto func = [this, &var_name](unsigned int comp) { return &coupledGradientOld(var_name, comp); };
2673  return coupledVectorHelper<const VariableGradient *>(var_name, func);
2674 }
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:1497

◆ coupledIndices()

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

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

2416 {
2417  auto func = [this, &var_name](unsigned int comp) { return coupled(var_name, comp); };
2418  return coupledVectorHelper<unsigned int>(var_name, func);
2419 }
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:441

◆ coupledMatrixTagScalarValue()

const VariableValue & ScalarCoupleable::coupledMatrixTagScalarValue ( const std::string &  var_name,
TagID  tag,
unsigned int  comp = 0 
) const
protectedinherited

Returns value of a scalar coupled variable.

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

Definition at line 202 of file ScalarCoupleable.C.

205 {
206  checkVar(var_name);
207  if (!isCoupledScalar(var_name, comp))
208  return *getDefaultValue(var_name);
209 
210  _sc_coupleable_matrix_tags.insert(tag);
211 
212  return getScalarVar(var_name, comp)->matrixTagSln(tag);
213 }
std::set< TagID > _sc_coupleable_matrix_tags
The scalar coupleable matrix tags.
bool isCoupledScalar(const std::string &var_name, unsigned int i=0) const
Returns true if a variables has been coupled_as name.
void checkVar(const std::string &var_name) const
Check that the right kind of variable is being coupled in.
const MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp) const
Extract pointer to a scalar coupled variable.
const VariableValue & matrixTagSln(TagID tag) const
const VariableValue * getDefaultValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for an uncoupled variable...

◆ coupledMatrixTagValue() [1/2]

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

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

Referenced by Coupleable::coupledMatrixTagValue(), and Coupleable::coupledMatrixTagValues().

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

◆ coupledMatrixTagValue() [2/2]

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

Definition at line 793 of file Coupleable.C.

796 {
797  if (!_c_parameters.isParamValid(tag_name))
798  mooseError("Tag name parameter '", tag_name, "' is invalid");
799 
800  TagName tagname = _c_parameters.get<TagName>(tag_name);
801  if (!_c_fe_problem.matrixTagExists(tagname))
802  mooseError("Matrix tag name '", tagname, "' does not exist");
803 
804  TagID tag = _c_fe_problem.getMatrixTagID(tagname);
805  return coupledMatrixTagValue(var_names, tag, index);
806 }
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:299
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:776
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1352
virtual TagID getMatrixTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:320
const InputParameters & _c_parameters
Definition: Coupleable.h:1344
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:306
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
protectedinherited

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

Referenced by Coupleable::coupledMatrixTagValues().

2605 {
2606  auto func = [this, &var_names, &tag](unsigned int comp)
2607  { return &coupledMatrixTagValue(var_names, tag, comp); };
2608  return coupledVectorHelper<const VariableValue *>(var_names, func);
2609 }
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:776

◆ coupledMatrixTagValues() [2/2]

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

Definition at line 2612 of file Coupleable.C.

2614 {
2615  if (!_c_parameters.isParamValid(tag_name))
2616  mooseError("Tag name parameter '", tag_name, "' is invalid");
2617 
2618  TagName tagname = _c_parameters.get<TagName>(tag_name);
2619  if (!_c_fe_problem.matrixTagExists(tagname))
2620  mooseError("Matrix tag name '", tagname, "' does not exist");
2621 
2622  TagID tag = _c_fe_problem.getMatrixTagID(tagname);
2623  return coupledMatrixTagValues(var_names, tag);
2624 }
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:299
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:1352
virtual TagID getMatrixTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:320
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:2604
const InputParameters & _c_parameters
Definition: Coupleable.h:1344
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:306
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
protectedinherited

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

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

2423 {
2424  if (getFieldVar(var_name, comp))
2425  return getFieldVar(var_name, comp)->name();
2426  // Detect if we are in the case where a constant was passed in lieu of a variable
2427  else if (isCoupledConstant(var_name))
2429  ": a variable name was queried but a constant was passed for parameter '",
2430  var_name,
2431  "Either pass a true variable or contact a developer to shield the call to "
2432  "'coupledName' with 'isCoupledConstant'");
2433  else
2434  mooseError(
2435  _c_name, ": Variable '", var_name, "' does not exist, yet its coupled name is requested");
2436 }
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:151
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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:1347
const MooseVariableFieldBase * getFieldVar(const std::string &var_name, unsigned int comp) const
Definition: Coupleable.C:281

◆ coupledNames()

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

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

2440 {
2441  auto func = [this, &var_name](unsigned int comp) { return coupledName(var_name, comp); };
2442  return coupledVectorHelper<VariableName>(var_name, func);
2443 }
VariableName coupledName(const std::string &var_name, unsigned int comp=0) const
Names of the variable in the Coupleable interface.
Definition: Coupleable.C:2422

◆ coupledNodalDot()

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

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

1917 {
1918  static const T zero = 0;
1919  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1920  if (!var)
1921  return zero;
1923 
1924  if (!_coupleable_neighbor)
1925  return var->nodalValueDot();
1926  mooseError("Neighbor version not implemented");
1927 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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:1651

◆ coupledNodalDotDot()

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

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

1931 {
1932  const auto * var = getVar(var_name, comp);
1933  if (!var)
1934  {
1936  return _default_value_zero;
1937  }
1939 
1940  if (!_coupleable_neighbor)
1941  return var->dofValuesDotDot();
1942  return var->dofValuesDotDotNeighbor();
1943 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1415
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
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:1651
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:1729

◆ coupledNodalDotDotOld()

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

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

1963 {
1964  const auto * var = getVar(var_name, comp);
1965  if (!var)
1966  {
1968  return _default_value_zero;
1969  }
1971 
1972  if (!_coupleable_neighbor)
1973  return var->dofValuesDotDotOld();
1974  return var->dofValuesDotDotOldNeighbor();
1975 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1415
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
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:1651
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:1729

◆ coupledNodalDotOld()

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

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

1947 {
1948  const auto * var = getVar(var_name, comp);
1949  if (!var)
1950  {
1952  return _default_value_zero;
1953  }
1955 
1956  if (!_coupleable_neighbor)
1957  return var->dofValuesDotOld();
1958  return var->dofValuesDotOldNeighbor();
1959 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1415
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
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:1651
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:1729

◆ coupledNodalValue()

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

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

1841 {
1842  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1843  if (!var)
1844  return getDefaultNodalValue<T>(var_name, comp);
1846 
1847  if (!var->isNodal())
1849  ": Trying to get nodal values of variable '",
1850  var->name(),
1851  "', but it is not nodal.");
1852 
1853  if (!_coupleable_neighbor)
1854  return (_c_is_implicit) ? var->nodalValue() : var->nodalValueOld();
1855  return (_c_is_implicit) ? var->nodalValueNeighbor() : var->nodalValueOldNeighbor();
1856 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1347
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:1651

◆ coupledNodalValueOld()

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

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

1861 {
1862  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1863  if (!var)
1864  return getDefaultNodalValue<T>(var_name, comp);
1866 
1867  if (!var->isNodal())
1869  ": Trying to get old nodal values of variable '",
1870  var->name(),
1871  "', but it is not nodal.");
1872 
1873  if (!_coupleable_neighbor)
1874  return (_c_is_implicit) ? var->nodalValueOld() : var->nodalValueOlder();
1875  return (_c_is_implicit) ? var->nodalValueOldNeighbor() : var->nodalValueOlderNeighbor();
1876 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1347
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:1651

◆ coupledNodalValueOlder()

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

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

1881 {
1882  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1883  if (!var)
1884  return getDefaultNodalValue<T>(var_name, comp);
1886 
1887  if (!var->isNodal())
1889  ": Trying to get older nodal values of variable '",
1890  var->name(),
1891  "', but it is not nodal.");
1892 
1893  if (!_coupleable_neighbor)
1894  return var->nodalValueOlder();
1895  return var->nodalValueOlderNeighbor();
1896 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1347
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:1651

◆ coupledNodalValuePreviousNL()

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

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

1901 {
1902  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1903  if (!var)
1904  return getDefaultNodalValue<T>(var_name, comp);
1906 
1908 
1909  if (!_coupleable_neighbor)
1910  return var->nodalValuePreviousNL();
1911  return var->nodalValuePreviousNLNeighbor();
1912 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1352
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:1651

◆ coupledScalar()

unsigned int ScalarCoupleable::coupledScalar ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protectedinherited

Returns the index for a scalar coupled variable by name.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Index of coupled variable

Definition at line 93 of file ScalarCoupleable.C.

Referenced by ParsedODEKernel::ParsedODEKernel().

94 {
95  checkVar(var_name);
96  return getScalarVar(var_name, comp)->number();
97 }
unsigned int number() const
Get variable number coming from libMesh.
void checkVar(const std::string &var_name) const
Check that the right kind of variable is being coupled in.
const MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp) const
Extract pointer to a scalar coupled variable.

◆ coupledScalarComponents()

unsigned int ScalarCoupleable::coupledScalarComponents ( const std::string &  var_name) const
protectedinherited

Return the number of components to the coupled scalar variable.

Parameters
var_nameThe of the coupled variable

Definition at line 353 of file ScalarCoupleable.C.

354 {
355  const auto var_name = _sc_parameters.checkForRename(var_name_in);
356 
357  const auto it = _coupled_scalar_vars.find(var_name);
358  if (it != _coupled_scalar_vars.end())
359  return it->second.size();
360 
361  mooseError(_sc_name, ": Trying to get a non-existent variable '", var_name, "'");
362 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
const std::string & _sc_name
The name of the object this interface is part of.
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _coupled_scalar_vars
Coupled vars whose values we provide.
const InputParameters & _sc_parameters
std::string checkForRename(const std::string &name) const
Checks whether the provided name is a renamed parameter name.

◆ coupledScalarDot()

const VariableValue & ScalarCoupleable::coupledScalarDot ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protectedinherited

Returns the time derivative of a scalar coupled variable.

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

Definition at line 244 of file ScalarCoupleable.C.

245 {
246  checkVar(var_name);
247  validateExecutionerType(var_name, "coupledScalarDot");
248  return getScalarVar(var_name, comp)->uDot();
249 }
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...
const VariableValue & uDot() const
void checkVar(const std::string &var_name) const
Check that the right kind of variable is being coupled in.
const MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp) const
Extract pointer to a scalar coupled variable.

◆ coupledScalarDotDot()

const VariableValue & ScalarCoupleable::coupledScalarDotDot ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protectedinherited

Returns the second time derivative of a scalar coupled variable.

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

Definition at line 260 of file ScalarCoupleable.C.

261 {
262  checkVar(var_name);
263  validateExecutionerType(var_name, "coupledScalarDotDot");
264  return getScalarVar(var_name, comp)->uDotDot();
265 }
const VariableValue & uDotDot() const
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...
void checkVar(const std::string &var_name) const
Check that the right kind of variable is being coupled in.
const MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp) const
Extract pointer to a scalar coupled variable.

◆ coupledScalarDotDotDu()

const VariableValue & ScalarCoupleable::coupledScalarDotDotDu ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protectedinherited

Second time derivative of a scalar 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 292 of file ScalarCoupleable.C.

293 {
294  checkVar(var_name);
295  validateExecutionerType(var_name, "coupledScalarDotDotDu");
296  return getScalarVar(var_name, comp)->duDotDotDu();
297 }
const VariableValue & duDotDotDu() const
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...
void checkVar(const std::string &var_name) const
Check that the right kind of variable is being coupled in.
const MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp) const
Extract pointer to a scalar coupled variable.

◆ coupledScalarDotDotOld()

const VariableValue & ScalarCoupleable::coupledScalarDotDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protectedinherited

Returns the old second time derivative of a scalar coupled variable.

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

Definition at line 276 of file ScalarCoupleable.C.

278 {
279  checkVar(var_name);
280  validateExecutionerType(var_name, "coupledScalarDotDotOld");
281  return getScalarVar(var_name, comp)->uDotDotOld();
282 }
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...
const VariableValue & uDotDotOld() const
void checkVar(const std::string &var_name) const
Check that the right kind of variable is being coupled in.
const MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp) const
Extract pointer to a scalar coupled variable.

◆ coupledScalarDotDu()

const VariableValue & ScalarCoupleable::coupledScalarDotDu ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protectedinherited

Time derivative of a scalar 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 284 of file ScalarCoupleable.C.

285 {
286  checkVar(var_name);
287  validateExecutionerType(var_name, "coupledScalarDotDu");
288  return getScalarVar(var_name, comp)->duDotDu();
289 }
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...
void checkVar(const std::string &var_name) const
Check that the right kind of variable is being coupled in.
const MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp) const
Extract pointer to a scalar coupled variable.
const VariableValue & duDotDu() const

◆ coupledScalarDotOld()

const VariableValue & ScalarCoupleable::coupledScalarDotOld ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protectedinherited

Returns the old time derivative of a scalar coupled variable.

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

Definition at line 268 of file ScalarCoupleable.C.

269 {
270  checkVar(var_name);
271  validateExecutionerType(var_name, "coupledScalarDotOld");
272  return getScalarVar(var_name, comp)->uDotOld();
273 }
const VariableValue & uDotOld() const
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...
void checkVar(const std::string &var_name) const
Check that the right kind of variable is being coupled in.
const MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp) const
Extract pointer to a scalar coupled variable.

◆ coupledScalarOrder()

Order ScalarCoupleable::coupledScalarOrder ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protectedinherited

Returns the order for a scalar coupled variable by name.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Order of coupled variable

Definition at line 100 of file ScalarCoupleable.C.

101 {
102  checkVar(var_name);
103  if (!isCoupledScalar(var_name, comp))
105 
106  return getScalarVar(var_name, comp)->order();
107 }
FEProblemBase & _sc_fe_problem
bool isCoupledScalar(const std::string &var_name, unsigned int i=0) const
Returns true if a variables has been coupled_as name.
void checkVar(const std::string &var_name) const
Check that the right kind of variable is being coupled in.
const MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp) const
Extract pointer to a scalar coupled variable.
Order order() const
Get the order of this variable Note: Order enum can be implicitly converted to unsigned int...
Order getMaxScalarOrder() const

◆ coupledScalarValue()

const VariableValue & ScalarCoupleable::coupledScalarValue ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protectedinherited

Returns value of a scalar 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 124 of file ScalarCoupleable.C.

Referenced by ParsedODEKernel::ParsedODEKernel().

125 {
126  checkVar(var_name);
127  if (!isCoupledScalar(var_name, comp))
128  return *getDefaultValue(var_name);
129 
130  auto var = getScalarVar(var_name, comp);
131  return _sc_is_implicit ? var->sln() : var->slnOld();
132 }
const bool _sc_is_implicit
True if implicit value is required.
bool isCoupledScalar(const std::string &var_name, unsigned int i=0) const
Returns true if a variables has been coupled_as name.
void checkVar(const std::string &var_name) const
Check that the right kind of variable is being coupled in.
const MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp) const
Extract pointer to a scalar coupled variable.
const VariableValue * getDefaultValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for an uncoupled variable...

◆ coupledScalarValueOld()

const VariableValue & ScalarCoupleable::coupledScalarValueOld ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protectedinherited

Returns the old (previous time step) value of a scalar coupled variable.

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

Definition at line 216 of file ScalarCoupleable.C.

217 {
218  checkVar(var_name);
219  if (!isCoupledScalar(var_name, comp))
220  return *getDefaultValue(var_name);
221 
222  validateExecutionerType(var_name, "coupledScalarValueOld");
223  auto var = getScalarVar(var_name, comp);
224  return _sc_is_implicit ? var->slnOld() : var->slnOlder();
225 }
const bool _sc_is_implicit
True if implicit value is required.
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...
bool isCoupledScalar(const std::string &var_name, unsigned int i=0) const
Returns true if a variables has been coupled_as name.
void checkVar(const std::string &var_name) const
Check that the right kind of variable is being coupled in.
const MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp) const
Extract pointer to a scalar coupled variable.
const VariableValue * getDefaultValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for an uncoupled variable...

◆ coupledScalarValueOlder()

const VariableValue & ScalarCoupleable::coupledScalarValueOlder ( const std::string &  var_name,
unsigned int  comp = 0 
) const
protectedinherited

Returns the older (two time steps previous) value of a scalar coupled variable.

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

Definition at line 228 of file ScalarCoupleable.C.

230 {
231  checkVar(var_name);
232  if (!isCoupledScalar(var_name, comp))
233  return *getDefaultValue(var_name);
234 
235  validateExecutionerType(var_name, "coupledScalarValueOlder");
236  auto var = getScalarVar(var_name, comp);
237  if (_sc_is_implicit)
238  return var->slnOlder();
239  else
240  mooseError("Older values not available for explicit schemes");
241 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
const bool _sc_is_implicit
True if implicit value is required.
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...
bool isCoupledScalar(const std::string &var_name, unsigned int i=0) const
Returns true if a variables has been coupled_as name.
void checkVar(const std::string &var_name) const
Check that the right kind of variable is being coupled in.
const MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp) const
Extract pointer to a scalar coupled variable.
const VariableValue * getDefaultValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for an uncoupled variable...

◆ coupledSecond()

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

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

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

1775 {
1776  const auto * var = getVar(var_name, comp);
1777  if (!var)
1778  {
1780  return _default_second;
1781  }
1783 
1784  if (!_coupleable_neighbor)
1785  return (_c_is_implicit) ? var->secondSln() : var->secondSlnOlder();
1786  return (_c_is_implicit) ? var->secondSlnNeighbor() : var->secondSlnOlderNeighbor();
1787 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1427
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledSecondOld()

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

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

1791 {
1792  const auto * var = getVar(var_name, comp);
1793  if (!var)
1794  {
1796  return _default_second;
1797  }
1799 
1800  if (!_coupleable_neighbor)
1801  return (_c_is_implicit) ? var->secondSlnOld() : var->secondSlnOlder();
1802  return (_c_is_implicit) ? var->secondSlnOldNeighbor() : var->secondSlnOlderNeighbor();
1803 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1427
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledSecondOlder()

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

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

1807 {
1808  const auto * var = getVar(var_name, comp);
1809  if (!var)
1810  {
1812  return _default_second;
1813  }
1815 
1816  if (!_coupleable_neighbor)
1817  return var->secondSlnOlder();
1818  return var->secondSlnOlderNeighbor();
1819 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1427
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledSecondPreviousNL()

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

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

1823 {
1824  const auto * var = getVar(var_name, comp);
1826  if (!var)
1827  {
1829  return _default_second;
1830  }
1832 
1833  if (!_coupleable_neighbor)
1834  return var->secondSlnPreviousNL();
1835  return var->secondSlnPreviousNLNeighbor();
1836 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1352
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1427
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledValue()

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

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

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

483 {
484  const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
485  if (!var)
486  return *getDefaultValue(var_name, comp);
488 
490  {
491  if (_c_nodal)
492  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
493  else
494  return (_c_is_implicit) ? var->sln() : var->slnOld();
495  }
496  else
497  {
498  if (_c_nodal)
499  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
500  else
501  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
502  }
503 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:334
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:1651

◆ coupledValueLower()

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

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

588 {
589  const auto * var = getVar(var_name, comp);
590  if (!var)
591  return *getDefaultValue(var_name, comp);
593 
595  mooseError(_c_name, ":coupledValueLower cannot be called in a coupleable neighbor object");
596 
597  if (_c_nodal)
598  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
599  else
600  return (_c_is_implicit) ? var->slnLower() : var->slnLowerOld();
601 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:334
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1347
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:1651

◆ coupledValueOld()

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

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

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

986 {
987  const auto * var = getVar(var_name, comp);
988  if (!var)
989  return *getDefaultValue(var_name, comp);
991 
993  {
994  if (_c_nodal)
995  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
996  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
997  }
998  else
999  {
1000  if (_c_nodal)
1001  return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
1002  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
1003  }
1004 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:334
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:1651

◆ coupledValueOlder()

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

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

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

1008 {
1009  const auto * var = getVar(var_name, comp);
1010  if (!var)
1011  return *getDefaultValue(var_name, comp);
1013 
1014  if (!_coupleable_neighbor)
1015  {
1016  if (_c_nodal)
1017  return var->dofValuesOlder();
1018  return var->slnOlder();
1019  }
1020  else
1021  {
1022  if (_c_nodal)
1023  return var->dofValuesOlderNeighbor();
1024  return var->slnOlderNeighbor();
1025  }
1026 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
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:334
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:1651

◆ coupledValuePreviousNL()

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

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

1030 {
1031  const auto * var = getVar(var_name, comp);
1032  if (!var)
1033  return *getDefaultValue(var_name, comp);
1035 
1037  if (!_coupleable_neighbor)
1038  {
1039  if (_c_nodal)
1040  return var->dofValuesPreviousNL();
1041  return var->slnPreviousNL();
1042  }
1043  else
1044  {
1045  if (_c_nodal)
1046  return var->dofValuesPreviousNLNeighbor();
1047  return var->slnPreviousNLNeighbor();
1048  }
1049 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:287
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1352
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:334
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:1651

◆ coupledValues()

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

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

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

◆ coupledValuesOld()

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

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

2628 {
2629  auto func = [this, &var_name](unsigned int comp) { return &coupledValueOld(var_name, comp); };
2630  return coupledVectorHelper<const VariableValue *>(var_name, func);
2631 }
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:985

◆ coupledValuesOlder()

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

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

2635 {
2636  auto func = [this, &var_name](unsigned int comp) { return &coupledValueOlder(var_name, comp); };
2637  return coupledVectorHelper<const VariableValue *>(var_name, func);
2638 }
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:1007

◆ coupledVectorDot()

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

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

1223 {
1224  const auto * var = getVectorVar(var_name, comp);
1225  if (!var)
1226  {
1229  }
1231 
1232  if (!_coupleable_neighbor)
1233  return var->uDot();
1234  return var->uDotNeighbor();
1235 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
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:1651
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1458
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledVectorDotDot()

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

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

1239 {
1240  const auto * var = getVectorVar(var_name, comp);
1241  if (!var)
1242  {
1245  }
1247 
1248  if (!_coupleable_neighbor)
1249  return var->uDotDot();
1250  return var->uDotDotNeighbor();
1251 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
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:1651
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1458
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledVectorDotDotDu()

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

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

1303 {
1304  const auto * var = getVectorVar(var_name, comp);
1305  if (!var)
1306  {
1308  return _default_value_zero;
1309  }
1311 
1312  if (!_coupleable_neighbor)
1313  return var->duDotDotDu();
1314  return var->duDotDotDuNeighbor();
1315 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1415
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:1651
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:1729

◆ coupledVectorDotDotOld()

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

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

1271 {
1272  const auto * var = getVectorVar(var_name, comp);
1273  if (!var)
1274  {
1277  }
1279 
1280  if (!_coupleable_neighbor)
1281  return var->uDotDotOld();
1282  return var->uDotDotOldNeighbor();
1283 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
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:1651
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1458
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledVectorDotDu()

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

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

1287 {
1288  const auto * var = getVectorVar(var_name, comp);
1289  if (!var)
1290  {
1292  return _default_value_zero;
1293  }
1295 
1296  if (!_coupleable_neighbor)
1297  return var->duDotDu();
1298  return var->duDotDuNeighbor();
1299 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1415
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:1651
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:1729

◆ coupledVectorDotOld()

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

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

1255 {
1256  const auto * var = getVectorVar(var_name, comp);
1257  if (!var)
1258  {
1261  }
1263 
1264  if (!_coupleable_neighbor)
1265  return var->uDotOld();
1266  return var->uDotOldNeighbor();
1267 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
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:1651
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1458
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledVectorGradient()

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

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

1579 {
1580  const auto * var = getVectorVar(var_name, comp);
1581  if (!var)
1582  {
1584  return _default_vector_gradient;
1585  }
1587 
1588  if (!_coupleable_neighbor)
1589  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
1590  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
1591 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1461
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledVectorGradientOld()

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

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

1595 {
1596  const auto * var = getVectorVar(var_name, comp);
1597  if (!var)
1598  {
1600  return _default_vector_gradient;
1601  }
1603 
1604  if (!_coupleable_neighbor)
1605  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
1606  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
1607 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1461
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:1651
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ coupledVectorGradientOlder()

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

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

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

◆ coupledVectorHelper()

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

Definition at line 1641 of file Coupleable.h.

1642  {
1643  const auto components = coupledComponents(var_name);
1644  std::vector<T> vals(components);
1645  for (MooseIndex(components) comp = 0; comp < components; ++comp)
1646  vals[comp] = func(comp);
1647  return vals;
1648  }
unsigned int coupledComponents(const std::string &var_name) const
Number of coupled components.
Definition: Coupleable.C:157

◆ coupledVectorTagArrayDofValue()

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

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

771 {
772  return vectorTagDofValueHelper<RealEigenVector>(var_name, tag_name, comp);
773 }

◆ coupledVectorTagArrayGradient() [1/2]

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

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

Referenced by Coupleable::coupledVectorTagArrayGradient(), and Coupleable::coupledVectorTagArrayGradients().

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

◆ coupledVectorTagArrayGradient() [2/2]

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

Definition at line 696 of file Coupleable.C.

699 {
700  if (!_c_parameters.isParamValid(tag_name))
701  mooseError("Tag name parameter '", tag_name, "' is invalid");
702 
703  TagName tagname = _c_parameters.get<TagName>(tag_name);
704  if (!_c_fe_problem.vectorTagExists(tagname))
705  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
706 
707  TagID tag = _c_fe_problem.getVectorTagID(tagname);
708  return coupledVectorTagArrayGradient(var_names, tag, index);
709 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:181
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:299
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:1352
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:674
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:173
const InputParameters & _c_parameters
Definition: Coupleable.h:1344
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
protectedinherited

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

Referenced by Coupleable::coupledVectorTagArrayGradients().

2559 {
2560  auto func = [this, &var_names, &tag](unsigned int index)
2561  { return &coupledVectorTagArrayGradient(var_names, tag, index); };
2562  return coupledVectorHelper<const ArrayVariableGradient *>(var_names, func);
2563 }
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:674

◆ coupledVectorTagArrayGradients() [2/2]

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

Definition at line 2566 of file Coupleable.C.

2568 {
2569  if (!_c_parameters.isParamValid(tag_name))
2570  mooseError("Tag name parameter '", tag_name, "' is invalid");
2571 
2572  TagName tagname = _c_parameters.get<TagName>(tag_name);
2573  if (!_c_fe_problem.vectorTagExists(tagname))
2574  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2575 
2576  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2577  return coupledVectorTagArrayGradients(var_names, tag);
2578 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:181
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:299
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:1352
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:173
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:2558
const InputParameters & _c_parameters
Definition: Coupleable.h:1344
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
protectedvirtualinherited

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

Referenced by Coupleable::coupledVectorTagArrayValues().

623 {
624  return vectorTagValueHelper<RealEigenVector>(var_names, tag, index);
625 }

◆ coupledVectorTagArrayValue() [2/2]

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

Definition at line 628 of file Coupleable.C.

631 {
632  return vectorTagValueHelper<RealEigenVector>(var_names, tag_name, index);
633 }

◆ coupledVectorTagArrayValues() [1/2]

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

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

Referenced by Coupleable::coupledVectorTagArrayValues().

2513 {
2514  auto func = [this, &var_names, &tag](unsigned int index)
2515  { return &coupledVectorTagArrayValue(var_names, tag, index); };
2516  return coupledVectorHelper<const ArrayVariableValue *>(var_names, func);
2517 }
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:620

◆ coupledVectorTagArrayValues() [2/2]

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

Definition at line 2520 of file Coupleable.C.

2522 {
2523  if (!_c_parameters.isParamValid(tag_name))
2524  mooseError("Tag name parameter '", tag_name, "' is invalid");
2525 
2526  TagName tagname = _c_parameters.get<TagName>(tag_name);
2527  if (!_c_fe_problem.vectorTagExists(tagname))
2528  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2529 
2530  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2531  return coupledVectorTagArrayValues(var_names, tag);
2532 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:181
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:299
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:2512
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1352
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:173
const InputParameters & _c_parameters
Definition: Coupleable.h:1344
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
protectedvirtualinherited

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

Referenced by Coupleable::coupledVectorTagDofValues().

755 {
756  return vectorTagDofValueHelper<Real>(var_name, tag, comp);
757 }

◆ coupledVectorTagDofValue() [2/2]

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

Definition at line 760 of file Coupleable.C.

763 {
764  return vectorTagDofValueHelper<Real>(var_name, tag_name, comp);
765 }

◆ coupledVectorTagDofValues() [1/2]

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

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

Referenced by Coupleable::coupledVectorTagDofValues().

2582 {
2583  auto func = [this, &var_names, &tag](unsigned int comp)
2584  { return &coupledVectorTagDofValue(var_names, tag, comp); };
2585  return coupledVectorHelper<const VariableValue *>(var_names, func);
2586 }
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:752

◆ coupledVectorTagDofValues() [2/2]

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

Definition at line 2589 of file Coupleable.C.

2591 {
2592  if (!_c_parameters.isParamValid(tag_name))
2593  mooseError("Tag name parameter '", tag_name, "' is invalid");
2594 
2595  TagName tagname = _c_parameters.get<TagName>(tag_name);
2596  if (!_c_fe_problem.vectorTagExists(tagname))
2597  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2598 
2599  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2600  return coupledVectorTagDofValues(var_names, tag);
2601 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:181
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:299
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:1352
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:2581
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:173
const InputParameters & _c_parameters
Definition: Coupleable.h:1344
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
protectedvirtualinherited

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

Referenced by Coupleable::coupledVectorTagGradient(), and Coupleable::coupledVectorTagGradients().

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

◆ coupledVectorTagGradient() [2/2]

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

Definition at line 658 of file Coupleable.C.

661 {
662  if (!_c_parameters.isParamValid(tag_name))
663  mooseError("Tag name parameter '", tag_name, "' is invalid");
664 
665  TagName tagname = _c_parameters.get<TagName>(tag_name);
666  if (!_c_fe_problem.vectorTagExists(tagname))
667  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
668 
669  TagID tag = _c_fe_problem.getVectorTagID(tagname);
670  return coupledVectorTagGradient(var_names, tag, index);
671 }
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:636
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:181
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:299
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:1352
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:173
const InputParameters & _c_parameters
Definition: Coupleable.h:1344
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
protectedinherited

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

Referenced by Coupleable::coupledVectorTagGradients().

2536 {
2537  auto func = [this, &var_names, &tag](unsigned int index)
2538  { return &coupledVectorTagGradient(var_names, tag, index); };
2539  return coupledVectorHelper<const VariableGradient *>(var_names, func);
2540 }
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:636

◆ coupledVectorTagGradients() [2/2]

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

Definition at line 2543 of file Coupleable.C.

2545 {
2546  if (!_c_parameters.isParamValid(tag_name))
2547  mooseError("Tag name parameter '", tag_name, "' is invalid");
2548 
2549  TagName tagname = _c_parameters.get<TagName>(tag_name);
2550  if (!_c_fe_problem.vectorTagExists(tagname))
2551  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2552 
2553  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2554  return coupledVectorTagGradients(var_names, tag);
2555 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:181
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:299
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:2535
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1352
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:173
const InputParameters & _c_parameters
Definition: Coupleable.h:1344
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledVectorTagScalarValue()

const VariableValue & ScalarCoupleable::coupledVectorTagScalarValue ( const std::string &  var_name,
TagID  tag,
unsigned int  comp = 0 
) const
protectedinherited

Returns value of a scalar coupled variable.

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

Definition at line 181 of file ScalarCoupleable.C.

184 {
185  checkVar(var_name);
186  if (!isCoupledScalar(var_name, comp))
187  return *getDefaultValue(var_name);
188 
190  mooseError("Attempting to couple to vector tag scalar with ID ",
191  tag,
192  "in ",
193  _sc_name,
194  ", but a vector tag with that ID does not exist");
195 
196  _sc_coupleable_vector_tags.insert(tag);
197 
198  return getScalarVar(var_name, comp)->vectorTagSln(tag);
199 }
std::set< TagID > _sc_coupleable_vector_tags
The scalar coupleable vector tags.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
const std::string & _sc_name
The name of the object this interface is part of.
FEProblemBase & _sc_fe_problem
bool isCoupledScalar(const std::string &var_name, unsigned int i=0) const
Returns true if a variables has been coupled_as name.
const VariableValue & vectorTagSln(TagID tag) const
void checkVar(const std::string &var_name) const
Check that the right kind of variable is being coupled in.
const MooseVariableScalar * getScalarVar(const std::string &var_name, unsigned int comp) const
Extract pointer to a scalar coupled variable.
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:173
const VariableValue * getDefaultValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for an uncoupled variable...

◆ coupledVectorTagValue() [1/2]

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

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

Referenced by Coupleable::coupledVectorTagValues().

607 {
608  return vectorTagValueHelper<Real>(var_names, tag, index);
609 }

◆ coupledVectorTagValue() [2/2]

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

Definition at line 612 of file Coupleable.C.

615 {
616  return vectorTagValueHelper<Real>(var_names, tag_name, index);
617 }

◆ coupledVectorTagValues() [1/2]

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

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

Referenced by Coupleable::coupledVectorTagValues().

2490 {
2491  auto func = [this, &var_names, &tag](unsigned int comp)
2492  { return &coupledVectorTagValue(var_names, tag, comp); };
2493  return coupledVectorHelper<const VariableValue *>(var_names, func);
2494 }
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:604

◆ coupledVectorTagValues() [2/2]

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

Definition at line 2497 of file Coupleable.C.

2499 {
2500  if (!_c_parameters.isParamValid(tag_name))
2501  mooseError("Tag name parameter '", tag_name, "' is invalid");
2502 
2503  TagName tagname = _c_parameters.get<TagName>(tag_name);
2504  if (!_c_fe_problem.vectorTagExists(tagname))
2505  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2506 
2507  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2508  return coupledVectorTagValues(var_names, tag);
2509 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:181
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:299
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:1352
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:173
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:2489
const InputParameters & _c_parameters
Definition: Coupleable.h:1344
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
protectedvirtualinherited

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

Referenced by Coupleable::coupledVectorValues().

810 {
811  const auto * var = getVectorVar(var_name, comp);
812  if (!var)
813  return *getDefaultVectorValue(var_name);
815 
817  {
818  if (_c_nodal)
819  return _c_is_implicit ? var->nodalValueArray() : var->nodalValueOldArray();
820  else
821  return _c_is_implicit ? var->sln() : var->slnOld();
822  }
823  else
824  {
825  if (_c_nodal)
826  // Since this is at a node, I don't feel like there should be any "neighbor" logic
827  return _c_is_implicit ? var->nodalValueArray() : var->nodalValueOldArray();
828  else
829  return _c_is_implicit ? var->slnNeighbor() : var->slnOldNeighbor();
830  }
831 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
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:361
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:1651

◆ coupledVectorValueOld()

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

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

1053 {
1054  const auto * var = getVectorVar(var_name, comp);
1055  if (!var)
1056  return *getDefaultVectorValue(var_name);
1058 
1059  if (!_coupleable_neighbor)
1060  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
1061  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
1062 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
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:361
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1385
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:1651

◆ coupledVectorValueOlder()

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

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

1066 {
1067  const auto * var = getVectorVar(var_name, comp);
1068  if (!var)
1069  return *getDefaultVectorValue(var_name);
1071 
1072  if (!_coupleable_neighbor)
1073  return var->slnOlder();
1074  return var->slnOlderNeighbor();
1075 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:191
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:293
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:361
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:1651

◆ coupledVectorValues()

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

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

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

◆ genericZeroGradient() [1/3]

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

Returns zero gradient templated with automatic differentiation boolean.

Returns
Reference to a const GenericVariableValue

◆ genericZeroGradient() [2/3]

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

Definition at line 2374 of file Coupleable.C.

2375 {
2376  return _grad_zero;
2377 }
const VariableGradient & _grad_zero
Zero gradient of a variable.
Definition: Coupleable.h:1438

◆ genericZeroGradient() [3/3]

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

Definition at line 2381 of file Coupleable.C.

2382 {
2383  return _ad_grad_zero;
2384 }
const MooseArray< ADRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:1439

◆ genericZeroSecond() [1/3]

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

Returns zero second derivative templated with automatic differentiation boolean.

Returns
Reference to a const GenericVariableValue

◆ genericZeroSecond() [2/3]

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

Definition at line 2388 of file Coupleable.C.

2389 {
2390  return _second_zero;
2391 }
const VariableSecond & _second_zero
Zero second derivative of a variable.
Definition: Coupleable.h:1445

◆ genericZeroSecond() [3/3]

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

Definition at line 2395 of file Coupleable.C.

2396 {
2397  return _ad_second_zero;
2398 }
const MooseArray< ADRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:1446

◆ genericZeroValue() [1/3]

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

Returns zero value templated with automatic differentiation boolean.

Returns
Reference to a const GenericVariableValue

◆ genericZeroValue() [2/3]

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

Definition at line 2360 of file Coupleable.C.

2361 {
2362  return _zero;
2363 }
const VariableValue & _zero
Zero value of a variable.
Definition: Coupleable.h:1433

◆ genericZeroValue() [3/3]

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

Definition at line 2367 of file Coupleable.C.

2368 {
2369  return _ad_zero;
2370 }
const MooseArray< DualReal > & _ad_zero
Definition: Coupleable.h:1435

◆ getADDefaultGradient()

const ADVariableGradient & Coupleable::getADDefaultGradient ( ) const
inherited

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

Referenced by Coupleable::adCoupledGradient(), and Coupleable::adCoupledGradientDot().

2318 {
2320  return _ad_default_gradient;
2321 }
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729
MooseArray< ADRealVectorValue > _ad_default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1421

◆ getADDefaultSecond()

const ADVariableSecond & Coupleable::getADDefaultSecond ( ) const
inherited

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

Referenced by Coupleable::adCoupledSecond().

2332 {
2334  return _ad_default_second;
2335 }
MooseArray< ADRealTensorValue > _ad_default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1430
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ getADDefaultValue()

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

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

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

2287 {
2288  auto default_value_it = _ad_default_value.find(var_name);
2289  if (default_value_it == _ad_default_value.end())
2290  {
2291  auto value = std::make_unique<ADVariableValue>(_coupleable_max_qps,
2293  default_value_it = _ad_default_value.insert(std::make_pair(var_name, std::move(value))).first;
2294  }
2295 
2296  return default_value_it->second.get();
2297 }
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:1398
const InputParameters & _c_parameters
Definition: Coupleable.h:1344
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ getADDefaultVectorGradient()

const ADVectorVariableGradient & Coupleable::getADDefaultVectorGradient ( ) const
inherited

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

Referenced by Coupleable::adCoupledVectorGradient().

2325 {
2328 }
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:1424
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ getADDefaultVectorValue()

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

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

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

2301 {
2302  auto default_value_it = _ad_default_vector_value.find(var_name);
2303  if (default_value_it == _ad_default_vector_value.end())
2304  {
2305  RealVectorValue default_vec;
2306  for (unsigned int i = 0; i < _c_parameters.numberDefaultCoupledValues(var_name); ++i)
2307  default_vec(i) = _c_parameters.defaultCoupledValue(var_name, i);
2308  auto value = std::make_unique<ADVectorVariableValue>(_coupleable_max_qps, default_vec);
2309  default_value_it =
2310  _ad_default_vector_value.insert(std::make_pair(var_name, std::move(value))).first;
2311  }
2312 
2313  return default_value_it->second.get();
2314 }
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:1409
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:1344
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1729

◆ getArrayVar() [1/2]

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

◆ getArrayVar() [2/2]

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

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

329 {
330  return getVarHelper<ArrayMooseVariable>(var_name, comp);
331 }

◆ getCoupledArrayMooseVars()

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

Get the list of array coupled variables.

Returns
The list of array coupled variables

Definition at line 97 of file Coupleable.h.

98  {
100  }
std::vector< ArrayMooseVariable * > _coupled_array_moose_vars
Vector of array coupled variables.
Definition: Coupleable.h:1370

◆ getCoupledMooseScalarVars()

const std::vector<MooseVariableScalar *>& ScalarCoupleable::getCoupledMooseScalarVars ( )
inlineinherited

Get the list of coupled scalar variables.

Returns
The list of coupled variables

Definition at line 45 of file ScalarCoupleable.h.

Referenced by AuxScalarKernel::AuxScalarKernel(), MortarScalarBase::computeJacobian(), and ScalarInitialCondition::ScalarInitialCondition().

46  {
48  }
std::vector< MooseVariableScalar * > _coupled_moose_scalar_vars
Vector of coupled variables.

◆ getCoupledMooseVars()

const std::vector<MooseVariableFieldBase *>& Coupleable::getCoupledMooseVars ( ) const
inlineinherited

◆ getCoupledStandardMooseVars()

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

Get the list of standard coupled variables.

Returns
The list of standard coupled variables

Definition at line 79 of file Coupleable.h.

80  {
82  }
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Definition: Coupleable.h:1364

◆ getCoupledVars()

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

Get the list of coupled variables.

Returns
The list of coupled variables

Definition at line 61 of file Coupleable.h.

Referenced by InitialConditionBase::InitialConditionBase().

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

◆ getCoupledVectorMooseVars()

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

Get the list of vector coupled variables.

Returns
The list of vector coupled variables

Definition at line 88 of file Coupleable.h.

89  {
91  }
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
Definition: Coupleable.h:1367

◆ getFEVar()

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

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

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

◆ getFEVariableCoupleableMatrixTags() [1/2]

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

Definition at line 108 of file Coupleable.h.

108 { return _fe_coupleable_matrix_tags; }
std::set< TagID > _fe_coupleable_matrix_tags
Definition: Coupleable.h:1739

◆ getFEVariableCoupleableMatrixTags() [2/2]

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

Definition at line 115 of file Coupleable.h.

116  {
118  }
std::set< TagID > _fe_coupleable_matrix_tags
Definition: Coupleable.h:1739

◆ getFEVariableCoupleableVectorTags() [1/2]

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

◆ getFEVariableCoupleableVectorTags() [2/2]

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

Definition at line 110 of file Coupleable.h.

111  {
113  }
std::set< TagID > _fe_coupleable_vector_tags
Definition: Coupleable.h:1737

◆ getFieldVar() [1/2]

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

◆ getFieldVar() [2/2]

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

Definition at line 275 of file Coupleable.C.

276 {
277  return getVarHelper<MooseVariableFieldBase>(var_name, comp);
278 }

◆ getMooseVariableDependencies()

const std::set<MooseVariableFieldBase *>& MooseVariableDependencyInterface::getMooseVariableDependencies ( ) const
inlineinherited

Retrieve the set of MooseVariableFieldBase that this object depends on.

Returns
The MooseVariableFieldBase that MUST be reinited before evaluating this object

Definition at line 35 of file MooseVariableDependencyInterface.h.

Referenced by ComputeUserObjectsThread::subdomainChanged(), and MooseObjectWarehouseBase< Indicator >::updateVariableDependencyHelper().

36  {
38  }
std::set< MooseVariableFieldBase * > _moose_variable_dependencies

◆ getScalarVar()

const MooseVariableScalar * ScalarCoupleable::getScalarVar ( const std::string &  var_name,
unsigned int  comp 
) const
protectedinherited

Extract pointer to a scalar coupled variable.

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

Definition at line 321 of file ScalarCoupleable.C.

Referenced by ScalarCoupleable::adCoupledScalarDot(), ScalarCoupleable::adCoupledScalarValue(), ScalarCoupleable::coupledMatrixTagScalarValue(), ScalarCoupleable::coupledScalar(), ScalarCoupleable::coupledScalarDot(), ScalarCoupleable::coupledScalarDotDot(), ScalarCoupleable::coupledScalarDotDotDu(), ScalarCoupleable::coupledScalarDotDotOld(), ScalarCoupleable::coupledScalarDotDu(), ScalarCoupleable::coupledScalarDotOld(), ScalarCoupleable::coupledScalarOrder(), ScalarCoupleable::coupledScalarValue(), ScalarCoupleable::coupledScalarValueOld(), ScalarCoupleable::coupledScalarValueOlder(), ScalarCoupleable::coupledVectorTagScalarValue(), and ParsedODEKernel::ParsedODEKernel().

322 {
323  const auto var_name = _sc_parameters.checkForRename(var_name_in);
324 
325  const auto it = _coupled_scalar_vars.find(var_name);
326  if (it != _coupled_scalar_vars.end())
327  {
328  const auto & entry = it->second;
329  if (comp < entry.size())
330  return entry[comp];
331  else
332  mooseError(_sc_name, ": Trying to get a non-existent component of variable '", var_name, "'");
333  }
334  else
335  mooseError(_sc_name, ": Trying to get a non-existent variable '", var_name, "'");
336 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
const std::string & _sc_name
The name of the object this interface is part of.
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _coupled_scalar_vars
Coupled vars whose values we provide.
const InputParameters & _sc_parameters
std::string checkForRename(const std::string &name) const
Checks whether the provided name is a renamed parameter name.

◆ getScalarVariableCoupleableMatrixTags()

const std::set<TagID>& ScalarCoupleable::getScalarVariableCoupleableMatrixTags ( ) const
inlineinherited

Definition at line 55 of file ScalarCoupleable.h.

56  {
58  }
std::set< TagID > _sc_coupleable_matrix_tags
The scalar coupleable matrix tags.

◆ getScalarVariableCoupleableVectorTags()

const std::set<TagID>& ScalarCoupleable::getScalarVariableCoupleableVectorTags ( ) const
inlineinherited

Definition at line 50 of file ScalarCoupleable.h.

51  {
53  }
std::set< TagID > _sc_coupleable_vector_tags
The scalar coupleable vector tags.

◆ getVar() [1/2]

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

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

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

288 {
289  return const_cast<MooseVariable *>(getVarHelper<MooseVariable>(var_name, comp));
290 }
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
protectedinherited

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

312 {
313  return getVarHelper<MooseVariable>(var_name, comp);
314 }

◆ getVarHelper() [1/2]

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

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

Definition at line 1810 of file Coupleable.h.

1811 {
1812  return const_cast<Coupleable *>(this)->getVarHelper<T>(var_name, comp);
1813 }
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:45

◆ getVarHelper() [2/2]

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

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

Definition at line 1756 of file Coupleable.h.

1757 {
1758  const auto var_name = _c_parameters.checkForRename(var_name_in);
1759  auto name_to_use = var_name;
1760 
1761  // First check for supplied name
1762  if (!checkVar(var_name, comp, 0))
1763  {
1764  // See if there is an associated deprecated name that the user may have used instead
1765  auto it = _new_to_deprecated_coupled_vars.find(var_name);
1766  if (it == _new_to_deprecated_coupled_vars.end())
1767  return nullptr;
1768  else
1769  {
1770  auto deprecated_name = it->second;
1771  if (checkVar(deprecated_name, comp, 0))
1772  name_to_use = deprecated_name;
1773  else
1774  return nullptr;
1775  }
1776  }
1777 
1778  auto coupled_vars_it = _coupled_vars.find(name_to_use);
1779 
1780  mooseAssert(coupled_vars_it != _coupled_vars.end(),
1781  "Trying to get a coupled var " << name_to_use << " that doesn't exist");
1782 
1783  if (auto coupled_var = dynamic_cast<T *>(coupled_vars_it->second[comp]))
1784  return coupled_var;
1785  else
1786  {
1787  for (auto & var : _coupled_standard_moose_vars)
1788  if (var->name() == name_to_use)
1789  mooseError("The named variable is a standard variable, try a "
1790  "'coupled[Value/Gradient/Dot/etc]...' function instead");
1791  for (auto & var : _coupled_vector_moose_vars)
1792  if (var->name() == name_to_use)
1793  mooseError("The named variable is a vector variable, try a "
1794  "'coupledVector[Value/Gradient/Dot/etc]...' function instead");
1795  for (auto & var : _coupled_array_moose_vars)
1796  if (var->name() == name_to_use)
1797  mooseError("The named variable is an array variable, try a "
1798  "'coupledArray[Value/Gradient/Dot/etc]...' function instead");
1799  for (auto & var : _coupled_standard_fv_moose_vars)
1800  if (var->name() == name_to_use)
1801  mooseError("The named variable is a finite volume variable, which the coupled[...] routine "
1802  "used does not support. Try using the functor system routines instead.");
1803  mooseError(
1804  "Variable '", name_to_use, "' is of a different C++ type than you tried to fetch it as.");
1805  }
1806 }
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1358
std::vector< MooseVariableFV< Real > * > _coupled_standard_fv_moose_vars
Vector of standard finite volume coupled variables.
Definition: Coupleable.h:1373
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
std::vector< ArrayMooseVariable * > _coupled_array_moose_vars
Vector of array coupled variables.
Definition: Coupleable.h:1370
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Definition: Coupleable.h:1364
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
Definition: Coupleable.h:1367
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:208
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:1344
const std::unordered_map< std::string, std::string > & _new_to_deprecated_coupled_vars
map from new to deprecated variable names
Definition: Coupleable.h:1379

◆ getVectorVar() [1/2]

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

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

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

294 {
295  auto * const var =
296  const_cast<VectorMooseVariable *>(getVarHelper<VectorMooseVariable>(var_name, comp));
297 
298  if (_c_nodal && var && var->feType().family != LAGRANGE_VEC)
299  mooseError(_c_name, ": Only LAGRANGE_VEC vector variables are defined at nodes");
300 
301  return var;
302 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1382
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:299
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1347

◆ getVectorVar() [2/2]

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

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

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

◆ getWritableCoupledVariables()

auto& Coupleable::getWritableCoupledVariables ( ) const
inlineinherited

returns a reference to the set of writable coupled variables

Definition at line 123 of file Coupleable.h.

Referenced by Coupleable::hasWritableCoupledVariables().

THREAD_ID _c_tid
Thread ID of the thread using this object.
Definition: Coupleable.h:1391
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:1751

◆ hasWritableCoupledVariables()

bool Coupleable::hasWritableCoupledVariables ( ) const
inlineinherited

Checks whether the object has any writable coupled variables.

Definition at line 128 of file Coupleable.h.

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

◆ isCoupled()

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

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

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

129 {
130  const auto var_name = _c_parameters.checkForRename(var_name_in);
131 
132  auto it = _coupled_vars.find(var_name);
133  if (it != _coupled_vars.end())
134  return (i < it->second.size());
135  else
136  {
137  // Make sure the user originally requested this value in the InputParameter syntax
138  if (!_c_parameters.hasCoupledValue(var_name))
140  ": The coupled variable \"",
141  var_name,
142  "\" was never added to this object's "
143  "InputParameters, please double-check your "
144  "spelling");
145 
146  return false;
147  }
148 }
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:1358
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1347
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:1344

◆ isCoupledConstant()

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

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

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

152 {
153  return _c_parameters.hasDefaultCoupledValue(var_name);
154 }
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:1344

◆ isCoupledScalar()

bool ScalarCoupleable::isCoupledScalar ( const std::string &  var_name,
unsigned int  i = 0 
) const
protectedinherited

Returns true if a variables has been coupled_as name.

Parameters
var_nameThe of the coupled variable
iBy default 0, in general the index to test in a vector of MooseVariable pointers.

Definition at line 70 of file ScalarCoupleable.C.

Referenced by ScalarCoupleable::adCoupledScalarValue(), ScalarCoupleable::coupledMatrixTagScalarValue(), ScalarCoupleable::coupledScalarOrder(), ScalarCoupleable::coupledScalarValue(), ScalarCoupleable::coupledScalarValueOld(), ScalarCoupleable::coupledScalarValueOlder(), and ScalarCoupleable::coupledVectorTagScalarValue().

71 {
72  const auto var_name = _sc_parameters.checkForRename(var_name_in);
73 
74  auto it = _coupled_scalar_vars.find(var_name);
75  if (it != _coupled_scalar_vars.end())
76  return (i < it->second.size());
77  else
78  {
79  // Make sure the user originally requested this value in the InputParameter syntax
80  if (!_sc_parameters.hasCoupledValue(var_name))
82  ": The coupled scalar variable \"",
83  var_name,
84  "\" was never added to this object's "
85  "InputParameters, please double-check "
86  "your spelling");
87 
88  return false;
89  }
90 }
bool hasCoupledValue(const std::string &coupling_name) const
Return whether or not the coupled variable exists.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
const std::string & _sc_name
The name of the object this interface is part of.
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _coupled_scalar_vars
Coupled vars whose values we provide.
const InputParameters & _sc_parameters
std::string checkForRename(const std::string &name) const
Checks whether the provided name is a renamed parameter name.

◆ validateExecutionerType()

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

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

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

2070 {
2071  if (!_c_fe_problem.isTransient())
2073  ": Calling \"",
2074  fn_name,
2075  "\" on variable \"",
2076  name,
2077  "\" when using a \"Steady\" executioner is not allowed. This value is available "
2078  "only in transient simulations.");
2079 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1352
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1347
virtual bool isTransient() const override

◆ writableCoupledValue()

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

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

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

◆ writableVariable()

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

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

864 {
865  auto * var = getVarHelper<MooseWritableVariable>(var_name, comp);
866 
867  const auto * aux = dynamic_cast<const AuxKernel *>(this);
868  const auto * euo = dynamic_cast<const ElementUserObject *>(this);
869  const auto * nuo = dynamic_cast<const NodalUserObject *>(this);
870  const auto * nfc = dynamic_cast<const NodeFaceConstraint *>(this);
871 
872  if (!aux && !euo && !nuo && !nfc)
873  mooseError("writableVariable() can only be called from AuxKernels, ElementUserObjects, "
874  "NodalUserObjects, or NodeFaceConstraints. '",
875  _obj->name(),
876  "' is none of those.");
877 
878  if (aux && !aux->isNodal() && var->isNodal())
879  mooseError("The elemental AuxKernel '",
880  _obj->name(),
881  "' cannot obtain a writable reference to the nodal variable '",
882  var->name(),
883  "'.");
884  if (euo && var->isNodal())
885  mooseError("The ElementUserObject '",
886  _obj->name(),
887  "' cannot obtain a writable reference to the nodal variable '",
888  var->name(),
889  "'.");
890 
891  // make sure only one object can access a variable
892  checkWritableVar(var);
893 
894  return *var;
895 }
void checkWritableVar(MooseWritableVariable *var)
Checks that the passed in variable is only accessed writable by one object in a given subdomain...
Definition: Coupleable.C:936
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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:1744

Member Data Documentation

◆ _ad_default_gradient

MooseArray<ADRealVectorValue> Coupleable::_ad_default_gradient
mutableprotectedinherited

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

Definition at line 1421 of file Coupleable.h.

Referenced by Coupleable::getADDefaultGradient().

◆ _ad_default_second

MooseArray<ADRealTensorValue> Coupleable::_ad_default_second
mutableprotectedinherited

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

Definition at line 1430 of file Coupleable.h.

Referenced by Coupleable::getADDefaultSecond().

◆ _ad_default_value

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

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

Definition at line 1398 of file Coupleable.h.

Referenced by Coupleable::getADDefaultValue().

◆ _ad_default_vector_gradient

MooseArray<ADRealTensorValue> Coupleable::_ad_default_vector_gradient
mutableprotectedinherited

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

Definition at line 1424 of file Coupleable.h.

Referenced by Coupleable::getADDefaultVectorGradient().

◆ _ad_default_vector_value

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

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

Definition at line 1409 of file Coupleable.h.

Referenced by Coupleable::getADDefaultVectorValue().

◆ _ad_grad_zero

const MooseArray<ADRealVectorValue>& Coupleable::_ad_grad_zero
protectedinherited

Definition at line 1439 of file Coupleable.h.

Referenced by Coupleable::adZeroGradient().

◆ _ad_second_zero

const MooseArray<ADRealTensorValue>& Coupleable::_ad_second_zero
protectedinherited

Definition at line 1446 of file Coupleable.h.

Referenced by Coupleable::adZeroSecond().

◆ _ad_zero

const MooseArray<DualReal>& Coupleable::_ad_zero
protectedinherited

Definition at line 1435 of file Coupleable.h.

Referenced by Coupleable::adZeroValue().

◆ _c_allow_element_to_nodal_coupling

const bool Coupleable::_c_allow_element_to_nodal_coupling
protectedinherited

Definition at line 1388 of file Coupleable.h.

Referenced by Coupleable::checkVar().

◆ _c_fe_problem

FEProblemBase& Coupleable::_c_fe_problem
protectedinherited

◆ _c_is_implicit

bool Coupleable::_c_is_implicit
protectedinherited

True if implicit value is required.

Definition at line 1385 of file Coupleable.h.

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

◆ _c_name

const std::string& Coupleable::_c_name
protectedinherited

◆ _c_nodal

bool Coupleable::_c_nodal
protectedinherited

◆ _c_parameters

const InputParameters& Coupleable::_c_parameters
protectedinherited

◆ _c_sys

const SystemBase* const Coupleable::_c_sys
protectedinherited

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

Definition at line 1355 of file Coupleable.h.

Referenced by Coupleable::coupled().

◆ _c_tid

THREAD_ID Coupleable::_c_tid
protectedinherited

Thread ID of the thread using this object.

Definition at line 1391 of file Coupleable.h.

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

◆ _c_type

const std::string& Coupleable::_c_type
protectedinherited

The type of the object this interface is part of.

Definition at line 1349 of file Coupleable.h.

◆ _coupleable_neighbor

bool Coupleable::_coupleable_neighbor
protectedinherited

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

Definition at line 1651 of file Coupleable.h.

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

◆ _coupled_array_moose_vars

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

Vector of array coupled variables.

Definition at line 1370 of file Coupleable.h.

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

◆ _coupled_moose_vars

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

◆ _coupled_standard_fv_moose_vars

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

Vector of standard finite volume coupled variables.

Definition at line 1373 of file Coupleable.h.

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

◆ _coupled_standard_linear_fv_moose_vars

std::vector<MooseLinearVariableFV<Real> *> Coupleable::_coupled_standard_linear_fv_moose_vars
protectedinherited

Vector of standard linear finite volume coupled variables.

Definition at line 1376 of file Coupleable.h.

Referenced by Coupleable::Coupleable().

◆ _coupled_standard_moose_vars

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

◆ _coupled_vars

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

◆ _coupled_vector_moose_vars

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

Vector of vector coupled variables.

Definition at line 1367 of file Coupleable.h.

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

◆ _default_array_gradient

ArrayVariableGradient Coupleable::_default_array_gradient
protectedinherited

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

Definition at line 1476 of file Coupleable.h.

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

◆ _default_array_value

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

Will hold the default value for optional array coupled variables.

Definition at line 1405 of file Coupleable.h.

Referenced by Coupleable::getDefaultArrayValue().

◆ _default_array_value_zero

ArrayVariableValue Coupleable::_default_array_value_zero
protectedinherited

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

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

◆ _default_div

VectorVariableDivergence Coupleable::_default_div
mutableprotectedinherited

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

Definition at line 1467 of file Coupleable.h.

Referenced by Coupleable::coupledDiv(), Coupleable::coupledDivOld(), and Coupleable::coupledDivOlder().

◆ _default_gradient

VariableGradient Coupleable::_default_gradient
mutableprotectedinherited

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

Definition at line 1418 of file Coupleable.h.

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

◆ _default_second

VariableSecond Coupleable::_default_second
mutableprotectedinherited

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 Coupleable::coupledSecond(), Coupleable::coupledSecondOld(), Coupleable::coupledSecondOlder(), and Coupleable::coupledSecondPreviousNL().

◆ _default_value

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

Will hold the default value for optional coupled variables.

Definition at line 1395 of file Coupleable.h.

Referenced by Coupleable::getDefaultValue().

◆ _default_value_zero

VariableValue Coupleable::_default_value_zero
mutableprotectedinherited

◆ _default_vector_curl

VectorVariableCurl Coupleable::_default_vector_curl
mutableprotectedinherited

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

Definition at line 1464 of file Coupleable.h.

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

◆ _default_vector_gradient

VectorVariableGradient Coupleable::_default_vector_gradient
mutableprotectedinherited

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

Definition at line 1461 of file Coupleable.h.

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

◆ _default_vector_value

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

Will hold the default value for optional vector coupled variables.

Definition at line 1402 of file Coupleable.h.

Referenced by Coupleable::getDefaultVectorValue().

◆ _default_vector_value_zero

VectorVariableValue Coupleable::_default_vector_value_zero
mutableprotectedinherited

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

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

◆ _grad_phi_zero

const VariablePhiGradient& Coupleable::_grad_phi_zero
protectedinherited

Zero gradient of trial function.

Definition at line 1442 of file Coupleable.h.

◆ _grad_zero

const VariableGradient& Coupleable::_grad_zero
protectedinherited

Zero gradient of a variable.

Definition at line 1438 of file Coupleable.h.

◆ _new_to_deprecated_coupled_vars

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

map from new to deprecated variable names

Definition at line 1379 of file Coupleable.h.

Referenced by Coupleable::getVarHelper().

◆ _phi_zero

const VariablePhiValue& Coupleable::_phi_zero
protectedinherited

Definition at line 1434 of file Coupleable.h.

◆ _point_zero

const Point& ScalarCoupleable::_point_zero
protectedinherited

◆ _real_zero

const Real& ScalarCoupleable::_real_zero
protectedinherited

Scalar zero.

Definition at line 238 of file ScalarCoupleable.h.

◆ _sc_fe_problem

FEProblemBase& ScalarCoupleable::_sc_fe_problem
protectedinherited

◆ _sc_tid

const THREAD_ID ScalarCoupleable::_sc_tid
protectedinherited

Thread ID of the thread using this object.

Definition at line 235 of file ScalarCoupleable.h.

Referenced by ScalarCoupleable::ScalarCoupleable().

◆ _scalar_zero

const VariableValue& ScalarCoupleable::_scalar_zero
protectedinherited

Zero value of a scalar variable.

Definition at line 241 of file ScalarCoupleable.h.

◆ _second_phi_zero

const VariablePhiSecond& Coupleable::_second_phi_zero
protectedinherited

Zero second derivative of a test function.

Definition at line 1448 of file Coupleable.h.

◆ _second_zero

const VariableSecond& Coupleable::_second_zero
protectedinherited

Zero second derivative of a variable.

Definition at line 1445 of file Coupleable.h.

◆ _vector_curl_zero

const VectorVariableCurl& Coupleable::_vector_curl_zero
protectedinherited

Zero value of the curl of a vector variable.

Definition at line 1452 of file Coupleable.h.

◆ _vector_zero

const VectorVariableValue& Coupleable::_vector_zero
protectedinherited

Zero value of a vector variable.

Definition at line 1450 of file Coupleable.h.

◆ _zero

const VariableValue& Coupleable::_zero
protectedinherited

Zero value of a variable.

Definition at line 1433 of file Coupleable.h.


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