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) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValuesByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradientByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradientsByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValuesByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagDofValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagDofValuesByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValues (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradient (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradients (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValues (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagDofValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagDofValues (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledValues (const std::string &var_name) const
 
Moose::Kokkos::VariableGradient kokkosCoupledGradient (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableGradient kokkosCoupledGradients (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledNodalValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledNodalValues (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledDofValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledDofValues (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledValuesOld (const std::string &var_name) const
 
Moose::Kokkos::VariableGradient kokkosCoupledGradientOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableGradient kokkosCoupledGradientsOld (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledNodalValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledNodalValuesOld (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledDofValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledDofValuesOld (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledValuesOlder (const std::string &var_name) const
 
Moose::Kokkos::VariableGradient kokkosCoupledGradientOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableGradient kokkosCoupledGradientsOlder (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledNodalValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledNodalValuesOlder (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledDofValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledDofValuesOlder (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledDot (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledDots (const std::string &var_name) const
 
Moose::Kokkos::VariableValue kokkosCoupledNodalDot (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledNodalDots (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagValuesByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledVectorTagGradientByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledVectorTagGradientsByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagNodalValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagNodalValuesByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagDofValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagDofValuesByName (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagValues (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledVectorTagGradient (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledVectorTagGradients (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagNodalValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagNodalValues (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagDofValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagDofValues (const std::string &var_name, const std::string &tag_param_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledValues (const std::string &var_name) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradient (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradients (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalValues (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledDofValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledDofValues (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledValuesOld (const std::string &var_name) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradientOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradientsOld (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalValuesOld (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledDofValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledDofValuesOld (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledValuesOlder (const std::string &var_name) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradientOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradientsOlder (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalValuesOlder (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledDofValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledDofValuesOlder (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledDot (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledDots (const std::string &var_name) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalDot (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalDots (const std::string &var_name) const
 
Moose::Kokkos::Scalar< const RealkokkosCoupledDotDu (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosZeroValue () const
 
Moose::Kokkos::VariableGradient kokkosZeroGradient () const
 
Moose::Kokkos::VariableValue kokkosZeroNodalValue () const
 

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)
 
std::vector< const MooseVariableFieldBase * > getFieldVars (const std::string &var_name) const
 
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...
 
template<typename T >
std::vector< const T * > getVarsHelper (const std::string &var_name) const
 Helper that can be used to retrieve all the component variables of 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) const
 
Moose::Kokkos::Variable kokkosCoupledVectorTagVariables (const std::string &var_name, const std::string &tag_name) const
 
Moose::Kokkos::Variable kokkosZeroVariable () const
 
template<>
const RealVectorValuegetDefaultNodalValue (const std::string &var_name, unsigned int) const
 
template<>
const RealEigenVector & getDefaultNodalValue (const std::string &var_name, unsigned int) const
 

Private Attributes

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

Member Enumeration Documentation

◆ FuncAge

enum Coupleable::FuncAge
strongprivate
Enumerator
Curr 
Old 
Older 

Definition at line 1590 of file Coupleable.h.

1591  {
1592  Curr,
1593  Old,
1594  Older,
1595  };

◆ VarType

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

Definition at line 1597 of file Coupleable.h.

1598  {
1599  Ignore,
1600  Gradient,
1601  Second,
1602  GradientDot,
1603  Dot,
1604  };

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:1444
std::vector< MooseArray< ADRealTensorValue > > _ad_second_zero
const VariableValue & _zero
Zero value of a variable.
Definition: Coupleable.h:1498
const VariablePhiGradient & _grad_phi_zero
Zero gradient of trial function.
Definition: Coupleable.h:1507
const VariablePhiSecond & _second_phi_zero
Zero second derivative of a test function.
Definition: Coupleable.h:1513
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:467
const VectorVariableValue & _vector_zero
Zero value of a vector variable.
Definition: Coupleable.h:1515
const VariableGradient & _grad_zero
Zero gradient of a variable.
Definition: Coupleable.h:1503
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1423
const MooseArray< ADRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:1504
const bool _is_fv
Whether the MooseObject is a finite volume object.
Definition: Coupleable.h:1831
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:1435
const VariableSecond & _second_zero
Zero second derivative of a variable.
Definition: Coupleable.h:1510
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:258
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:1450
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:1453
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:1840
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _c_coupled_scalar_vars
Scalar variables coupled into this object (for error checking)
Definition: Coupleable.h:1824
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:85
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:1429
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:1420
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1417
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
std::vector< VariablePhiGradient > _grad_phi_zero
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
Definition: Coupleable.h:1432
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:1412
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:1517
const MooseObject *const _obj
Definition: Coupleable.h:1833
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:1426
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
std::vector< VariablePhiValue > _phi_zero
std::vector< MooseVariableField< Real > * > _coupled_fv_moose_vars
Vector of all finite volume coupled variables.
Definition: Coupleable.h:1438
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:1414
const MooseArray< ADRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:1511
std::vector< VariableGradient > _grad_zero
const VariablePhiValue & _phi_zero
Definition: Coupleable.h:1499
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:1821
std::vector< VectorVariableValue > _vector_zero
const InputParameters & _c_parameters
Definition: Coupleable.h:1409
const MooseArray< ADReal > & _ad_zero
Definition: Coupleable.h:1500
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818
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:1712
unsigned int THREAD_ID
Definition: MooseTypes.h:237
const std::unordered_map< std::string, std::string > & _new_to_deprecated_coupled_vars
map from new to deprecated variable names
Definition: Coupleable.h:1441
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:1444
const VariableValue & _zero
Zero value of a variable.
Definition: Coupleable.h:1498
const VariablePhiGradient & _grad_phi_zero
Zero gradient of trial function.
Definition: Coupleable.h:1507
const VariablePhiSecond & _second_phi_zero
Zero second derivative of a test function.
Definition: Coupleable.h:1513
const VectorVariableValue & _vector_zero
Zero value of a vector variable.
Definition: Coupleable.h:1515
const VariableGradient & _grad_zero
Zero gradient of a variable.
Definition: Coupleable.h:1503
const MooseArray< ADRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:1504
const bool _is_fv
Whether the MooseObject is a finite volume object.
Definition: Coupleable.h:1831
const VariableSecond & _second_zero
Zero second derivative of a variable.
Definition: Coupleable.h:1510
const bool _c_allow_element_to_nodal_coupling
Definition: Coupleable.h:1450
THREAD_ID _c_tid
Thread ID of the thread using this object.
Definition: Coupleable.h:1453
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:1840
const SystemBase *const _c_sys
Pointer to the system object if the moose object this is an interface for has one.
Definition: Coupleable.h:1420
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1417
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1412
const VectorVariableCurl & _vector_curl_zero
Zero value of the curl of a vector variable.
Definition: Coupleable.h:1517
const MooseObject *const _obj
Definition: Coupleable.h:1833
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
const std::string & _c_type
The type of the object this interface is part of.
Definition: Coupleable.h:1414
const MooseArray< ADRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:1511
const VariablePhiValue & _phi_zero
Definition: Coupleable.h:1499
const InputParameters & _c_parameters
Definition: Coupleable.h:1409
const MooseArray< ADReal > & _ad_zero
Definition: Coupleable.h:1500
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818
const std::unordered_map< std::string, std::string > & _new_to_deprecated_coupled_vars
map from new to deprecated variable names
Definition: Coupleable.h:1441

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

1795 {
1796  const auto * var = getVectorVar(var_name, comp);
1797 
1798  if (!var)
1799  return getADDefaultCurl();
1801 
1802  if (!_c_is_implicit)
1803  mooseError("Not implemented");
1804 
1805  if (!_coupleable_neighbor)
1806  return var->adCurlSln();
1807  return var->adCurlSlnNeighbor();
1808 }
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:330
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
const ADVectorVariableCurl & getADDefaultCurl() const
Helper method to return (and insert if necessary) the default curl value for Automatic Differentiatio...
Definition: Coupleable.C:2430
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

2139 {
2140  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2141 
2142  if (!var)
2143  return *getADDefaultValue(var_name);
2145 
2146  if (!_c_is_implicit)
2147  mooseError("Not implemented");
2148 
2149  if (!_coupleable_neighbor)
2150  return var->adDofValues();
2151  return var->adDofValuesNeighbor();
2152 }
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:311
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
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:2378
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

Referenced by adCoupledDots().

2289 {
2290  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2291 
2292  if (!var)
2293  return *getADDefaultValue(var_name);
2295 
2296  if (!_coupleable_neighbor)
2297  {
2298  if (_c_nodal)
2299  return var->adDofValuesDot();
2300  return var->adUDot();
2301  }
2302  else
2303  {
2304  if (_c_nodal)
2305  mooseError("AD neighbor nodal dof dot not implemented");
2306  return var->adUDotNeighbor();
2307  }
2308 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:311
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:2378
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

2312 {
2313  const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2314 
2315  if (!var)
2316  return *getADDefaultValue(var_name);
2318 
2319  if (_c_nodal)
2320  mooseError("Not implemented");
2321 
2322  if (!_coupleable_neighbor)
2323  return var->adUDotDot();
2324  return var->adUDotDotNeighbor();
2325 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:311
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:2378
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

2792 {
2793  auto func = [this, &var_name](unsigned int comp) { return &adCoupledDot(var_name, comp); };
2794  return coupledVectorHelper<const ADVariableValue *>(var_name, func);
2795 }
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:2288

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

Referenced by adCoupledGradients().

2230 {
2231  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2232 
2233  if (!var)
2234  return getADDefaultGradient();
2236 
2237  if (!_c_is_implicit)
2238  mooseError("Not implemented");
2239 
2240  if (!_coupleable_neighbor)
2241  return var->adGradSln();
2242  return var->adGradSlnNeighbor();
2243 }
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:311
const ADVariableGradient & getADDefaultGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
Definition: Coupleable.C:2409
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

2247 {
2248  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2249 
2250  if (!var)
2251  return getADDefaultGradient();
2253 
2254  if (!_c_is_implicit)
2255  mooseError("Not implemented");
2256 
2257  if (!_coupleable_neighbor)
2258  return var->adGradSlnDot();
2259  return var->adGradSlnNeighborDot();
2260 }
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:311
const ADVariableGradient & getADDefaultGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
Definition: Coupleable.C:2409
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

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

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

2212 {
2213  auto var = getVarHelper<MooseVariableFE<Real>>(var_name, comp);
2214 
2215  if (!var)
2216  return *getADDefaultValue(var_name);
2218 
2219  if (!_c_is_implicit)
2220  mooseError("adCoupledLowerValue cannot be called in a coupleable neighbor object");
2221 
2222  if (_c_nodal)
2223  return var->adDofValues();
2224  else
2225  return var->adSlnLower();
2226 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:311
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
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:2378

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

2170 {
2171  static const typename Moose::ADType<T>::type zero = 0;
2172  if (!isCoupled(var_name))
2173  return zero;
2174 
2175  if (!_c_nodal)
2176  mooseError("The adCoupledNodalValue method should only be called for nodal computing objects");
2178  mooseError(
2179  "The adCoupledNodalValue method shouldn't be called for neighbor computing objects. I "
2180  "don't even know what that would mean, although maybe someone could explain it to me.");
2181  if (!_c_is_implicit)
2182  mooseError("If you're going to use an explicit scheme, then use coupledNodalValue instead of "
2183  "adCoupledNodalValue");
2184 
2185  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
2186 
2187  return var->adNodalValue();
2188 }
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:1444
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
const Number zero
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

2264 {
2265  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2266 
2267  if (!var)
2268  return getADDefaultSecond();
2270 
2271  if (!_c_is_implicit)
2272  mooseError("Not implemented");
2273 
2274  if (!_coupleable_neighbor)
2275  return var->adSecondSln();
2276  else
2277  return var->adSecondSlnNeighbor();
2278 }
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:311
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
const ADVariableSecond & getADDefaultSecond() const
Helper method to return (and insert if necessary) the default second derivatives for Automatic Differ...
Definition: Coupleable.C:2423

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

Referenced by adCoupledValues().

2192 {
2193  const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2194 
2195  if (!var)
2196  return *getADDefaultValue(var_name);
2198 
2199  if (!_c_is_implicit)
2200  mooseError("Not implemented");
2201 
2202  if (_c_nodal)
2203  return var->adDofValues();
2204 
2205  if (!_coupleable_neighbor)
2206  return var->adSln();
2207  return var->adSlnNeighbor();
2208 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:311
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
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:2378
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

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

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

2329 {
2330  const auto * var = getVectorVar(var_name, comp);
2331  if (!var)
2332  return *getADDefaultVectorValue(var_name);
2334 
2335  if (_c_nodal)
2336  mooseError("Not implemented");
2337 
2338  if (!_coupleable_neighbor)
2339  return var->adUDot();
2340  return var->adUDotNeighbor();
2341 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:330
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:2392
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

2363 {
2364  const auto * var = getVectorVar(var_name, comp);
2365  if (!var)
2366  return getADDefaultVectorGradient();
2368 
2369  if (!_c_is_implicit)
2370  mooseError("Not implemented");
2371 
2372  if (!_coupleable_neighbor)
2373  return var->adGradSln();
2374  return var->adGradSlnNeighbor();
2375 }
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:330
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
const ADVectorVariableGradient & getADDefaultVectorGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
Definition: Coupleable.C:2416
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

Referenced by adCoupledVectorValues().

2345 {
2346  const auto * var = getVectorVar(var_name, comp);
2347  if (!var)
2348  return *getADDefaultVectorValue(var_name);
2350 
2351  if (_c_nodal)
2352  mooseError("Not implemented");
2353  if (!_c_is_implicit)
2354  mooseError("Not implemented");
2355 
2356  if (!_coupleable_neighbor)
2357  return var->adSln();
2358  return var->adSlnNeighbor();
2359 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:330
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:2392
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

2581 {
2582  auto func = [this, &var_name](unsigned int comp)
2583  { return &adCoupledVectorValue(var_name, comp); };
2584  return coupledVectorHelper<const ADVectorVariableValue *>(var_name, func);
2585 }
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:2344

◆ addFEVariableCoupleableMatrixTag()

void Coupleable::addFEVariableCoupleableMatrixTag ( TagID  tag)
inline

Definition at line 118 of file Coupleable.h.

Referenced by coupledMatrixTagValue().

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

◆ addFEVariableCoupleableVectorTag()

void Coupleable::addFEVariableCoupleableVectorTag ( TagID  tag)
inline

Definition at line 116 of file Coupleable.h.

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

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

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

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

◆ adZeroSecond()

const ADVariableSecond & Coupleable::adZeroSecond ( ) const
protected

Retrieve a zero second for automatic differentiation.

Definition at line 2451 of file Coupleable.C.

2452 {
2453  mooseDeprecated("Method adZeroSecond() is deprecated. Use '_ad_second_zero' instead.");
2454  return _ad_second_zero;
2455 }
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:363
const MooseArray< ADRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:1511

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

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

◆ 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(), coupledAllDofValues(), 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:2155
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
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:149
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1412

◆ 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:1444
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:467
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1423
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
const bool _is_fv
Whether the MooseObject is a finite volume object.
Definition: Coupleable.h:1831
const bool _c_allow_element_to_nodal_coupling
Definition: Coupleable.h:1450
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _c_coupled_scalar_vars
Scalar variables coupled into this object (for error checking)
Definition: Coupleable.h:1824
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1412
const MooseObject *const _obj
Definition: Coupleable.h:1833
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:1409
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 988 of file Coupleable.C.

Referenced by writableCoupledValue(), and writableVariable().

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

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

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

479 {
480  const auto * var = getFieldVar(var_name, comp);
481  if (!var)
482  {
483  mooseAssert(_optional_var_index.find(var_name) != _optional_var_index.end(),
484  "optional var index for " << var_name << " does not exist!");
485  // make sure we don't try to access default var ids that were not provided
486  checkComponent(_obj, comp, _optional_var_index.at(var_name).size(), var_name);
487  return _optional_var_index.at(var_name)[comp];
488  }
490 
491  if (var->kind() == Moose::VAR_SOLVER &&
492  // are we not an object that feeds into the nonlinear system?
493  (!_c_sys || _c_sys->varKind() != Moose::VAR_SOLVER ||
494  // are we an object that impacts the nonlinear system and this variable is within our
495  // nonlinear system?
496  var->sys().number() == _c_sys->number()))
497  return var->number();
498  else
499  // Avoid registering coupling to variables outside of our system (e.g. avoid potentially
500  // creating bad Jacobians)
501  return std::numeric_limits<unsigned int>::max() - var->number();
502 }
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:1420
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1158
const MooseObject *const _obj
Definition: Coupleable.h:1833
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:1821
Moose::VarKindType varKind() const
Definition: SystemBase.h:927
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 2076 of file Coupleable.C.

2077 {
2078  auto func = [this, &var_name](unsigned int comp) { return &coupledDofValues(var_name, comp); };
2080  return coupledVectorHelper<const VariableValue *>(var_name, func);
2081 }
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:2063
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222

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

2098 {
2099  auto func = [this, &var_name](unsigned int comp) { return &coupledDofValuesOld(var_name, comp); };
2100  return coupledVectorHelper<const VariableValue *>(var_name, func);
2101 }
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:2084

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

2118 {
2119  auto func = [this, &var_name](unsigned int comp)
2120  { return &coupledDofValuesOlder(var_name, comp); };
2121  return coupledVectorHelper<const VariableValue *>(var_name, func);
2122 }
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:2104

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

2126 {
2127  const auto * var = getArrayVar(var_name, comp);
2128  if (!var)
2129  return *getDefaultArrayValue(var_name);
2131 
2132  if (!_coupleable_neighbor)
2133  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
2134  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
2135 }
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:433
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:342

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

1387 {
1388  const auto * var = getArrayVar(var_name, comp);
1389  if (!var)
1392 
1393  if (!_coupleable_neighbor)
1394  {
1395  if (_c_nodal)
1396  return var->dofValuesDot();
1397  return var->uDot();
1398  }
1399  else
1400  {
1401  if (_c_nodal)
1402  return var->dofValuesDotNeighbor();
1403  return var->uDotNeighbor();
1404  }
1405 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:1732
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:342
ArrayVariableValue _default_array_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1538

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

1409 {
1410  const auto * var = getArrayVar(var_name, comp);
1411  if (!var)
1414 
1415  if (!_coupleable_neighbor)
1416  {
1417  if (_c_nodal)
1418  return var->dofValuesDotDot();
1419  return var->uDotDot();
1420  }
1421  else
1422  {
1423  if (_c_nodal)
1424  return var->dofValuesDotDotNeighbor();
1425  return var->uDotDotNeighbor();
1426  }
1427 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:1732
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:342
ArrayVariableValue _default_array_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1538

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

1453 {
1454  const auto * var = getArrayVar(var_name, comp);
1455  if (!var)
1458 
1459  if (!_coupleable_neighbor)
1460  {
1461  if (_c_nodal)
1462  return var->dofValuesDotDotOld();
1463  return var->uDotDotOld();
1464  }
1465  else
1466  {
1467  if (_c_nodal)
1468  return var->dofValuesDotDotOldNeighbor();
1469  return var->uDotDotOldNeighbor();
1470  }
1471 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:1732
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:342
ArrayVariableValue _default_array_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1538

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

1525 {
1526  const auto * const var = getArrayVar(var_name, comp);
1527  if (!var)
1528  {
1530  return _default_value_zero;
1531  }
1533 
1534  if (!_coupleable_neighbor)
1535  {
1536  if (_c_nodal)
1537  return var->dofValuesDuDotDu();
1538  return var->duDotDu();
1539  }
1540  else
1541  {
1542  if (_c_nodal)
1543  return var->dofValuesDuDotDuNeighbor();
1544  return var->duDotDuNeighbor();
1545  }
1546 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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: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:1732
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:342
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:1818

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

1431 {
1432  const auto * var = getArrayVar(var_name, comp);
1433  if (!var)
1436 
1437  if (!_coupleable_neighbor)
1438  {
1439  if (_c_nodal)
1440  return var->dofValuesDotOld();
1441  return var->uDotOld();
1442  }
1443  else
1444  {
1445  if (_c_nodal)
1446  return var->dofValuesDotOldNeighbor();
1447  return var->uDotOldNeighbor();
1448  }
1449 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:1732
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:342
ArrayVariableValue _default_array_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1538

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

1695 {
1696  const auto * var = getArrayVar(var_name, comp);
1697  if (!var)
1698  return _default_array_gradient;
1700 
1701  if (!_coupleable_neighbor)
1702  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
1703  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
1704 }
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:1447
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:342
ArrayVariableGradient _default_array_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1541

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

1734 {
1735  const auto * const var = getArrayVar(var_name, comp);
1736  if (!var)
1737  return _default_array_gradient;
1739 
1740  if (!_coupleable_neighbor)
1741  return var->gradSlnDot();
1742  return var->gradSlnNeighborDot();
1743 }
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:1732
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:342
ArrayVariableGradient _default_array_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1541

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

1708 {
1709  const auto * var = getArrayVar(var_name, comp);
1710  if (!var)
1711  return _default_array_gradient;
1713 
1714  if (!_coupleable_neighbor)
1715  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
1716  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
1717 }
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:1447
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:342
ArrayVariableGradient _default_array_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1541

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

1721 {
1722  const auto * var = getArrayVar(var_name, comp);
1723  if (!var)
1724  return _default_array_gradient;
1726 
1727  if (!_coupleable_neighbor)
1728  return var->gradSlnOlder();
1729  return var->gradSlnOlderNeighbor();
1730 }
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:1732
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:342
ArrayVariableGradient _default_array_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1541

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

Referenced by coupledArrayValues().

886 {
887  const auto * var = getArrayVar(var_name, comp);
888  if (!var)
889  return *getDefaultArrayValue(var_name);
891 
893  {
894  if (_c_nodal)
895  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
896  return (_c_is_implicit) ? var->sln() : var->slnOld();
897  }
898  else
899  {
900  if (_c_nodal)
901  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
902  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
903  }
904 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:433
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:342

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

1133 {
1134  const auto * var = getArrayVar(var_name, comp);
1135  if (!var)
1136  return *getDefaultArrayValue(var_name);
1138 
1139  if (!_coupleable_neighbor)
1140  {
1141  if (_c_nodal)
1142  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
1143  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
1144  }
1145  else
1146  {
1147  if (_c_nodal)
1148  return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
1149  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
1150  }
1151 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:433
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:342

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

1155 {
1156  const auto * var = getArrayVar(var_name, comp);
1157  if (!var)
1158  return *getDefaultArrayValue(var_name);
1160 
1161  if (!_coupleable_neighbor)
1162  {
1163  if (_c_nodal)
1164  return var->dofValuesOlder();
1165  return var->slnOlder();
1166  }
1167  else
1168  {
1169  if (_c_nodal)
1170  return var->dofValuesOlderNeighbor();
1171  return var->slnOlderNeighbor();
1172  }
1173 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:433
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:342

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

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

◆ 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 AuxKernelBase.

Definition at line 149 of file Coupleable.h.

Referenced by checkFuncType().

149 {}

◆ 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 ArrayVariableValueVolumeHistogram::ArrayVariableValueVolumeHistogram(), coupledVectorHelper(), getVarsHelper(), 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:1423
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:1409

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

1747 {
1748  const auto * var = getVectorVar(var_name, comp);
1749  if (!var)
1750  {
1752  return _default_vector_curl;
1753  }
1755 
1756  if (!_coupleable_neighbor)
1757  return (_c_is_implicit) ? var->curlSln() : var->curlSlnOld();
1758  return (_c_is_implicit) ? var->curlSlnNeighbor() : var->curlSlnOldNeighbor();
1759 }
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:1529
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:330
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

1763 {
1764  const auto * var = getVectorVar(var_name, comp);
1765  if (!var)
1766  {
1768  return _default_vector_curl;
1769  }
1771 
1772  if (!_coupleable_neighbor)
1773  return (_c_is_implicit) ? var->curlSlnOld() : var->curlSlnOlder();
1774  return (_c_is_implicit) ? var->curlSlnOldNeighbor() : var->curlSlnOlderNeighbor();
1775 }
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:1529
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:330
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

1779 {
1780  const auto * var = getVectorVar(var_name, comp);
1781  if (!var)
1782  {
1784  return _default_vector_curl;
1785  }
1787 
1788  if (!_coupleable_neighbor)
1789  return var->curlSlnOlder();
1790  return var->curlSlnOlderNeighbor();
1791 }
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:1529
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:330
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

1812 {
1813  const auto * var = getVectorVar(var_name, comp);
1814  if (!var)
1815  {
1817  return _default_div;
1818  }
1820 
1821  if (!_coupleable_neighbor)
1822  return (_c_is_implicit) ? var->divSln() : var->divSlnOld();
1823  return (_c_is_implicit) ? var->divSlnNeighbor() : var->divSlnOldNeighbor();
1824 }
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:330
VectorVariableDivergence _default_div
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1532
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

1828 {
1829  const auto * var = getVectorVar(var_name, comp);
1830  if (!var)
1831  {
1833  return _default_div;
1834  }
1836 
1837  if (!_coupleable_neighbor)
1838  return (_c_is_implicit) ? var->divSlnOld() : var->divSlnOlder();
1839  return (_c_is_implicit) ? var->divSlnOldNeighbor() : var->divSlnOlderNeighbor();
1840 }
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:330
VectorVariableDivergence _default_div
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1532
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

1844 {
1845  const auto * var = getVectorVar(var_name, comp);
1846  if (!var)
1847  {
1849  return _default_div;
1850  }
1852 
1853  if (!_coupleable_neighbor)
1854  return var->divSlnOlder();
1855  return var->divSlnOlderNeighbor();
1856 }
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:330
VectorVariableDivergence _default_div
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1532
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

Referenced by coupledAllDofValues().

2064 {
2065  const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2066  if (!var)
2067  return *getDefaultValue(var_name, comp);
2069 
2070  if (!_coupleable_neighbor)
2071  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
2072  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
2073 }
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:1447
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:371
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

Referenced by coupledAllDofValuesOld().

2085 {
2086  const auto * var = getVar(var_name, comp);
2087  if (!var)
2088  return *getDefaultValue(var_name, comp);
2090 
2091  if (!_coupleable_neighbor)
2092  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
2093  return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
2094 }
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:324
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
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:371
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

Referenced by coupledAllDofValuesOlder().

2105 {
2106  const auto * var = getVar(var_name, comp);
2107  if (!var)
2108  return *getDefaultValue(var_name, comp);
2110 
2111  if (!_coupleable_neighbor)
2112  return var->dofValuesOlder();
2113  return var->dofValuesOlderNeighbor();
2114 }
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:324
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:371
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

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

1177 {
1178  const auto * var = getVar(var_name, comp);
1179  if (!var)
1180  {
1182  return _default_value_zero;
1183  }
1185 
1186  if (!_coupleable_neighbor)
1187  {
1188  if (_c_nodal)
1189  return var->dofValuesDot();
1190  return var->uDot();
1191  }
1192  else
1193  {
1194  if (_c_nodal)
1195  return var->dofValuesDotNeighbor();
1196  return var->uDotNeighbor();
1197  }
1198 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:1477
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled 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:1732
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:1818

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

1202 {
1203  const auto * var = getVar(var_name, comp);
1204  if (!var)
1205  {
1207  return _default_value_zero;
1208  }
1210 
1211  if (!_coupleable_neighbor)
1212  {
1213  if (_c_nodal)
1214  return var->dofValuesDotDot();
1215  return var->uDotDot();
1216  }
1217  else
1218  {
1219  if (_c_nodal)
1220  return var->dofValuesDotDotNeighbor();
1221  return var->uDotDotNeighbor();
1222  }
1223 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:1477
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled 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:1732
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:1818

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

1500 {
1501  const auto * var = getVar(var_name, comp);
1502  if (!var)
1503  {
1505  return _default_value_zero;
1506  }
1508 
1509  if (!_coupleable_neighbor)
1510  {
1511  if (_c_nodal)
1512  return var->dofValuesDuDotDotDu();
1513  return var->duDotDotDu();
1514  }
1515  else
1516  {
1517  if (_c_nodal)
1518  return var->dofValuesDuDotDotDuNeighbor();
1519  return var->duDotDotDuNeighbor();
1520  }
1521 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:1477
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled 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:1732
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:1818

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

1266 {
1267  const auto * var = getVar(var_name, comp);
1268  if (!var)
1269  {
1271  return _default_value_zero;
1272  }
1274 
1275  if (!_coupleable_neighbor)
1276  {
1277  if (_c_nodal)
1278  return var->dofValuesDotDotOld();
1279  return var->uDotDotOld();
1280  }
1281  else
1282  {
1283  if (_c_nodal)
1284  return var->dofValuesDotDotOldNeighbor();
1285  return var->uDotDotOldNeighbor();
1286  }
1287 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:1477
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled 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:1732
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:1818

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

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

1475 {
1476  const auto * var = getVar(var_name, comp);
1477  if (!var)
1478  {
1480  return _default_value_zero;
1481  }
1483 
1484  if (!_coupleable_neighbor)
1485  {
1486  if (_c_nodal)
1487  return var->dofValuesDuDotDu();
1488  return var->duDotDu();
1489  }
1490  else
1491  {
1492  if (_c_nodal)
1493  return var->dofValuesDuDotDuNeighbor();
1494  return var->duDotDuNeighbor();
1495  }
1496 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:1477
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled 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:1732
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:1818

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

1241 {
1242  const auto * var = getVar(var_name, comp);
1243  if (!var)
1244  {
1246  return _default_value_zero;
1247  }
1249 
1250  if (!_coupleable_neighbor)
1251  {
1252  if (_c_nodal)
1253  return var->dofValuesDotOld();
1254  return var->uDotOld();
1255  }
1256  else
1257  {
1258  if (_c_nodal)
1259  return var->dofValuesDotOldNeighbor();
1260  return var->uDotOldNeighbor();
1261  }
1262 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:1477
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled 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:1732
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:1818

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

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

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

626 {
627  return coupledDofValues(var_name, comp);
628 }
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:2063

◆ coupledGenericDofValue() [3/3]

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

Definition at line 632 of file Coupleable.C.

633 {
634  return adCoupledDofValues(var_name, comp);
635 }
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:2138

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

2800 {
2801  return coupledDot(var_name, comp);
2802 }
virtual const VariableValue & coupledDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled variable.
Definition: Coupleable.C:1176

◆ coupledGenericDot() [3/3]

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

Definition at line 2806 of file Coupleable.C.

2807 {
2808  return adCoupledDot(var_name, comp);
2809 }
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:2288

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

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

◆ coupledGenericDotDot() [3/3]

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

Definition at line 1234 of file Coupleable.C.

1235 {
1236  return adCoupledDotDot(var_name, comp);
1237 }
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:2311

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

2502 {
2503  return coupledGradient(var_name, comp);
2504 }
virtual const VariableGradient & coupledGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable.
Definition: Coupleable.C:1549

◆ coupledGenericGradient() [3/3]

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

Definition at line 2508 of file Coupleable.C.

2509 {
2510  return adCoupledGradient(var_name, comp);
2511 }
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:2229

◆ coupledGenericGradients() [1/3]

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

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

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

◆ coupledGenericGradients() [2/3]

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

Definition at line 2756 of file Coupleable.C.

2757 {
2758  return coupledGradients(var_name);
2759 }
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:2748

◆ coupledGenericGradients() [3/3]

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

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 GenericVariableGradient<true> *>(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:2229

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

507 {
508  return coupledValue(var_name, comp);
509 }
virtual const VariableValue & coupledValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled variable.
Definition: Coupleable.C:533

◆ coupledGenericValue() [3/3]

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

Definition at line 513 of file Coupleable.C.

514 {
515  return adCoupledValue(var_name, comp);
516 }
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:2191

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

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

◆ coupledGenericValues() [3/3]

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

Definition at line 2567 of file Coupleable.C.

2568 {
2569  return adCoupledValues(var_name);
2570 }
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:2573

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

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

◆ coupledGenericVectorValue() [3/3]

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

Definition at line 527 of file Coupleable.C.

528 {
529  return adCoupledVectorValue(var_name, comp);
530 }
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:2344

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

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

1550 {
1551  const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
1552  if (!var)
1553  {
1555  return _default_gradient;
1556  }
1558 
1559  if (!_coupleable_neighbor)
1560  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
1561  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
1562 }
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:1447
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1480
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

1615 {
1616  const auto * var = getVar(var_name, comp);
1617  if (!var)
1618  {
1620  return _default_gradient;
1621  }
1623 
1624  if (!_coupleable_neighbor)
1625  return var->gradSlnDot();
1626  return var->gradSlnNeighborDot();
1627 }
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:324
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1480
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

1631 {
1632  const auto * var = getVar(var_name, comp);
1633  if (!var)
1634  {
1636  return _default_gradient;
1637  }
1639 
1640  if (!_coupleable_neighbor)
1641  return var->gradSlnDotDot();
1642  return var->gradSlnNeighborDotDot();
1643 }
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:324
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1480
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

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

1566 {
1567  const auto * var = getVar(var_name, comp);
1568  if (!var)
1569  {
1571  return _default_gradient;
1572  }
1574 
1575  if (!_coupleable_neighbor)
1576  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
1577  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
1578 }
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:324
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1480
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

Referenced by NodeFaceConstraint::coupledSecondaryGradientOlder().

1582 {
1583  const auto * var = getVar(var_name, comp);
1584  if (!var)
1585  {
1587  return _default_gradient;
1588  }
1590 
1591  if (!_coupleable_neighbor)
1592  return var->gradSlnOlder();
1593  return var->gradSlnOlderNeighbor();
1594 }
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:324
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1480
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

1598 {
1599  const auto * var = getVar(var_name, comp);
1601  if (!var)
1602  {
1604  return _default_gradient;
1605  }
1607 
1608  if (!_coupleable_neighbor)
1609  return var->gradSlnPreviousNL();
1610  return var->gradSlnPreviousNLNeighbor();
1611 }
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:324
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1417
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1480
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:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

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

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

2778 {
2779  auto func = [this, &var_name](unsigned int comp) { return &coupledGradientOld(var_name, comp); };
2780  return coupledVectorHelper<const VariableGradient *>(var_name, func);
2781 }
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:1565

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

2515 {
2516  auto func = [this, &var_name](unsigned int comp) { return coupled(var_name, comp); };
2517  return coupledVectorHelper<unsigned int>(var_name, func);
2518 }
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:478

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

Referenced by coupledMatrixTagValue(), and coupledMatrixTagValues().

830 {
831  const auto * var = getVarHelper<MooseVariableField<Real>>(var_names, index);
832  if (!var)
833  mooseError(var_names, ": invalid variable name for coupledMatrixTagValue");
835 
836  const_cast<Coupleable *>(this)->addFEVariableCoupleableMatrixTag(tag);
837 
838  if (_c_nodal)
839  return var->nodalMatrixTagValue(tag);
840  return var->matrixTagValue(tag);
841 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:311
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:52
void addFEVariableCoupleableMatrixTag(TagID tag)
Definition: Coupleable.h:118

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

847 {
848  if (!_c_parameters.isParamValid(tag_name))
849  mooseError("Tag name parameter '", tag_name, "' is invalid");
850 
851  TagName tagname = _c_parameters.get<TagName>(tag_name);
852  if (!_c_fe_problem.matrixTagExists(tagname))
853  mooseError("Matrix tag name '", tagname, "' does not exist");
854 
855  TagID tag = _c_fe_problem.getMatrixTagID(tagname);
856  return coupledMatrixTagValue(var_names, tag, index);
857 }
unsigned int TagID
Definition: MooseTypes.h:238
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
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:827
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1417
virtual TagID getMatrixTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:343
const InputParameters & _c_parameters
Definition: Coupleable.h:1409
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:329
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 2703 of file Coupleable.C.

Referenced by coupledMatrixTagValues().

2704 {
2705  auto func = [this, &var_names, &tag](unsigned int comp)
2706  { return &coupledMatrixTagValue(var_names, tag, comp); };
2707  return coupledVectorHelper<const VariableValue *>(var_names, func);
2708 }
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:827

◆ coupledMatrixTagValues() [2/2]

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

Definition at line 2711 of file Coupleable.C.

2713 {
2714  if (!_c_parameters.isParamValid(tag_name))
2715  mooseError("Tag name parameter '", tag_name, "' is invalid");
2716 
2717  TagName tagname = _c_parameters.get<TagName>(tag_name);
2718  if (!_c_fe_problem.matrixTagExists(tagname))
2719  mooseError("Matrix tag name '", tagname, "' does not exist");
2720 
2721  TagID tag = _c_fe_problem.getMatrixTagID(tagname);
2722  return coupledMatrixTagValues(var_names, tag);
2723 }
unsigned int TagID
Definition: MooseTypes.h:238
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
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:1417
virtual TagID getMatrixTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:343
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:2703
const InputParameters & _c_parameters
Definition: Coupleable.h:1409
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:329
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 2521 of file Coupleable.C.

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

2522 {
2523  if (getFieldVar(var_name, comp))
2524  return getFieldVar(var_name, comp)->name();
2525  // Detect if we are in the case where a constant was passed in lieu of a variable
2526  else if (isCoupledConstant(var_name))
2528  ": a variable name was queried but a constant was passed for parameter '",
2529  var_name,
2530  "Either pass a true variable or contact a developer to shield the call to "
2531  "'coupledName' with 'isCoupledConstant'");
2532  else
2533  mooseError(
2534  _c_name, ": Variable '", var_name, "' does not exist, yet its coupled name is requested");
2535 }
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:311
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:1412
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 2538 of file Coupleable.C.

2539 {
2540  auto func = [this, &var_name](unsigned int comp) { return coupledName(var_name, comp); };
2541  return coupledVectorHelper<VariableName>(var_name, func);
2542 }
VariableName coupledName(const std::string &var_name, unsigned int comp=0) const
Names of the variable in the Coupleable interface.
Definition: Coupleable.C:2521

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

2002 {
2003  static const T zero = 0;
2004  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
2005  if (!var)
2006  return zero;
2008 
2009  if (!_coupleable_neighbor)
2010  return var->nodalValueDot();
2011  mooseError("Neighbor version not implemented");
2012 }
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:311
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:1732

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

2016 {
2017  const auto * var = getVar(var_name, comp);
2018  if (!var)
2019  {
2021  return _default_value_zero;
2022  }
2024 
2025  if (!_coupleable_neighbor)
2026  return var->dofValuesDotDot();
2027  return var->dofValuesDotDotNeighbor();
2028 }
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:1477
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled 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:1732
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:1818

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

2048 {
2049  const auto * var = getVar(var_name, comp);
2050  if (!var)
2051  {
2053  return _default_value_zero;
2054  }
2056 
2057  if (!_coupleable_neighbor)
2058  return var->dofValuesDotDotOld();
2059  return var->dofValuesDotDotOldNeighbor();
2060 }
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:1477
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled 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:1732
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:1818

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

2032 {
2033  const auto * var = getVar(var_name, comp);
2034  if (!var)
2035  {
2037  return _default_value_zero;
2038  }
2040 
2041  if (!_coupleable_neighbor)
2042  return var->dofValuesDotOld();
2043  return var->dofValuesDotOldNeighbor();
2044 }
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:1477
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled 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:1732
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:1818

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

1926 {
1927  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1928  if (!var)
1929  return getDefaultNodalValue<T>(var_name, comp);
1931 
1932  if (!var->isNodal())
1934  ": Trying to get nodal values of variable '",
1935  var->name(),
1936  "', but it is not nodal.");
1937 
1938  if (!_coupleable_neighbor)
1939  return (_c_is_implicit) ? var->nodalValue() : var->nodalValueOld();
1940  return (_c_is_implicit) ? var->nodalValueNeighbor() : var->nodalValueOldNeighbor();
1941 }
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:311
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1412
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

1946 {
1947  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1948  if (!var)
1949  return getDefaultNodalValue<T>(var_name, comp);
1951 
1952  if (!var->isNodal())
1954  ": Trying to get old nodal values of variable '",
1955  var->name(),
1956  "', but it is not nodal.");
1957 
1958  if (!_coupleable_neighbor)
1959  return (_c_is_implicit) ? var->nodalValueOld() : var->nodalValueOlder();
1960  return (_c_is_implicit) ? var->nodalValueOldNeighbor() : var->nodalValueOlderNeighbor();
1961 }
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:311
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1412
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

1966 {
1967  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1968  if (!var)
1969  return getDefaultNodalValue<T>(var_name, comp);
1971 
1972  if (!var->isNodal())
1974  ": Trying to get older nodal values of variable '",
1975  var->name(),
1976  "', but it is not nodal.");
1977 
1978  if (!_coupleable_neighbor)
1979  return var->nodalValueOlder();
1980  return var->nodalValueOlderNeighbor();
1981 }
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:311
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1412
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

1986 {
1987  const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1988  if (!var)
1989  return getDefaultNodalValue<T>(var_name, comp);
1991 
1993 
1994  if (!_coupleable_neighbor)
1995  return var->nodalValuePreviousNL();
1996  return var->nodalValuePreviousNLNeighbor();
1997 }
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition: Coupleable.C:222
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1417
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:1732

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

Referenced by NodeFaceConstraint::coupledSecondarySecond().

1860 {
1861  const auto * var = getVar(var_name, comp);
1862  if (!var)
1863  {
1865  return _default_second;
1866  }
1868 
1869  if (!_coupleable_neighbor)
1870  return (_c_is_implicit) ? var->secondSln() : var->secondSlnOlder();
1871  return (_c_is_implicit) ? var->secondSlnNeighbor() : var->secondSlnOlderNeighbor();
1872 }
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:324
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1489
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

1876 {
1877  const auto * var = getVar(var_name, comp);
1878  if (!var)
1879  {
1881  return _default_second;
1882  }
1884 
1885  if (!_coupleable_neighbor)
1886  return (_c_is_implicit) ? var->secondSlnOld() : var->secondSlnOlder();
1887  return (_c_is_implicit) ? var->secondSlnOldNeighbor() : var->secondSlnOlderNeighbor();
1888 }
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:324
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1489
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

1892 {
1893  const auto * var = getVar(var_name, comp);
1894  if (!var)
1895  {
1897  return _default_second;
1898  }
1900 
1901  if (!_coupleable_neighbor)
1902  return var->secondSlnOlder();
1903  return var->secondSlnOlderNeighbor();
1904 }
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:324
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1489
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

1908 {
1909  const auto * var = getVar(var_name, comp);
1911  if (!var)
1912  {
1914  return _default_second;
1915  }
1917 
1918  if (!_coupleable_neighbor)
1919  return var->secondSlnPreviousNL();
1920  return var->secondSlnPreviousNLNeighbor();
1921 }
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:324
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1417
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1489
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:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

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

534 {
535  const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
536  if (!var)
537  return *getDefaultValue(var_name, comp);
539 
541  {
542  if (_c_nodal)
543  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
544  else
545  return (_c_is_implicit) ? var->sln() : var->slnOld();
546  }
547  else
548  {
549  if (_c_nodal)
550  return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
551  else
552  return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
553  }
554 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:1447
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:371
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

639 {
640  const auto * var = getVar(var_name, comp);
641  if (!var)
642  return *getDefaultValue(var_name, comp);
644 
646  mooseError(_c_name, ":coupledValueLower cannot be called in a coupleable neighbor object");
647 
648  if (_c_nodal)
649  return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
650  else
651  return (_c_is_implicit) ? var->slnLower() : var->slnLowerOld();
652 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:311
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:324
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
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:371
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1412
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

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

1038 {
1039  const auto * var = getVar(var_name, comp);
1040  if (!var)
1041  return *getDefaultValue(var_name, comp);
1043 
1044  if (!_coupleable_neighbor)
1045  {
1046  if (_c_nodal)
1047  return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
1048  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
1049  }
1050  else
1051  {
1052  if (_c_nodal)
1053  return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
1054  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
1055  }
1056 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:324
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
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:371
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

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

1060 {
1061  const auto * var = getVar(var_name, comp);
1062  if (!var)
1063  return *getDefaultValue(var_name, comp);
1065 
1066  if (!_coupleable_neighbor)
1067  {
1068  if (_c_nodal)
1069  return var->dofValuesOlder();
1070  return var->slnOlder();
1071  }
1072  else
1073  {
1074  if (_c_nodal)
1075  return var->dofValuesOlderNeighbor();
1076  return var->slnOlderNeighbor();
1077  }
1078 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:324
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:371
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

1082 {
1083  const auto * var = getVar(var_name, comp);
1084  if (!var)
1085  return *getDefaultValue(var_name, comp);
1087 
1089  if (!_coupleable_neighbor)
1090  {
1091  if (_c_nodal)
1092  return var->dofValuesPreviousNL();
1093  return var->slnPreviousNL();
1094  }
1095  else
1096  {
1097  if (_c_nodal)
1098  return var->dofValuesPreviousNLNeighbor();
1099  return var->slnPreviousNLNeighbor();
1100  }
1101 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:324
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1417
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:371
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:1732

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

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

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

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

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

2734 {
2735  auto func = [this, &var_name](unsigned int comp) { return &coupledValueOlder(var_name, comp); };
2736  return coupledVectorHelper<const VariableValue *>(var_name, func);
2737 }
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:1059

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

1291 {
1292  const auto * var = getVectorVar(var_name, comp);
1293  if (!var)
1294  {
1297  }
1299 
1300  if (!_coupleable_neighbor)
1301  return var->uDot();
1302  return var->uDotNeighbor();
1303 }
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:330
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1523
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

1307 {
1308  const auto * var = getVectorVar(var_name, comp);
1309  if (!var)
1310  {
1313  }
1315 
1316  if (!_coupleable_neighbor)
1317  return var->uDotDot();
1318  return var->uDotDotNeighbor();
1319 }
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:330
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1523
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

1371 {
1372  const auto * var = getVectorVar(var_name, comp);
1373  if (!var)
1374  {
1376  return _default_value_zero;
1377  }
1379 
1380  if (!_coupleable_neighbor)
1381  return var->duDotDotDu();
1382  return var->duDotDotDuNeighbor();
1383 }
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:330
VariableValue _default_value_zero
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:1732
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:1818

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

1339 {
1340  const auto * var = getVectorVar(var_name, comp);
1341  if (!var)
1342  {
1345  }
1347 
1348  if (!_coupleable_neighbor)
1349  return var->uDotDotOld();
1350  return var->uDotDotOldNeighbor();
1351 }
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:330
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1523
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

1355 {
1356  const auto * var = getVectorVar(var_name, comp);
1357  if (!var)
1358  {
1360  return _default_value_zero;
1361  }
1363 
1364  if (!_coupleable_neighbor)
1365  return var->duDotDu();
1366  return var->duDotDuNeighbor();
1367 }
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:330
VariableValue _default_value_zero
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:1732
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:1818

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

1323 {
1324  const auto * var = getVectorVar(var_name, comp);
1325  if (!var)
1326  {
1329  }
1331 
1332  if (!_coupleable_neighbor)
1333  return var->uDotOld();
1334  return var->uDotOldNeighbor();
1335 }
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:330
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1523
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

1647 {
1648  const auto * var = getVectorVar(var_name, comp);
1649  if (!var)
1650  {
1652  return _default_vector_gradient;
1653  }
1655 
1656  if (!_coupleable_neighbor)
1657  return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
1658  return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
1659 }
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:330
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1526
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

1663 {
1664  const auto * var = getVectorVar(var_name, comp);
1665  if (!var)
1666  {
1668  return _default_vector_gradient;
1669  }
1671 
1672  if (!_coupleable_neighbor)
1673  return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
1674  return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
1675 }
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:330
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1526
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

1679 {
1680  const auto * var = getVectorVar(var_name, comp);
1681  if (!var)
1682  {
1684  return _default_vector_gradient;
1685  }
1687 
1688  if (!_coupleable_neighbor)
1689  return var->gradSlnOlder();
1690  return var->gradSlnOlderNeighbor();
1691 }
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:330
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1526
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

◆ coupledVectorHelper()

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

Definition at line 1722 of file Coupleable.h.

1723  {
1724  const auto components = coupledComponents(var_name);
1725  std::vector<T> vals(components);
1726  for (MooseIndex(components) comp = 0; comp < components; ++comp)
1727  vals[comp] = func(comp);
1728  return vals;
1729  }
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 819 of file Coupleable.C.

822 {
823  return vectorTagDofValueHelper<RealEigenVector>(var_name, tag_name, comp);
824 }

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

Referenced by coupledVectorTagArrayGradient(), and coupledVectorTagArrayGradients().

728 {
729  const auto * var = getArrayVar(var_names, index);
730  if (!var)
731  mooseError(var_names, ": invalid variable name for coupledVectorTagArrayGradient");
733 
734  if (!_c_fe_problem.vectorTagExists(tag))
735  mooseError("Attempting to couple to vector tag with ID ",
736  tag,
737  "in ",
738  _c_name,
739  ", but a vector tag with that ID does not exist");
740 
741  const_cast<Coupleable *>(this)->addFEVariableCoupleableVectorTag(tag);
742 
743  return var->vectorTagGradient(tag);
744 }
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:311
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1417
void addFEVariableCoupleableVectorTag(TagID tag)
Definition: Coupleable.h:116
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1412
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:52
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:342

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

750 {
751  if (!_c_parameters.isParamValid(tag_name))
752  mooseError("Tag name parameter '", tag_name, "' is invalid");
753 
754  TagName tagname = _c_parameters.get<TagName>(tag_name);
755  if (!_c_fe_problem.vectorTagExists(tagname))
756  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
757 
758  TagID tag = _c_fe_problem.getVectorTagID(tagname);
759  return coupledVectorTagArrayGradient(var_names, tag, index);
760 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:204
unsigned int TagID
Definition: MooseTypes.h:238
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
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:1417
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:725
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:1409
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 2657 of file Coupleable.C.

Referenced by coupledVectorTagArrayGradients().

2658 {
2659  auto func = [this, &var_names, &tag](unsigned int index)
2660  { return &coupledVectorTagArrayGradient(var_names, tag, index); };
2661  return coupledVectorHelper<const ArrayVariableGradient *>(var_names, func);
2662 }
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:725

◆ coupledVectorTagArrayGradients() [2/2]

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

Definition at line 2665 of file Coupleable.C.

2667 {
2668  if (!_c_parameters.isParamValid(tag_name))
2669  mooseError("Tag name parameter '", tag_name, "' is invalid");
2670 
2671  TagName tagname = _c_parameters.get<TagName>(tag_name);
2672  if (!_c_fe_problem.vectorTagExists(tagname))
2673  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2674 
2675  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2676  return coupledVectorTagArrayGradients(var_names, tag);
2677 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:204
unsigned int TagID
Definition: MooseTypes.h:238
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
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:1417
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:2657
const InputParameters & _c_parameters
Definition: Coupleable.h:1409
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 671 of file Coupleable.C.

Referenced by coupledVectorTagArrayValues().

674 {
675  return vectorTagValueHelper<RealEigenVector>(var_names, tag, index);
676 }

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

682 {
683  return vectorTagValueHelper<RealEigenVector>(var_names, tag_name, index);
684 }

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

Referenced by coupledVectorTagArrayValues().

2612 {
2613  auto func = [this, &var_names, &tag](unsigned int index)
2614  { return &coupledVectorTagArrayValue(var_names, tag, index); };
2615  return coupledVectorHelper<const ArrayVariableValue *>(var_names, func);
2616 }
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:671

◆ coupledVectorTagArrayValues() [2/2]

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

Definition at line 2619 of file Coupleable.C.

2621 {
2622  if (!_c_parameters.isParamValid(tag_name))
2623  mooseError("Tag name parameter '", tag_name, "' is invalid");
2624 
2625  TagName tagname = _c_parameters.get<TagName>(tag_name);
2626  if (!_c_fe_problem.vectorTagExists(tagname))
2627  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2628 
2629  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2630  return coupledVectorTagArrayValues(var_names, tag);
2631 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:204
unsigned int TagID
Definition: MooseTypes.h:238
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
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:2611
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1417
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:1409
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 803 of file Coupleable.C.

Referenced by coupledVectorTagDofValues().

806 {
807  return vectorTagDofValueHelper<Real>(var_name, tag, comp);
808 }

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

814 {
815  return vectorTagDofValueHelper<Real>(var_name, tag_name, comp);
816 }

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

Referenced by coupledVectorTagDofValues().

2681 {
2682  auto func = [this, &var_names, &tag](unsigned int comp)
2683  { return &coupledVectorTagDofValue(var_names, tag, comp); };
2684  return coupledVectorHelper<const VariableValue *>(var_names, func);
2685 }
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:803

◆ coupledVectorTagDofValues() [2/2]

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

Definition at line 2688 of file Coupleable.C.

2690 {
2691  if (!_c_parameters.isParamValid(tag_name))
2692  mooseError("Tag name parameter '", tag_name, "' is invalid");
2693 
2694  TagName tagname = _c_parameters.get<TagName>(tag_name);
2695  if (!_c_fe_problem.vectorTagExists(tagname))
2696  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2697 
2698  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2699  return coupledVectorTagDofValues(var_names, tag);
2700 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:204
unsigned int TagID
Definition: MooseTypes.h:238
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
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:1417
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:2680
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:1409
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 687 of file Coupleable.C.

Referenced by coupledVectorTagGradient(), and coupledVectorTagGradients().

690 {
691  const auto * var = getVar(var_names, index);
692  if (!var)
693  mooseError(var_names, ": invalid variable name for coupledVectorTagGradient");
695 
696  if (!_c_fe_problem.vectorTagExists(tag))
697  mooseError("Attempting to couple to vector tag with ID ",
698  tag,
699  "in ",
700  _c_name,
701  ", but a vector tag with that ID does not exist");
702 
703  const_cast<Coupleable *>(this)->addFEVariableCoupleableVectorTag(tag);
704 
705  return var->vectorTagGradient(tag);
706 }
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:311
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition: Coupleable.C:324
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1417
void addFEVariableCoupleableVectorTag(TagID tag)
Definition: Coupleable.h:116
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1412
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:52

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

712 {
713  if (!_c_parameters.isParamValid(tag_name))
714  mooseError("Tag name parameter '", tag_name, "' is invalid");
715 
716  TagName tagname = _c_parameters.get<TagName>(tag_name);
717  if (!_c_fe_problem.vectorTagExists(tagname))
718  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
719 
720  TagID tag = _c_fe_problem.getVectorTagID(tagname);
721  return coupledVectorTagGradient(var_names, tag, index);
722 }
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:687
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:204
unsigned int TagID
Definition: MooseTypes.h:238
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
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:1417
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:1409
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 2634 of file Coupleable.C.

Referenced by coupledVectorTagGradients().

2635 {
2636  auto func = [this, &var_names, &tag](unsigned int index)
2637  { return &coupledVectorTagGradient(var_names, tag, index); };
2638  return coupledVectorHelper<const VariableGradient *>(var_names, func);
2639 }
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:687

◆ coupledVectorTagGradients() [2/2]

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

Definition at line 2642 of file Coupleable.C.

2644 {
2645  if (!_c_parameters.isParamValid(tag_name))
2646  mooseError("Tag name parameter '", tag_name, "' is invalid");
2647 
2648  TagName tagname = _c_parameters.get<TagName>(tag_name);
2649  if (!_c_fe_problem.vectorTagExists(tagname))
2650  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2651 
2652  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2653  return coupledVectorTagGradients(var_names, tag);
2654 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:204
unsigned int TagID
Definition: MooseTypes.h:238
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
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:2634
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1417
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:1409
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 655 of file Coupleable.C.

Referenced by coupledVectorTagValues().

658 {
659  return vectorTagValueHelper<Real>(var_names, tag, index);
660 }

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

666 {
667  return vectorTagValueHelper<Real>(var_names, tag_name, index);
668 }

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

Referenced by coupledVectorTagValues().

2589 {
2590  auto func = [this, &var_names, &tag](unsigned int comp)
2591  { return &coupledVectorTagValue(var_names, tag, comp); };
2592  return coupledVectorHelper<const VariableValue *>(var_names, func);
2593 }
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:655

◆ coupledVectorTagValues() [2/2]

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

Definition at line 2596 of file Coupleable.C.

2598 {
2599  if (!_c_parameters.isParamValid(tag_name))
2600  mooseError("Tag name parameter '", tag_name, "' is invalid");
2601 
2602  TagName tagname = _c_parameters.get<TagName>(tag_name);
2603  if (!_c_fe_problem.vectorTagExists(tagname))
2604  mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2605 
2606  TagID tag = _c_fe_problem.getVectorTagID(tagname);
2607  return coupledVectorTagValues(var_names, tag);
2608 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:204
unsigned int TagID
Definition: MooseTypes.h:238
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
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:1417
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:2588
const InputParameters & _c_parameters
Definition: Coupleable.h:1409
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 860 of file Coupleable.C.

Referenced by coupledVectorValues().

861 {
862  const auto * var = getVectorVar(var_name, comp);
863  if (!var)
864  return *getDefaultVectorValue(var_name);
866 
868  {
869  if (_c_nodal)
870  return _c_is_implicit ? var->nodalValueArray() : var->nodalValueOldArray();
871  else
872  return _c_is_implicit ? var->sln() : var->slnOld();
873  }
874  else
875  {
876  if (_c_nodal)
877  // Since this is at a node, I don't feel like there should be any "neighbor" logic
878  return _c_is_implicit ? var->nodalValueArray() : var->nodalValueOldArray();
879  else
880  return _c_is_implicit ? var->slnNeighbor() : var->slnOldNeighbor();
881  }
882 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:330
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:398
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

Referenced by coupledVectorValuesOld().

1105 {
1106  const auto * var = getVectorVar(var_name, comp);
1107  if (!var)
1108  return *getDefaultVectorValue(var_name);
1110 
1111  if (_c_nodal)
1112  return (_c_is_implicit) ? var->nodalValueOldArray() : var->nodalValueOlderArray();
1113  if (!_coupleable_neighbor)
1114  return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
1115  return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
1116 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:330
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:398
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

1120 {
1121  const auto * var = getVectorVar(var_name, comp);
1122  if (!var)
1123  return *getDefaultVectorValue(var_name);
1125 
1126  if (!_coupleable_neighbor)
1127  return var->slnOlder();
1128  return var->slnOlderNeighbor();
1129 }
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:330
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:398
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1732

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

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

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

2741 {
2742  auto func = [this, &var_name](unsigned int comp)
2743  { return &coupledVectorValueOld(var_name, comp); };
2744  return coupledVectorHelper<const VectorVariableValue *>(var_name, func);
2745 }
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:1104

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

2474 {
2475  return _grad_zero;
2476 }
const VariableGradient & _grad_zero
Zero gradient of a variable.
Definition: Coupleable.h:1503

◆ genericZeroGradient() [3/3]

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

Definition at line 2480 of file Coupleable.C.

2481 {
2482  return _ad_grad_zero;
2483 }
const MooseArray< ADRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:1504

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

2488 {
2489  return _second_zero;
2490 }
const VariableSecond & _second_zero
Zero second derivative of a variable.
Definition: Coupleable.h:1510

◆ genericZeroSecond() [3/3]

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

Definition at line 2494 of file Coupleable.C.

2495 {
2496  return _ad_second_zero;
2497 }
const MooseArray< ADRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:1511

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

2460 {
2461  return _zero;
2462 }
const VariableValue & _zero
Zero value of a variable.
Definition: Coupleable.h:1498

◆ genericZeroValue() [3/3]

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

Definition at line 2466 of file Coupleable.C.

2467 {
2468  return _ad_zero;
2469 }
const MooseArray< ADReal > & _ad_zero
Definition: Coupleable.h:1500

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

Referenced by adCoupledCurl().

2431 {
2433  return _ad_default_curl;
2434 }
MooseArray< ADRealVectorValue > _ad_default_curl
This will always be zero because the default values for optionally coupled vector variables is always...
Definition: Coupleable.h:1495
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

Referenced by adCoupledGradient(), and adCoupledGradientDot().

2410 {
2412  return _ad_default_gradient;
2413 }
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818
MooseArray< ADRealVectorValue > _ad_default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1483

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

Referenced by adCoupledSecond().

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

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

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

2379 {
2380  auto default_value_it = _ad_default_value.find(var_name);
2381  if (default_value_it == _ad_default_value.end())
2382  {
2383  auto value = std::make_unique<ADVariableValue>(_coupleable_max_qps,
2385  default_value_it = _ad_default_value.insert(std::make_pair(var_name, std::move(value))).first;
2386  }
2387 
2388  return default_value_it->second.get();
2389 }
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:1460
const InputParameters & _c_parameters
Definition: Coupleable.h:1409
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

Referenced by adCoupledVectorGradient().

2417 {
2420 }
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:1486
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

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

2393 {
2394  auto default_value_it = _ad_default_vector_value.find(var_name);
2395  if (default_value_it == _ad_default_vector_value.end())
2396  {
2397  RealVectorValue default_vec;
2398  for (unsigned int i = 0; i < _c_parameters.numberDefaultCoupledValues(var_name); ++i)
2399  default_vec(i) = _c_parameters.defaultCoupledValue(var_name, i);
2400  auto value = std::make_unique<ADVectorVariableValue>(_coupleable_max_qps, default_vec);
2401  default_value_it =
2402  _ad_default_vector_value.insert(std::make_pair(var_name, std::move(value))).first;
2403  }
2404 
2405  return default_value_it->second.get();
2406 }
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:1471
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:1409
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

366 {
367  return getVarHelper<ArrayMooseVariable>(var_name, comp);
368 }

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

112  {
114  }
std::vector< ArrayMooseVariable * > _coupled_array_moose_vars
Vector of array coupled variables.
Definition: Coupleable.h:1435

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

94  {
96  }
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Definition: Coupleable.h:1429

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

Referenced by InitialConditionBase::InitialConditionBase().

76  {
77  return _coupled_vars;
78  }
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1423

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

103  {
105  }
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
Definition: Coupleable.h:1432

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

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

434 {
435  auto default_value_it = _default_array_value.find(var_name);
436  if (default_value_it == _default_array_value.end())
437  {
438  auto value = std::make_unique<ArrayVariableValue>(_coupleable_max_qps);
439  for (unsigned int qp = 0; qp < _coupleable_max_qps; ++qp)
440  {
441  auto n = _c_parameters.numberDefaultCoupledValues(var_name);
442  (*value)[qp].resize(n);
443  for (unsigned int i = 0; i < n; ++i)
444  (*value)[qp](i) = _c_parameters.defaultCoupledValue(var_name, i);
445  }
446  default_value_it =
447  _default_array_value.insert(std::make_pair(var_name, std::move(value))).first;
448  }
449 
450  return default_value_it->second.get();
451 }
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:1409
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:1467
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

464 {
465  auto && default_variable_value = getDefaultVectorValue(var_name);
466  return *default_variable_value->data();
467 }
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:398

◆ getDefaultNodalValue() [2/3]

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

Definition at line 471 of file Coupleable.C.

472 {
473  auto && default_variable_value = getDefaultArrayValue(var_name);
474  return *default_variable_value->data();
475 }
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:433

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

456 {
457  auto && default_variable_value = getDefaultValue(var_name, comp);
458  return *default_variable_value->data();
459 }
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:371

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

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

372 {
373  // make sure we don't access values that were not provided
374  checkComponent(_obj, comp, _c_parameters.numberDefaultCoupledValues(var_name), var_name);
375 
376  auto default_value_it = _default_value.find(var_name);
377  if (default_value_it == _default_value.end())
378  {
379  _default_value[var_name].emplace_back(std::make_unique<VariableValue>(
381  for (unsigned int j = 1; j < _c_parameters.numberDefaultCoupledValues(var_name); ++j)
382  _default_value[var_name].emplace_back(std::make_unique<VariableValue>(
384  default_value_it = _default_value.find(var_name);
385  }
386 
387  const auto & default_value_vec = default_value_it->second;
388  const auto n_default_vals = default_value_vec.size();
389  if (comp >= n_default_vals)
390  mooseError("Requested comp ",
391  comp,
392  " is equal to or greater than the number of default values ",
393  n_default_vals);
394  return default_value_vec[comp].get();
395 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
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:1833
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:1457
const InputParameters & _c_parameters
Definition: Coupleable.h:1409
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

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

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

399 {
400  auto default_value_it = _default_vector_value.find(var_name);
401  if (default_value_it == _default_vector_value.end())
402  {
403  auto value = std::make_unique<VectorVariableValue>(_coupleable_max_qps, 0);
404  bool already_warned = false;
405  for (unsigned int qp = 0; qp < _coupleable_max_qps; ++qp)
406  for (const auto i : make_range(Moose::dim))
407  {
408  try
409  {
410  (*value)[qp](i) = _c_parameters.defaultCoupledValue(var_name, i);
411  }
412  catch (const std::out_of_range &)
413  {
414  if (!already_warned)
415  mooseWarning(
416  "You supplied less than 3 arguments for the default vector value for variable ",
417  var_name,
418  ". Did you accidently leave something off? We are going to assign 0s, assuming "
419  "this "
420  "was intentional.");
421  already_warned = true;
422  (*value)[qp](i) = 0;
423  }
424  }
425  default_value_it =
426  _default_vector_value.insert(std::make_pair(var_name, std::move(value))).first;
427  }
428 
429  return default_value_it->second.get();
430 }
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition: MooseError.h:345
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:163
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:1464
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:1409
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1818

◆ 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:363
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 122 of file Coupleable.h.

122 { return _fe_coupleable_matrix_tags; }
std::set< TagID > _fe_coupleable_matrix_tags
Definition: Coupleable.h:1828

◆ getFEVariableCoupleableMatrixTags() [2/2]

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

Definition at line 129 of file Coupleable.h.

130  {
132  }
std::set< TagID > _fe_coupleable_matrix_tags
Definition: Coupleable.h:1828

◆ getFEVariableCoupleableVectorTags() [1/2]

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

◆ getFEVariableCoupleableVectorTags() [2/2]

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

Definition at line 124 of file Coupleable.h.

125  {
127  }
std::set< TagID > _fe_coupleable_vector_tags
Definition: Coupleable.h:1826

◆ 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 }

◆ getFieldVars()

std::vector< const MooseVariableFieldBase * > Coupleable::getFieldVars ( const std::string &  var_name) const
protected

Definition at line 318 of file Coupleable.C.

319 {
320  return getVarsHelper<MooseVariableFieldBase>(var_name);
321 }

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

325 {
326  return const_cast<MooseVariable *>(getVarHelper<MooseVariable>(var_name, comp));
327 }

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

349 {
350  return getVarHelper<MooseVariable>(var_name, comp);
351 }

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

2117 {
2118  return const_cast<Coupleable *>(this)->getVarHelper<T>(var_name, comp);
2119 }
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:52

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

2063 {
2064  const auto var_name = _c_parameters.checkForRename(var_name_in);
2065  auto name_to_use = var_name;
2066 
2067  // First check for supplied name
2068  if (!checkVar(var_name, comp, 0))
2069  {
2070  // See if there is an associated deprecated name that the user may have used instead
2071  auto it = _new_to_deprecated_coupled_vars.find(var_name);
2072  if (it == _new_to_deprecated_coupled_vars.end())
2073  return nullptr;
2074  else
2075  {
2076  auto deprecated_name = it->second;
2077  if (checkVar(deprecated_name, comp, 0))
2078  name_to_use = deprecated_name;
2079  else
2080  return nullptr;
2081  }
2082  }
2083 
2084  auto coupled_vars_it = _coupled_vars.find(name_to_use);
2085 
2086  mooseAssert(coupled_vars_it != _coupled_vars.end(),
2087  "Trying to get a coupled var " << name_to_use << " that doesn't exist");
2088 
2089  if (auto coupled_var = dynamic_cast<T *>(coupled_vars_it->second[comp]))
2090  return coupled_var;
2091  else
2092  {
2093  for (auto & var : _coupled_standard_moose_vars)
2094  if (var->name() == name_to_use)
2095  mooseError("The named variable is a standard variable, try a "
2096  "'coupled[Value/Gradient/Dot/etc]...' function instead");
2097  for (auto & var : _coupled_vector_moose_vars)
2098  if (var->name() == name_to_use)
2099  mooseError("The named variable is a vector variable, try a "
2100  "'coupledVector[Value/Gradient/Dot/etc]...' function instead");
2101  for (auto & var : _coupled_array_moose_vars)
2102  if (var->name() == name_to_use)
2103  mooseError("The named variable is an array variable, try a "
2104  "'coupledArray[Value/Gradient/Dot/etc]...' function instead");
2105  for (auto & var : _coupled_fv_moose_vars)
2106  if (var->name() == name_to_use)
2107  mooseError("The named variable is a finite volume variable, which the coupled[...] routine "
2108  "used does not support. Try using the functor system routines instead.");
2109  mooseError(
2110  "Variable '", name_to_use, "' is of a different C++ type than you tried to fetch it as.");
2111  }
2112 }
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
Definition: Coupleable.h:1423
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
std::vector< ArrayMooseVariable * > _coupled_array_moose_vars
Vector of array coupled variables.
Definition: Coupleable.h:1435
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Definition: Coupleable.h:1429
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
Definition: Coupleable.h:1432
std::vector< MooseVariableField< Real > * > _coupled_fv_moose_vars
Vector of all finite volume coupled variables.
Definition: Coupleable.h:1438
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:1409
const std::unordered_map< std::string, std::string > & _new_to_deprecated_coupled_vars
map from new to deprecated variable names
Definition: Coupleable.h:1441

◆ getVarsHelper()

template<typename T >
std::vector< const T * > Coupleable::getVarsHelper ( const std::string &  var_name) const
protected

Helper that can be used to retrieve all the component variables of a variable of arbitrary type T.

Parameters
var_nameof the variable, can be a regular, vector or array variable

Definition at line 2123 of file Coupleable.h.

2124 {
2125  const auto components = coupledComponents(var_name);
2126  std::vector<const T *> vars(components);
2127  for (const auto i : make_range(components))
2128  vars[i] = getVarHelper<T>(var_name, i);
2129  return vars;
2130 }
char ** vars
unsigned int coupledComponents(const std::string &var_name) const
Number of coupled components.
Definition: Coupleable.C:188
IntRange< T > make_range(T beg, T end)

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

331 {
332  auto * const var =
333  const_cast<VectorMooseVariable *>(getVarHelper<VectorMooseVariable>(var_name, comp));
334 
335  if (_c_nodal && var && var->feType().family != LAGRANGE_VEC)
336  mooseError(_c_name, ": Only LAGRANGE_VEC vector variables are defined at nodes");
337 
338  return var;
339 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
LAGRANGE_VEC
Class for stuff related to variables.
Definition: Adaptivity.h:33
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1412

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

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

◆ getWritableCoupledVariables()

auto& Coupleable::getWritableCoupledVariables ( ) const
inline

returns a reference to the set of writable coupled variables

Definition at line 137 of file Coupleable.h.

Referenced by hasWritableCoupledVariables().

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

◆ hasWritableCoupledVariables()

bool Coupleable::hasWritableCoupledVariables ( ) const
inline

Checks whether the object has any writable coupled variables.

Definition at line 142 of file Coupleable.h.

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

◆ 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 MatReactionTempl< false >::MatReactionTempl().

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:1423
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1412
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:1409

◆ 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:1409

◆ kokkosADCoupledDofValue()

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

◆ kokkosADCoupledDofValueOld()

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

◆ kokkosADCoupledDofValueOlder()

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

◆ kokkosADCoupledDofValues()

Moose::Kokkos::ADVariableValue Coupleable::kokkosADCoupledDofValues ( const std::string &  var_name) const

◆ kokkosADCoupledDofValuesOld()

Moose::Kokkos::ADVariableValue Coupleable::kokkosADCoupledDofValuesOld ( const std::string &  var_name) const

◆ kokkosADCoupledDofValuesOlder()

Moose::Kokkos::ADVariableValue Coupleable::kokkosADCoupledDofValuesOlder ( const std::string &  var_name) const

◆ kokkosADCoupledDot()

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

◆ kokkosADCoupledDots()

Moose::Kokkos::ADVariableValue Coupleable::kokkosADCoupledDots ( const std::string &  var_name) const

◆ kokkosADCoupledGradient()

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

◆ kokkosADCoupledGradientOld()

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

◆ kokkosADCoupledGradientOlder()

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

◆ kokkosADCoupledGradients()

Moose::Kokkos::ADVariableGradient Coupleable::kokkosADCoupledGradients ( const std::string &  var_name) const

◆ kokkosADCoupledGradientsOld()

Moose::Kokkos::ADVariableGradient Coupleable::kokkosADCoupledGradientsOld ( const std::string &  var_name) const

◆ kokkosADCoupledGradientsOlder()

Moose::Kokkos::ADVariableGradient Coupleable::kokkosADCoupledGradientsOlder ( const std::string &  var_name) const

◆ kokkosADCoupledNodalDot()

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

◆ kokkosADCoupledNodalDots()

Moose::Kokkos::ADVariableValue Coupleable::kokkosADCoupledNodalDots ( const std::string &  var_name) const

◆ kokkosADCoupledNodalValue()

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

◆ kokkosADCoupledNodalValueOld()

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

◆ kokkosADCoupledNodalValueOlder()

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

◆ kokkosADCoupledNodalValues()

Moose::Kokkos::ADVariableValue Coupleable::kokkosADCoupledNodalValues ( const std::string &  var_name) const

◆ kokkosADCoupledNodalValuesOld()

Moose::Kokkos::ADVariableValue Coupleable::kokkosADCoupledNodalValuesOld ( const std::string &  var_name) const

◆ kokkosADCoupledNodalValuesOlder()

Moose::Kokkos::ADVariableValue Coupleable::kokkosADCoupledNodalValuesOlder ( const std::string &  var_name) const

◆ kokkosADCoupledValue()

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

◆ kokkosADCoupledValueOld()

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

◆ kokkosADCoupledValueOlder()

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

◆ kokkosADCoupledValues()

Moose::Kokkos::ADVariableValue Coupleable::kokkosADCoupledValues ( const std::string &  var_name) const

◆ kokkosADCoupledValuesOld()

Moose::Kokkos::ADVariableValue Coupleable::kokkosADCoupledValuesOld ( const std::string &  var_name) const

◆ kokkosADCoupledValuesOlder()

Moose::Kokkos::ADVariableValue Coupleable::kokkosADCoupledValuesOlder ( const std::string &  var_name) const

◆ kokkosADCoupledVectorTagDofValue()

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

◆ kokkosADCoupledVectorTagDofValueByName()

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

◆ kokkosADCoupledVectorTagDofValues()

Moose::Kokkos::ADVariableValue Coupleable::kokkosADCoupledVectorTagDofValues ( const std::string &  var_name,
const std::string &  tag_param_name 
) const

◆ kokkosADCoupledVectorTagDofValuesByName()

Moose::Kokkos::ADVariableValue Coupleable::kokkosADCoupledVectorTagDofValuesByName ( const std::string &  var_name,
const std::string &  tag_name 
) const

◆ kokkosADCoupledVectorTagGradient()

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

◆ kokkosADCoupledVectorTagGradientByName()

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

◆ kokkosADCoupledVectorTagGradients()

Moose::Kokkos::ADVariableGradient Coupleable::kokkosADCoupledVectorTagGradients ( const std::string &  var_name,
const std::string &  tag_param_name 
) const

◆ kokkosADCoupledVectorTagGradientsByName()

Moose::Kokkos::ADVariableGradient Coupleable::kokkosADCoupledVectorTagGradientsByName ( const std::string &  var_name,
const std::string &  tag_name 
) const

◆ kokkosADCoupledVectorTagNodalValue()

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

◆ kokkosADCoupledVectorTagNodalValueByName()

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

◆ kokkosADCoupledVectorTagNodalValues()

Moose::Kokkos::ADVariableValue Coupleable::kokkosADCoupledVectorTagNodalValues ( const std::string &  var_name,
const std::string &  tag_param_name 
) const

◆ kokkosADCoupledVectorTagNodalValuesByName()

Moose::Kokkos::ADVariableValue Coupleable::kokkosADCoupledVectorTagNodalValuesByName ( const std::string &  var_name,
const std::string &  tag_name 
) const

◆ kokkosADCoupledVectorTagValue()

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

◆ kokkosADCoupledVectorTagValueByName()

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

◆ kokkosADCoupledVectorTagValues()

Moose::Kokkos::ADVariableValue Coupleable::kokkosADCoupledVectorTagValues ( const std::string &  var_name,
const std::string &  tag_param_name 
) const

◆ kokkosADCoupledVectorTagValuesByName()

Moose::Kokkos::ADVariableValue Coupleable::kokkosADCoupledVectorTagValuesByName ( const std::string &  var_name,
const std::string &  tag_name 
) const

◆ kokkosCoupledDofValue()

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

◆ kokkosCoupledDofValueOld()

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

◆ kokkosCoupledDofValueOlder()

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

◆ kokkosCoupledDofValues()

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

◆ kokkosCoupledDofValuesOld()

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

◆ kokkosCoupledDofValuesOlder()

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

◆ kokkosCoupledDot()

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

◆ kokkosCoupledDotDu()

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

◆ kokkosCoupledDots()

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

◆ kokkosCoupledGradient()

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

◆ kokkosCoupledGradientOld()

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

◆ kokkosCoupledGradientOlder()

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

◆ kokkosCoupledGradients()

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

◆ kokkosCoupledGradientsOld()

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

◆ kokkosCoupledGradientsOlder()

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

◆ kokkosCoupledNodalDot()

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

◆ kokkosCoupledNodalDots()

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

◆ kokkosCoupledNodalValue()

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

◆ kokkosCoupledNodalValueOld()

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

◆ kokkosCoupledNodalValueOlder()

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

◆ kokkosCoupledNodalValues()

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

◆ kokkosCoupledNodalValuesOld()

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

◆ kokkosCoupledNodalValuesOlder()

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

◆ kokkosCoupledValue()

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

◆ kokkosCoupledValueOld()

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

◆ kokkosCoupledValueOlder()

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

◆ kokkosCoupledValues()

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

◆ kokkosCoupledValuesOld()

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

◆ kokkosCoupledValuesOlder()

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

◆ kokkosCoupledVectorTagDofValue()

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

◆ kokkosCoupledVectorTagDofValueByName()

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

◆ kokkosCoupledVectorTagDofValues()

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

◆ kokkosCoupledVectorTagDofValuesByName()

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

◆ kokkosCoupledVectorTagGradient()

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

◆ kokkosCoupledVectorTagGradientByName()

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

◆ kokkosCoupledVectorTagGradients()

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

◆ kokkosCoupledVectorTagGradientsByName()

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

◆ kokkosCoupledVectorTagNodalValue()

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

◆ kokkosCoupledVectorTagNodalValueByName()

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

◆ kokkosCoupledVectorTagNodalValues()

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

◆ kokkosCoupledVectorTagNodalValuesByName()

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

◆ kokkosCoupledVectorTagValue()

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

◆ kokkosCoupledVectorTagValueByName()

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

◆ kokkosCoupledVectorTagValues()

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

◆ kokkosCoupledVectorTagValuesByName()

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

◆ kokkosCoupledVectorTagVariable()

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

◆ kokkosCoupledVectorTagVariables()

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

◆ kokkosZeroGradient()

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

◆ kokkosZeroNodalValue()

Moose::Kokkos::VariableValue Coupleable::kokkosZeroNodalValue ( ) const

◆ kokkosZeroValue()

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

◆ kokkosZeroVariable()

Moose::Kokkos::Variable Coupleable::kokkosZeroVariable ( ) const
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 584 of file Coupleable.C.

587 {
588  auto var =
589  const_cast<MooseVariableField<T> *>(getVarHelper<MooseVariableField<T>>(var_name, comp));
590  if (!var)
591  mooseError(var_name, ": invalid variable name for tag coupling");
592 
593  auto & var_sys = var->sys();
594  if (tag_name == Moose::OLD_SOLUTION_TAG)
595  var_sys.needSolutionState(1);
596  else if (tag_name == Moose::OLDER_SOLUTION_TAG)
597  var_sys.needSolutionState(2);
598 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
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 2155 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().

2156 {
2157  if (!_c_fe_problem.isTransient())
2159  ": Calling \"",
2160  fn_name,
2161  "\" on variable \"",
2162  name,
2163  "\" when using a \"Steady\" executioner is not allowed. This value is available "
2164  "only in transient simulations.");
2165 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1417
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1412
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 764 of file Coupleable.C.

767 {
768  const auto * var = getVarHelper<MooseVariableField<T>>(var_name, comp);
769  if (!var)
770  mooseError(var_name, ": invalid variable name for coupledVectorTagDofValue");
772 
773  const_cast<Coupleable *>(this)->addFEVariableCoupleableVectorTag(tag);
774 
775  return var->vectorTagDofValue(tag);
776 }
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:311
void addFEVariableCoupleableVectorTag(TagID tag)
Definition: Coupleable.h:116
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:52

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

783 {
784  if (!_c_parameters.isParamValid(tag_param_name))
785  mooseError("Tag name parameter '", tag_param_name, "' is invalid");
786 
787  const TagName tag_name = MooseUtils::toUpper(_c_parameters.get<TagName>(tag_param_name));
788 
789  const bool older_state_tag = _older_state_tags.count(tag_name);
790  if (older_state_tag)
791  // We may need to add solution states and create vector tags
792  const_cast<Coupleable *>(this)->requestStates<T>(var_name, tag_name, comp);
793 
794  if (!_c_fe_problem.vectorTagExists(tag_name))
795  mooseError("Tagged vector with tag name '", tag_name, "' does not exist");
796 
797  TagID tag = _c_fe_problem.getVectorTagID(tag_name);
798 
799  return vectorTagDofValueHelper<T>(var_name, tag, comp);
800 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:204
unsigned int TagID
Definition: MooseTypes.h:238
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
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:1417
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:52
const InputParameters & _c_parameters
Definition: Coupleable.h:1409
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:1836
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 558 of file Coupleable.C.

561 {
562  const auto * const var = getVarHelper<MooseVariableField<T>>(var_names, index);
563  if (!var)
564  mooseError(var_names, ": invalid variable name for coupledVectorTagValue");
566 
567  if (!_c_fe_problem.vectorTagExists(tag))
568  mooseError("Attempting to couple to vector tag with ID ",
569  tag,
570  "in ",
571  _c_name,
572  ", but a vector tag with that ID does not exist");
573 
574  const_cast<Coupleable *>(this)->addFEVariableCoupleableVectorTag(tag);
575 
576  if (_c_nodal)
577  return var->nodalVectorTagValue(tag);
578  else
579  return var->vectorTagValue(tag);
580 }
bool _c_nodal
True if we provide coupling to nodal values.
Definition: Coupleable.h:1444
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:311
FEProblemBase & _c_fe_problem
Definition: Coupleable.h:1417
void addFEVariableCoupleableVectorTag(TagID tag)
Definition: Coupleable.h:116
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1412
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:52

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

605 {
606  if (!_c_parameters.isParamValid(tag_param_name))
607  mooseError("Tag name parameter '", tag_param_name, "' is invalid");
608 
609  const TagName tag_name = MooseUtils::toUpper(_c_parameters.get<TagName>(tag_param_name));
610 
611  const bool older_state_tag = _older_state_tags.count(tag_name);
612  if (older_state_tag)
613  // We may need to add solution states and create vector tags
614  const_cast<Coupleable *>(this)->requestStates<T>(var_names, tag_name, index);
615 
616  if (!_c_fe_problem.vectorTagExists(tag_name))
617  mooseError("Tagged vector with tag name '", tag_name, "' does not exist");
618 
619  TagID tag = _c_fe_problem.getVectorTagID(tag_name);
620  return vectorTagValueHelper<T>(var_names, tag, index);
621 }
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition: SubProblem.C:204
unsigned int TagID
Definition: MooseTypes.h:238
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
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:1417
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:52
const InputParameters & _c_parameters
Definition: Coupleable.h:1409
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:1836
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 950 of file Coupleable.C.

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

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

915 {
916  auto * var = getVarHelper<MooseWritableVariable>(var_name, comp);
917 
918  const auto * aux = dynamic_cast<const AuxKernel *>(this);
919  const auto * euo = dynamic_cast<const ElementUserObject *>(this);
920  const auto * nuo = dynamic_cast<const NodalUserObject *>(this);
921  const auto * nfc = dynamic_cast<const NodeFaceConstraint *>(this);
922  const auto * nec = dynamic_cast<const NodeElemConstraintBase *>(this);
923 
924  if (!aux && !euo && !nuo && !nfc && !nec)
925  mooseError("writableVariable() can only be called from AuxKernels, ElementUserObjects, "
926  "NodalUserObjects, NodeFaceConstraints, or NodeElemConstraints. '",
927  _obj->name(),
928  "' is none of those.");
929 
930  if (aux && !aux->isNodal() && var->isNodal())
931  mooseError("The elemental AuxKernel '",
932  _obj->name(),
933  "' cannot obtain a writable reference to the nodal variable '",
934  var->name(),
935  "'.");
936  if (euo && var->isNodal())
937  mooseError("The ElementUserObject '",
938  _obj->name(),
939  "' cannot obtain a writable reference to the nodal variable '",
940  var->name(),
941  "'.");
942 
943  // make sure only one object can access a variable
944  checkWritableVar(var);
945 
946  return *var;
947 }
void checkWritableVar(MooseWritableVariable *var)
Checks that the passed in variable is only accessed writable by one object in a given subdomain...
Definition: Coupleable.C:988
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
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:1833
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 1495 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 1483 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 1492 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 1460 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 1486 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 1471 of file Coupleable.h.

Referenced by getADDefaultVectorValue().

◆ _ad_grad_zero

const MooseArray<ADRealVectorValue>& Coupleable::_ad_grad_zero
protected

Definition at line 1504 of file Coupleable.h.

Referenced by adZeroGradient().

◆ _ad_second_zero

const MooseArray<ADRealTensorValue>& Coupleable::_ad_second_zero
protected

Definition at line 1511 of file Coupleable.h.

Referenced by adZeroSecond().

◆ _ad_zero

const MooseArray<ADReal>& Coupleable::_ad_zero
protected

Definition at line 1500 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 1450 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 1824 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 1447 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 1420 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 1414 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 1732 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 1438 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 1423 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 1432 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 1541 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 1467 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 1538 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 1532 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 1480 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 1489 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 1457 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 1477 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 1529 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 1526 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 1464 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 1523 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 1507 of file Coupleable.h.

◆ _grad_zero

const VariableGradient& Coupleable::_grad_zero
protected

Zero gradient of a variable.

Definition at line 1503 of file Coupleable.h.

◆ _is_fv

const bool Coupleable::_is_fv
private

Whether the MooseObject is a finite volume object.

Definition at line 1831 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 1846 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 1441 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 1836 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 1821 of file Coupleable.h.

Referenced by Coupleable(), and coupled().

◆ _phi_zero

const VariablePhiValue& Coupleable::_phi_zero
protected

Definition at line 1499 of file Coupleable.h.

◆ _second_phi_zero

const VariablePhiSecond& Coupleable::_second_phi_zero
protected

Zero second derivative of a test function.

Definition at line 1513 of file Coupleable.h.

◆ _second_zero

const VariableSecond& Coupleable::_second_zero
protected

Zero second derivative of a variable.

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

◆ _vector_zero

const VectorVariableValue& Coupleable::_vector_zero
protected

Zero value of a vector variable.

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

Referenced by checkWritableVar(), and getWritableCoupledVariables().

◆ _zero

const VariableValue& Coupleable::_zero
protected

Zero value of a variable.

Definition at line 1498 of file Coupleable.h.


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