12 #ifdef MOOSE_KOKKOS_SCOPE 16 #include <unordered_map> 25 #define usingCoupleableMembers \ 26 using Coupleable::_zero; \ 27 using Coupleable::_grad_zero; \ 28 using Coupleable::_ad_zero; \ 29 using Coupleable::_ad_grad_zero 60 #ifdef MOOSE_KOKKOS_ENABLED 71 const std::unordered_map<std::string, std::vector<MooseVariableFieldBase *>> &
154 virtual bool isCoupled(
const std::string & var_name,
unsigned int i = 0)
const;
176 VariableName
coupledName(
const std::string & var_name,
unsigned int comp = 0)
const;
183 std::vector<VariableName>
coupledNames(
const std::string & var_name)
const;
192 virtual unsigned int coupled(
const std::string & var_name,
unsigned int comp = 0)
const;
199 std::vector<unsigned int>
coupledIndices(
const std::string & var_name)
const;
209 unsigned int comp = 0)
const;
216 std::vector<const VariableValue *>
coupledValues(
const std::string & var_name)
const;
223 std::vector<const VectorVariableValue *>
coupledVectorValues(
const std::string & var_name)
const;
231 template <
bool is_ad>
233 unsigned int comp = 0)
const;
242 template <
bool is_ad>
244 unsigned int comp = 0)
const;
252 template <
bool is_ad>
253 std::vector<const GenericVariableValue<is_ad> *>
262 template <
bool is_ad>
264 unsigned int comp = 0)
const;
273 template <
bool is_ad>
275 unsigned int comp = 0)
const;
284 template <
bool is_ad>
286 unsigned int comp = 0)
const;
295 unsigned int comp = 0)
const;
311 std::vector<const ADVariableValue *>
adCoupledValues(
const std::string & var_name)
const;
320 unsigned int comp = 0)
const;
330 unsigned int comp = 0)
const;
338 std::vector<const ADVectorVariableValue *>
353 const std::string & tag_name,
354 unsigned int index = 0)
const;
366 const std::string & tag_name)
const;
378 unsigned int index = 0)
const;
381 const std::string & tag_name,
382 unsigned int index = 0)
const;
393 std::vector<const ArrayVariableValue *>
408 const std::string & tag_name,
409 unsigned int index = 0)
const;
420 std::vector<const VariableGradient *>
434 unsigned int index = 0)
const;
437 const std::string & tag_name,
438 unsigned int index = 0)
const;
446 std::vector<const ArrayVariableGradient *>
449 std::vector<const ArrayVariableGradient *>
463 const std::string & tag_name,
464 unsigned int index = 0)
const;
473 const std::string & tag_name,
474 unsigned int comp = 0)
const;
486 const std::string & tag_name)
const;
500 const std::string & tag_name,
501 unsigned int index = 0)
const;
513 const std::string & tag_name)
const;
523 unsigned int comp = 0)
const;
533 unsigned int comp = 0)
const;
540 std::vector<const ArrayVariableValue *>
coupledArrayValues(
const std::string & var_name)
const;
580 unsigned int comp = 0)
const;
587 std::vector<const VariableValue *>
coupledValuesOld(
const std::string & var_name)
const;
594 std::vector<const VectorVariableValue *>
605 unsigned int comp = 0)
const;
612 std::vector<const VariableValue *>
coupledValuesOlder(
const std::string & var_name)
const;
621 unsigned int comp = 0)
const;
631 unsigned int comp = 0)
const;
641 unsigned int comp = 0)
const;
651 unsigned int comp = 0)
const;
661 unsigned int comp = 0)
const;
671 unsigned int comp = 0)
const;
678 std::vector<const VariableGradient *>
coupledGradients(
const std::string & var_name)
const;
688 unsigned int comp = 0)
const;
698 unsigned int comp = 0)
const;
706 std::vector<const ADVariableGradient *>
adCoupledGradients(
const std::string & var_name)
const;
715 template <
bool is_ad>
717 unsigned int comp = 0)
const;
725 template <
bool is_ad>
726 std::vector<const GenericVariableGradient<is_ad> *>
737 unsigned int comp = 0)
const;
746 unsigned int comp = 0)
const;
756 unsigned int comp = 0)
const;
766 unsigned int comp = 0)
const;
773 std::vector<const VariableGradient *>
coupledGradientsOld(
const std::string & var_name)
const;
783 unsigned int comp = 0)
const;
792 unsigned int comp = 0)
const;
802 unsigned int comp = 0)
const;
812 unsigned int comp = 0)
const;
822 unsigned int comp = 0)
const;
832 unsigned int comp = 0)
const;
842 unsigned int comp = 0)
const;
852 unsigned int comp = 0)
const;
862 unsigned int comp = 0)
const;
872 unsigned int comp = 0)
const;
882 unsigned int comp = 0)
const;
892 unsigned int comp = 0)
const;
902 unsigned int comp = 0)
const;
912 unsigned int comp = 0)
const;
922 unsigned int comp = 0)
const;
933 unsigned int comp = 0)
const;
944 unsigned int comp = 0)
const;
955 unsigned int comp = 0)
const;
965 unsigned int comp = 0)
const;
976 unsigned int comp = 0)
const;
987 unsigned int comp = 0)
const;
996 unsigned int comp = 0)
const;
1005 unsigned int comp = 0)
const;
1012 std::vector<const VariableValue *>
coupledDots(
const std::string & var_name)
const;
1022 unsigned int comp = 0)
const;
1031 unsigned int comp = 0)
const;
1041 unsigned int comp = 0)
const;
1057 std::vector<const ADVariableValue *>
adCoupledDots(
const std::string & var_name)
const;
1067 unsigned int comp = 0)
const;
1078 unsigned int comp = 0)
const;
1088 unsigned int comp = 0)
const;
1098 unsigned int comp = 0)
const;
1108 unsigned int comp = 0)
const;
1118 unsigned int comp = 0)
const;
1128 unsigned int comp = 0)
const;
1138 unsigned int comp = 0)
const;
1148 unsigned int comp = 0)
const;
1158 unsigned int comp = 0)
const;
1168 unsigned int comp = 0)
const;
1178 unsigned int comp = 0)
const;
1188 unsigned int comp = 0)
const;
1198 unsigned int comp = 0)
const;
1208 unsigned int comp = 0)
const;
1216 template <
typename T>
1217 const T &
coupledNodalValue(
const std::string & var_name,
unsigned int comp = 0)
const;
1225 template <
typename T>
1227 unsigned int comp = 0)
const;
1235 template <
typename T>
1244 template <
typename T>
1253 template <
typename T>
1263 template <
typename T>
1264 const T &
coupledNodalDot(
const std::string & var_name,
unsigned int comp = 0)
const;
1274 unsigned int comp = 0)
const;
1284 unsigned int comp = 0)
const;
1294 unsigned int comp = 0)
const;
1303 unsigned int comp = 0)
const;
1311 std::vector<const VariableValue *>
coupledAllDofValues(
const std::string & var_name)
const;
1320 unsigned int comp = 0)
const;
1337 unsigned int comp = 0)
const;
1354 unsigned int comp = 0)
const;
1364 unsigned int comp = 0)
const;
1387 template <
bool is_ad>
1394 template <
bool is_ad>
1401 template <
bool is_ad>
1420 std::unordered_map<std::string, std::vector<MooseVariableFieldBase *>>
_coupled_vars;
1453 mutable std::unordered_map<std::string, std::vector<std::unique_ptr<VariableValue>>>
1460 mutable std::unordered_map<std::string, std::unique_ptr<VectorVariableValue>>
1467 mutable std::unordered_map<std::string, std::unique_ptr<MooseArray<ADRealVectorValue>>>
1546 checkVar(
const std::string & var_name,
unsigned int comp = 0,
unsigned int comp_bound = 0)
const;
1552 template <
typename T>
1559 template <
typename T>
1561 const std::string & tag_name,
1562 unsigned int index = 0)
const;
1567 template <
typename T>
1574 template <
typename T>
1576 const std::string & var_name,
const std::string & tag_name,
unsigned int comp = 0)
const;
1583 template <
typename T>
1585 requestStates(
const std::string & var_name,
const TagName & tag_name,
const unsigned int comp);
1637 template <
typename T>
1638 const T *
getVarHelper(
const std::string & var_name,
unsigned int comp)
const;
1643 template <
typename T>
1644 T *
getVarHelper(
const std::string & var_name,
unsigned int comp);
1702 template <
typename T,
typename Func>
1706 std::vector<T> vals(components);
1707 for (MooseIndex(components) comp = 0; comp < components; ++comp)
1708 vals[comp] = func(comp);
1792 template <
typename T>
1795 template <
typename T>
1829 #ifdef MOOSE_KOKKOS_SCOPE 1831 const std::string & tag_name,
1834 const std::string & tag_name);
1839 const std::string & tag_name,
1840 unsigned int comp = 0);
1842 const std::string & tag_name);
1844 const std::string & tag_name,
1845 unsigned int comp = 0);
1849 const std::string & tag_name,
1850 unsigned int comp = 0);
1853 const std::string & tag_name);
1856 const std::string & tag_param_name,
1857 unsigned int comp = 0);
1859 const std::string & tag_param_name);
1861 const std::string & tag_param_name,
1862 unsigned int comp = 0);
1866 const std::string & tag_param_name,
1867 unsigned int comp = 0);
1870 const std::string & tag_param_name);
1873 unsigned int comp = 0);
1876 unsigned int comp = 0);
1879 unsigned int comp = 0);
1883 unsigned int comp = 0);
1886 unsigned int comp = 0);
1889 unsigned int comp = 0);
1893 unsigned int comp = 0);
1896 unsigned int comp = 0);
1899 unsigned int comp = 0);
1903 unsigned int comp = 0);
1906 unsigned int comp = 0);
1910 unsigned int comp = 0);
1918 template <
typename T>
1923 auto name_to_use = var_name;
1934 auto deprecated_name = it->second;
1935 if (
checkVar(deprecated_name, comp, 0))
1936 name_to_use = deprecated_name;
1945 "Trying to get a coupled var " << name_to_use <<
" that doesn't exist");
1947 if (
auto coupled_var = dynamic_cast<T *>(coupled_vars_it->second[comp]))
1952 if (var->name() == name_to_use)
1953 mooseError(
"The named variable is a standard variable, try a " 1954 "'coupled[Value/Gradient/Dot/etc]...' function instead");
1956 if (var->name() == name_to_use)
1957 mooseError(
"The named variable is a vector variable, try a " 1958 "'coupledVector[Value/Gradient/Dot/etc]...' function instead");
1960 if (var->name() == name_to_use)
1961 mooseError(
"The named variable is an array variable, try a " 1962 "'coupledArray[Value/Gradient/Dot/etc]...' function instead");
1964 if (var->name() == name_to_use)
1965 mooseError(
"The named variable is a finite volume variable, which the coupled[...] routine " 1966 "used does not support. Try using the functor system routines instead.");
1968 "Variable '", name_to_use,
"' is of a different C++ type than you tried to fetch it as.");
1972 template <
typename T>
1976 return const_cast<Coupleable *
>(
this)->getVarHelper<T>(var_name, comp);
virtual const ArrayVariableValue & coupledArrayDotDotOld(const std::string &var_name, unsigned int comp=0) const
Old second time derivative of a coupled array variable.
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.
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.
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.
virtual const ArrayVariableValue & coupledArrayValueOlder(const std::string &var_name, unsigned int comp=0) const
Returns an old value from two time steps previous of a coupled array variable.
OutputTools< Real >::VariableGradient VariableGradient
Moose::Kokkos::VariableValue kokkosCoupledDots(const std::string &var_name)
const T & coupledNodalDot(const std::string &var_name, unsigned int comp=0) const
Nodal values of time derivative of a coupled variable.
Moose::Kokkos::VariableValue kokkosZeroNodalValue()
OutputTools< RealVectorValue >::VariableDivergence VectorVariableDivergence
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...
virtual bool isCoupled(const std::string &var_name, unsigned int i=0) const
Returns true if a variables has been coupled as name.
virtual const VectorVariableGradient & coupledVectorGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled vector variable.
const std::vector< ArrayMooseVariable * > & getCoupledArrayMooseVars() const
Get the list of array coupled variables.
bool _c_nodal
True if we provide coupling to nodal values.
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
const std::vector< VectorMooseVariable * > & getCoupledVectorMooseVars() const
Get the list of vector coupled variables.
Moose::Kokkos::Variable kokkosZeroVariable()
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValue(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0)
Moose::GenericType< VectorVariableValue, is_ad > GenericVectorVariableValue
Moose::Kokkos::VariableValue kokkosCoupledValuesOlder(const std::string &var_name)
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
const VariableValue & _zero
Zero value of a variable.
const VariablePhiGradient & _grad_phi_zero
Zero gradient of trial function.
virtual unsigned int coupled(const std::string &var_name, unsigned int comp=0) const
Returns the index for a coupled variable by name.
virtual const VectorVariableValue & coupledVectorDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of a coupled vector variable.
const VariablePhiSecond & _second_phi_zero
Zero second derivative of a test function.
virtual const VariableSecond & coupledSecondPreviousNL(const std::string &var_name, unsigned int comp=0) const
Returns second derivative of a coupled variable for the previous Newton iterate.
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.
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...
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.
Moose::Kokkos::VariableGradient kokkosCoupledGradientsOld(const std::string &var_name)
std::vector< const VariableValue * > coupledValuesOlder(const std::string &var_name) const
Returns the older values for all of a coupled variable's components.
const ADVariableSecond & adZeroSecond() const
Retrieve a zero second for automatic differentiation.
const ADVectorVariableValue * getADDefaultVectorValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default vector value for Automatic Differentiat...
virtual const VariableSecond & coupledSecond(const std::string &var_name, unsigned int comp=0) const
Returns second spatial derivatives of a coupled variable.
virtual bool isCoupledConstant(const std::string &var_name) const
Returns true if a variable passed as a coupled value is really a constant.
virtual const VariableValue & coupledDotOld(const std::string &var_name, unsigned int comp=0) const
Old time derivative of a coupled variable.
Moose::Kokkos::Variable kokkosCoupledVectorTagVariables(const std::string &var_name, const std::string &tag_name)
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.
Moose::Kokkos::VariableGradient kokkosCoupledGradientsOlder(const std::string &var_name)
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValuesByName(const std::string &var_name, const std::string &tag_name)
std::vector< const ArrayVariableValue * > coupledArrayValues(const std::string &var_name) const
Returns the values for all of a coupled array variable's components.
std::vector< const VariableValue * > coupledDots(const std::string &var_name) const
Returns the time derivatives for all of a coupled variable's components.
virtual const ArrayVariableValue & coupledArrayValueOld(const std::string &var_name, unsigned int comp=0) const
Returns an old value from previous time step of a coupled array variable.
Moose::Kokkos::VariableValue kokkosZeroValue()
VariableName coupledName(const std::string &var_name, unsigned int comp=0) const
Names of the variable in the Coupleable interface.
virtual const VectorVariableGradient & coupledVectorGradientOld(const std::string &var_name, unsigned int comp=0) const
Returns an old gradient from previous time step of a coupled vector variable.
MooseVariableField< Real > MooseWritableVariable
Class for stuff related to variables.
const VectorVariableValue & _vector_zero
Zero value of a vector variable.
const VariableGradient & _grad_zero
Zero gradient of a variable.
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
std::set< TagID > _fe_coupleable_matrix_tags
const MooseArray< ADRealVectorValue > & _ad_grad_zero
virtual const VectorVariableValue & coupledVectorDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled vector variable.
virtual const VariableValue & coupledDotDotDu(const std::string &var_name, unsigned int comp=0) const
Second time derivative of a coupled variable with respect to the coefficients.
void checkWritableVar(MooseWritableVariable *var)
Checks that the passed in variable is only accessed writable by one object in a given subdomain...
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
const bool _is_fv
Whether the MooseObject is a finite volume object.
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.
const TagName OLDER_SOLUTION_TAG
Moose::Kokkos::VariableGradient kokkosCoupledGradientOlder(const std::string &var_name, unsigned int comp=0)
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 differen...
std::vector< ArrayMooseVariable * > _coupled_array_moose_vars
Vector of array coupled variables.
const ArrayVariableValue & coupledVectorTagArrayDofValue(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...
const VariableSecond & _second_zero
Zero second derivative of a variable.
std::vector< const VectorVariableValue * > coupledVectorValuesOld(const std::string &var_name) const
Returns the old values for all of a coupled vector variable's components.
const T & coupledNodalValue(const std::string &var_name, unsigned int comp=0) const
Returns nodal values of a coupled variable.
std::vector< T > coupledVectorHelper(const std::string &var_name, const Func &func) const
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.
OutputTools< RealVectorValue >::VariableValue VectorVariableValue
const ADVariableGradient & adCoupledGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable for use in Automatic Differentiation.
VectorVariableDivergence _default_div
This will always be zero because the default values for optionally coupled variables is always consta...
Moose::Kokkos::VariableValue kokkosCoupledNodalValuesOlder(const std::string &var_name)
const bool _c_allow_element_to_nodal_coupling
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.
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradientsByName(const std::string &var_name, const std::string &tag_name)
virtual const ArrayVariableValue & coupledArrayDofValues(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...
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.
std::set< TagID > _fe_coupleable_vector_tags
This is a wrapper that forwards calls to the implementation, which can be switched out at any time wi...
MooseArray< ADRealVectorValue > _ad_default_curl
This will always be zero because the default values for optionally coupled vector variables is always...
Moose::Kokkos::VariableValue kokkosCoupledValue(const std::string &var_name, unsigned int comp=0)
virtual const VariableValue & coupledDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled variable.
THREAD_ID _c_tid
Thread ID of the thread using this object.
const ADVariableValue & adCoupledValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled variable for use in Automatic Differentiation.
Moose::Kokkos::VariableValue kokkosCoupledDot(const std::string &var_name, unsigned int comp=0)
virtual const VariableValue & coupledNodalDotDot(const std::string &var_name, unsigned int comp=0) const
Nodal values of second time derivative of a coupled variable.
const ADVariableGradient & getADDefaultGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
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...
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...
virtual const VariableGradient & coupledGradientDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of the gradient of a coupled variable.
OutputTools< Real >::VariablePhiValue VariablePhiValue
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _c_coupled_scalar_vars
Scalar variables coupled into this object (for error checking)
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
const ADVectorVariableCurl & getADDefaultCurl() const
Helper method to return (and insert if necessary) the default curl value for Automatic Differentiatio...
Moose::Kokkos::VariableValue kokkosCoupledNodalValue(const std::string &var_name, unsigned int comp=0)
const GenericVariableGradient< is_ad > & genericZeroGradient()
Returns zero gradient templated with automatic differentiation boolean.
OutputTools< RealVectorValue >::VariableCurl VectorVariableCurl
virtual const ArrayVariableValue & coupledArrayDotOld(const std::string &var_name, unsigned int comp=0) const
Old time derivative of a coupled array variable.
Moose::Kokkos::VariableValue kokkosCoupledNodalValueOld(const std::string &var_name, unsigned int comp=0)
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.
This class provides an interface for common operations on field variables of both FE and FV types wit...
virtual const ArrayVariableValue & coupledArrayDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled array variable.
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 differentiati...
Moose::Kokkos::VariableValue kokkosCoupledValues(const std::string &var_name)
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
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.
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...
const ADVariableGradient & adZeroGradient() const
method that returns _grad_zero to RESIDUAL computing objects and _ad_grad_zero to JACOBIAN computing ...
MooseWritableVariable & writableVariable(const std::string &var_name, unsigned int comp=0)
Returns a writable MooseVariable object for a nodal or elemental variable.
Base class for a system (of equations)
virtual const VectorVariableDivergence & coupledDivOlder(const std::string &var_name, unsigned int comp=0) const
Returns an old divergence from two time steps previous of a coupled variable.
std::unordered_map< std::string, std::unique_ptr< VectorVariableValue > > _default_vector_value
Will hold the default value for optional vector coupled variables.
virtual VariableValue & writableCoupledValue(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...
std::vector< VariableName > coupledNames(const std::string &var_name) const
Names of the variables in the Coupleable interface.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual const VariableGradient & coupledGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable.
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.
Moose::Kokkos::VariableGradient kokkosCoupledGradients(const std::string &var_name)
OutputTools< Real >::VariablePhiSecond VariablePhiSecond
const T & coupledNodalValuePreviousNL(const std::string &var_name, unsigned int comp=0) const
Returns nodal values of a coupled variable for previous Newton iterate.
Moose::Kokkos::VariableValue kokkosCoupledValueOld(const std::string &var_name, unsigned int comp=0)
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...
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.
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradient(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0)
Moose::Kokkos::VariableGradient kokkosCoupledGradient(const std::string &var_name, unsigned int comp=0)
const std::vector< MooseVariable * > & getCoupledStandardMooseVars() const
Get the list of standard coupled variables.
const ADVariableValue & adCoupledDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of a coupled variable for ad simulations.
const SystemBase *const _c_sys
Pointer to the system object if the moose object this is an interface for has one.
FEProblemBase & _c_fe_problem
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.
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...
virtual const VariableSecond & coupledSecondOlder(const std::string &var_name, unsigned int comp=0) const
Returns an old second derivative from two time steps previous of a coupled variable.
const OutputTools< T >::VariableValue & vectorTagDofValueHelper(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. ...
bool _c_is_implicit
True if implicit value is required.
virtual const VariableValue & coupledValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled variable.
const ADVariableValue & adCoupledLowerValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled lower-dimensional variable for use in Automatic Differentiation.
virtual const VectorVariableValue & coupledVectorValueOlder(const std::string &var_name, unsigned int comp=0) const
Returns an old value from two time steps previous of a coupled vector variable.
Moose::Kokkos::VariableValue kokkosCoupledNodalValues(const std::string &var_name)
const ADVectorVariableSecond & adCoupledVectorSecond(const std::string &var_name, unsigned int comp=0) const
Returns second derivatives of a coupled vector variable for use in Automatic Differentiation.
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
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 ...
virtual const VariableValue & coupledValueLower(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled lower-dimensional variable.
Coupleable(const MooseObject *moose_object, bool nodal, bool is_fv=false)
Constructing the object.
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.
Moose::Kokkos::VariableGradient kokkosZeroGradient()
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.
const Real _kokkos_default_value_zero
kokkos-related variables and methods
OutputTools< RealEigenVector >::VariableValue ArrayVariableValue
virtual const VariableValue & coupledVectorDotDu(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled vector variable with respect to the coefficients.
void addFEVariableCoupleableVectorTag(TagID tag)
virtual const VariableSecond & coupledSecondOld(const std::string &var_name, unsigned int comp=0) const
Returns an old second spatial derivatives from previous time step of a coupled variable.
Moose::GenericType< VariableValue, is_ad > GenericVariableValue
auto & getWritableCoupledVariables() const
returns a reference to the set of writable coupled variables
const TagName OLD_SOLUTION_TAG
Every object that can be built by the factory should be derived from this class.
Moose::GenericType< VariableGradient, is_ad > GenericVariableGradient
virtual const ArrayVariableValue & coupledArrayValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled array variable.
const OutputTools< T >::VariableValue & vectorTagValueHelper(const std::string &var_names, TagID tag, unsigned int index=0) const
Generic helper method to get vector tag values based on tag ID.
std::vector< const VariableGradient * > coupledGradientsOld(const std::string &var_name) const
Returns the old gradients for all of a coupled variable's components.
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.
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
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.
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...
Moose::Kokkos::VariableValue kokkosCoupledNodalValuesOld(const std::string &var_name)
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.
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...
virtual const VariableGradient & coupledGradientDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of the gradient of a coupled variable.
const ADVariableValue * getADDefaultValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for Automatic Differentiation for...
const ADVariableValue & adCoupledDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled variable for ad simulations.
Moose::Kokkos::VariableValue kokkosCoupledValueOlder(const std::string &var_name, unsigned int comp=0)
const std::string & _c_name
The name of the object this interface is part of.
Moose::Kokkos::VariableValue kokkosCoupledNodalDots(const std::string &var_name)
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...
virtual const VectorVariableCurl & coupledCurlOld(const std::string &var_name, unsigned int comp=0) const
Returns an old curl from previous time step of a coupled variable.
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.
virtual const VariableValue & coupledNodalDotDotOld(const std::string &var_name, unsigned int comp=0) const
Nodal values of old second time derivative of a coupled variable.
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 eleme...
std::vector< const VariableGradient * > coupledGradients(const std::string &var_name) const
Returns the gradients for all of a coupled variable's components.
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 ele...
const std::set< TagID > & getFEVariableCoupleableMatrixTags() const
const ADVectorVariableValue & adCoupledVectorDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a vector coupled variable for ad simulations.
const Moose::Functor< T > & getDefaultFunctor(const std::string &var_name) const
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.
const VectorVariableCurl & _vector_curl_zero
Zero value of the curl of a vector variable.
const ADVectorVariableGradient & getADDefaultVectorGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
const ADVariableValue & adZeroValue() const
method that returns _zero to RESIDUAL computing objects and _ad_zero to JACOBIAN computing objects ...
std::vector< unsigned int > coupledIndices(const std::string &var_name) const
Returns the indices for a coupled variable's components.
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.
const std::vector< MooseVariableFieldBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
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...
Moose::Kokkos::VariableValue kokkosCoupledNodalDot(const std::string &var_name, unsigned int comp=0)
const MooseObject *const _obj
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
std::vector< MooseVariableFieldBase * > _coupled_moose_vars
Vector of all coupled variables.
virtual const VectorVariableCurl & coupledCurl(const std::string &var_name, unsigned int comp=0) const
Returns curl of a coupled variable.
OutputTools< Real >::VariableValue VariableValue
std::set< TagID > & getFEVariableCoupleableMatrixTags()
virtual const ArrayVariableGradient & coupledArrayGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled array variable.
virtual const VariableValue & coupledDotDu(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled variable with respect to the coefficients.
OutputTools< Real >::VariablePhiGradient VariablePhiGradient
unsigned int coupledComponents(const std::string &var_name) const
Number of coupled components.
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it's coupled values should be neighbor v...
virtual const ArrayVariableGradient & coupledArrayGradientOlder(const std::string &var_name, unsigned int comp=0) const
Returns an old gradient from two time steps previous of a coupled array variable. ...
virtual const VariableValue & coupledVectorDotDotDu(const std::string &var_name, unsigned int comp=0) const
Second time derivative of a coupled vector variable with respect to the coefficients.
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...
Interface for objects that needs coupling capabilities.
std::vector< MooseVariableField< Real > * > _coupled_fv_moose_vars
Vector of all finite volume coupled variables.
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValues(const std::string &var_name, const std::string &tag_param_name)
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValuesByName(const std::string &var_name, const std::string &tag_name)
const GenericVariableSecond< is_ad > & genericZeroSecond()
Returns zero second derivative templated with automatic differentiation boolean.
std::vector< const VariableValue * > coupledValues(const std::string &var_name) const
Returns the values for all of a coupled variable components.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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.
const T & getDefaultNodalValue(const std::string &var_name, unsigned int comp=0) const
Get nodal default value.
const std::string & _c_type
The type of the object this interface is part of.
virtual const VectorVariableGradient & coupledVectorGradientOlder(const std::string &var_name, unsigned int comp=0) const
Returns an old gradient from two time steps previous of a coupled vector variable.
const MooseArray< ADRealTensorValue > & _ad_second_zero
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
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.
virtual const VariableValue & coupledValuePreviousNL(const std::string &var_name, unsigned int comp=0) const
Returns value of previous Newton iterate of a coupled variable.
MooseArray< ADRealTensorValue > _ad_default_vector_gradient
This will always be zero because the default values for optionally coupled vector variables is always...
virtual const VectorVariableValue & coupledVectorValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled vector variable.
const std::set< TagID > & getFEVariableCoupleableVectorTags() const
virtual const VariableValue & coupledDotDotOld(const std::string &var_name, unsigned int comp=0) const
Old second time derivative of a coupled variable.
The Kokkos variable object that carries the coupled variable and tag information. ...
MooseArray< ADRealTensorValue > _ad_default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Moose::Kokkos::VariableValue kokkosCoupledNodalValueOlder(const std::string &var_name, unsigned int comp=0)
const VariableValue & coupledArrayDotDu(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled array variable with respect to the coefficients.
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.
const VariablePhiValue & _phi_zero
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Moose::Kokkos::VariableValue kokkosCoupledValuesOld(const std::string &var_name)
virtual const ArrayVariableValue & coupledArrayDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of a coupled array variable.
Class for scalar variables (they are different).
const ADVectorVariableGradient & adCoupledVectorGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled vector variable for use in Automatic Differentiation.
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradients(const std::string &var_name, const std::string &tag_param_name)
std::unordered_map< std::string, std::vector< unsigned int > > _optional_var_index
Unique indices for optionally coupled vars that weren't provided.
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValues(const std::string &var_name, const std::string &tag_param_name)
const MooseVariableFieldBase * getFEVar(const std::string &var_name, unsigned int comp) const
Deprecated method.
std::unordered_map< std::string, std::vector< std::unique_ptr< VariableValue > > > _default_value
Will hold the default value for optional coupled variables.
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...
Moose::GenericType< VariableSecond, is_ad > GenericVariableSecond
const InputParameters & _c_parameters
OutputTools< Real >::VariableSecond VariableSecond
const MooseArray< ADReal > & _ad_zero
virtual const ArrayVariableGradient & coupledArrayGradientOld(const std::string &var_name, unsigned int comp=0) const
Returns an old gradient from previous time step of a coupled array variable.
const Moose::ADType< T >::type & adCoupledNodalValue(const std::string &var_name, unsigned int comp=0) const
Returns AD nodal values of a coupled variable.
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradientByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0)
virtual const VariableValue & coupledNodalDotOld(const std::string &var_name, unsigned int comp=0) const
Nodal values of old time derivative of a coupled variable.
const GenericVariableValue< is_ad > & genericZeroValue()
Returns zero value templated with automatic differentiation boolean.
std::unordered_map< std::string, std::unique_ptr< ArrayVariableValue > > _default_array_value
Will hold the default value for optional array coupled variables.
Moose::Kokkos::Scalar< const Real > kokkosCoupledDotDu(const std::string &var_name, unsigned int comp=0)
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValueByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0)
OutputTools< RealVectorValue >::VariableGradient VectorVariableGradient
ArrayVariableGradient _default_array_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValue(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0)
const ADVariableSecond & getADDefaultSecond() const
Helper method to return (and insert if necessary) the default second derivatives for Automatic Differ...
The Kokkos wrapper classes for MOOSE-like variable value access.
const std::set< std::string > _older_state_tags
vector tag names for which we need to request older solution states from the system ...
virtual const VectorVariableCurl & coupledCurlOlder(const std::string &var_name, unsigned int comp=0) const
Returns an old curl from two time steps previous of a coupled variable.
Moose::Kokkos::VariableGradient kokkosCoupledGradientOld(const std::string &var_name, unsigned int comp=0)
virtual const VectorVariableDivergence & coupledDiv(const std::string &var_name, unsigned int comp=0) const
Returns divergence of a coupled variable.
virtual const VariableGradient & coupledGradientPreviousNL(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable for previous Newton iterate.
ArrayVariableValue _default_array_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValueByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0)
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
OutputTools< RealEigenVector >::VariableGradient ArrayVariableGradient
void addFEVariableCoupleableMatrixTag(TagID tag)
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 Differentia...
std::vector< const VectorVariableValue * > coupledVectorValues(const std::string &var_name) const
Returns the values for all of a coupled vector variable's components.
virtual const VariableValue & coupledDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of a coupled variable.
Moose::Kokkos::Variable kokkosCoupledVectorTagVariable(const std::string &var_name, const std::string &tag_name, unsigned int comp)
virtual const ArrayVariableGradient & coupledArrayGradientDot(const std::string &var_name, unsigned int comp=0) const
Retun a gradient of a coupled array variable's time derivative.
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 diffe...
const std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > & getCoupledVars() const
Get the list of coupled variables.
std::set< TagID > & getFEVariableCoupleableVectorTags()
virtual const VectorVariableValue & coupledVectorDotOld(const std::string &var_name, unsigned int comp=0) const
Old time derivative of a coupled vector variable.
const ADVariableGradient & adCoupledGradientDot(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable's time derivative for use in Automatic Differentiation.
const ADVariableSecond & adCoupledSecond(const std::string &var_name, unsigned int comp=0) const
Returns second derivatives of a coupled variable for use in Automatic Differentiation.
bool hasWritableCoupledVariables() const
Checks whether the object has any writable coupled variables.
virtual const VectorVariableValue & coupledVectorDotDotOld(const std::string &var_name, unsigned int comp=0) const
Old second time derivative of a coupled vector variable.
const ADVectorVariableCurl & adCoupledCurl(const std::string &var_name, unsigned int comp=0) const
Returns curl of a coupled variable for use in objects utilizing Automatic Differentiation.
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.
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.
MooseArray< ADRealVectorValue > _ad_default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
std::vector< const VariableValue * > coupledValuesOld(const std::string &var_name) const
Returns the old values for all of a coupled variable's components.
virtual const VariableGradient & coupledGradientOlder(const std::string &var_name, unsigned int comp=0) const
Returns an old gradient from two time steps previous of a coupled variable.
const std::unordered_map< std::string, std::string > & _new_to_deprecated_coupled_vars
map from new to deprecated variable names
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 e...
const MooseVariableFieldBase * getFieldVar(const std::string &var_name, unsigned int comp) const
virtual const VectorVariableDivergence & coupledDivOld(const std::string &var_name, unsigned int comp=0) const
Returns an old divergence from previous time step of a coupled variable.