https://mooseframework.inl.gov
Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
Coupleable Class Reference

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

#include <Coupleable.h>

Inheritance diagram for Coupleable:
[legend]

Public Member Functions

 Coupleable (const MooseObject *moose_object, bool nodal, bool is_fv=false)
 Constructing the object. More...
 
 Coupleable (const Coupleable &object, const Moose::Kokkos::FunctorCopy &key)
 Special constructor used for Kokkos functor copy during parallel dispatch. More...
 
const std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > & getCoupledVars () const
 Get the list of coupled variables. More...
 
const std::vector< MooseVariableFieldBase * > & getCoupledMooseVars () const
 Get the list of all coupled variables. More...
 
const std::vector< MooseVariable * > & getCoupledStandardMooseVars () const
 Get the list of standard coupled variables. More...
 
const std::vector< VectorMooseVariable * > & getCoupledVectorMooseVars () const
 Get the list of vector coupled variables. More...
 
const std::vector< ArrayMooseVariable * > & getCoupledArrayMooseVars () const
 Get the list of array coupled variables. More...
 
void addFEVariableCoupleableVectorTag (TagID tag)
 
void addFEVariableCoupleableMatrixTag (TagID tag)
 
std::set< TagID > & getFEVariableCoupleableVectorTags ()
 
std::set< TagID > & getFEVariableCoupleableMatrixTags ()
 
const std::set< TagID > & getFEVariableCoupleableVectorTags () const
 
const std::set< TagID > & getFEVariableCoupleableMatrixTags () const
 
auto & getWritableCoupledVariables () const
 returns a reference to the set of writable coupled variables More...
 
bool hasWritableCoupledVariables () const
 Checks whether the object has any writable coupled variables. More...
 
const ADVariableValuegetADDefaultValue (const std::string &var_name) const
 Helper method to return (and insert if necessary) the default value for Automatic Differentiation for an uncoupled variable. More...
 
const ADVectorVariableValuegetADDefaultVectorValue (const std::string &var_name) const
 Helper method to return (and insert if necessary) the default vector value for Automatic Differentiation for an uncoupled variable. More...
 
const ADVariableGradientgetADDefaultGradient () const
 Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation for an uncoupled variable. More...
 
const ADVectorVariableGradientgetADDefaultVectorGradient () const
 Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation for an uncoupled vector variable. More...
 
const ADVariableSecondgetADDefaultSecond () const
 Helper method to return (and insert if necessary) the default second derivatives for Automatic Differentiation for an uncoupled variable. More...
 
const ADVectorVariableCurlgetADDefaultCurl () const
 Helper method to return (and insert if necessary) the default curl value for Automatic Differentiation for an uncoupled variable. More...
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0)
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValuesByName (const std::string &var_name, const std::string &tag_name)
 
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradientByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0)
 
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradientsByName (const std::string &var_name, const std::string &tag_name)
 
Moose::Kokkos::VariableNodalValue kokkosCoupledVectorTagNodalValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0)
 
Moose::Kokkos::VariableNodalValue kokkosCoupledVectorTagNodalValuesByName (const std::string &var_name, const std::string &tag_name)
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0)
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValues (const std::string &var_name, const std::string &tag_param_name)
 
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradient (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0)
 
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradients (const std::string &var_name, const std::string &tag_param_name)
 
Moose::Kokkos::VariableNodalValue kokkosCoupledVectorTagNodalValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0)
 
Moose::Kokkos::VariableNodalValue kokkosCoupledVectorTagNodalValues (const std::string &var_name, const std::string &tag_param_name)
 
Moose::Kokkos::VariableValue kokkosCoupledValue (const std::string &var_name, unsigned int comp=0)
 
Moose::Kokkos::VariableValue kokkosCoupledValues (const std::string &var_name)
 
Moose::Kokkos::VariableGradient kokkosCoupledGradient (const std::string &var_name, unsigned int comp=0)
 
Moose::Kokkos::VariableGradient kokkosCoupledGradients (const std::string &var_name)
 
Moose::Kokkos::VariableNodalValue kokkosCoupledNodalValue (const std::string &var_name, unsigned int comp=0)
 
Moose::Kokkos::VariableNodalValue kokkosCoupledNodalValues (const std::string &var_name)
 
Moose::Kokkos::VariableValue kokkosCoupledValueOld (const std::string &var_name, unsigned int comp=0)
 
Moose::Kokkos::VariableValue kokkosCoupledValuesOld (const std::string &var_name)
 
Moose::Kokkos::VariableGradient kokkosCoupledGradientOld (const std::string &var_name, unsigned int comp=0)
 
Moose::Kokkos::VariableGradient kokkosCoupledGradientsOld (const std::string &var_name)
 
Moose::Kokkos::VariableNodalValue kokkosCoupledNodalValueOld (const std::string &var_name, unsigned int comp=0)
 
Moose::Kokkos::VariableNodalValue kokkosCoupledNodalValuesOld (const std::string &var_name)
 
Moose::Kokkos::VariableValue kokkosCoupledValueOlder (const std::string &var_name, unsigned int comp=0)
 
Moose::Kokkos::VariableValue kokkosCoupledValuesOlder (const std::string &var_name)
 
Moose::Kokkos::VariableGradient kokkosCoupledGradientOlder (const std::string &var_name, unsigned int comp=0)
 
Moose::Kokkos::VariableGradient kokkosCoupledGradientsOlder (const std::string &var_name)
 
Moose::Kokkos::VariableNodalValue kokkosCoupledNodalValueOlder (const std::string &var_name, unsigned int comp=0)
 
Moose::Kokkos::VariableNodalValue kokkosCoupledNodalValuesOlder (const std::string &var_name)
 
Moose::Kokkos::VariableValue kokkosCoupledDot (const std::string &var_name, unsigned int comp=0)
 
Moose::Kokkos::VariableValue kokkosCoupledDots (const std::string &var_name)
 
Moose::Kokkos::VariableNodalValue kokkosCoupledNodalDot (const std::string &var_name, unsigned int comp=0)
 
Moose::Kokkos::VariableNodalValue kokkosCoupledNodalDots (const std::string &var_name)
 
Moose::Kokkos::Scalar< const RealkokkosCoupledDotDu (const std::string &var_name, unsigned int comp=0)
 
Moose::Kokkos::VariableValue kokkosZeroValue ()
 
Moose::Kokkos::VariableGradient kokkosZeroGradient ()
 
Moose::Kokkos::VariableNodalValue kokkosZeroNodalValue ()
 

Protected Member Functions

virtual void coupledCallback (const std::string &, bool) const
 A call-back function provided by the derived object for actions before coupling a variable with functions such as coupledValue. More...
 
virtual bool isCoupled (const std::string &var_name, unsigned int i=0) const
 Returns true if a variables has been coupled as name. More...
 
virtual bool isCoupledConstant (const std::string &var_name) const
 Returns true if a variable passed as a coupled value is really a constant. More...
 
unsigned int coupledComponents (const std::string &var_name) const
 Number of coupled components. More...
 
VariableName coupledName (const std::string &var_name, unsigned int comp=0) const
 Names of the variable in the Coupleable interface. More...
 
std::vector< VariableName > coupledNames (const std::string &var_name) const
 Names of the variables in the Coupleable interface. More...
 
virtual unsigned int coupled (const std::string &var_name, unsigned int comp=0) const
 Returns the index for a coupled variable by name. More...
 
std::vector< unsigned intcoupledIndices (const std::string &var_name) const
 Returns the indices for a coupled variable's components. More...
 
virtual const VariableValuecoupledValue (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled variable. More...
 
std::vector< const VariableValue * > coupledValues (const std::string &var_name) const
 Returns the values for all of a coupled variable components. More...
 
std::vector< const VectorVariableValue * > coupledVectorValues (const std::string &var_name) const
 Returns the values for all of a coupled vector variable's components. More...
 
template<bool is_ad>
const GenericVariableValue< is_ad > & coupledGenericValue (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled variable for use in templated automatic differentiation classes. More...
 
template<bool is_ad>
const GenericVectorVariableValue< is_ad > & coupledGenericVectorValue (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled vector variable for use in templated automatic differentiation classes. More...
 
template<bool is_ad>
std::vector< const GenericVariableValue< is_ad > * > coupledGenericValues (const std::string &var_name) const
 Returns the values for all of a coupled variable's components for use in templated automatic differentiation classes. More...
 
template<bool is_ad>
const GenericVariableValue< is_ad > & coupledGenericDofValue (const std::string &var_name, unsigned int comp=0) const
 Returns DOF value of a coupled variable for use in templated automatic differentiation classes. More...
 
template<bool is_ad>
const GenericVariableValue< is_ad > & coupledGenericDot (const std::string &var_name, unsigned int comp=0) const
 Returns time derivative of a coupled variable for use in templated automatic differentiation classes. More...
 
template<bool is_ad>
const GenericVariableValue< is_ad > & coupledGenericDotDot (const std::string &var_name, unsigned int comp=0) const
 Returns the second time derivative of a coupled variable for use in templated automatic differentiation classes. More...
 
virtual const VariableValuecoupledValueLower (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled lower-dimensional variable. More...
 
const ADVariableValueadCoupledValue (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled variable for use in Automatic Differentiation. More...
 
std::vector< const ADVariableValue * > adCoupledValues (const std::string &var_name) const
 Returns the values for all of a coupled variable's components for use in Automatic Differentiation. More...
 
const ADVariableValueadCoupledLowerValue (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled lower-dimensional variable for use in Automatic Differentiation. More...
 
const ADVectorVariableValueadCoupledVectorValue (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled vector variable for use in Automatic Differentiation. More...
 
std::vector< const ADVectorVariableValue * > adCoupledVectorValues (const std::string &var_name) const
 Returns the values for all of a coupled vector variable's components for use in Automatic Differentiation. More...
 
virtual const VariableValuecoupledVectorTagValue (const std::string &var_names, TagID tag, unsigned int index=0) const
 Returns value of a coupled variable for a given tag. More...
 
virtual const VariableValuecoupledVectorTagValue (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
std::vector< const VariableValue * > coupledVectorTagValues (const std::string &var_names, TagID tag) const
 Returns the values for all the coupled variables desired for a given tag. More...
 
std::vector< const VariableValue * > coupledVectorTagValues (const std::string &var_names, const std::string &tag_name) const
 
virtual const ArrayVariableValuecoupledVectorTagArrayValue (const std::string &var_names, TagID tag, unsigned int index=0) const
 Returns value of a coupled array variable for a given tag. More...
 
virtual const ArrayVariableValuecoupledVectorTagArrayValue (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
std::vector< const ArrayVariableValue * > coupledVectorTagArrayValues (const std::string &var_names, TagID tag) const
 Returns the values for all the coupled variables desired for a given tag. More...
 
std::vector< const ArrayVariableValue * > coupledVectorTagArrayValues (const std::string &var_names, const std::string &tag_name) const
 
virtual const VariableGradientcoupledVectorTagGradient (const std::string &var_names, TagID tag, unsigned int index=0) const
 Returns gradient of a coupled variable for a given tag. More...
 
virtual const VariableGradientcoupledVectorTagGradient (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
std::vector< const VariableGradient * > coupledVectorTagGradients (const std::string &var_names, TagID tag) const
 Returns gradients for all the coupled variables desired for a given tag. More...
 
std::vector< const VariableGradient * > coupledVectorTagGradients (const std::string &var_names, const std::string &tag_name) const
 
virtual const ArrayVariableGradientcoupledVectorTagArrayGradient (const std::string &var_names, TagID tag, unsigned int index=0) const
 Returns gradient of a coupled array variable for a given tag. More...
 
virtual const ArrayVariableGradientcoupledVectorTagArrayGradient (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
std::vector< const ArrayVariableGradient * > coupledVectorTagArrayGradients (const std::string &var_names, TagID tag) const
 Returns gradients for all the coupled variables desired for a given tag. More...
 
std::vector< const ArrayVariableGradient * > coupledVectorTagArrayGradients (const std::string &var_names, const std::string &tag_name) const
 
virtual const VariableValuecoupledVectorTagDofValue (const std::string &var_name, TagID tag, unsigned int index=0) const
 Returns dof value of a coupled variable for a given tag. More...
 
virtual const VariableValuecoupledVectorTagDofValue (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
const ArrayVariableValuecoupledVectorTagArrayDofValue (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 Returns evaluations of a tagged vector at the requested variable's degree of freedom indices. More...
 
std::vector< const VariableValue * > coupledVectorTagDofValues (const std::string &var_names, TagID tag) const
 Returns the dof values for all the coupled variables desired for a given tag. More...
 
std::vector< const VariableValue * > coupledVectorTagDofValues (const std::string &var_names, const std::string &tag_name) const
 
virtual const VariableValuecoupledMatrixTagValue (const std::string &var_names, TagID tag, unsigned int index=0) const
 Returns value of a coupled variable for a given tag. More...
 
virtual const VariableValuecoupledMatrixTagValue (const std::string &var_names, const std::string &tag_name, unsigned int index=0) const
 
std::vector< const VariableValue * > coupledMatrixTagValues (const std::string &var_names, TagID tag) const
 Returns the diagonal matrix values for all the coupled variables desired for a given tag. More...
 
std::vector< const VariableValue * > coupledMatrixTagValues (const std::string &var_names, const std::string &tag_name) const
 
virtual const VectorVariableValuecoupledVectorValue (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled vector variable. More...
 
virtual const ArrayVariableValuecoupledArrayValue (const std::string &var_name, unsigned int comp=0) const
 Returns value of a coupled array variable. More...
 
std::vector< const ArrayVariableValue * > coupledArrayValues (const std::string &var_name) const
 Returns the values for all of a coupled array variable's components. More...
 
MooseWritableVariablewritableVariable (const std::string &var_name, unsigned int comp=0)
 Returns a writable MooseVariable object for a nodal or elemental variable. More...
 
virtual VariableValuewritableCoupledValue (const std::string &var_name, unsigned int comp=0)
 Returns a writable reference to a coupled variable for writing to multiple AuxVariables from a single AuxKernel or a UserObject. More...
 
void checkWritableVar (MooseWritableVariable *var)
 Checks that the passed in variable is only accessed writable by one object in a given subdomain. More...
 
virtual const VariableValuecoupledValueOld (const std::string &var_name, unsigned int comp=0) const
 Returns an old value from previous time step of a coupled variable. More...
 
std::vector< const VariableValue * > coupledValuesOld (const std::string &var_name) const
 Returns the old values for all of a coupled variable's components. More...
 
std::vector< const VectorVariableValue * > coupledVectorValuesOld (const std::string &var_name) const
 Returns the old values for all of a coupled vector variable's components. More...
 
virtual const VariableValuecoupledValueOlder (const std::string &var_name, unsigned int comp=0) const
 Returns an old value from two time steps previous of a coupled variable. More...
 
std::vector< const VariableValue * > coupledValuesOlder (const std::string &var_name) const
 Returns the older values for all of a coupled variable's components. More...
 
virtual const VariableValuecoupledValuePreviousNL (const std::string &var_name, unsigned int comp=0) const
 Returns value of previous Newton iterate of a coupled variable. More...
 
virtual const VectorVariableValuecoupledVectorValueOld (const std::string &var_name, unsigned int comp=0) const
 Returns an old value from previous time step of a coupled vector variable. More...
 
virtual const VectorVariableValuecoupledVectorValueOlder (const std::string &var_name, unsigned int comp=0) const
 Returns an old value from two time steps previous of a coupled vector variable. More...
 
virtual const ArrayVariableValuecoupledArrayValueOld (const std::string &var_name, unsigned int comp=0) const
 Returns an old value from previous time step of a coupled array variable. More...
 
virtual const ArrayVariableValuecoupledArrayValueOlder (const std::string &var_name, unsigned int comp=0) const
 Returns an old value from two time steps previous of a coupled array variable. More...
 
virtual const VariableGradientcoupledGradient (const std::string &var_name, unsigned int comp=0) const
 Returns gradient of a coupled variable. More...
 
std::vector< const VariableGradient * > coupledGradients (const std::string &var_name) const
 Returns the gradients for all of a coupled variable's components. More...
 
const ADVariableGradientadCoupledGradient (const std::string &var_name, unsigned int comp=0) const
 Returns gradient of a coupled variable for use in Automatic Differentiation. More...
 
const ADVariableGradientadCoupledGradientDot (const std::string &var_name, unsigned int comp=0) const
 Returns gradient of a coupled variable's time derivative for use in Automatic Differentiation. More...
 
std::vector< const ADVariableGradient * > adCoupledGradients (const std::string &var_name) const
 Returns the gradients for all of a coupled variable's components for use in Automatic Differentiation. More...
 
template<bool is_ad>
const GenericVariableGradient< is_ad > & coupledGenericGradient (const std::string &var_name, unsigned int comp=0) const
 Returns gradient of a coupled variable for use in templated automatic differentiation. More...
 
template<bool is_ad>
std::vector< const GenericVariableGradient< is_ad > * > coupledGenericGradients (const std::string &var_name) const
 Returns the gradients for all of a coupled variable's components for use in templated automatic differentiation. More...
 
const ADVectorVariableGradientadCoupledVectorGradient (const std::string &var_name, unsigned int comp=0) const
 Returns gradient of a coupled vector variable for use in Automatic Differentiation. More...
 
const ADVariableSecondadCoupledSecond (const std::string &var_name, unsigned int comp=0) const
 Returns second derivatives of a coupled variable for use in Automatic Differentiation. More...
 
const ADVectorVariableSecondadCoupledVectorSecond (const std::string &var_name, unsigned int comp=0) const
 Returns second derivatives of a coupled vector variable for use in Automatic Differentiation. More...
 
virtual const VariableGradientcoupledGradientOld (const std::string &var_name, unsigned int comp=0) const
 Returns an old gradient from previous time step of a coupled variable. More...
 
std::vector< const VariableGradient * > coupledGradientsOld (const std::string &var_name) const
 Returns the old gradients for all of a coupled variable's components. More...
 
virtual const VariableGradientcoupledGradientOlder (const std::string &var_name, unsigned int comp=0) const
 Returns an old gradient from two time steps previous of a coupled variable. More...
 
virtual const VariableGradientcoupledGradientPreviousNL (const std::string &var_name, unsigned int comp=0) const
 Returns gradient of a coupled variable for previous Newton iterate. More...
 
virtual const VariableGradientcoupledGradientDot (const std::string &var_name, unsigned int comp=0) const
 Time derivative of the gradient of a coupled variable. More...
 
virtual const VariableGradientcoupledGradientDotDot (const std::string &var_name, unsigned int comp=0) const
 Second time derivative of the gradient of a coupled variable. More...
 
virtual const VectorVariableGradientcoupledVectorGradient (const std::string &var_name, unsigned int comp=0) const
 Returns gradient of a coupled vector variable. More...
 
virtual const VectorVariableGradientcoupledVectorGradientOld (const std::string &var_name, unsigned int comp=0) const
 Returns an old gradient from previous time step of a coupled vector variable. More...
 
virtual const VectorVariableGradientcoupledVectorGradientOlder (const std::string &var_name, unsigned int comp=0) const
 Returns an old gradient from two time steps previous of a coupled vector variable. More...
 
virtual const ArrayVariableGradientcoupledArrayGradient (const std::string &var_name, unsigned int comp=0) const
 Returns gradient of a coupled array variable. More...
 
virtual const ArrayVariableGradientcoupledArrayGradientOld (const std::string &var_name, unsigned int comp=0) const
 Returns an old gradient from previous time step of a coupled array variable. More...
 
virtual const ArrayVariableGradientcoupledArrayGradientOlder (const std::string &var_name, unsigned int comp=0) const
 Returns an old gradient from two time steps previous of a coupled array variable. More...
 
virtual const ArrayVariableGradientcoupledArrayGradientDot (const std::string &var_name, unsigned int comp=0) const
 Retun a gradient of a coupled array variable's time derivative. More...
 
virtual const VectorVariableCurlcoupledCurl (const std::string &var_name, unsigned int comp=0) const
 Returns curl of a coupled variable. More...
 
virtual const VectorVariableCurlcoupledCurlOld (const std::string &var_name, unsigned int comp=0) const
 Returns an old curl from previous time step of a coupled variable. More...
 
virtual const VectorVariableCurlcoupledCurlOlder (const std::string &var_name, unsigned int comp=0) const
 Returns an old curl from two time steps previous of a coupled variable. More...
 
const ADVectorVariableCurladCoupledCurl (const std::string &var_name, unsigned int comp=0) const
 Returns curl of a coupled variable for use in objects utilizing Automatic Differentiation. 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<bool is_ad>
const GenericVariableGradient< is_ad > & genericZeroGradient ()
 Returns zero gradient templated with automatic differentiation boolean. More...
 
template<bool is_ad>
const GenericVariableSecond< is_ad > & genericZeroSecond ()
 Returns zero second derivative templated with automatic differentiation boolean. More...
 
bool checkVar (const std::string &var_name, unsigned int comp=0, unsigned int comp_bound=0) const
 Check that the right kind of variable is being coupled in. More...
 
const MooseVariableFieldBasegetFEVar (const std::string &var_name, unsigned int comp) const
 Deprecated method. More...
 
const MooseVariableFieldBasegetFieldVar (const std::string &var_name, unsigned int comp) const
 
MooseVariableFieldBasegetFieldVar (const std::string &var_name, unsigned int comp)
 
template<typename T >
const T * getVarHelper (const std::string &var_name, unsigned int comp) const
 Helper that that be used to retrieve a variable of arbitrary type T. More...
 
template<typename T >
T * getVarHelper (const std::string &var_name, unsigned int comp)
 Helper that can be used to retrieve a variable of arbitrary type T. More...
 
MooseVariablegetVar (const std::string &var_name, unsigned int comp)
 Extract pointer to a coupled variable. More...
 
VectorMooseVariablegetVectorVar (const std::string &var_name, unsigned int comp)
 Extract pointer to a coupled vector variable. More...
 
ArrayMooseVariablegetArrayVar (const std::string &var_name, unsigned int comp)
 Extract pointer to a coupled array variable. More...
 
const MooseVariablegetVar (const std::string &var_name, unsigned int comp) const
 Extract pointer to a coupled variable. More...
 
const VectorMooseVariablegetVectorVar (const std::string &var_name, unsigned int comp) const
 Extract pointer to a coupled vector variable. More...
 
const ArrayMooseVariablegetArrayVar (const std::string &var_name, unsigned int comp) const
 Extract pointer to a coupled array variable. More...
 
void validateExecutionerType (const std::string &name, const std::string &fn_name) const
 Checks to make sure that the current Executioner has set "_is_transient" when old/older values are coupled in. More...
 
template<typename T , typename Func >
std::vector< T > coupledVectorHelper (const std::string &var_name, const Func &func) const
 
template<>
const GenericVariableValue< false > & coupledGenericValue (const std::string &var_name, unsigned int comp) const
 
template<>
const GenericVariableValue< true > & coupledGenericValue (const std::string &var_name, unsigned int comp) const
 
template<>
const GenericVectorVariableValue< false > & coupledGenericVectorValue (const std::string &var_name, unsigned int comp) const
 
template<>
const GenericVectorVariableValue< true > & coupledGenericVectorValue (const std::string &var_name, unsigned int comp) const
 
template<>
const GenericVariableValue< false > & coupledGenericDofValue (const std::string &var_name, unsigned int comp) const
 
template<>
const GenericVariableValue< true > & coupledGenericDofValue (const std::string &var_name, unsigned int comp) const
 
template<>
const GenericVariableValue< false > & coupledGenericDotDot (const std::string &var_name, unsigned int comp) const
 
template<>
const GenericVariableValue< true > & coupledGenericDotDot (const std::string &var_name, unsigned int comp) const
 
template<>
const GenericVariableValue< false > & genericZeroValue ()
 
template<>
const GenericVariableValue< true > & genericZeroValue ()
 
template<>
const GenericVariableGradient< false > & genericZeroGradient ()
 
template<>
const GenericVariableGradient< true > & genericZeroGradient ()
 
template<>
const GenericVariableSecond< false > & genericZeroSecond ()
 
template<>
const GenericVariableSecond< true > & genericZeroSecond ()
 
template<>
const GenericVariableGradient< false > & coupledGenericGradient (const std::string &var_name, unsigned int comp) const
 
template<>
const GenericVariableGradient< true > & coupledGenericGradient (const std::string &var_name, unsigned int comp) const
 
template<>
std::vector< const GenericVariableValue< false > * > coupledGenericValues (const std::string &var_name) const
 
template<>
std::vector< const GenericVariableValue< true > * > coupledGenericValues (const std::string &var_name) const
 
template<>
std::vector< const GenericVariableGradient< false > * > coupledGenericGradients (const std::string &var_name) const
 
template<>
std::vector< const GenericVariableGradient< true > * > coupledGenericGradients (const std::string &var_name) const
 
template<>
const GenericVariableValue< false > & coupledGenericDot (const std::string &var_name, unsigned int comp) const
 
template<>
const GenericVariableValue< true > & coupledGenericDot (const std::string &var_name, unsigned int comp) const
 

Protected Attributes

const InputParameters_c_parameters
 
const std::string & _c_name
 The name of the object this interface is part of. More...
 
const std::string & _c_type
 The type of the object this interface is part of. More...
 
FEProblemBase_c_fe_problem
 
const SystemBase *const _c_sys
 Pointer to the system object if the moose object this is an interface for has one. More...
 
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
 Coupled vars whose values we provide. More...
 
std::vector< MooseVariableFieldBase * > _coupled_moose_vars
 Vector of all coupled variables. More...
 
std::vector< MooseVariable * > _coupled_standard_moose_vars
 Vector of standard coupled variables. More...
 
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
 Vector of vector coupled variables. More...
 
std::vector< ArrayMooseVariable * > _coupled_array_moose_vars
 Vector of array coupled variables. More...
 
std::vector< MooseVariableField< Real > * > _coupled_fv_moose_vars
 Vector of all 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< ADReal > > > _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...
 
MooseArray< ADRealVectorValue_ad_default_curl
 This will always be zero because the default values for optionally coupled vector variables is always constant. More...
 
const VariableValue_zero
 Zero value of a variable. More...
 
const VariablePhiValue_phi_zero
 
const MooseArray< ADReal > & _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...
 

Private Types

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

Private Member Functions

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

Private Attributes

unsigned int _coupleable_max_qps
 Maximum qps for any element in this system. More...
 
std::unordered_map< std::string, std::vector< unsigned int > > _optional_var_index
 Unique indices for optionally coupled vars that weren't provided. More...
 
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _c_coupled_scalar_vars
 Scalar variables coupled into this object (for error checking) More...
 
std::set< TagID_fe_coupleable_vector_tags
 
std::set< TagID_fe_coupleable_matrix_tags
 
const bool _is_fv
 Whether the MooseObject is a finite volume object. More...
 
const MooseObject *const _obj
 
const std::set< std::string > _older_state_tags
 vector tag names for which we need to request older solution states from the system More...
 
std::vector< std::set< MooseWritableVariable * > > _writable_coupled_variables
 keep a set of allocated writable variable references to make sure only one object can obtain them per thread More...
 
const Real _kokkos_default_value_zero = 0
 kokkos-related variables and methods More...
 

Detailed Description

Interface for objects that needs coupling capabilities.

Definition at line 49 of file Coupleable.h.

Member Enumeration Documentation

◆ FuncAge

enum Coupleable::FuncAge
strongprivate
Enumerator
Curr 
Old 
Older 

Definition at line 1587 of file Coupleable.h.

1588  {
1589  Curr,
1590  Old,
1591  Older,
1592  };

◆ VarType

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

Definition at line 1594 of file Coupleable.h.

1595  {
1596  Ignore,
1597  Gradient,
1598  Second,
1599  GradientDot,
1600  Dot,
1601  };

Constructor & Destructor Documentation

◆ Coupleable() [1/2]

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

Constructing the object.

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

Definition at line 27 of file Coupleable.C.

28  : _c_parameters(moose_object->parameters()),
29  _c_name(moose_object->name()),
30  _c_type(moose_object->type()),
32  _c_sys(_c_parameters.isParamValid("_sys") ? _c_parameters.get<SystemBase *>("_sys") : nullptr),
34  _c_nodal(nodal),
36  ? _c_parameters.get<bool>("implicit")
37  : true),
39  _c_parameters.have_parameter<bool>("_allow_nodal_to_elemental_coupling")
40  ? _c_parameters.get<bool>("_allow_nodal_to_elemental_coupling")
41  : false),
55  ? _c_parameters.get<bool>("_neighbor")
56  : false),
58  _is_fv(is_fv),
59  _obj(moose_object),
61 {
62  SubProblem & problem = *_c_parameters.getCheckedPointerParam<SubProblem *>("_subproblem");
64 
65  unsigned int optional_var_index_counter = 0;
66 
67  // Coupling
68  for (auto iter = _c_parameters.coupledVarsBegin(); iter != _c_parameters.coupledVarsEnd(); ++iter)
69  {
70  std::string name = *iter;
71 
72  std::vector<std::string> vars = _c_parameters.getVecMooseType(name);
73  if (vars.size() > 0)
74  {
75  for (const auto & coupled_var_name : vars)
76  {
77  if (problem.hasVariable(coupled_var_name))
78  {
79  MooseVariableFieldBase * moose_var =
80  &problem.getVariable(_c_tid,
81  coupled_var_name,
84  _coupled_vars[name].push_back(moose_var);
85  _coupled_moose_vars.push_back(moose_var);
86  if (auto * tmp_var = dynamic_cast<MooseVariable *>(moose_var))
87  _coupled_standard_moose_vars.push_back(tmp_var);
88  else if (auto * tmp_var = dynamic_cast<VectorMooseVariable *>(moose_var))
89  _coupled_vector_moose_vars.push_back(tmp_var);
90  else if (auto * tmp_var = dynamic_cast<ArrayMooseVariable *>(moose_var))
91  _coupled_array_moose_vars.push_back(tmp_var);
92  else if (auto * tmp_var = dynamic_cast<MooseVariableFV<Real> *>(moose_var))
93  {
94  // We are using a finite volume variable through add*CoupledVar as opposed to getFunctor
95  // so we can be reasonably confident that the variable values will be obtained using
96  // traditional pre-evaluation and quadrature point indexing
97  tmp_var->requireQpComputations();
98  _coupled_fv_moose_vars.push_back(tmp_var);
99  }
100  else if (auto * tmp_var = dynamic_cast<MooseLinearVariableFV<Real> *>(moose_var))
101  _coupled_fv_moose_vars.push_back(tmp_var);
102  else
103  _obj->paramError(name, "provided c++ type for variable parameter is not supported");
104  }
105  else if (problem.hasScalarVariable(coupled_var_name))
106  {
107  MooseVariableScalar * moose_scalar_var =
108  &problem.getScalarVariable(_c_tid, coupled_var_name);
109  _c_coupled_scalar_vars[name].push_back(moose_scalar_var);
110  }
111  else
112  _obj->paramError(name, "coupled variable '", coupled_var_name, "' was not found");
113  }
114  }
115  else // This means it was optional coupling. Let's assign a unique id to this variable
116  {
118  for (unsigned int j = 0; j < _optional_var_index[name].size(); ++j)
119  _optional_var_index[name][j] =
120  std::numeric_limits<unsigned int>::max() - optional_var_index_counter;
121  ++optional_var_index_counter;
122  }
123  }
124 }
std::string name(const ElemQuality q)
virtual MooseVariableScalar & getScalarVariable(const THREAD_ID tid, const std::string &var_name)=0
Returns the scalar variable reference from whichever system contains it.
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
std::vector< MooseArray< ADRealTensorValue > > _ad_second_zero
const VariableValue & _zero
Zero value of a variable.
Definition: Coupleable.h:1495
const VariablePhiGradient & _grad_phi_zero
Zero gradient of trial function.
Definition: Coupleable.h:1504
const VariablePhiSecond & _second_phi_zero
Zero second derivative of a test function.
Definition: Coupleable.h:1510
unsigned int n_threads()
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 ...
Definition: MooseBase.h:439
const VectorVariableValue & _vector_zero
Zero value of a vector variable.
Definition: Coupleable.h:1512
const VariableGradient & _grad_zero
Zero gradient of a variable.
Definition: Coupleable.h:1500
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1420
const MooseArray< ADRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:1501
const bool _is_fv
Whether the MooseObject is a finite volume object.
Definition: Coupleable.h:1812
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
std::vector< MooseArray< ADRealVectorValue > > _ad_grad_zero
std::vector< ArrayMooseVariable * > _coupled_array_moose_vars
Vector of array coupled variables.
Definition: Coupleable.h:1432
const VariableSecond & _second_zero
Zero second derivative of a variable.
Definition: Coupleable.h:1507
constexpr std::size_t constMaxQpsPerElem
This is used for places where we initialize some qp-sized data structures that would end up being siz...
Definition: MooseTypes.h:230
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
char ** vars
const bool _c_allow_element_to_nodal_coupling
Definition: Coupleable.h:1447
T getCheckedPointerParam(const std::string &name, const std::string &error_string="") const
Verifies that the requested parameter exists and is not NULL and returns it to the caller...
THREAD_ID _c_tid
Thread ID of the thread using this object.
Definition: Coupleable.h:1450
std::set< std::string >::const_iterator coupledVarsBegin() const
Methods returning iterators to the coupled variables names stored in this InputParameters object...
std::vector< std::set< MooseWritableVariable * > > _writable_coupled_variables
keep a set of allocated writable variable references to make sure only one object can obtain them per...
Definition: Coupleable.h:1821
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _c_coupled_scalar_vars
Scalar variables coupled into this object (for error checking)
Definition: Coupleable.h:1805
std::vector< VariableSecond > _second_zero
std::vector< MooseArray< ADReal > > _ad_zero
std::vector< VectorVariableCurl > _vector_curl_zero
This class provides an interface for common operations on field variables of both FE and FV types wit...
const std::unordered_map< std::string, std::string > & getNewToDeprecatedVarMap() const
Return the new to deprecated variable name map.
Base class for a system (of equations)
Definition: SystemBase.h:84
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Definition: MooseBase.h:87
auto max(const L &left, const R &right)
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Definition: Coupleable.h:1426
unsigned int numberDefaultCoupledValues(const std::string &coupling_name) const
Get the number of defaulted coupled value entries.
const SystemBase *const _c_sys
Pointer to the system object if the moose object this is an interface for has one.
Definition: Coupleable.h:1417
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1414
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
std::vector< VariablePhiGradient > _grad_phi_zero
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
Definition: Coupleable.h:1429
const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:103
std::set< std::string >::const_iterator coupledVarsEnd() const
virtual bool hasScalarVariable(const std::string &var_name) const =0
Returns a Boolean indicating whether any system contains a variable with the name provided...
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:93
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1409
std::vector< VariablePhiSecond > _second_phi_zero
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const =0
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
virtual bool hasVariable(const std::string &var_name) const =0
Whether or not this problem has the variable.
const VectorVariableCurl & _vector_curl_zero
Zero value of the curl of a vector variable.
Definition: Coupleable.h:1514
const MooseObject *const _obj
Definition: Coupleable.h:1814
bool have_parameter(std::string_view name) const
A wrapper around the Parameters base class method.
std::vector< MooseVariableFieldBase * > _coupled_moose_vars
Vector of all coupled variables.
Definition: Coupleable.h:1423
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:1713
std::vector< VariablePhiValue > _phi_zero
std::vector< MooseVariableField< Real > * > _coupled_fv_moose_vars
Vector of all finite volume coupled variables.
Definition: Coupleable.h:1435
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:78
const std::string & _c_type
The type of the object this interface is part of.
Definition: Coupleable.h:1411
const MooseArray< ADRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:1508
std::vector< VariableGradient > _grad_zero
const VariablePhiValue & _phi_zero
Definition: Coupleable.h:1496
Class for scalar variables (they are different).
std::vector< VariableValue > _zero
std::unordered_map< std::string, std::vector< unsigned int > > _optional_var_index
Unique indices for optionally coupled vars that weren&#39;t provided.
Definition: Coupleable.h:1802
std::vector< VectorVariableValue > _vector_zero
const InputParameters & _c_parameters
Definition: Coupleable.h:1406
const MooseArray< ADReal > & _ad_zero
Definition: Coupleable.h:1497
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799
std::vector< std::string > getVecMooseType(const std::string &name) const
void registerInterfaceObject(T &interface)
Registers an interface object for accessing with getInterfaceObjects.
Definition: MooseApp.h:1656
unsigned int THREAD_ID
Definition: MooseTypes.h:209
const std::unordered_map< std::string, std::string > & _new_to_deprecated_coupled_vars
map from new to deprecated variable names
Definition: Coupleable.h:1438
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ Coupleable() [2/2]

Coupleable::Coupleable ( const Coupleable object,
const Moose::Kokkos::FunctorCopy key 
)

Special constructor used for Kokkos functor copy during parallel dispatch.

Definition at line 127 of file Coupleable.C.

128  : _c_parameters(object._c_parameters),
129  _c_name(object._c_name),
130  _c_type(object._c_type),
132  _c_sys(object._c_sys),
134  _c_nodal(object._c_nodal),
137  _c_tid(object._c_tid),
138  _zero(object._zero),
139  _phi_zero(object._phi_zero),
140  _ad_zero(object._ad_zero),
141  _grad_zero(object._grad_zero),
144  _second_zero(object._second_zero),
147  _vector_zero(object._vector_zero),
151  _is_fv(object._is_fv),
152  _obj(object._obj),
154 {
155 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
const VariableValue & _zero
Zero value of a variable.
Definition: Coupleable.h:1495
const VariablePhiGradient & _grad_phi_zero
Zero gradient of trial function.
Definition: Coupleable.h:1504
const VariablePhiSecond & _second_phi_zero
Zero second derivative of a test function.
Definition: Coupleable.h:1510
const VectorVariableValue & _vector_zero
Zero value of a vector variable.
Definition: Coupleable.h:1512
const VariableGradient & _grad_zero
Zero gradient of a variable.
Definition: Coupleable.h:1500
const MooseArray< ADRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:1501
const bool _is_fv
Whether the MooseObject is a finite volume object.
Definition: Coupleable.h:1812
const VariableSecond & _second_zero
Zero second derivative of a variable.
Definition: Coupleable.h:1507
const bool _c_allow_element_to_nodal_coupling
Definition: Coupleable.h:1447
THREAD_ID _c_tid
Thread ID of the thread using this object.
Definition: Coupleable.h:1450
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:1821
const SystemBase *const _c_sys
Pointer to the system object if the moose object this is an interface for has one.
Definition: Coupleable.h:1417
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1414
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1409
const VectorVariableCurl & _vector_curl_zero
Zero value of the curl of a vector variable.
Definition: Coupleable.h:1514
const MooseObject *const _obj
Definition: Coupleable.h:1814
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:1713
const std::string & _c_type
The type of the object this interface is part of.
Definition: Coupleable.h:1411
const MooseArray< ADRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:1508
const VariablePhiValue & _phi_zero
Definition: Coupleable.h:1496
const InputParameters & _c_parameters
Definition: Coupleable.h:1406
const MooseArray< ADReal > & _ad_zero
Definition: Coupleable.h:1497
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799
const std::unordered_map< std::string, std::string > & _new_to_deprecated_coupled_vars
map from new to deprecated variable names
Definition: Coupleable.h:1438

Member Function Documentation

◆ adCoupledCurl()

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

Returns curl of a coupled variable for use in objects utilizing Automatic Differentiation.

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

Definition at line 1788 of file Coupleable.C.

1789 {
1790  const auto * var = getVectorVar(var_name, comp);
1791 
1792  if (!var)
1793  return getADDefaultCurl();
1795 
1796  if (!_c_is_implicit)
1797  mooseError("Not implemented");
1798 
1799  if (!_coupleable_neighbor)
1800  return var->adCurlSln();
1801  return var->adCurlSlnNeighbor();
1802 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
const ADVectorVariableCurl & getADDefaultCurl() const
Helper method to return (and insert if necessary) the default curl value for Automatic Differentiatio...
Definition: Coupleable.C:2423
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:1713

◆ adCoupledDofValues()

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

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

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

Definition at line 2131 of file Coupleable.C.

2132 {
2133  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2134 
2135  if (!var)
2136  return *getADDefaultValue(var_name);
2138 
2139  if (!_c_is_implicit)
2140  mooseError("Not implemented");
2141 
2142  if (!_coupleable_neighbor)
2143  return var->adDofValues();
2144  return var->adDofValuesNeighbor();
2145 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:2371
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:1713

◆ adCoupledDot()

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

Time derivative of a coupled variable for ad simulations.

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

Definition at line 2281 of file Coupleable.C.

Referenced by adCoupledDots().

2282 {
2283  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2284 
2285  if (!var)
2286  return *getADDefaultValue(var_name);
2288 
2289  if (!_coupleable_neighbor)
2290  {
2291  if (_c_nodal)
2292  return var->adDofValuesDot();
2293  return var->adUDot();
2294  }
2295  else
2296  {
2297  if (_c_nodal)
2298  mooseError("AD neighbor nodal dof dot not implemented");
2299  return var->adUDotNeighbor();
2300  }
2301 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
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:2371
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:1713

◆ adCoupledDotDot()

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

Second time derivative of a coupled variable for ad simulations.

Parameters
var_nameName of coupled variable
compComponent number for vector of coupled variables
Returns
Reference to an ADVariableValue containing the second time derivative of the coupled variable

Definition at line 2304 of file Coupleable.C.

2305 {
2306  const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2307 
2308  if (!var)
2309  return *getADDefaultValue(var_name);
2311 
2312  if (_c_nodal)
2313  mooseError("Not implemented");
2314 
2315  if (!_coupleable_neighbor)
2316  return var->adUDotDot();
2317  return var->adUDotDotNeighbor();
2318 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
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:2371
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:1713

◆ adCoupledDots()

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

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

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

Definition at line 2784 of file Coupleable.C.

2785 {
2786  auto func = [this, &var_name](unsigned int comp) { return &adCoupledDot(var_name, comp); };
2787  return coupledVectorHelper<const ADVariableValue *>(var_name, func);
2788 }
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:2281

◆ adCoupledGradient()

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

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

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

Definition at line 2222 of file Coupleable.C.

Referenced by adCoupledGradients().

2223 {
2224  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2225 
2226  if (!var)
2227  return getADDefaultGradient();
2229 
2230  if (!_c_is_implicit)
2231  mooseError("Not implemented");
2232 
2233  if (!_coupleable_neighbor)
2234  return var->adGradSln();
2235  return var->adGradSlnNeighbor();
2236 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
const ADVariableGradient & getADDefaultGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
Definition: Coupleable.C:2402
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:1713

◆ adCoupledGradientDot()

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

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

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

Definition at line 2239 of file Coupleable.C.

2240 {
2241  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2242 
2243  if (!var)
2244  return getADDefaultGradient();
2246 
2247  if (!_c_is_implicit)
2248  mooseError("Not implemented");
2249 
2250  if (!_coupleable_neighbor)
2251  return var->adGradSlnDot();
2252  return var->adGradSlnNeighborDot();
2253 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
const ADVariableGradient & getADDefaultGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
Definition: Coupleable.C:2402
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:1713

◆ adCoupledGradients()

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

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

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

Definition at line 2763 of file Coupleable.C.

2764 {
2765  auto func = [this, &var_name](unsigned int comp) { return &adCoupledGradient(var_name, comp); };
2766  return coupledVectorHelper<const ADVariableGradient *>(var_name, func);
2767 }
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:2222

◆ adCoupledLowerValue()

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

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

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

Definition at line 2204 of file Coupleable.C.

2205 {
2206  auto var = getVarHelper<MooseVariableFE<Real>>(var_name, comp);
2207 
2208  if (!var)
2209  return *getADDefaultValue(var_name);
2211 
2212  if (!_c_is_implicit)
2213  mooseError("adCoupledLowerValue cannot be called in a coupleable neighbor object");
2214 
2215  if (_c_nodal)
2216  return var->adDofValues();
2217  else
2218  return var->adSlnLower();
2219 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:2371

◆ adCoupledNodalValue()

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

Returns AD nodal values of a coupled variable.

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

Definition at line 2162 of file Coupleable.C.

2163 {
2164  static const typename Moose::ADType<T>::type zero = 0;
2165  if (!isCoupled(var_name))
2166  return zero;
2167 
2168  if (!_c_nodal)
2169  mooseError("The adCoupledNodalValue method should only be called for nodal computing objects");
2171  mooseError(
2172  "The adCoupledNodalValue method shouldn't be called for neighbor computing objects. I "
2173  "don't even know what that would mean, although maybe someone could explain it to me.");
2174  if (!_c_is_implicit)
2175  mooseError("If you're going to use an explicit scheme, then use coupledNodalValue instead of "
2176  "adCoupledNodalValue");
2177 
2178  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
2179 
2180  return var->adNodalValue();
2181 }
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:159
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
const Number zero
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:1713

◆ adCoupledSecond()

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

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

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

Definition at line 2256 of file Coupleable.C.

2257 {
2258  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2259 
2260  if (!var)
2261  return getADDefaultSecond();
2263 
2264  if (!_c_is_implicit)
2265  mooseError("Not implemented");
2266 
2267  if (!_coupleable_neighbor)
2268  return var->adSecondSln();
2269  else
2270  return var->adSecondSlnNeighbor();
2271 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:1713
const ADVariableSecond & getADDefaultSecond() const
Helper method to return (and insert if necessary) the default second derivatives for Automatic Differ...
Definition: Coupleable.C:2416

◆ adCoupledValue()

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

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

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

Definition at line 2184 of file Coupleable.C.

Referenced by adCoupledValues().

2185 {
2186  const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2187 
2188  if (!var)
2189  return *getADDefaultValue(var_name);
2191 
2192  if (!_c_is_implicit)
2193  mooseError("Not implemented");
2194 
2195  if (_c_nodal)
2196  return var->adDofValues();
2197 
2198  if (!_coupleable_neighbor)
2199  return var->adSln();
2200  return var->adSlnNeighbor();
2201 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:2371
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:1713

◆ adCoupledValues()

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

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

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

Definition at line 2566 of file Coupleable.C.

2567 {
2568  auto func = [this, &var_name](unsigned int comp) { return &adCoupledValue(var_name, comp); };
2569  return coupledVectorHelper<const ADVariableValue *>(var_name, func);
2570 }
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:2184

◆ adCoupledVectorDot()

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

Time derivative of a vector coupled variable for ad simulations.

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

Definition at line 2321 of file Coupleable.C.

2322 {
2323  const auto * var = getVectorVar(var_name, comp);
2324  if (!var)
2325  return *getADDefaultVectorValue(var_name);
2327 
2328  if (_c_nodal)
2329  mooseError("Not implemented");
2330 
2331  if (!_coupleable_neighbor)
2332  return var->adUDot();
2333  return var->adUDotNeighbor();
2334 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
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:2385
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
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:1713

◆ adCoupledVectorGradient()

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

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

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

Definition at line 2355 of file Coupleable.C.

2356 {
2357  const auto * var = getVectorVar(var_name, comp);
2358  if (!var)
2359  return getADDefaultVectorGradient();
2361 
2362  if (!_c_is_implicit)
2363  mooseError("Not implemented");
2364 
2365  if (!_coupleable_neighbor)
2366  return var->adGradSln();
2367  return var->adGradSlnNeighbor();
2368 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
const ADVectorVariableGradient & getADDefaultVectorGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
Definition: Coupleable.C:2409
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:1713

◆ adCoupledVectorSecond()

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

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

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

◆ adCoupledVectorValue()

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

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

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

Definition at line 2337 of file Coupleable.C.

Referenced by adCoupledVectorValues().

2338 {
2339  const auto * var = getVectorVar(var_name, comp);
2340  if (!var)
2341  return *getADDefaultVectorValue(var_name);
2343 
2344  if (_c_nodal)
2345  mooseError("Not implemented");
2346  if (!_c_is_implicit)
2347  mooseError("Not implemented");
2348 
2349  if (!_coupleable_neighbor)
2350  return var->adSln();
2351  return var->adSlnNeighbor();
2352 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
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:2385
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:1713

◆ adCoupledVectorValues()

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

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

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

Definition at line 2573 of file Coupleable.C.

2574 {
2575  auto func = [this, &var_name](unsigned int comp)
2576  { return &adCoupledVectorValue(var_name, comp); };
2577  return coupledVectorHelper<const ADVectorVariableValue *>(var_name, func);
2578 }
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:2337

◆ addFEVariableCoupleableMatrixTag()

void Coupleable::addFEVariableCoupleableMatrixTag ( TagID  tag)
inline

Definition at line 115 of file Coupleable.h.

Referenced by coupledMatrixTagValue().

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

◆ addFEVariableCoupleableVectorTag()

void Coupleable::addFEVariableCoupleableVectorTag ( TagID  tag)
inline

Definition at line 113 of file Coupleable.h.

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

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

◆ adZeroGradient()

const ADVariableGradient & Coupleable::adZeroGradient ( ) const
protected

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

Definition at line 2437 of file Coupleable.C.

2438 {
2439  mooseDeprecated("Method adZeroGradient() is deprecated. Use '_ad_grad_zero' instead.");
2440  return _ad_grad_zero;
2441 }
const MooseArray< ADRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:1501
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:374

◆ adZeroSecond()

const ADVariableSecond & Coupleable::adZeroSecond ( ) const
protected

Retrieve a zero second for automatic differentiation.

Definition at line 2444 of file Coupleable.C.

2445 {
2446  mooseDeprecated("Method adZeroSecond() is deprecated. Use '_ad_second_zero' instead.");
2447  return _ad_second_zero;
2448 }
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:374
const MooseArray< ADRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:1508

◆ adZeroValue()

const ADVariableValue & Coupleable::adZeroValue ( ) const
protected

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

Definition at line 2430 of file Coupleable.C.

2431 {
2432  mooseDeprecated("Method adZeroValue() is deprecated. Use '_ad_zero' instead.");
2433  return _ad_zero;
2434 }
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:374
const MooseArray< ADReal > & _ad_zero
Definition: Coupleable.h:1497

◆ checkFuncType()

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

Definition at line 222 of file Coupleable.C.

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

223 {
224  if (t == VarType::Gradient && _c_nodal)
225  mooseError(_c_name, ": nodal variables do not have gradients at nodes");
226 
227  if (age == FuncAge::Old || age == FuncAge::Older || t == VarType::GradientDot ||
228  t == VarType::Dot)
229  validateExecutionerType(var_name, "coupled[Vector][Gradient/Dot]Old[er]");
230  if (age == FuncAge::Older && !_c_is_implicit)
231  mooseError("object '",
232  _c_name,
233  "' uses older variable values that are unavailable with explicit schemes");
234 
235  coupledCallback(var_name, age == FuncAge::Old || age == FuncAge::Older);
236 }
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:2148
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
virtual void coupledCallback(const std::string &, bool) const
A call-back function provided by the derived object for actions before coupling a variable with funct...
Definition: Coupleable.h:146
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1409

◆ checkVar()

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

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

Parameters
var_nameThe name of the coupled variable

Definition at line 239 of file Coupleable.C.

Referenced by getVarHelper().

242 {
243  const auto var_name = _c_parameters.checkForRename(var_name_in);
244  auto it = _c_coupled_scalar_vars.find(var_name);
245  if (it != _c_coupled_scalar_vars.end())
246  {
247  std::string cvars;
248  for (auto jt : it->second)
249  cvars += " " + jt->name();
250 
251  _obj->paramError(var_name,
252  "cannot couple '",
253  var_name,
254  "' to a scalar variable (",
255  cvars,
256  ") where field variable is expected");
257  }
258 
259  if (!isCoupled(var_name, comp))
260  return false; // return false since variable is *not* coupled
261 
262  auto vars_vector_it = _coupled_vars.find(var_name);
263  if (vars_vector_it == _coupled_vars.end())
264  mooseError(_c_name, ": Trying to get a coupled var ", var_name, " that doesn't exist");
265 
266  const auto & vars_vector = vars_vector_it->second;
267 
268  auto bound = comp_bound ? comp_bound : vars_vector.size();
269  checkComponent(_obj, comp, bound, var_name);
270 
271  // We should know we have a variable now
272  const auto * var = vars_vector[comp];
273  if (!var)
274  mooseError(
275  _c_name,
276  ": We did all our checks for the existence of a var, yet we still don't have a var!?");
277 
278  // Only perform the following checks for objects that feed into residuals/Jacobians, e.g. objects
279  // that inherit from the TaggingInterface
280  if (_c_parameters.have_parameter<MultiMooseEnum>("vector_tags"))
281  {
282  // Are we attempting to couple to a non-FV var in an FV object?
283  if (!var->isFV() && _is_fv)
284  mooseError("Attempting to couple non-FV variable ",
285  var->name(),
286  " into an FV object ",
287  _c_name,
288  ". This is not currently supported");
289  }
290 
291  if (!(vars_vector[comp])->isNodal() && _c_nodal && !_c_allow_element_to_nodal_coupling)
292  mooseError(_c_name, ": cannot couple elemental variables into nodal objects");
293 
294  return true;
295 }
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:159
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
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 ...
Definition: MooseBase.h:439
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1420
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
const bool _is_fv
Whether the MooseObject is a finite volume object.
Definition: Coupleable.h:1812
const bool _c_allow_element_to_nodal_coupling
Definition: Coupleable.h:1447
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _c_coupled_scalar_vars
Scalar variables coupled into this object (for error checking)
Definition: Coupleable.h:1805
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1409
const MooseObject *const _obj
Definition: Coupleable.h:1814
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: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:1406
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type...

◆ checkWritableVar()

void Coupleable::checkWritableVar ( MooseWritableVariable var)
protected

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

Definition at line 982 of file Coupleable.C.

Referenced by writableCoupledValue(), and writableVariable().

983 {
984  // check domain restrictions for compatibility
985  const auto * br = dynamic_cast<const BlockRestrictable *>(this);
986  const auto * nfc = dynamic_cast<const NodeFaceConstraint *>(this);
987 
988  if (br && !var->hasBlocks(br->blockIDs()))
989  mooseError("The variable '",
990  var->name(),
991  "' must be defined on all blocks '",
992  _obj->name(),
993  "' is defined on.");
994 
995  if (nfc && !var->hasBlocks(nfc->getSecondaryConnectedBlocks()))
996  mooseError("The variable '",
997  var->name(),
998  " must be defined on all blocks '",
999  _obj->name(),
1000  "'s secondary surface is defined on.");
1001 
1002  // make sure only one object can access a variable
1003  for (const auto & ci : _obj->getMooseApp().getInterfaceObjects<Coupleable>())
1004  if (ci != this && ci->_writable_coupled_variables[_c_tid].count(var))
1005  {
1006  // if both this and ci are block restrictable then we check if the block restrictions
1007  // are not overlapping. If they don't we permit the call.
1008  const auto * br_other = dynamic_cast<const BlockRestrictable *>(ci);
1009  if (br && br_other && br->blockRestricted() && br_other->blockRestricted() &&
1010  !MooseUtils::setsIntersect(br->blockIDs(), br_other->blockIDs()))
1011  continue;
1012  else if (nfc)
1013  continue;
1014 
1015  mooseError("'",
1016  ci->_obj->name(),
1017  "' already obtained a writable reference to '",
1018  var->name(),
1019  "'. Only one object can obtain such a reference per variable and subdomain in a "
1020  "simulation.");
1021  }
1022 
1023  // var is unique across threads, so we could forego having a separate set per thread, but we
1024  // need quick access to the list of all variables that need to be inserted into the solution
1025  // vector by a given thread.
1026 
1027  _writable_coupled_variables[_c_tid].insert(var);
1028 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
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:1158
THREAD_ID _c_tid
Thread ID of the thread using this object.
Definition: Coupleable.h:1450
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:1821
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Definition: MooseBase.h:87
const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:103
A NodeFaceConstraint is used when you need to create constraints between two surfaces in a mesh...
const MooseObject *const _obj
Definition: Coupleable.h:1814
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:49
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:1678

◆ coupled()

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

Returns the index for a coupled variable by name.

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

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

Definition at line 472 of file Coupleable.C.

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

473 {
474  const auto * var = getFieldVar(var_name, comp);
475  if (!var)
476  {
477  mooseAssert(_optional_var_index.find(var_name) != _optional_var_index.end(),
478  "optional var index for " << var_name << " does not exist!");
479  // make sure we don't try to access default var ids that were not provided
480  checkComponent(_obj, comp, _optional_var_index.at(var_name).size(), var_name);
481  return _optional_var_index.at(var_name)[comp];
482  }
484 
485  if (var->kind() == Moose::VAR_SOLVER &&
486  // are we not an object that feeds into the nonlinear system?
487  (!_c_sys || _c_sys->varKind() != Moose::VAR_SOLVER ||
488  // are we an object that impacts the nonlinear system and this variable is within our
489  // nonlinear system?
490  var->sys().number() == _c_sys->number()))
491  return var->number();
492  else
493  // Avoid registering coupling to variables outside of our system (e.g. avoid potentially
494  // creating bad Jacobians)
495  return std::numeric_limits<unsigned int>::max() - var->number();
496 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
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:1417
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1157
const MooseObject *const _obj
Definition: Coupleable.h:1814
void checkComponent(const MooseObject *obj, unsigned int comp, unsigned int bound, const std::string &var_name)
Definition: Coupleable.C:208
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:1802
Moose::VarKindType varKind() const
Definition: SystemBase.h:924
const MooseVariableFieldBase * getFieldVar(const std::string &var_name, unsigned int comp) const
Definition: Coupleable.C:312

◆ coupledAllDofValues()

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

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

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

Definition at line 2070 of file Coupleable.C.

2071 {
2072  auto func = [this, &var_name](unsigned int comp) { return &coupledDofValues(var_name, comp); };
2073  return coupledVectorHelper<const VariableValue *>(var_name, func);
2074 }
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:2057

◆ coupledAllDofValuesOld()

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

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

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

Definition at line 2090 of file Coupleable.C.

2091 {
2092  auto func = [this, &var_name](unsigned int comp) { return &coupledDofValuesOld(var_name, comp); };
2093  return coupledVectorHelper<const VariableValue *>(var_name, func);
2094 }
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:2077

◆ coupledAllDofValuesOlder()

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

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

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

Definition at line 2110 of file Coupleable.C.

2111 {
2112  auto func = [this, &var_name](unsigned int comp)
2113  { return &coupledDofValuesOlder(var_name, comp); };
2114  return coupledVectorHelper<const VariableValue *>(var_name, func);
2115 }
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:2097

◆ coupledArrayDofValues()

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

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

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

Definition at line 2118 of file Coupleable.C.

2119 {
2120  const auto * var = getArrayVar(var_name, comp);
2121  if (!var)
2122  return *getDefaultArrayValue(var_name);
2124 
2125  if (!_coupleable_neighbor)
2126  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
2127  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
2128 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
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:427
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:1713
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:336

◆ coupledArrayDot()

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

Time derivative of a coupled array variable.

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

Definition at line 1380 of file Coupleable.C.

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

◆ coupledArrayDotDot()

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

Second time derivative of a coupled array variable.

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

Definition at line 1402 of file Coupleable.C.

1403 {
1404  const auto * var = getArrayVar(var_name, comp);
1405  if (!var)
1408 
1409  if (!_coupleable_neighbor)
1410  {
1411  if (_c_nodal)
1412  return var->dofValuesDotDot();
1413  return var->uDotDot();
1414  }
1415  else
1416  {
1417  if (_c_nodal)
1418  return var->dofValuesDotDotNeighbor();
1419  return var->uDotDotNeighbor();
1420  }
1421 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
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:1713
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:336
ArrayVariableValue _default_array_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1535

◆ coupledArrayDotDotOld()

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

Old second time derivative of a coupled array variable.

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

Definition at line 1446 of file Coupleable.C.

1447 {
1448  const auto * var = getArrayVar(var_name, comp);
1449  if (!var)
1452 
1453  if (!_coupleable_neighbor)
1454  {
1455  if (_c_nodal)
1456  return var->dofValuesDotDotOld();
1457  return var->uDotDotOld();
1458  }
1459  else
1460  {
1461  if (_c_nodal)
1462  return var->dofValuesDotDotOldNeighbor();
1463  return var->uDotDotOldNeighbor();
1464  }
1465 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
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:1713
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:336
ArrayVariableValue _default_array_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1535

◆ coupledArrayDotDu()

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

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

Parameters
var_nameName of coupled 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 1518 of file Coupleable.C.

1519 {
1520  const auto * const var = getArrayVar(var_name, comp);
1521  if (!var)
1522  {
1524  return _default_value_zero;
1525  }
1527 
1528  if (!_coupleable_neighbor)
1529  {
1530  if (_c_nodal)
1531  return var->dofValuesDuDotDu();
1532  return var->duDotDu();
1533  }
1534  else
1535  {
1536  if (_c_nodal)
1537  return var->dofValuesDuDotDuNeighbor();
1538  return var->duDotDuNeighbor();
1539  }
1540 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1474
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:1713
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:336
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledArrayDotOld()

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

Old time derivative of a coupled array variable.

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

Definition at line 1424 of file Coupleable.C.

1425 {
1426  const auto * var = getArrayVar(var_name, comp);
1427  if (!var)
1430 
1431  if (!_coupleable_neighbor)
1432  {
1433  if (_c_nodal)
1434  return var->dofValuesDotOld();
1435  return var->uDotOld();
1436  }
1437  else
1438  {
1439  if (_c_nodal)
1440  return var->dofValuesDotOldNeighbor();
1441  return var->uDotOldNeighbor();
1442  }
1443 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
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:1713
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:336
ArrayVariableValue _default_array_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1535

◆ coupledArrayGradient()

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

Returns gradient of a coupled array variable.

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

Definition at line 1688 of file Coupleable.C.

1689 {
1690  const auto * var = getArrayVar(var_name, comp);
1691  if (!var)
1692  return _default_array_gradient;
1694 
1695  if (!_coupleable_neighbor)
1696  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
1697  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
1698 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:1713
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:336
ArrayVariableGradient _default_array_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1538

◆ coupledArrayGradientDot()

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

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

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

Definition at line 1727 of file Coupleable.C.

1728 {
1729  const auto * const var = getArrayVar(var_name, comp);
1730  if (!var)
1731  return _default_array_gradient;
1733 
1734  if (!_coupleable_neighbor)
1735  return var->gradSlnDot();
1736  return var->gradSlnNeighborDot();
1737 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
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:1713
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:336
ArrayVariableGradient _default_array_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1538

◆ coupledArrayGradientOld()

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

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

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

Definition at line 1701 of file Coupleable.C.

1702 {
1703  const auto * var = getArrayVar(var_name, comp);
1704  if (!var)
1705  return _default_array_gradient;
1707 
1708  if (!_coupleable_neighbor)
1709  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
1710  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
1711 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:1713
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:336
ArrayVariableGradient _default_array_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1538

◆ coupledArrayGradientOlder()

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

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

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

Definition at line 1714 of file Coupleable.C.

1715 {
1716  const auto * var = getArrayVar(var_name, comp);
1717  if (!var)
1718  return _default_array_gradient;
1720 
1721  if (!_coupleable_neighbor)
1722  return var->gradSlnOlder();
1723  return var->gradSlnOlderNeighbor();
1724 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
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:1713
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:336
ArrayVariableGradient _default_array_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1538

◆ coupledArrayValue()

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

Returns value of a coupled array variable.

Parameters
var_nameName of coupled 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 879 of file Coupleable.C.

Referenced by coupledArrayValues().

880 {
881  const auto * var = getArrayVar(var_name, comp);
882  if (!var)
883  return *getDefaultArrayValue(var_name);
885 
887  {
888  if (_c_nodal)
889  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
890  return (_c_is_implicit) ? var->sln() : var->slnOld();
891  }
892  else
893  {
894  if (_c_nodal)
895  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
896  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
897  }
898 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
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:427
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:1713
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:336

◆ coupledArrayValueOld()

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

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

Parameters
var_nameName of coupled 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 1126 of file Coupleable.C.

1127 {
1128  const auto * var = getArrayVar(var_name, comp);
1129  if (!var)
1130  return *getDefaultArrayValue(var_name);
1132 
1133  if (!_coupleable_neighbor)
1134  {
1135  if (_c_nodal)
1136  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
1137  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
1138  }
1139  else
1140  {
1141  if (_c_nodal)
1142  return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
1143  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
1144  }
1145 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
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:427
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:1713
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:336

◆ coupledArrayValueOlder()

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

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

Parameters
var_nameName of coupled 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 1148 of file Coupleable.C.

1149 {
1150  const auto * var = getArrayVar(var_name, comp);
1151  if (!var)
1152  return *getDefaultArrayValue(var_name);
1154 
1155  if (!_coupleable_neighbor)
1156  {
1157  if (_c_nodal)
1158  return var->dofValuesOlder();
1159  return var->slnOlder();
1160  }
1161  else
1162  {
1163  if (_c_nodal)
1164  return var->dofValuesOlderNeighbor();
1165  return var->slnOlderNeighbor();
1166  }
1167 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
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:427
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:1713
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:336

◆ coupledArrayValues()

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

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

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

Definition at line 901 of file Coupleable.C.

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

◆ coupledCallback()

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

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

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

Definition at line 146 of file Coupleable.h.

Referenced by checkFuncType().

146 {}

◆ coupledComponents()

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

Number of coupled components.

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

Definition at line 188 of file Coupleable.C.

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

189 {
190  const auto var_name = _c_parameters.checkForRename(var_name_in);
191 
192  if (isCoupled(var_name))
193  {
194  mooseAssert(_coupled_vars.find(var_name) != _coupled_vars.end(),
195  var_name << " must not actually be coupled!");
196  return _coupled_vars.at(var_name).size();
197  }
198  else
199  {
201  return _c_parameters.numberDefaultCoupledValues(var_name);
202  else
203  return 0;
204  }
205 }
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:159
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1420
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:1406

◆ coupledCurl()

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

Returns curl of a coupled variable.

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

Definition at line 1740 of file Coupleable.C.

1741 {
1742  const auto * var = getVectorVar(var_name, comp);
1743  if (!var)
1744  {
1746  return _default_vector_curl;
1747  }
1749 
1750  if (!_coupleable_neighbor)
1751  return (_c_is_implicit) ? var->curlSln() : var->curlSlnOld();
1752  return (_c_is_implicit) ? var->curlSlnNeighbor() : var->curlSlnOldNeighbor();
1753 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1526
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledCurlOld()

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

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

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

Definition at line 1756 of file Coupleable.C.

1757 {
1758  const auto * var = getVectorVar(var_name, comp);
1759  if (!var)
1760  {
1762  return _default_vector_curl;
1763  }
1765 
1766  if (!_coupleable_neighbor)
1767  return (_c_is_implicit) ? var->curlSlnOld() : var->curlSlnOlder();
1768  return (_c_is_implicit) ? var->curlSlnOldNeighbor() : var->curlSlnOlderNeighbor();
1769 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1526
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledCurlOlder()

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

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

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

Definition at line 1772 of file Coupleable.C.

1773 {
1774  const auto * var = getVectorVar(var_name, comp);
1775  if (!var)
1776  {
1778  return _default_vector_curl;
1779  }
1781 
1782  if (!_coupleable_neighbor)
1783  return var->curlSlnOlder();
1784  return var->curlSlnOlderNeighbor();
1785 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1526
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledDiv()

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

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

1806 {
1807  const auto * var = getVectorVar(var_name, comp);
1808  if (!var)
1809  {
1811  return _default_div;
1812  }
1814 
1815  if (!_coupleable_neighbor)
1816  return (_c_is_implicit) ? var->divSln() : var->divSlnOld();
1817  return (_c_is_implicit) ? var->divSlnNeighbor() : var->divSlnOldNeighbor();
1818 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
VectorVariableDivergence _default_div
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1529
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledDivOld()

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

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

1822 {
1823  const auto * var = getVectorVar(var_name, comp);
1824  if (!var)
1825  {
1827  return _default_div;
1828  }
1830 
1831  if (!_coupleable_neighbor)
1832  return (_c_is_implicit) ? var->divSlnOld() : var->divSlnOlder();
1833  return (_c_is_implicit) ? var->divSlnOldNeighbor() : var->divSlnOlderNeighbor();
1834 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
VectorVariableDivergence _default_div
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1529
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledDivOlder()

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

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

1838 {
1839  const auto * var = getVectorVar(var_name, comp);
1840  if (!var)
1841  {
1843  return _default_div;
1844  }
1846 
1847  if (!_coupleable_neighbor)
1848  return var->divSlnOlder();
1849  return var->divSlnOlderNeighbor();
1850 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
VectorVariableDivergence _default_div
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1529
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledDofValues()

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

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

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

Definition at line 2057 of file Coupleable.C.

Referenced by coupledAllDofValues().

2058 {
2059  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2060  if (!var)
2061  return *getDefaultValue(var_name, comp);
2063 
2064  if (!_coupleable_neighbor)
2065  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
2066  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
2067 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:365
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:1713

◆ coupledDofValuesOld()

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

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

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

Definition at line 2077 of file Coupleable.C.

Referenced by coupledAllDofValuesOld().

2078 {
2079  const auto * var = getVar(var_name, comp);
2080  if (!var)
2081  return *getDefaultValue(var_name, comp);
2083 
2084  if (!_coupleable_neighbor)
2085  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
2086  return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
2087 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:365
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:1713

◆ coupledDofValuesOlder()

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

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

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

Definition at line 2097 of file Coupleable.C.

Referenced by coupledAllDofValuesOlder().

2098 {
2099  const auto * var = getVar(var_name, comp);
2100  if (!var)
2101  return *getDefaultValue(var_name, comp);
2103 
2104  if (!_coupleable_neighbor)
2105  return var->dofValuesOlder();
2106  return var->dofValuesOlderNeighbor();
2107 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
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:365
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:1713

◆ coupledDot()

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

Time derivative of a coupled variable.

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

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

Definition at line 1170 of file Coupleable.C.

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

1171 {
1172  const auto * var = getVar(var_name, comp);
1173  if (!var)
1174  {
1176  return _default_value_zero;
1177  }
1179 
1180  if (!_coupleable_neighbor)
1181  {
1182  if (_c_nodal)
1183  return var->dofValuesDot();
1184  return var->uDot();
1185  }
1186  else
1187  {
1188  if (_c_nodal)
1189  return var->dofValuesDotNeighbor();
1190  return var->uDotNeighbor();
1191  }
1192 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1474
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
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:1713
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledDotDot()

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

Second time derivative of a coupled variable.

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

Definition at line 1195 of file Coupleable.C.

1196 {
1197  const auto * var = getVar(var_name, comp);
1198  if (!var)
1199  {
1201  return _default_value_zero;
1202  }
1204 
1205  if (!_coupleable_neighbor)
1206  {
1207  if (_c_nodal)
1208  return var->dofValuesDotDot();
1209  return var->uDotDot();
1210  }
1211  else
1212  {
1213  if (_c_nodal)
1214  return var->dofValuesDotDotNeighbor();
1215  return var->uDotDotNeighbor();
1216  }
1217 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1474
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
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:1713
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledDotDotDu()

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

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

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

Definition at line 1493 of file Coupleable.C.

1494 {
1495  const auto * var = getVar(var_name, comp);
1496  if (!var)
1497  {
1499  return _default_value_zero;
1500  }
1502 
1503  if (!_coupleable_neighbor)
1504  {
1505  if (_c_nodal)
1506  return var->dofValuesDuDotDotDu();
1507  return var->duDotDotDu();
1508  }
1509  else
1510  {
1511  if (_c_nodal)
1512  return var->dofValuesDuDotDotDuNeighbor();
1513  return var->duDotDotDuNeighbor();
1514  }
1515 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1474
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
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:1713
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledDotDotOld()

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

Old second time derivative of a coupled variable.

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

Definition at line 1259 of file Coupleable.C.

1260 {
1261  const auto * var = getVar(var_name, comp);
1262  if (!var)
1263  {
1265  return _default_value_zero;
1266  }
1268 
1269  if (!_coupleable_neighbor)
1270  {
1271  if (_c_nodal)
1272  return var->dofValuesDotDotOld();
1273  return var->uDotDotOld();
1274  }
1275  else
1276  {
1277  if (_c_nodal)
1278  return var->dofValuesDotDotOldNeighbor();
1279  return var->uDotDotOldNeighbor();
1280  }
1281 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1474
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
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:1713
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledDotDu()

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

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

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

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

Definition at line 1468 of file Coupleable.C.

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

1469 {
1470  const auto * var = getVar(var_name, comp);
1471  if (!var)
1472  {
1474  return _default_value_zero;
1475  }
1477 
1478  if (!_coupleable_neighbor)
1479  {
1480  if (_c_nodal)
1481  return var->dofValuesDuDotDu();
1482  return var->duDotDu();
1483  }
1484  else
1485  {
1486  if (_c_nodal)
1487  return var->dofValuesDuDotDuNeighbor();
1488  return var->duDotDuNeighbor();
1489  }
1490 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1474
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
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:1713
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledDotOld()

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

Old time derivative of a coupled variable.

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

Definition at line 1234 of file Coupleable.C.

1235 {
1236  const auto * var = getVar(var_name, comp);
1237  if (!var)
1238  {
1240  return _default_value_zero;
1241  }
1243 
1244  if (!_coupleable_neighbor)
1245  {
1246  if (_c_nodal)
1247  return var->dofValuesDotOld();
1248  return var->uDotOld();
1249  }
1250  else
1251  {
1252  if (_c_nodal)
1253  return var->dofValuesDotOldNeighbor();
1254  return var->uDotOldNeighbor();
1255  }
1256 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1474
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
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:1713
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledDots()

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

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

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

Definition at line 2777 of file Coupleable.C.

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

◆ coupledGenericDofValue() [1/3]

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

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

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

◆ coupledGenericDofValue() [2/3]

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

Definition at line 619 of file Coupleable.C.

620 {
621  return coupledDofValues(var_name, comp);
622 }
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:2057

◆ coupledGenericDofValue() [3/3]

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

Definition at line 626 of file Coupleable.C.

627 {
628  return adCoupledDofValues(var_name, comp);
629 }
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:2131

◆ coupledGenericDot() [1/3]

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

Returns time derivative 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 time derivative

◆ coupledGenericDot() [2/3]

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

Definition at line 2792 of file Coupleable.C.

2793 {
2794  return coupledDot(var_name, comp);
2795 }
virtual const VariableValue & coupledDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled variable.
Definition: Coupleable.C:1170

◆ coupledGenericDot() [3/3]

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

Definition at line 2799 of file Coupleable.C.

2800 {
2801  return adCoupledDot(var_name, comp);
2802 }
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:2281

◆ coupledGenericDotDot() [1/3]

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

Returns the second time derivative 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 second time derivative

◆ coupledGenericDotDot() [2/3]

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

Definition at line 1221 of file Coupleable.C.

1222 {
1223  return coupledDotDot(var_name, comp);
1224 }
virtual const VariableValue & coupledDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of a coupled variable.
Definition: Coupleable.C:1195

◆ coupledGenericDotDot() [3/3]

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

Definition at line 1228 of file Coupleable.C.

1229 {
1230  return adCoupledDotDot(var_name, comp);
1231 }
const ADVariableValue & adCoupledDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of a coupled variable for ad simulations.
Definition: Coupleable.C:2304

◆ coupledGenericGradient() [1/3]

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

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

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

◆ coupledGenericGradient() [2/3]

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

Definition at line 2494 of file Coupleable.C.

2495 {
2496  return coupledGradient(var_name, comp);
2497 }
virtual const VariableGradient & coupledGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable.
Definition: Coupleable.C:1543

◆ coupledGenericGradient() [3/3]

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

Definition at line 2501 of file Coupleable.C.

2502 {
2503  return adCoupledGradient(var_name, comp);
2504 }
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:2222

◆ coupledGenericGradients() [1/3]

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

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

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

◆ coupledGenericGradients() [2/3]

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

Definition at line 2756 of file Coupleable.C.

2757 {
2758  auto func = [this, &var_name](unsigned int comp) { return &adCoupledGradient(var_name, comp); };
2759  return coupledVectorHelper<const GenericVariableGradient<true> *>(var_name, func);
2760 }
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:2222

◆ coupledGenericGradients() [3/3]

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

Definition at line 2749 of file Coupleable.C.

2750 {
2751  return coupledGradients(var_name);
2752 }
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:2741

◆ coupledGenericValue() [1/3]

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

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

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

◆ coupledGenericValue() [2/3]

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

Definition at line 500 of file Coupleable.C.

501 {
502  return coupledValue(var_name, comp);
503 }
virtual const VariableValue & coupledValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled variable.
Definition: Coupleable.C:527

◆ coupledGenericValue() [3/3]

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

Definition at line 507 of file Coupleable.C.

508 {
509  return adCoupledValue(var_name, comp);
510 }
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:2184

◆ coupledGenericValues() [1/3]

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

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

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

◆ coupledGenericValues() [2/3]

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

Definition at line 2553 of file Coupleable.C.

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

◆ coupledGenericValues() [3/3]

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

Definition at line 2560 of file Coupleable.C.

2561 {
2562  return adCoupledValues(var_name);
2563 }
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:2566

◆ coupledGenericVectorValue() [1/3]

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

Returns value of a coupled vector 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 GenericVariableVectorValue for the coupled variable

◆ coupledGenericVectorValue() [2/3]

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

Definition at line 514 of file Coupleable.C.

515 {
516  return coupledVectorValue(var_name, comp);
517 }
virtual const VectorVariableValue & coupledVectorValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled vector variable.
Definition: Coupleable.C:854

◆ coupledGenericVectorValue() [3/3]

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

Definition at line 521 of file Coupleable.C.

522 {
523  return adCoupledVectorValue(var_name, comp);
524 }
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:2337

◆ coupledGradient()

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

Returns gradient of a coupled variable.

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

Definition at line 1543 of file Coupleable.C.

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

1544 {
1545  const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
1546  if (!var)
1547  {
1549  return _default_gradient;
1550  }
1552 
1553  if (!_coupleable_neighbor)
1554  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
1555  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
1556 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1477
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledGradientDot()

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

Time derivative of the gradient of a coupled variable.

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

Definition at line 1608 of file Coupleable.C.

1609 {
1610  const auto * var = getVar(var_name, comp);
1611  if (!var)
1612  {
1614  return _default_gradient;
1615  }
1617 
1618  if (!_coupleable_neighbor)
1619  return var->gradSlnDot();
1620  return var->gradSlnNeighborDot();
1621 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1477
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledGradientDotDot()

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

Second time derivative of the gradient of a coupled variable.

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

Definition at line 1624 of file Coupleable.C.

1625 {
1626  const auto * var = getVar(var_name, comp);
1627  if (!var)
1628  {
1630  return _default_gradient;
1631  }
1633 
1634  if (!_coupleable_neighbor)
1635  return var->gradSlnDotDot();
1636  return var->gradSlnNeighborDotDot();
1637 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1477
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledGradientOld()

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

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

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

Definition at line 1559 of file Coupleable.C.

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

1560 {
1561  const auto * var = getVar(var_name, comp);
1562  if (!var)
1563  {
1565  return _default_gradient;
1566  }
1568 
1569  if (!_coupleable_neighbor)
1570  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
1571  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
1572 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1477
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledGradientOlder()

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

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

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

Definition at line 1575 of file Coupleable.C.

Referenced by NodeFaceConstraint::coupledSecondaryGradientOlder().

1576 {
1577  const auto * var = getVar(var_name, comp);
1578  if (!var)
1579  {
1581  return _default_gradient;
1582  }
1584 
1585  if (!_coupleable_neighbor)
1586  return var->gradSlnOlder();
1587  return var->gradSlnOlderNeighbor();
1588 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1477
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledGradientPreviousNL()

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

Returns gradient of a coupled variable for previous Newton iterate.

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

Definition at line 1591 of file Coupleable.C.

1592 {
1593  const auto * var = getVar(var_name, comp);
1595  if (!var)
1596  {
1598  return _default_gradient;
1599  }
1601 
1602  if (!_coupleable_neighbor)
1603  return var->gradSlnPreviousNL();
1604  return var->gradSlnPreviousNLNeighbor();
1605 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1414
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1477
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledGradients()

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

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

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

Definition at line 2741 of file Coupleable.C.

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

◆ coupledGradientsOld()

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

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

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

Definition at line 2770 of file Coupleable.C.

2771 {
2772  auto func = [this, &var_name](unsigned int comp) { return &coupledGradientOld(var_name, comp); };
2773  return coupledVectorHelper<const VariableGradient *>(var_name, func);
2774 }
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:1559

◆ coupledIndices()

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

Returns the indices for a coupled variable's components.

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

Definition at line 2507 of file Coupleable.C.

2508 {
2509  auto func = [this, &var_name](unsigned int comp) { return coupled(var_name, comp); };
2510  return coupledVectorHelper<unsigned int>(var_name, func);
2511 }
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:472

◆ coupledMatrixTagValue() [1/2]

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

Returns value of a coupled variable for a given tag.

This couples the diag vector of matrix

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

Definition at line 821 of file Coupleable.C.

Referenced by coupledMatrixTagValue(), and coupledMatrixTagValues().

824 {
825  const auto * var = getVarHelper<MooseVariableField<Real>>(var_names, index);
826  if (!var)
827  mooseError(var_names, ": invalid variable name for coupledMatrixTagValue");
829 
830  const_cast<Coupleable *>(this)->addFEVariableCoupleableMatrixTag(tag);
831 
832  if (_c_nodal)
833  return var->nodalMatrixTagValue(tag);
834  return var->matrixTagValue(tag);
835 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:49
void addFEVariableCoupleableMatrixTag(TagID tag)
Definition: Coupleable.h:115

◆ coupledMatrixTagValue() [2/2]

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

Definition at line 838 of file Coupleable.C.

841 {
842  if (!_c_parameters.isParamValid(tag_name))
843  mooseError("Tag name parameter '", tag_name, "' is invalid");
844 
845  TagName tagname = _c_parameters.get<TagName>(tag_name);
846  if (!_c_fe_problem.matrixTagExists(tagname))
847  mooseError("Matrix tag name '", tagname, "' does not exist");
848 
849  TagID tag = _c_fe_problem.getMatrixTagID(tagname);
850  return coupledMatrixTagValue(var_names, tag, index);
851 }
unsigned int TagID
Definition: MooseTypes.h:210
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
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:821
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1414
virtual TagID getMatrixTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:342
const InputParameters & _c_parameters
Definition: Coupleable.h:1406
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:328
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledMatrixTagValues() [1/2]

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

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

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

Definition at line 2696 of file Coupleable.C.

Referenced by coupledMatrixTagValues().

2697 {
2698  auto func = [this, &var_names, &tag](unsigned int comp)
2699  { return &coupledMatrixTagValue(var_names, tag, comp); };
2700  return coupledVectorHelper<const VariableValue *>(var_names, func);
2701 }
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:821

◆ coupledMatrixTagValues() [2/2]

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

Definition at line 2704 of file Coupleable.C.

2706 {
2707  if (!_c_parameters.isParamValid(tag_name))
2708  mooseError("Tag name parameter '", tag_name, "' is invalid");
2709 
2710  TagName tagname = _c_parameters.get<TagName>(tag_name);
2711  if (!_c_fe_problem.matrixTagExists(tagname))
2712  mooseError("Matrix tag name '", tagname, "' does not exist");
2713 
2714  TagID tag = _c_fe_problem.getMatrixTagID(tagname);
2715  return coupledMatrixTagValues(var_names, tag);
2716 }
unsigned int TagID
Definition: MooseTypes.h:210
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
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:1414
virtual TagID getMatrixTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:342
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:2696
const InputParameters & _c_parameters
Definition: Coupleable.h:1406
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:328
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledName()

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

Names of the variable in the Coupleable interface.

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

Definition at line 2514 of file Coupleable.C.

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

2515 {
2516  if (getFieldVar(var_name, comp))
2517  return getFieldVar(var_name, comp)->name();
2518  // Detect if we are in the case where a constant was passed in lieu of a variable
2519  else if (isCoupledConstant(var_name))
2521  ": a variable name was queried but a constant was passed for parameter '",
2522  var_name,
2523  "Either pass a true variable or contact a developer to shield the call to "
2524  "'coupledName' with 'isCoupledConstant'");
2525  else
2526  mooseError(
2527  _c_name, ": Variable '", var_name, "' does not exist, yet its coupled name is requested");
2528 }
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:182
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:103
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1409
const MooseVariableFieldBase * getFieldVar(const std::string &var_name, unsigned int comp) const
Definition: Coupleable.C:312

◆ coupledNames()

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

Names of the variables in the Coupleable interface.

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

Definition at line 2531 of file Coupleable.C.

2532 {
2533  auto func = [this, &var_name](unsigned int comp) { return coupledName(var_name, comp); };
2534  return coupledVectorHelper<VariableName>(var_name, func);
2535 }
VariableName coupledName(const std::string &var_name, unsigned int comp=0) const
Names of the variable in the Coupleable interface.
Definition: Coupleable.C:2514

◆ coupledNodalDot()

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

Nodal values of time derivative of a coupled variable.

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

Definition at line 1995 of file Coupleable.C.

1996 {
1997  static const T zero = 0;
1998  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1999  if (!var)
2000  return zero;
2002 
2003  if (!_coupleable_neighbor)
2004  return var->nodalValueDot();
2005  mooseError("Neighbor version not implemented");
2006 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
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:1713

◆ coupledNodalDotDot()

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

Nodal values of second time derivative of a coupled variable.

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

Definition at line 2009 of file Coupleable.C.

2010 {
2011  const auto * var = getVar(var_name, comp);
2012  if (!var)
2013  {
2015  return _default_value_zero;
2016  }
2018 
2019  if (!_coupleable_neighbor)
2020  return var->dofValuesDotDot();
2021  return var->dofValuesDotDotNeighbor();
2022 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1474
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
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:1713
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledNodalDotDotOld()

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

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

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

Definition at line 2041 of file Coupleable.C.

2042 {
2043  const auto * var = getVar(var_name, comp);
2044  if (!var)
2045  {
2047  return _default_value_zero;
2048  }
2050 
2051  if (!_coupleable_neighbor)
2052  return var->dofValuesDotDotOld();
2053  return var->dofValuesDotDotOldNeighbor();
2054 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1474
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
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:1713
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledNodalDotOld()

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

Nodal values of old time derivative of a coupled variable.

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

Definition at line 2025 of file Coupleable.C.

2026 {
2027  const auto * var = getVar(var_name, comp);
2028  if (!var)
2029  {
2031  return _default_value_zero;
2032  }
2034 
2035  if (!_coupleable_neighbor)
2036  return var->dofValuesDotOld();
2037  return var->dofValuesDotOldNeighbor();
2038 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1474
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
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:1713
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledNodalValue()

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

Returns nodal values of a coupled variable.

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

Definition at line 1919 of file Coupleable.C.

1920 {
1921  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1922  if (!var)
1923  return getDefaultNodalValue<T>(var_name, comp);
1925 
1926  if (!var->isNodal())
1928  ": Trying to get nodal values of variable '",
1929  var->name(),
1930  "', but it is not nodal.");
1931 
1932  if (!_coupleable_neighbor)
1933  return (_c_is_implicit) ? var->nodalValue() : var->nodalValueOld();
1934  return (_c_is_implicit) ? var->nodalValueNeighbor() : var->nodalValueOldNeighbor();
1935 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1409
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:1713

◆ coupledNodalValueOld()

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

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

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

Definition at line 1939 of file Coupleable.C.

1940 {
1941  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1942  if (!var)
1943  return getDefaultNodalValue<T>(var_name, comp);
1945 
1946  if (!var->isNodal())
1948  ": Trying to get old nodal values of variable '",
1949  var->name(),
1950  "', but it is not nodal.");
1951 
1952  if (!_coupleable_neighbor)
1953  return (_c_is_implicit) ? var->nodalValueOld() : var->nodalValueOlder();
1954  return (_c_is_implicit) ? var->nodalValueOldNeighbor() : var->nodalValueOlderNeighbor();
1955 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1409
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:1713

◆ coupledNodalValueOlder()

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

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

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

Definition at line 1959 of file Coupleable.C.

1960 {
1961  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1962  if (!var)
1963  return getDefaultNodalValue<T>(var_name, comp);
1965 
1966  if (!var->isNodal())
1968  ": Trying to get older nodal values of variable '",
1969  var->name(),
1970  "', but it is not nodal.");
1971 
1972  if (!_coupleable_neighbor)
1973  return var->nodalValueOlder();
1974  return var->nodalValueOlderNeighbor();
1975 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1409
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:1713

◆ coupledNodalValuePreviousNL()

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

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

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

Definition at line 1979 of file Coupleable.C.

1980 {
1981  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1982  if (!var)
1983  return getDefaultNodalValue<T>(var_name, comp);
1985 
1987 
1988  if (!_coupleable_neighbor)
1989  return var->nodalValuePreviousNL();
1990  return var->nodalValuePreviousNLNeighbor();
1991 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1414
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:1713

◆ coupledSecond()

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

Returns second spatial derivatives of a coupled variable.

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

Definition at line 1853 of file Coupleable.C.

Referenced by NodeFaceConstraint::coupledSecondarySecond().

1854 {
1855  const auto * var = getVar(var_name, comp);
1856  if (!var)
1857  {
1859  return _default_second;
1860  }
1862 
1863  if (!_coupleable_neighbor)
1864  return (_c_is_implicit) ? var->secondSln() : var->secondSlnOlder();
1865  return (_c_is_implicit) ? var->secondSlnNeighbor() : var->secondSlnOlderNeighbor();
1866 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1486
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledSecondOld()

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

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

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

Definition at line 1869 of file Coupleable.C.

1870 {
1871  const auto * var = getVar(var_name, comp);
1872  if (!var)
1873  {
1875  return _default_second;
1876  }
1878 
1879  if (!_coupleable_neighbor)
1880  return (_c_is_implicit) ? var->secondSlnOld() : var->secondSlnOlder();
1881  return (_c_is_implicit) ? var->secondSlnOldNeighbor() : var->secondSlnOlderNeighbor();
1882 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1486
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledSecondOlder()

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

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

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

Definition at line 1885 of file Coupleable.C.

1886 {
1887  const auto * var = getVar(var_name, comp);
1888  if (!var)
1889  {
1891  return _default_second;
1892  }
1894 
1895  if (!_coupleable_neighbor)
1896  return var->secondSlnOlder();
1897  return var->secondSlnOlderNeighbor();
1898 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1486
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledSecondPreviousNL()

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

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

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

Definition at line 1901 of file Coupleable.C.

1902 {
1903  const auto * var = getVar(var_name, comp);
1905  if (!var)
1906  {
1908  return _default_second;
1909  }
1911 
1912  if (!_coupleable_neighbor)
1913  return var->secondSlnPreviousNL();
1914  return var->secondSlnPreviousNLNeighbor();
1915 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1414
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1486
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledValue()

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

Returns value of a coupled variable.

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

Definition at line 527 of file Coupleable.C.

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

528 {
529  const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
530  if (!var)
531  return *getDefaultValue(var_name, comp);
533 
535  {
536  if (_c_nodal)
537  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
538  else
539  return (_c_is_implicit) ? var->sln() : var->slnOld();
540  }
541  else
542  {
543  if (_c_nodal)
544  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
545  else
546  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
547  }
548 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:365
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:1713

◆ coupledValueLower()

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

Returns value of a coupled lower-dimensional variable.

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

Definition at line 632 of file Coupleable.C.

633 {
634  const auto * var = getVar(var_name, comp);
635  if (!var)
636  return *getDefaultValue(var_name, comp);
638 
640  mooseError(_c_name, ":coupledValueLower cannot be called in a coupleable neighbor object");
641 
642  if (_c_nodal)
643  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
644  else
645  return (_c_is_implicit) ? var->slnLower() : var->slnLowerOld();
646 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:365
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1409
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:1713

◆ coupledValueOld()

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

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

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

Definition at line 1031 of file Coupleable.C.

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

1032 {
1033  const auto * var = getVar(var_name, comp);
1034  if (!var)
1035  return *getDefaultValue(var_name, comp);
1037 
1038  if (!_coupleable_neighbor)
1039  {
1040  if (_c_nodal)
1041  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
1042  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
1043  }
1044  else
1045  {
1046  if (_c_nodal)
1047  return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
1048  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
1049  }
1050 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:365
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:1713

◆ coupledValueOlder()

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

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

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

Definition at line 1053 of file Coupleable.C.

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

1054 {
1055  const auto * var = getVar(var_name, comp);
1056  if (!var)
1057  return *getDefaultValue(var_name, comp);
1059 
1060  if (!_coupleable_neighbor)
1061  {
1062  if (_c_nodal)
1063  return var->dofValuesOlder();
1064  return var->slnOlder();
1065  }
1066  else
1067  {
1068  if (_c_nodal)
1069  return var->dofValuesOlderNeighbor();
1070  return var->slnOlderNeighbor();
1071  }
1072 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
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:365
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:1713

◆ coupledValuePreviousNL()

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

Returns value of previous Newton iterate of a coupled variable.

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

Definition at line 1075 of file Coupleable.C.

1076 {
1077  const auto * var = getVar(var_name, comp);
1078  if (!var)
1079  return *getDefaultValue(var_name, comp);
1081 
1083  if (!_coupleable_neighbor)
1084  {
1085  if (_c_nodal)
1086  return var->dofValuesPreviousNL();
1087  return var->slnPreviousNL();
1088  }
1089  else
1090  {
1091  if (_c_nodal)
1092  return var->dofValuesPreviousNLNeighbor();
1093  return var->slnPreviousNLNeighbor();
1094  }
1095 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1414
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:365
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:1713

◆ coupledValues()

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

Returns the values for all of a coupled variable components.

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

Definition at line 2538 of file Coupleable.C.

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

◆ coupledValuesOld()

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

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

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

Definition at line 2719 of file Coupleable.C.

2720 {
2721  auto func = [this, &var_name](unsigned int comp) { return &coupledValueOld(var_name, comp); };
2722  return coupledVectorHelper<const VariableValue *>(var_name, func);
2723 }
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:1031

◆ coupledValuesOlder()

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

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

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

Definition at line 2726 of file Coupleable.C.

2727 {
2728  auto func = [this, &var_name](unsigned int comp) { return &coupledValueOlder(var_name, comp); };
2729  return coupledVectorHelper<const VariableValue *>(var_name, func);
2730 }
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:1053

◆ coupledVectorDot()

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

Time derivative of a coupled vector variable.

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

Definition at line 1284 of file Coupleable.C.

1285 {
1286  const auto * var = getVectorVar(var_name, comp);
1287  if (!var)
1288  {
1291  }
1293 
1294  if (!_coupleable_neighbor)
1295  return var->uDot();
1296  return var->uDotNeighbor();
1297 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
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:1713
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1520
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledVectorDotDot()

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

Second time derivative of a coupled vector variable.

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

Definition at line 1300 of file Coupleable.C.

1301 {
1302  const auto * var = getVectorVar(var_name, comp);
1303  if (!var)
1304  {
1307  }
1309 
1310  if (!_coupleable_neighbor)
1311  return var->uDotDot();
1312  return var->uDotDotNeighbor();
1313 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
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:1713
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1520
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledVectorDotDotDu()

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

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

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

Definition at line 1364 of file Coupleable.C.

1365 {
1366  const auto * var = getVectorVar(var_name, comp);
1367  if (!var)
1368  {
1370  return _default_value_zero;
1371  }
1373 
1374  if (!_coupleable_neighbor)
1375  return var->duDotDotDu();
1376  return var->duDotDotDuNeighbor();
1377 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1474
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:1713
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledVectorDotDotOld()

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

Old second time derivative of a coupled vector variable.

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

Definition at line 1332 of file Coupleable.C.

1333 {
1334  const auto * var = getVectorVar(var_name, comp);
1335  if (!var)
1336  {
1339  }
1341 
1342  if (!_coupleable_neighbor)
1343  return var->uDotDotOld();
1344  return var->uDotDotOldNeighbor();
1345 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
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:1713
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1520
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledVectorDotDu()

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

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

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

Definition at line 1348 of file Coupleable.C.

1349 {
1350  const auto * var = getVectorVar(var_name, comp);
1351  if (!var)
1352  {
1354  return _default_value_zero;
1355  }
1357 
1358  if (!_coupleable_neighbor)
1359  return var->duDotDu();
1360  return var->duDotDuNeighbor();
1361 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1474
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:1713
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledVectorDotOld()

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

Old time derivative of a coupled vector variable.

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

Definition at line 1316 of file Coupleable.C.

1317 {
1318  const auto * var = getVectorVar(var_name, comp);
1319  if (!var)
1320  {
1323  }
1325 
1326  if (!_coupleable_neighbor)
1327  return var->uDotOld();
1328  return var->uDotOldNeighbor();
1329 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
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:1713
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1520
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledVectorGradient()

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

Returns gradient of a coupled vector variable.

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

Definition at line 1640 of file Coupleable.C.

1641 {
1642  const auto * var = getVectorVar(var_name, comp);
1643  if (!var)
1644  {
1646  return _default_vector_gradient;
1647  }
1649 
1650  if (!_coupleable_neighbor)
1651  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
1652  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
1653 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1523
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledVectorGradientOld()

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

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

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

Definition at line 1656 of file Coupleable.C.

1657 {
1658  const auto * var = getVectorVar(var_name, comp);
1659  if (!var)
1660  {
1662  return _default_vector_gradient;
1663  }
1665 
1666  if (!_coupleable_neighbor)
1667  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
1668  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
1669 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1523
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledVectorGradientOlder()

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

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

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

Definition at line 1672 of file Coupleable.C.

1673 {
1674  const auto * var = getVectorVar(var_name, comp);
1675  if (!var)
1676  {
1678  return _default_vector_gradient;
1679  }
1681 
1682  if (!_coupleable_neighbor)
1683  return var->gradSlnOlder();
1684  return var->gradSlnOlderNeighbor();
1685 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1523
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:1713
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ coupledVectorHelper()

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

Definition at line 1703 of file Coupleable.h.

1704  {
1705  const auto components = coupledComponents(var_name);
1706  std::vector<T> vals(components);
1707  for (MooseIndex(components) comp = 0; comp < components; ++comp)
1708  vals[comp] = func(comp);
1709  return vals;
1710  }
unsigned int coupledComponents(const std::string &var_name) const
Number of coupled components.
Definition: Coupleable.C:188

◆ coupledVectorTagArrayDofValue()

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

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

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

Definition at line 813 of file Coupleable.C.

816 {
817  return vectorTagDofValueHelper<RealEigenVector>(var_name, tag_name, comp);
818 }

◆ coupledVectorTagArrayGradient() [1/2]

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

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

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

Definition at line 719 of file Coupleable.C.

Referenced by coupledVectorTagArrayGradient(), and coupledVectorTagArrayGradients().

722 {
723  const auto * var = getArrayVar(var_names, index);
724  if (!var)
725  mooseError(var_names, ": invalid variable name for coupledVectorTagArrayGradient");
727 
728  if (!_c_fe_problem.vectorTagExists(tag))
729  mooseError("Attempting to couple to vector tag with ID ",
730  tag,
731  "in ",
732  _c_name,
733  ", but a vector tag with that ID does not exist");
734 
735  const_cast<Coupleable *>(this)->addFEVariableCoupleableVectorTag(tag);
736 
737  return var->vectorTagGradient(tag);
738 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1414
void addFEVariableCoupleableVectorTag(TagID tag)
Definition: Coupleable.h:113
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1409
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:201
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:49
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:336

◆ coupledVectorTagArrayGradient() [2/2]

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

Definition at line 741 of file Coupleable.C.

744 {
745  if (!_c_parameters.isParamValid(tag_name))
746  mooseError("Tag name parameter '", tag_name, "' is invalid");
747 
748  TagName tagname = _c_parameters.get<TagName>(tag_name);
749  if (!_c_fe_problem.vectorTagExists(tagname))
750  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
751 
752  TagID tag = _c_fe_problem.getVectorTagID(tagname);
753  return coupledVectorTagArrayGradient(var_names, tag, index);
754 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:203
unsigned int TagID
Definition: MooseTypes.h:210
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
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:1414
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:719
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:201
const InputParameters & _c_parameters
Definition: Coupleable.h:1406
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledVectorTagArrayGradients() [1/2]

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

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

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

Definition at line 2650 of file Coupleable.C.

Referenced by coupledVectorTagArrayGradients().

2651 {
2652  auto func = [this, &var_names, &tag](unsigned int index)
2653  { return &coupledVectorTagArrayGradient(var_names, tag, index); };
2654  return coupledVectorHelper<const ArrayVariableGradient *>(var_names, func);
2655 }
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:719

◆ coupledVectorTagArrayGradients() [2/2]

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

Definition at line 2658 of file Coupleable.C.

2660 {
2661  if (!_c_parameters.isParamValid(tag_name))
2662  mooseError("Tag name parameter '", tag_name, "' is invalid");
2663 
2664  TagName tagname = _c_parameters.get<TagName>(tag_name);
2665  if (!_c_fe_problem.vectorTagExists(tagname))
2666  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2667 
2668  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2669  return coupledVectorTagArrayGradients(var_names, tag);
2670 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:203
unsigned int TagID
Definition: MooseTypes.h:210
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
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:1414
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:201
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:2650
const InputParameters & _c_parameters
Definition: Coupleable.h:1406
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledVectorTagArrayValue() [1/2]

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

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

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

Definition at line 665 of file Coupleable.C.

Referenced by coupledVectorTagArrayValues().

668 {
669  return vectorTagValueHelper<RealEigenVector>(var_names, tag, index);
670 }

◆ coupledVectorTagArrayValue() [2/2]

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

Definition at line 673 of file Coupleable.C.

676 {
677  return vectorTagValueHelper<RealEigenVector>(var_names, tag_name, index);
678 }

◆ coupledVectorTagArrayValues() [1/2]

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

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

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

Definition at line 2604 of file Coupleable.C.

Referenced by coupledVectorTagArrayValues().

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

◆ coupledVectorTagArrayValues() [2/2]

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

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.vectorTagExists(tagname))
2620  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2621 
2622  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2623  return coupledVectorTagArrayValues(var_names, tag);
2624 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:203
unsigned int TagID
Definition: MooseTypes.h:210
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
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:2604
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1414
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:201
const InputParameters & _c_parameters
Definition: Coupleable.h:1406
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledVectorTagDofValue() [1/2]

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

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

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

Definition at line 797 of file Coupleable.C.

Referenced by coupledVectorTagDofValues().

800 {
801  return vectorTagDofValueHelper<Real>(var_name, tag, comp);
802 }

◆ coupledVectorTagDofValue() [2/2]

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

Definition at line 805 of file Coupleable.C.

808 {
809  return vectorTagDofValueHelper<Real>(var_name, tag_name, comp);
810 }

◆ coupledVectorTagDofValues() [1/2]

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

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

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

Definition at line 2673 of file Coupleable.C.

Referenced by coupledVectorTagDofValues().

2674 {
2675  auto func = [this, &var_names, &tag](unsigned int comp)
2676  { return &coupledVectorTagDofValue(var_names, tag, comp); };
2677  return coupledVectorHelper<const VariableValue *>(var_names, func);
2678 }
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:797

◆ coupledVectorTagDofValues() [2/2]

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

Definition at line 2681 of file Coupleable.C.

2683 {
2684  if (!_c_parameters.isParamValid(tag_name))
2685  mooseError("Tag name parameter '", tag_name, "' is invalid");
2686 
2687  TagName tagname = _c_parameters.get<TagName>(tag_name);
2688  if (!_c_fe_problem.vectorTagExists(tagname))
2689  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2690 
2691  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2692  return coupledVectorTagDofValues(var_names, tag);
2693 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:203
unsigned int TagID
Definition: MooseTypes.h:210
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
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:1414
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:2673
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:201
const InputParameters & _c_parameters
Definition: Coupleable.h:1406
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledVectorTagGradient() [1/2]

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

Returns gradient of a coupled variable for a given tag.

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

Definition at line 681 of file Coupleable.C.

Referenced by coupledVectorTagGradient(), and coupledVectorTagGradients().

684 {
685  const auto * var = getVar(var_names, index);
686  if (!var)
687  mooseError(var_names, ": invalid variable name for coupledVectorTagGradient");
689 
690  if (!_c_fe_problem.vectorTagExists(tag))
691  mooseError("Attempting to couple to vector tag with ID ",
692  tag,
693  "in ",
694  _c_name,
695  ", but a vector tag with that ID does not exist");
696 
697  const_cast<Coupleable *>(this)->addFEVariableCoupleableVectorTag(tag);
698 
699  return var->vectorTagGradient(tag);
700 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1414
void addFEVariableCoupleableVectorTag(TagID tag)
Definition: Coupleable.h:113
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1409
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:201
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:49

◆ coupledVectorTagGradient() [2/2]

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

Definition at line 703 of file Coupleable.C.

706 {
707  if (!_c_parameters.isParamValid(tag_name))
708  mooseError("Tag name parameter '", tag_name, "' is invalid");
709 
710  TagName tagname = _c_parameters.get<TagName>(tag_name);
711  if (!_c_fe_problem.vectorTagExists(tagname))
712  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
713 
714  TagID tag = _c_fe_problem.getVectorTagID(tagname);
715  return coupledVectorTagGradient(var_names, tag, index);
716 }
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:681
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:203
unsigned int TagID
Definition: MooseTypes.h:210
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
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:1414
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:201
const InputParameters & _c_parameters
Definition: Coupleable.h:1406
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledVectorTagGradients() [1/2]

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

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

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

Definition at line 2627 of file Coupleable.C.

Referenced by coupledVectorTagGradients().

2628 {
2629  auto func = [this, &var_names, &tag](unsigned int index)
2630  { return &coupledVectorTagGradient(var_names, tag, index); };
2631  return coupledVectorHelper<const VariableGradient *>(var_names, func);
2632 }
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:681

◆ coupledVectorTagGradients() [2/2]

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

Definition at line 2635 of file Coupleable.C.

2637 {
2638  if (!_c_parameters.isParamValid(tag_name))
2639  mooseError("Tag name parameter '", tag_name, "' is invalid");
2640 
2641  TagName tagname = _c_parameters.get<TagName>(tag_name);
2642  if (!_c_fe_problem.vectorTagExists(tagname))
2643  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2644 
2645  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2646  return coupledVectorTagGradients(var_names, tag);
2647 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:203
unsigned int TagID
Definition: MooseTypes.h:210
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
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:2627
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1414
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:201
const InputParameters & _c_parameters
Definition: Coupleable.h:1406
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledVectorTagValue() [1/2]

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

Returns value of a coupled variable for a given tag.

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

Definition at line 649 of file Coupleable.C.

Referenced by coupledVectorTagValues().

652 {
653  return vectorTagValueHelper<Real>(var_names, tag, index);
654 }

◆ coupledVectorTagValue() [2/2]

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

Definition at line 657 of file Coupleable.C.

660 {
661  return vectorTagValueHelper<Real>(var_names, tag_name, index);
662 }

◆ coupledVectorTagValues() [1/2]

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

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

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

Definition at line 2581 of file Coupleable.C.

Referenced by coupledVectorTagValues().

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

◆ coupledVectorTagValues() [2/2]

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

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 coupledVectorTagValues(var_names, tag);
2601 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:203
unsigned int TagID
Definition: MooseTypes.h:210
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
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:1414
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:201
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:2581
const InputParameters & _c_parameters
Definition: Coupleable.h:1406
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ coupledVectorValue()

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

Returns value of a coupled vector variable.

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

Definition at line 854 of file Coupleable.C.

Referenced by coupledVectorValues().

855 {
856  const auto * var = getVectorVar(var_name, comp);
857  if (!var)
858  return *getDefaultVectorValue(var_name);
860 
862  {
863  if (_c_nodal)
864  return _c_is_implicit ? var->nodalValueArray() : var->nodalValueOldArray();
865  else
866  return _c_is_implicit ? var->sln() : var->slnOld();
867  }
868  else
869  {
870  if (_c_nodal)
871  // Since this is at a node, I don't feel like there should be any "neighbor" logic
872  return _c_is_implicit ? var->nodalValueArray() : var->nodalValueOldArray();
873  else
874  return _c_is_implicit ? var->slnNeighbor() : var->slnOldNeighbor();
875  }
876 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
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:392
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:1713

◆ coupledVectorValueOld()

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

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

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

Definition at line 1098 of file Coupleable.C.

Referenced by coupledVectorValuesOld().

1099 {
1100  const auto * var = getVectorVar(var_name, comp);
1101  if (!var)
1102  return *getDefaultVectorValue(var_name);
1104 
1105  if (_c_nodal)
1106  return (_c_is_implicit) ? var->nodalValueOldArray() : var->nodalValueOlderArray();
1107  if (!_coupleable_neighbor)
1108  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
1109  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
1110 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
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:392
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1444
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:1713

◆ coupledVectorValueOlder()

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

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

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

Definition at line 1113 of file Coupleable.C.

1114 {
1115  const auto * var = getVectorVar(var_name, comp);
1116  if (!var)
1117  return *getDefaultVectorValue(var_name);
1119 
1120  if (!_coupleable_neighbor)
1121  return var->slnOlder();
1122  return var->slnOlderNeighbor();
1123 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
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:392
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1713

◆ coupledVectorValues()

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

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

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

Definition at line 2545 of file Coupleable.C.

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

◆ coupledVectorValuesOld()

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

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

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

Definition at line 2733 of file Coupleable.C.

2734 {
2735  auto func = [this, &var_name](unsigned int comp)
2736  { return &coupledVectorValueOld(var_name, comp); };
2737  return coupledVectorHelper<const VectorVariableValue *>(var_name, func);
2738 }
virtual const VectorVariableValue & coupledVectorValueOld(const std::string &var_name, unsigned int comp=0) const
Returns an old value from previous time step of a coupled vector variable.
Definition: Coupleable.C:1098

◆ genericZeroGradient() [1/3]

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

Returns zero gradient templated with automatic differentiation boolean.

Returns
Reference to a const GenericVariableValue

◆ genericZeroGradient() [2/3]

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

Definition at line 2466 of file Coupleable.C.

2467 {
2468  return _grad_zero;
2469 }
const VariableGradient & _grad_zero
Zero gradient of a variable.
Definition: Coupleable.h:1500

◆ genericZeroGradient() [3/3]

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

Definition at line 2473 of file Coupleable.C.

2474 {
2475  return _ad_grad_zero;
2476 }
const MooseArray< ADRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:1501

◆ genericZeroSecond() [1/3]

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

Returns zero second derivative templated with automatic differentiation boolean.

Returns
Reference to a const GenericVariableValue

◆ genericZeroSecond() [2/3]

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

Definition at line 2480 of file Coupleable.C.

2481 {
2482  return _second_zero;
2483 }
const VariableSecond & _second_zero
Zero second derivative of a variable.
Definition: Coupleable.h:1507

◆ genericZeroSecond() [3/3]

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

Definition at line 2487 of file Coupleable.C.

2488 {
2489  return _ad_second_zero;
2490 }
const MooseArray< ADRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:1508

◆ genericZeroValue() [1/3]

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

Returns zero value templated with automatic differentiation boolean.

Returns
Reference to a const GenericVariableValue

◆ genericZeroValue() [2/3]

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

Definition at line 2452 of file Coupleable.C.

2453 {
2454  return _zero;
2455 }
const VariableValue & _zero
Zero value of a variable.
Definition: Coupleable.h:1495

◆ genericZeroValue() [3/3]

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

Definition at line 2459 of file Coupleable.C.

2460 {
2461  return _ad_zero;
2462 }
const MooseArray< ADReal > & _ad_zero
Definition: Coupleable.h:1497

◆ getADDefaultCurl()

const ADVectorVariableCurl & Coupleable::getADDefaultCurl ( ) const

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

Parameters
var_namethe name of the vector variable for which to retrieve a default value
Returns
Reference to a ADVectorVariableCurl containing zero entries for the default values

Definition at line 2423 of file Coupleable.C.

Referenced by adCoupledCurl().

2424 {
2426  return _ad_default_curl;
2427 }
MooseArray< ADRealVectorValue > _ad_default_curl
This will always be zero because the default values for optionally coupled vector variables is always...
Definition: Coupleable.h:1492
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ getADDefaultGradient()

const ADVariableGradient & Coupleable::getADDefaultGradient ( ) const

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

Parameters
var_namethe name of the variable for which to retrieve a default gradient
Returns
Reference to a ADVariableGradient containing zero entries for the default values

Definition at line 2402 of file Coupleable.C.

Referenced by adCoupledGradient(), and adCoupledGradientDot().

2403 {
2405  return _ad_default_gradient;
2406 }
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799
MooseArray< ADRealVectorValue > _ad_default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1480

◆ getADDefaultSecond()

const ADVariableSecond & Coupleable::getADDefaultSecond ( ) const

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

Parameters
var_namethe name of the variable for which to retrieve a default second derivative
Returns
Reference to a ADVariableSecond containing zero entries for the default values

Definition at line 2416 of file Coupleable.C.

Referenced by adCoupledSecond().

2417 {
2419  return _ad_default_second;
2420 }
MooseArray< ADRealTensorValue > _ad_default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1489
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ getADDefaultValue()

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

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

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

Definition at line 2371 of file Coupleable.C.

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

2372 {
2373  auto default_value_it = _ad_default_value.find(var_name);
2374  if (default_value_it == _ad_default_value.end())
2375  {
2376  auto value = std::make_unique<ADVariableValue>(_coupleable_max_qps,
2378  default_value_it = _ad_default_value.insert(std::make_pair(var_name, std::move(value))).first;
2379  }
2380 
2381  return default_value_it->second.get();
2382 }
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< ADReal > > > _ad_default_value
Will hold the default value for optional coupled variables for automatic differentiation.
Definition: Coupleable.h:1457
const InputParameters & _c_parameters
Definition: Coupleable.h:1406
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ getADDefaultVectorGradient()

const ADVectorVariableGradient & Coupleable::getADDefaultVectorGradient ( ) const

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

Parameters
var_namethe name of the vector variable for which to retrieve a default gradient
Returns
Reference to a ADVectorVariableGradient containing zero entries for the default values

Definition at line 2409 of file Coupleable.C.

Referenced by adCoupledVectorGradient().

2410 {
2413 }
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:1483
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ getADDefaultVectorValue()

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

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

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

Definition at line 2385 of file Coupleable.C.

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

2386 {
2387  auto default_value_it = _ad_default_vector_value.find(var_name);
2388  if (default_value_it == _ad_default_vector_value.end())
2389  {
2390  RealVectorValue default_vec;
2391  for (unsigned int i = 0; i < _c_parameters.numberDefaultCoupledValues(var_name); ++i)
2392  default_vec(i) = _c_parameters.defaultCoupledValue(var_name, i);
2393  auto value = std::make_unique<ADVectorVariableValue>(_coupleable_max_qps, default_vec);
2394  default_value_it =
2395  _ad_default_vector_value.insert(std::make_pair(var_name, std::move(value))).first;
2396  }
2397 
2398  return default_value_it->second.get();
2399 }
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:1468
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:1406
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ getArrayVar() [1/2]

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

◆ getArrayVar() [2/2]

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

Extract pointer to a coupled array variable.

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

Definition at line 359 of file Coupleable.C.

360 {
361  return getVarHelper<ArrayMooseVariable>(var_name, comp);
362 }

◆ getCoupledArrayMooseVars()

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

Get the list of array coupled variables.

Returns
The list of array coupled variables

Definition at line 108 of file Coupleable.h.

109  {
111  }
std::vector< ArrayMooseVariable * > _coupled_array_moose_vars
Vector of array coupled variables.
Definition: Coupleable.h:1432

◆ getCoupledMooseVars()

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

◆ getCoupledStandardMooseVars()

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

Get the list of standard coupled variables.

Returns
The list of standard coupled variables

Definition at line 90 of file Coupleable.h.

91  {
93  }
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Definition: Coupleable.h:1426

◆ getCoupledVars()

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

Get the list of coupled variables.

Returns
The list of coupled variables

Definition at line 72 of file Coupleable.h.

Referenced by InitialConditionBase::InitialConditionBase().

73  {
74  return _coupled_vars;
75  }
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1420

◆ getCoupledVectorMooseVars()

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

Get the list of vector coupled variables.

Returns
The list of vector coupled variables

Definition at line 99 of file Coupleable.h.

100  {
102  }
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
Definition: Coupleable.h:1429

◆ getDefaultArrayValue()

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

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

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

Definition at line 427 of file Coupleable.C.

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

428 {
429  auto default_value_it = _default_array_value.find(var_name);
430  if (default_value_it == _default_array_value.end())
431  {
432  auto value = std::make_unique<ArrayVariableValue>(_coupleable_max_qps);
433  for (unsigned int qp = 0; qp < _coupleable_max_qps; ++qp)
434  {
435  auto n = _c_parameters.numberDefaultCoupledValues(var_name);
436  (*value)[qp].resize(n);
437  for (unsigned int i = 0; i < n; ++i)
438  (*value)[qp](i) = _c_parameters.defaultCoupledValue(var_name, i);
439  }
440  default_value_it =
441  _default_array_value.insert(std::make_pair(var_name, std::move(value))).first;
442  }
443 
444  return default_value_it->second.get();
445 }
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:1406
std::unordered_map< std::string, std::unique_ptr< ArrayVariableValue > > _default_array_value
Will hold the default value for optional array coupled variables.
Definition: Coupleable.h:1464
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ getDefaultFunctor()

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

◆ getDefaultNodalValue() [1/3]

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

Definition at line 457 of file Coupleable.C.

458 {
459  auto && default_variable_value = getDefaultVectorValue(var_name);
460  return *default_variable_value->data();
461 }
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:392

◆ getDefaultNodalValue() [2/3]

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

Definition at line 465 of file Coupleable.C.

466 {
467  auto && default_variable_value = getDefaultArrayValue(var_name);
468  return *default_variable_value->data();
469 }
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:427

◆ getDefaultNodalValue() [3/3]

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

Get nodal default value.

Definition at line 449 of file Coupleable.C.

450 {
451  auto && default_variable_value = getDefaultValue(var_name, comp);
452  return *default_variable_value->data();
453 }
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:365

◆ getDefaultValue()

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

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

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

Definition at line 365 of file Coupleable.C.

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

366 {
367  // make sure we don't access values that were not provided
368  checkComponent(_obj, comp, _c_parameters.numberDefaultCoupledValues(var_name), var_name);
369 
370  auto default_value_it = _default_value.find(var_name);
371  if (default_value_it == _default_value.end())
372  {
373  _default_value[var_name].emplace_back(std::make_unique<VariableValue>(
375  for (unsigned int j = 1; j < _c_parameters.numberDefaultCoupledValues(var_name); ++j)
376  _default_value[var_name].emplace_back(std::make_unique<VariableValue>(
378  default_value_it = _default_value.find(var_name);
379  }
380 
381  const auto & default_value_vec = default_value_it->second;
382  const auto n_default_vals = default_value_vec.size();
383  if (comp >= n_default_vals)
384  mooseError("Requested comp ",
385  comp,
386  " is equal to or greater than the number of default values ",
387  n_default_vals);
388  return default_value_vec[comp].get();
389 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
unsigned int numberDefaultCoupledValues(const std::string &coupling_name) const
Get the number of defaulted coupled value entries.
Real defaultCoupledValue(const std::string &coupling_name, unsigned int i=0) const
Get the default value for an optionally coupled variable.
const MooseObject *const _obj
Definition: Coupleable.h:1814
void checkComponent(const MooseObject *obj, unsigned int comp, unsigned int bound, const std::string &var_name)
Definition: Coupleable.C:208
std::unordered_map< std::string, std::vector< std::unique_ptr< VariableValue > > > _default_value
Will hold the default value for optional coupled variables.
Definition: Coupleable.h:1454
const InputParameters & _c_parameters
Definition: Coupleable.h:1406
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ getDefaultVectorValue()

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

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

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

Definition at line 392 of file Coupleable.C.

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

393 {
394  auto default_value_it = _default_vector_value.find(var_name);
395  if (default_value_it == _default_vector_value.end())
396  {
397  auto value = std::make_unique<VectorVariableValue>(_coupleable_max_qps, 0);
398  bool already_warned = false;
399  for (unsigned int qp = 0; qp < _coupleable_max_qps; ++qp)
400  for (const auto i : make_range(Moose::dim))
401  {
402  try
403  {
404  (*value)[qp](i) = _c_parameters.defaultCoupledValue(var_name, i);
405  }
406  catch (const std::out_of_range &)
407  {
408  if (!already_warned)
409  mooseWarning(
410  "You supplied less than 3 arguments for the default vector value for variable ",
411  var_name,
412  ". Did you accidently leave something off? We are going to assign 0s, assuming "
413  "this "
414  "was intentional.");
415  already_warned = true;
416  (*value)[qp](i) = 0;
417  }
418  }
419  default_value_it =
420  _default_vector_value.insert(std::make_pair(var_name, std::move(value))).first;
421  }
422 
423  return default_value_it->second.get();
424 }
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:357
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:159
std::unordered_map< std::string, std::unique_ptr< VectorVariableValue > > _default_vector_value
Will hold the default value for optional vector coupled variables.
Definition: Coupleable.h:1461
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
Real defaultCoupledValue(const std::string &coupling_name, unsigned int i=0) const
Get the default value for an optionally coupled variable.
IntRange< T > make_range(T beg, T end)
const InputParameters & _c_parameters
Definition: Coupleable.h:1406
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1799

◆ getFEVar()

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

Deprecated method.

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

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

Definition at line 298 of file Coupleable.C.

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

◆ getFEVariableCoupleableMatrixTags() [1/2]

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

Definition at line 119 of file Coupleable.h.

119 { return _fe_coupleable_matrix_tags; }
std::set< TagID > _fe_coupleable_matrix_tags
Definition: Coupleable.h:1809

◆ getFEVariableCoupleableMatrixTags() [2/2]

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

Definition at line 126 of file Coupleable.h.

127  {
129  }
std::set< TagID > _fe_coupleable_matrix_tags
Definition: Coupleable.h:1809

◆ getFEVariableCoupleableVectorTags() [1/2]

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

◆ getFEVariableCoupleableVectorTags() [2/2]

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

Definition at line 121 of file Coupleable.h.

122  {
124  }
std::set< TagID > _fe_coupleable_vector_tags
Definition: Coupleable.h:1807

◆ getFieldVar() [1/2]

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

◆ getFieldVar() [2/2]

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

Definition at line 306 of file Coupleable.C.

307 {
308  return getVarHelper<MooseVariableFieldBase>(var_name, comp);
309 }

◆ getVar() [1/2]

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

Extract pointer to a coupled variable.

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

Definition at line 318 of file Coupleable.C.

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

319 {
320  return const_cast<MooseVariable *>(getVarHelper<MooseVariable>(var_name, comp));
321 }

◆ getVar() [2/2]

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

Extract pointer to a coupled variable.

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

Definition at line 342 of file Coupleable.C.

343 {
344  return getVarHelper<MooseVariable>(var_name, comp);
345 }

◆ getVarHelper() [1/2]

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

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

Definition at line 1972 of file Coupleable.h.

1973 {
1974  return const_cast<Coupleable *>(this)->getVarHelper<T>(var_name, comp);
1975 }
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:49

◆ getVarHelper() [2/2]

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

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

Definition at line 1918 of file Coupleable.h.

1919 {
1920  const auto var_name = _c_parameters.checkForRename(var_name_in);
1921  auto name_to_use = var_name;
1922 
1923  // First check for supplied name
1924  if (!checkVar(var_name, comp, 0))
1925  {
1926  // See if there is an associated deprecated name that the user may have used instead
1927  auto it = _new_to_deprecated_coupled_vars.find(var_name);
1928  if (it == _new_to_deprecated_coupled_vars.end())
1929  return nullptr;
1930  else
1931  {
1932  auto deprecated_name = it->second;
1933  if (checkVar(deprecated_name, comp, 0))
1934  name_to_use = deprecated_name;
1935  else
1936  return nullptr;
1937  }
1938  }
1939 
1940  auto coupled_vars_it = _coupled_vars.find(name_to_use);
1941 
1942  mooseAssert(coupled_vars_it != _coupled_vars.end(),
1943  "Trying to get a coupled var " << name_to_use << " that doesn't exist");
1944 
1945  if (auto coupled_var = dynamic_cast<T *>(coupled_vars_it->second[comp]))
1946  return coupled_var;
1947  else
1948  {
1949  for (auto & var : _coupled_standard_moose_vars)
1950  if (var->name() == name_to_use)
1951  mooseError("The named variable is a standard variable, try a "
1952  "'coupled[Value/Gradient/Dot/etc]...' function instead");
1953  for (auto & var : _coupled_vector_moose_vars)
1954  if (var->name() == name_to_use)
1955  mooseError("The named variable is a vector variable, try a "
1956  "'coupledVector[Value/Gradient/Dot/etc]...' function instead");
1957  for (auto & var : _coupled_array_moose_vars)
1958  if (var->name() == name_to_use)
1959  mooseError("The named variable is an array variable, try a "
1960  "'coupledArray[Value/Gradient/Dot/etc]...' function instead");
1961  for (auto & var : _coupled_fv_moose_vars)
1962  if (var->name() == name_to_use)
1963  mooseError("The named variable is a finite volume variable, which the coupled[...] routine "
1964  "used does not support. Try using the functor system routines instead.");
1965  mooseError(
1966  "Variable '", name_to_use, "' is of a different C++ type than you tried to fetch it as.");
1967  }
1968 }
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1420
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
std::vector< ArrayMooseVariable * > _coupled_array_moose_vars
Vector of array coupled variables.
Definition: Coupleable.h:1432
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Definition: Coupleable.h:1426
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
Definition: Coupleable.h:1429
std::vector< MooseVariableField< Real > * > _coupled_fv_moose_vars
Vector of all finite volume coupled variables.
Definition: Coupleable.h:1435
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:239
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:1406
const std::unordered_map< std::string, std::string > & _new_to_deprecated_coupled_vars
map from new to deprecated variable names
Definition: Coupleable.h:1438

◆ getVectorVar() [1/2]

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

Extract pointer to a coupled vector variable.

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

Definition at line 324 of file Coupleable.C.

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

325 {
326  auto * const var =
327  const_cast<VectorMooseVariable *>(getVarHelper<VectorMooseVariable>(var_name, comp));
328 
329  if (_c_nodal && var && var->feType().family != LAGRANGE_VEC)
330  mooseError(_c_name, ": Only LAGRANGE_VEC vector variables are defined at nodes");
331 
332  return var;
333 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
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:323
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1409

◆ getVectorVar() [2/2]

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

Extract pointer to a coupled vector variable.

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

Definition at line 348 of file Coupleable.C.

349 {
350  const auto * const var = getVarHelper<VectorMooseVariable>(var_name, comp);
351 
352  if (_c_nodal && var && var->feType().family != LAGRANGE_VEC)
353  mooseError(_c_name, ": Only LAGRANGE_VEC vector variables are defined at nodes");
354 
355  return var;
356 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
LAGRANGE_VEC
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1409

◆ getWritableCoupledVariables()

auto& Coupleable::getWritableCoupledVariables ( ) const
inline

returns a reference to the set of writable coupled variables

Definition at line 134 of file Coupleable.h.

Referenced by hasWritableCoupledVariables().

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

◆ hasWritableCoupledVariables()

bool Coupleable::hasWritableCoupledVariables ( ) const
inline

Checks whether the object has any writable coupled variables.

Definition at line 139 of file Coupleable.h.

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

◆ isCoupled()

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

Returns true if a variables has been coupled as name.

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

Definition at line 159 of file Coupleable.C.

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

160 {
161  const auto var_name = _c_parameters.checkForRename(var_name_in);
162 
163  auto it = _coupled_vars.find(var_name);
164  if (it != _coupled_vars.end())
165  return (i < it->second.size());
166  else
167  {
168  // Make sure the user originally requested this value in the InputParameter syntax
169  if (!_c_parameters.hasCoupledValue(var_name))
171  ": The coupled variable \"",
172  var_name,
173  "\" was never added to this object's "
174  "InputParameters, please double-check your "
175  "spelling");
176 
177  return false;
178  }
179 }
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:1420
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1409
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:1406

◆ isCoupledConstant()

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

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

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

Definition at line 182 of file Coupleable.C.

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

183 {
184  return _c_parameters.hasDefaultCoupledValue(var_name);
185 }
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:1406

◆ kokkosCoupledDot()

Moose::Kokkos::VariableValue Coupleable::kokkosCoupledDot ( const std::string &  var_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledDotDu()

Moose::Kokkos::Scalar<const Real> Coupleable::kokkosCoupledDotDu ( const std::string &  var_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledDots()

Moose::Kokkos::VariableValue Coupleable::kokkosCoupledDots ( const std::string &  var_name)

◆ kokkosCoupledGradient()

Moose::Kokkos::VariableGradient Coupleable::kokkosCoupledGradient ( const std::string &  var_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledGradientOld()

Moose::Kokkos::VariableGradient Coupleable::kokkosCoupledGradientOld ( const std::string &  var_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledGradientOlder()

Moose::Kokkos::VariableGradient Coupleable::kokkosCoupledGradientOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledGradients()

Moose::Kokkos::VariableGradient Coupleable::kokkosCoupledGradients ( const std::string &  var_name)

◆ kokkosCoupledGradientsOld()

Moose::Kokkos::VariableGradient Coupleable::kokkosCoupledGradientsOld ( const std::string &  var_name)

◆ kokkosCoupledGradientsOlder()

Moose::Kokkos::VariableGradient Coupleable::kokkosCoupledGradientsOlder ( const std::string &  var_name)

◆ kokkosCoupledNodalDot()

Moose::Kokkos::VariableNodalValue Coupleable::kokkosCoupledNodalDot ( const std::string &  var_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledNodalDots()

Moose::Kokkos::VariableNodalValue Coupleable::kokkosCoupledNodalDots ( const std::string &  var_name)

◆ kokkosCoupledNodalValue()

Moose::Kokkos::VariableNodalValue Coupleable::kokkosCoupledNodalValue ( const std::string &  var_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledNodalValueOld()

Moose::Kokkos::VariableNodalValue Coupleable::kokkosCoupledNodalValueOld ( const std::string &  var_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledNodalValueOlder()

Moose::Kokkos::VariableNodalValue Coupleable::kokkosCoupledNodalValueOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledNodalValues()

Moose::Kokkos::VariableNodalValue Coupleable::kokkosCoupledNodalValues ( const std::string &  var_name)

◆ kokkosCoupledNodalValuesOld()

Moose::Kokkos::VariableNodalValue Coupleable::kokkosCoupledNodalValuesOld ( const std::string &  var_name)

◆ kokkosCoupledNodalValuesOlder()

Moose::Kokkos::VariableNodalValue Coupleable::kokkosCoupledNodalValuesOlder ( const std::string &  var_name)

◆ kokkosCoupledValue()

Moose::Kokkos::VariableValue Coupleable::kokkosCoupledValue ( const std::string &  var_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledValueOld()

Moose::Kokkos::VariableValue Coupleable::kokkosCoupledValueOld ( const std::string &  var_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledValueOlder()

Moose::Kokkos::VariableValue Coupleable::kokkosCoupledValueOlder ( const std::string &  var_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledValues()

Moose::Kokkos::VariableValue Coupleable::kokkosCoupledValues ( const std::string &  var_name)

◆ kokkosCoupledValuesOld()

Moose::Kokkos::VariableValue Coupleable::kokkosCoupledValuesOld ( const std::string &  var_name)

◆ kokkosCoupledValuesOlder()

Moose::Kokkos::VariableValue Coupleable::kokkosCoupledValuesOlder ( const std::string &  var_name)

◆ kokkosCoupledVectorTagGradient()

Moose::Kokkos::VariableGradient Coupleable::kokkosCoupledVectorTagGradient ( const std::string &  var_name,
const std::string &  tag_param_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledVectorTagGradientByName()

Moose::Kokkos::VariableGradient Coupleable::kokkosCoupledVectorTagGradientByName ( const std::string &  var_name,
const std::string &  tag_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledVectorTagGradients()

Moose::Kokkos::VariableGradient Coupleable::kokkosCoupledVectorTagGradients ( const std::string &  var_name,
const std::string &  tag_param_name 
)

◆ kokkosCoupledVectorTagGradientsByName()

Moose::Kokkos::VariableGradient Coupleable::kokkosCoupledVectorTagGradientsByName ( const std::string &  var_name,
const std::string &  tag_name 
)

◆ kokkosCoupledVectorTagNodalValue()

Moose::Kokkos::VariableNodalValue Coupleable::kokkosCoupledVectorTagNodalValue ( const std::string &  var_name,
const std::string &  tag_param_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledVectorTagNodalValueByName()

Moose::Kokkos::VariableNodalValue Coupleable::kokkosCoupledVectorTagNodalValueByName ( const std::string &  var_name,
const std::string &  tag_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledVectorTagNodalValues()

Moose::Kokkos::VariableNodalValue Coupleable::kokkosCoupledVectorTagNodalValues ( const std::string &  var_name,
const std::string &  tag_param_name 
)

◆ kokkosCoupledVectorTagNodalValuesByName()

Moose::Kokkos::VariableNodalValue Coupleable::kokkosCoupledVectorTagNodalValuesByName ( const std::string &  var_name,
const std::string &  tag_name 
)

◆ kokkosCoupledVectorTagValue()

Moose::Kokkos::VariableValue Coupleable::kokkosCoupledVectorTagValue ( const std::string &  var_name,
const std::string &  tag_param_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledVectorTagValueByName()

Moose::Kokkos::VariableValue Coupleable::kokkosCoupledVectorTagValueByName ( const std::string &  var_name,
const std::string &  tag_name,
unsigned int  comp = 0 
)

◆ kokkosCoupledVectorTagValues()

Moose::Kokkos::VariableValue Coupleable::kokkosCoupledVectorTagValues ( const std::string &  var_name,
const std::string &  tag_param_name 
)

◆ kokkosCoupledVectorTagValuesByName()

Moose::Kokkos::VariableValue Coupleable::kokkosCoupledVectorTagValuesByName ( const std::string &  var_name,
const std::string &  tag_name 
)

◆ kokkosCoupledVectorTagVariable()

Moose::Kokkos::Variable Coupleable::kokkosCoupledVectorTagVariable ( const std::string &  var_name,
const std::string &  tag_name,
unsigned int  comp 
)
private

◆ kokkosCoupledVectorTagVariables()

Moose::Kokkos::Variable Coupleable::kokkosCoupledVectorTagVariables ( const std::string &  var_name,
const std::string &  tag_name 
)
private

◆ kokkosZeroGradient()

Moose::Kokkos::VariableGradient Coupleable::kokkosZeroGradient ( )

◆ kokkosZeroNodalValue()

Moose::Kokkos::VariableNodalValue Coupleable::kokkosZeroNodalValue ( )

◆ kokkosZeroValue()

Moose::Kokkos::VariableValue Coupleable::kokkosZeroValue ( )

◆ kokkosZeroVariable()

Moose::Kokkos::Variable Coupleable::kokkosZeroVariable ( )
private

◆ requestStates()

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

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

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

Definition at line 578 of file Coupleable.C.

581 {
582  auto var =
583  const_cast<MooseVariableField<T> *>(getVarHelper<MooseVariableField<T>>(var_name, comp));
584  if (!var)
585  mooseError(var_name, ": invalid variable name for tag coupling");
586 
587  auto & var_sys = var->sys();
588  if (tag_name == Moose::OLD_SOLUTION_TAG)
589  var_sys.needSolutionState(1);
590  else if (tag_name == Moose::OLDER_SOLUTION_TAG)
591  var_sys.needSolutionState(2);
592 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
const TagName OLDER_SOLUTION_TAG
Definition: MooseTypes.C:27
const TagName OLD_SOLUTION_TAG
Definition: MooseTypes.C:26

◆ validateExecutionerType()

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

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

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

Definition at line 2148 of file Coupleable.C.

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

2149 {
2150  if (!_c_fe_problem.isTransient())
2152  ": Calling \"",
2153  fn_name,
2154  "\" on variable \"",
2155  name,
2156  "\" when using a \"Steady\" executioner is not allowed. This value is available "
2157  "only in transient simulations.");
2158 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1414
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1409
virtual bool isTransient() const override

◆ vectorTagDofValueHelper() [1/2]

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

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

Definition at line 758 of file Coupleable.C.

761 {
762  const auto * var = getVarHelper<MooseVariableField<T>>(var_name, comp);
763  if (!var)
764  mooseError(var_name, ": invalid variable name for coupledVectorTagDofValue");
766 
767  const_cast<Coupleable *>(this)->addFEVariableCoupleableVectorTag(tag);
768 
769  return var->vectorTagDofValue(tag);
770 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
void addFEVariableCoupleableVectorTag(TagID tag)
Definition: Coupleable.h:113
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:49

◆ vectorTagDofValueHelper() [2/2]

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

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

Definition at line 774 of file Coupleable.C.

777 {
778  if (!_c_parameters.isParamValid(tag_param_name))
779  mooseError("Tag name parameter '", tag_param_name, "' is invalid");
780 
781  const TagName tag_name = MooseUtils::toUpper(_c_parameters.get<TagName>(tag_param_name));
782 
783  const bool older_state_tag = _older_state_tags.count(tag_name);
784  if (older_state_tag)
785  // We may need to add solution states and create vector tags
786  const_cast<Coupleable *>(this)->requestStates<T>(var_name, tag_name, comp);
787 
788  if (!_c_fe_problem.vectorTagExists(tag_name))
789  mooseError("Tagged vector with tag name '", tag_name, "' does not exist");
790 
791  TagID tag = _c_fe_problem.getVectorTagID(tag_name);
792 
793  return vectorTagDofValueHelper<T>(var_name, tag, comp);
794 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:203
unsigned int TagID
Definition: MooseTypes.h:210
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
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:1414
std::string toUpper(std::string name)
Convert supplied string to upper case.
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:201
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:49
const InputParameters & _c_parameters
Definition: Coupleable.h:1406
const std::set< std::string > _older_state_tags
vector tag names for which we need to request older solution states from the system ...
Definition: Coupleable.h:1817
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ vectorTagValueHelper() [1/2]

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

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

Definition at line 552 of file Coupleable.C.

555 {
556  const auto * const var = getVarHelper<MooseVariableField<T>>(var_names, index);
557  if (!var)
558  mooseError(var_names, ": invalid variable name for coupledVectorTagValue");
560 
561  if (!_c_fe_problem.vectorTagExists(tag))
562  mooseError("Attempting to couple to vector tag with ID ",
563  tag,
564  "in ",
565  _c_name,
566  ", but a vector tag with that ID does not exist");
567 
568  const_cast<Coupleable *>(this)->addFEVariableCoupleableVectorTag(tag);
569 
570  if (_c_nodal)
571  return var->nodalVectorTagValue(tag);
572  else
573  return var->vectorTagValue(tag);
574 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1441
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1414
void addFEVariableCoupleableVectorTag(TagID tag)
Definition: Coupleable.h:113
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1409
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:201
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:49

◆ vectorTagValueHelper() [2/2]

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

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

Definition at line 596 of file Coupleable.C.

599 {
600  if (!_c_parameters.isParamValid(tag_param_name))
601  mooseError("Tag name parameter '", tag_param_name, "' is invalid");
602 
603  const TagName tag_name = MooseUtils::toUpper(_c_parameters.get<TagName>(tag_param_name));
604 
605  const bool older_state_tag = _older_state_tags.count(tag_name);
606  if (older_state_tag)
607  // We may need to add solution states and create vector tags
608  const_cast<Coupleable *>(this)->requestStates<T>(var_names, tag_name, index);
609 
610  if (!_c_fe_problem.vectorTagExists(tag_name))
611  mooseError("Tagged vector with tag name '", tag_name, "' does not exist");
612 
613  TagID tag = _c_fe_problem.getVectorTagID(tag_name);
614  return vectorTagValueHelper<T>(var_names, tag, index);
615 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:203
unsigned int TagID
Definition: MooseTypes.h:210
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
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:1414
std::string toUpper(std::string name)
Convert supplied string to upper case.
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:201
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:49
const InputParameters & _c_parameters
Definition: Coupleable.h:1406
const std::set< std::string > _older_state_tags
vector tag names for which we need to request older solution states from the system ...
Definition: Coupleable.h:1817
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ writableCoupledValue()

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

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

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

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

Definition at line 944 of file Coupleable.C.

945 {
946  mooseDeprecated("Coupleable::writableCoupledValue is deprecated, please use "
947  "Coupleable::writableVariable instead. ");
948 
949  // check if the variable exists
950  auto * const var = getVar(var_name, comp);
951  if (!var)
952  mooseError(
953  "Unable to create a writable reference for '", var_name, "', is it a constant expression?");
954 
955  // is the requested variable an AuxiliaryVariable?
956  if (!_c_fe_problem.getAuxiliarySystem().hasVariable(var->name()))
957  mooseError(
958  "'", var->name(), "' must be an auxiliary variable in Coupleable::writableCoupledValue");
959 
960  // check that the variable type (elemental/nodal) is compatible with the object type
961  const auto * aux = dynamic_cast<const AuxKernel *>(this);
962 
963  if (!aux)
964  mooseError("writableCoupledValue() can only be called from AuxKernels, but '",
965  _obj->name(),
966  "' is not an AuxKernel.");
967 
968  if (!aux->isNodal() && var->isNodal())
969  mooseError("The elemental AuxKernel '",
970  _obj->name(),
971  "' cannot obtain a writable reference to the nodal variable '",
972  var->name(),
973  "'.");
974 
975  // make sure only one object can access a variable
976  checkWritableVar(var);
977 
978  return const_cast<VariableValue &>(coupledValue(var_name, comp));
979 }
void checkWritableVar(MooseWritableVariable *var)
Checks that the passed in variable is only accessed writable by one object in a given subdomain...
Definition: Coupleable.C:982
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:318
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1414
virtual const VariableValue & coupledValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled variable.
Definition: Coupleable.C:527
const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:103
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:374
AuxiliarySystem & getAuxiliarySystem()
virtual bool hasVariable(const std::string &var_name) const
Query a system for a variable.
Definition: SystemBase.C:851
const MooseObject *const _obj
Definition: Coupleable.h:1814
OutputTools< Real >::VariableValue VariableValue
Definition: MooseTypes.h:315

◆ writableVariable()

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

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

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

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

Definition at line 908 of file Coupleable.C.

909 {
910  auto * var = getVarHelper<MooseWritableVariable>(var_name, comp);
911 
912  const auto * aux = dynamic_cast<const AuxKernel *>(this);
913  const auto * euo = dynamic_cast<const ElementUserObject *>(this);
914  const auto * nuo = dynamic_cast<const NodalUserObject *>(this);
915  const auto * nfc = dynamic_cast<const NodeFaceConstraint *>(this);
916  const auto * nec = dynamic_cast<const NodeElemConstraintBase *>(this);
917 
918  if (!aux && !euo && !nuo && !nfc && !nec)
919  mooseError("writableVariable() can only be called from AuxKernels, ElementUserObjects, "
920  "NodalUserObjects, NodeFaceConstraints, or NodeElemConstraints. '",
921  _obj->name(),
922  "' is none of those.");
923 
924  if (aux && !aux->isNodal() && var->isNodal())
925  mooseError("The elemental AuxKernel '",
926  _obj->name(),
927  "' cannot obtain a writable reference to the nodal variable '",
928  var->name(),
929  "'.");
930  if (euo && var->isNodal())
931  mooseError("The ElementUserObject '",
932  _obj->name(),
933  "' cannot obtain a writable reference to the nodal variable '",
934  var->name(),
935  "'.");
936 
937  // make sure only one object can access a variable
938  checkWritableVar(var);
939 
940  return *var;
941 }
void checkWritableVar(MooseWritableVariable *var)
Checks that the passed in variable is only accessed writable by one object in a given subdomain...
Definition: Coupleable.C:982
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
A user object that runs over all the nodes and does an aggregation step to compute a single value...
const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:103
A NodeFaceConstraint is used when you need to create constraints between two surfaces in a mesh...
const MooseObject *const _obj
Definition: Coupleable.h:1814
A NodeElemConstraintBase is used when you need to create constraints between a secondary node and a p...

Member Data Documentation

◆ _ad_default_curl

MooseArray<ADRealVectorValue> Coupleable::_ad_default_curl
mutableprotected

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

Definition at line 1492 of file Coupleable.h.

Referenced by getADDefaultCurl().

◆ _ad_default_gradient

MooseArray<ADRealVectorValue> Coupleable::_ad_default_gradient
mutableprotected

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

Definition at line 1480 of file Coupleable.h.

Referenced by getADDefaultGradient().

◆ _ad_default_second

MooseArray<ADRealTensorValue> Coupleable::_ad_default_second
mutableprotected

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

Definition at line 1489 of file Coupleable.h.

Referenced by getADDefaultSecond().

◆ _ad_default_value

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

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

Definition at line 1457 of file Coupleable.h.

Referenced by getADDefaultValue().

◆ _ad_default_vector_gradient

MooseArray<ADRealTensorValue> Coupleable::_ad_default_vector_gradient
mutableprotected

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

Definition at line 1483 of file Coupleable.h.

Referenced by getADDefaultVectorGradient().

◆ _ad_default_vector_value

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

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

Definition at line 1468 of file Coupleable.h.

Referenced by getADDefaultVectorValue().

◆ _ad_grad_zero

const MooseArray<ADRealVectorValue>& Coupleable::_ad_grad_zero
protected

Definition at line 1501 of file Coupleable.h.

Referenced by adZeroGradient().

◆ _ad_second_zero

const MooseArray<ADRealTensorValue>& Coupleable::_ad_second_zero
protected

Definition at line 1508 of file Coupleable.h.

Referenced by adZeroSecond().

◆ _ad_zero

const MooseArray<ADReal>& Coupleable::_ad_zero
protected

Definition at line 1497 of file Coupleable.h.

Referenced by adZeroValue().

◆ _c_allow_element_to_nodal_coupling

const bool Coupleable::_c_allow_element_to_nodal_coupling
protected

Definition at line 1447 of file Coupleable.h.

Referenced by checkVar().

◆ _c_coupled_scalar_vars

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

Scalar variables coupled into this object (for error checking)

Definition at line 1805 of file Coupleable.h.

Referenced by checkVar(), and Coupleable().

◆ _c_fe_problem

FEProblemBase& Coupleable::_c_fe_problem
protected

◆ _c_is_implicit

bool Coupleable::_c_is_implicit
protected

True if implicit value is required.

Definition at line 1444 of file Coupleable.h.

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

◆ _c_name

const std::string& Coupleable::_c_name
protected

◆ _c_nodal

bool Coupleable::_c_nodal
protected

◆ _c_parameters

const InputParameters& Coupleable::_c_parameters
protected

◆ _c_sys

const SystemBase* const Coupleable::_c_sys
protected

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

Definition at line 1417 of file Coupleable.h.

Referenced by coupled().

◆ _c_tid

THREAD_ID Coupleable::_c_tid
protected

◆ _c_type

const std::string& Coupleable::_c_type
protected

The type of the object this interface is part of.

Definition at line 1411 of file Coupleable.h.

◆ _coupleable_max_qps

unsigned int Coupleable::_coupleable_max_qps
private

◆ _coupleable_neighbor

bool Coupleable::_coupleable_neighbor
protected

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

Definition at line 1713 of file Coupleable.h.

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

◆ _coupled_array_moose_vars

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

◆ _coupled_fv_moose_vars

std::vector<MooseVariableField<Real> *> Coupleable::_coupled_fv_moose_vars
protected

Vector of all finite volume coupled variables.

Definition at line 1435 of file Coupleable.h.

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

◆ _coupled_moose_vars

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

◆ _coupled_standard_moose_vars

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

◆ _coupled_vars

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

Coupled vars whose values we provide.

Definition at line 1420 of file Coupleable.h.

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

◆ _coupled_vector_moose_vars

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

Vector of vector coupled variables.

Definition at line 1429 of file Coupleable.h.

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

◆ _default_array_gradient

ArrayVariableGradient Coupleable::_default_array_gradient
protected

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

Definition at line 1538 of file Coupleable.h.

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

◆ _default_array_value

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

Will hold the default value for optional array coupled variables.

Definition at line 1464 of file Coupleable.h.

Referenced by getDefaultArrayValue().

◆ _default_array_value_zero

ArrayVariableValue Coupleable::_default_array_value_zero
protected

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

Definition at line 1535 of file Coupleable.h.

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

◆ _default_div

VectorVariableDivergence Coupleable::_default_div
mutableprotected

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

Definition at line 1529 of file Coupleable.h.

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

◆ _default_gradient

VariableGradient Coupleable::_default_gradient
mutableprotected

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

Definition at line 1477 of file Coupleable.h.

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

◆ _default_second

VariableSecond Coupleable::_default_second
mutableprotected

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

Definition at line 1486 of file Coupleable.h.

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

◆ _default_value

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

Will hold the default value for optional coupled variables.

Definition at line 1454 of file Coupleable.h.

Referenced by getDefaultValue().

◆ _default_value_zero

VariableValue Coupleable::_default_value_zero
mutableprotected

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

Definition at line 1474 of file Coupleable.h.

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

◆ _default_vector_curl

VectorVariableCurl Coupleable::_default_vector_curl
mutableprotected

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

Definition at line 1526 of file Coupleable.h.

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

◆ _default_vector_gradient

VectorVariableGradient Coupleable::_default_vector_gradient
mutableprotected

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

Definition at line 1523 of file Coupleable.h.

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

◆ _default_vector_value

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

Will hold the default value for optional vector coupled variables.

Definition at line 1461 of file Coupleable.h.

Referenced by getDefaultVectorValue().

◆ _default_vector_value_zero

VectorVariableValue Coupleable::_default_vector_value_zero
mutableprotected

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

Definition at line 1520 of file Coupleable.h.

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

◆ _fe_coupleable_matrix_tags

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

◆ _fe_coupleable_vector_tags

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

◆ _grad_phi_zero

const VariablePhiGradient& Coupleable::_grad_phi_zero
protected

Zero gradient of trial function.

Definition at line 1504 of file Coupleable.h.

◆ _grad_zero

const VariableGradient& Coupleable::_grad_zero
protected

Zero gradient of a variable.

Definition at line 1500 of file Coupleable.h.

◆ _is_fv

const bool Coupleable::_is_fv
private

Whether the MooseObject is a finite volume object.

Definition at line 1812 of file Coupleable.h.

Referenced by checkVar().

◆ _kokkos_default_value_zero

const Real Coupleable::_kokkos_default_value_zero = 0
private

kokkos-related variables and methods

Definition at line 1827 of file Coupleable.h.

◆ _new_to_deprecated_coupled_vars

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

map from new to deprecated variable names

Definition at line 1438 of file Coupleable.h.

Referenced by getVarHelper().

◆ _obj

const MooseObject* const Coupleable::_obj
private

◆ _older_state_tags

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

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

Definition at line 1817 of file Coupleable.h.

Referenced by vectorTagDofValueHelper(), and vectorTagValueHelper().

◆ _optional_var_index

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

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

Definition at line 1802 of file Coupleable.h.

Referenced by Coupleable(), and coupled().

◆ _phi_zero

const VariablePhiValue& Coupleable::_phi_zero
protected

Definition at line 1496 of file Coupleable.h.

◆ _second_phi_zero

const VariablePhiSecond& Coupleable::_second_phi_zero
protected

Zero second derivative of a test function.

Definition at line 1510 of file Coupleable.h.

◆ _second_zero

const VariableSecond& Coupleable::_second_zero
protected

Zero second derivative of a variable.

Definition at line 1507 of file Coupleable.h.

◆ _vector_curl_zero

const VectorVariableCurl& Coupleable::_vector_curl_zero
protected

Zero value of the curl of a vector variable.

Definition at line 1514 of file Coupleable.h.

◆ _vector_zero

const VectorVariableValue& Coupleable::_vector_zero
protected

Zero value of a vector variable.

Definition at line 1512 of file Coupleable.h.

◆ _writable_coupled_variables

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

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

Definition at line 1821 of file Coupleable.h.

Referenced by checkWritableVar(), and getWritableCoupledVariables().

◆ _zero

const VariableValue& Coupleable::_zero
protected

Zero value of a variable.

Definition at line 1495 of file Coupleable.h.


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