https://mooseframework.inl.gov
Coupleable.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #ifdef MOOSE_KOKKOS_SCOPE
13 #include "KokkosVariableValue.h"
14 #endif
15 
16 #include <unordered_map>
17 #include "MooseTypes.h"
18 #include "MooseArray.h"
19 #include "MooseVariableFE.h"
20 #include "MooseVariableFV.h"
21 #include "MooseLinearVariableFV.h"
22 #include "InputParameters.h"
23 #include "HasMembers.h"
24 
25 #define usingCoupleableMembers \
26  using Coupleable::_zero; \
27  using Coupleable::_grad_zero; \
28  using Coupleable::_ad_zero; \
29  using Coupleable::_ad_grad_zero; \
30  using Coupleable::coupled; \
31  using Coupleable::isCoupled; \
32  using Coupleable::coupledComponents
33 
34 // Forward declarations
36 class MooseObject;
37 
38 namespace libMesh
39 {
40 template <typename T>
41 class DenseVector;
42 }
43 
44 template <typename>
47 
53 {
54 public:
61  Coupleable(const MooseObject * moose_object, bool nodal, bool is_fv = false);
62 
63 #ifdef MOOSE_KOKKOS_ENABLED
64 
67  Coupleable(const Coupleable & object, const Moose::Kokkos::FunctorCopy & key);
68 #endif
69 
74  const std::unordered_map<std::string, std::vector<MooseVariableFieldBase *>> &
76  {
77  return _coupled_vars;
78  }
79 
84  const std::vector<MooseVariableFieldBase *> & getCoupledMooseVars() const
85  {
86  return _coupled_moose_vars;
87  }
88 
93  const std::vector<MooseVariable *> & getCoupledStandardMooseVars() const
94  {
96  }
97 
102  const std::vector<VectorMooseVariable *> & getCoupledVectorMooseVars() const
103  {
105  }
106 
111  const std::vector<ArrayMooseVariable *> & getCoupledArrayMooseVars() const
112  {
114  }
115 
117 
119 
121 
123 
124  const std::set<TagID> & getFEVariableCoupleableVectorTags() const
125  {
127  }
128 
129  const std::set<TagID> & getFEVariableCoupleableMatrixTags() const
130  {
132  }
133 
138 
142  bool hasWritableCoupledVariables() const { return !getWritableCoupledVariables().empty(); }
143 
144 protected:
149  virtual void coupledCallback(const std::string & /*var_name*/, bool /*is_old*/) const {}
150 
157  virtual bool isCoupled(const std::string & var_name, unsigned int i = 0) const;
158 
164  virtual bool isCoupledConstant(const std::string & var_name) const;
165 
171  unsigned int coupledComponents(const std::string & var_name) const;
172 
179  VariableName coupledName(const std::string & var_name, unsigned int comp = 0) const;
180 
186  std::vector<VariableName> coupledNames(const std::string & var_name) const;
187 
195  virtual unsigned int coupled(const std::string & var_name, unsigned int comp = 0) const;
196 
202  std::vector<unsigned int> coupledIndices(const std::string & var_name) const;
203 
211  virtual const VariableValue & coupledValue(const std::string & var_name,
212  unsigned int comp = 0) const;
213 
219  std::vector<const VariableValue *> coupledValues(const std::string & var_name) const;
220 
226  std::vector<const VectorVariableValue *> coupledVectorValues(const std::string & var_name) const;
227 
234  template <bool is_ad>
235  const GenericVariableValue<is_ad> & coupledGenericValue(const std::string & var_name,
236  unsigned int comp = 0) const;
237 
245  template <bool is_ad>
246  const GenericVectorVariableValue<is_ad> & coupledGenericVectorValue(const std::string & var_name,
247  unsigned int comp = 0) const;
248 
255  template <bool is_ad>
256  std::vector<const GenericVariableValue<is_ad> *>
257  coupledGenericValues(const std::string & var_name) const;
258 
265  template <bool is_ad>
266  const GenericVariableValue<is_ad> & coupledGenericDofValue(const std::string & var_name,
267  unsigned int comp = 0) const;
268 
276  template <bool is_ad>
277  const GenericVariableValue<is_ad> & coupledGenericDot(const std::string & var_name,
278  unsigned int comp = 0) const;
279 
287  template <bool is_ad>
288  const GenericVariableValue<is_ad> & coupledGenericDotDot(const std::string & var_name,
289  unsigned int comp = 0) const;
290 
297  virtual const VariableValue & coupledValueLower(const std::string & var_name,
298  unsigned int comp = 0) const;
299 
306  const ADVariableValue & adCoupledValue(const std::string & var_name, unsigned int comp = 0) const;
307 
314  std::vector<const ADVariableValue *> adCoupledValues(const std::string & var_name) const;
315 
322  const ADVariableValue & adCoupledLowerValue(const std::string & var_name,
323  unsigned int comp = 0) const;
324 
332  const ADVectorVariableValue & adCoupledVectorValue(const std::string & var_name,
333  unsigned int comp = 0) const;
334 
341  std::vector<const ADVectorVariableValue *>
342  adCoupledVectorValues(const std::string & var_name) const;
343 
352  virtual const VariableValue &
353  coupledVectorTagValue(const std::string & var_names, TagID tag, unsigned int index = 0) const;
354 
355  virtual const VariableValue & coupledVectorTagValue(const std::string & var_names,
356  const std::string & tag_name,
357  unsigned int index = 0) const;
358 
365  std::vector<const VariableValue *> coupledVectorTagValues(const std::string & var_names,
366  TagID tag) const;
367 
368  std::vector<const VariableValue *> coupledVectorTagValues(const std::string & var_names,
369  const std::string & tag_name) const;
370 
379  virtual const ArrayVariableValue & coupledVectorTagArrayValue(const std::string & var_names,
380  TagID tag,
381  unsigned int index = 0) const;
382 
383  virtual const ArrayVariableValue & coupledVectorTagArrayValue(const std::string & var_names,
384  const std::string & tag_name,
385  unsigned int index = 0) const;
386 
393  std::vector<const ArrayVariableValue *> coupledVectorTagArrayValues(const std::string & var_names,
394  TagID tag) const;
395 
396  std::vector<const ArrayVariableValue *>
397  coupledVectorTagArrayValues(const std::string & var_names, const std::string & tag_name) const;
398 
407  virtual const VariableGradient &
408  coupledVectorTagGradient(const std::string & var_names, TagID tag, unsigned int index = 0) const;
409 
410  virtual const VariableGradient & coupledVectorTagGradient(const std::string & var_names,
411  const std::string & tag_name,
412  unsigned int index = 0) const;
413 
420  std::vector<const VariableGradient *> coupledVectorTagGradients(const std::string & var_names,
421  TagID tag) const;
422 
423  std::vector<const VariableGradient *>
424  coupledVectorTagGradients(const std::string & var_names, const std::string & tag_name) const;
425 
435  virtual const ArrayVariableGradient & coupledVectorTagArrayGradient(const std::string & var_names,
436  TagID tag,
437  unsigned int index = 0) const;
438 
439  virtual const ArrayVariableGradient & coupledVectorTagArrayGradient(const std::string & var_names,
440  const std::string & tag_name,
441  unsigned int index = 0) const;
442 
449  std::vector<const ArrayVariableGradient *>
450  coupledVectorTagArrayGradients(const std::string & var_names, TagID tag) const;
451 
452  std::vector<const ArrayVariableGradient *>
453  coupledVectorTagArrayGradients(const std::string & var_names, const std::string & tag_name) const;
454 
462  virtual const VariableValue &
463  coupledVectorTagDofValue(const std::string & var_name, TagID tag, unsigned int index = 0) const;
464 
465  virtual const VariableValue & coupledVectorTagDofValue(const std::string & var_names,
466  const std::string & tag_name,
467  unsigned int index = 0) const;
468 
475  const ArrayVariableValue & coupledVectorTagArrayDofValue(const std::string & var_name,
476  const std::string & tag_name,
477  unsigned int comp = 0) const;
478 
485  std::vector<const VariableValue *> coupledVectorTagDofValues(const std::string & var_names,
486  TagID tag) const;
487 
488  std::vector<const VariableValue *> coupledVectorTagDofValues(const std::string & var_names,
489  const std::string & tag_name) const;
490 
499  virtual const VariableValue &
500  coupledMatrixTagValue(const std::string & var_names, TagID tag, unsigned int index = 0) const;
501 
502  virtual const VariableValue & coupledMatrixTagValue(const std::string & var_names,
503  const std::string & tag_name,
504  unsigned int index = 0) const;
505 
512  std::vector<const VariableValue *> coupledMatrixTagValues(const std::string & var_names,
513  TagID tag) const;
514 
515  std::vector<const VariableValue *> coupledMatrixTagValues(const std::string & var_names,
516  const std::string & tag_name) const;
517 
525  virtual const VectorVariableValue & coupledVectorValue(const std::string & var_name,
526  unsigned int comp = 0) const;
527 
535  virtual const ArrayVariableValue & coupledArrayValue(const std::string & var_name,
536  unsigned int comp = 0) const;
537 
543  std::vector<const ArrayVariableValue *> coupledArrayValues(const std::string & var_name) const;
544 
557  MooseWritableVariable & writableVariable(const std::string & var_name, unsigned int comp = 0);
558 
568  virtual VariableValue & writableCoupledValue(const std::string & var_name, unsigned int comp = 0);
569 
574 
582  virtual const VariableValue & coupledValueOld(const std::string & var_name,
583  unsigned int comp = 0) const;
584 
590  std::vector<const VariableValue *> coupledValuesOld(const std::string & var_name) const;
591 
597  std::vector<const VectorVariableValue *>
598  coupledVectorValuesOld(const std::string & var_name) const;
599 
607  virtual const VariableValue & coupledValueOlder(const std::string & var_name,
608  unsigned int comp = 0) const;
609 
615  std::vector<const VariableValue *> coupledValuesOlder(const std::string & var_name) const;
616 
623  virtual const VariableValue & coupledValuePreviousNL(const std::string & var_name,
624  unsigned int comp = 0) const;
625 
633  virtual const VectorVariableValue & coupledVectorValueOld(const std::string & var_name,
634  unsigned int comp = 0) const;
635 
643  virtual const VectorVariableValue & coupledVectorValueOlder(const std::string & var_name,
644  unsigned int comp = 0) const;
645 
653  virtual const ArrayVariableValue & coupledArrayValueOld(const std::string & var_name,
654  unsigned int comp = 0) const;
655 
663  virtual const ArrayVariableValue & coupledArrayValueOlder(const std::string & var_name,
664  unsigned int comp = 0) const;
665 
673  virtual const VariableGradient & coupledGradient(const std::string & var_name,
674  unsigned int comp = 0) const;
675 
681  std::vector<const VariableGradient *> coupledGradients(const std::string & var_name) const;
682 
690  const ADVariableGradient & adCoupledGradient(const std::string & var_name,
691  unsigned int comp = 0) const;
692 
700  const ADVariableGradient & adCoupledGradientDot(const std::string & var_name,
701  unsigned int comp = 0) const;
702 
709  std::vector<const ADVariableGradient *> adCoupledGradients(const std::string & var_name) const;
710 
718  template <bool is_ad>
719  const GenericVariableGradient<is_ad> & coupledGenericGradient(const std::string & var_name,
720  unsigned int comp = 0) const;
721 
728  template <bool is_ad>
729  std::vector<const GenericVariableGradient<is_ad> *>
730  coupledGenericGradients(const std::string & var_name) const;
731 
739  const ADVectorVariableGradient & adCoupledVectorGradient(const std::string & var_name,
740  unsigned int comp = 0) const;
741 
748  const ADVariableSecond & adCoupledSecond(const std::string & var_name,
749  unsigned int comp = 0) const;
750 
758  const ADVectorVariableSecond & adCoupledVectorSecond(const std::string & var_name,
759  unsigned int comp = 0) const;
760 
768  virtual const VariableGradient & coupledGradientOld(const std::string & var_name,
769  unsigned int comp = 0) const;
770 
776  std::vector<const VariableGradient *> coupledGradientsOld(const std::string & var_name) const;
777 
785  virtual const VariableGradient & coupledGradientOlder(const std::string & var_name,
786  unsigned int comp = 0) const;
787 
794  virtual const VariableGradient & coupledGradientPreviousNL(const std::string & var_name,
795  unsigned int comp = 0) const;
796 
804  virtual const VariableGradient & coupledGradientDot(const std::string & var_name,
805  unsigned int comp = 0) const;
806 
814  virtual const VariableGradient & coupledGradientDotDot(const std::string & var_name,
815  unsigned int comp = 0) const;
816 
824  virtual const VectorVariableGradient & coupledVectorGradient(const std::string & var_name,
825  unsigned int comp = 0) const;
826 
834  virtual const VectorVariableGradient & coupledVectorGradientOld(const std::string & var_name,
835  unsigned int comp = 0) const;
836 
844  virtual const VectorVariableGradient & coupledVectorGradientOlder(const std::string & var_name,
845  unsigned int comp = 0) const;
846 
854  virtual const ArrayVariableGradient & coupledArrayGradient(const std::string & var_name,
855  unsigned int comp = 0) const;
856 
864  virtual const ArrayVariableGradient & coupledArrayGradientOld(const std::string & var_name,
865  unsigned int comp = 0) const;
866 
874  virtual const ArrayVariableGradient & coupledArrayGradientOlder(const std::string & var_name,
875  unsigned int comp = 0) const;
876 
884  virtual const ArrayVariableGradient & coupledArrayGradientDot(const std::string & var_name,
885  unsigned int comp = 0) const;
886 
894  virtual const VectorVariableCurl & coupledCurl(const std::string & var_name,
895  unsigned int comp = 0) const;
896 
904  virtual const VectorVariableCurl & coupledCurlOld(const std::string & var_name,
905  unsigned int comp = 0) const;
906 
914  virtual const VectorVariableCurl & coupledCurlOlder(const std::string & var_name,
915  unsigned int comp = 0) const;
916 
924  const ADVectorVariableCurl & adCoupledCurl(const std::string & var_name,
925  unsigned int comp = 0) const;
926 
935  virtual const VectorVariableDivergence & coupledDiv(const std::string & var_name,
936  unsigned int comp = 0) const;
937 
946  virtual const VectorVariableDivergence & coupledDivOld(const std::string & var_name,
947  unsigned int comp = 0) const;
948 
957  virtual const VectorVariableDivergence & coupledDivOlder(const std::string & var_name,
958  unsigned int comp = 0) const;
959 
967  virtual const VariableSecond & coupledSecond(const std::string & var_name,
968  unsigned int comp = 0) const;
969 
978  virtual const VariableSecond & coupledSecondOld(const std::string & var_name,
979  unsigned int comp = 0) const;
980 
989  virtual const VariableSecond & coupledSecondOlder(const std::string & var_name,
990  unsigned int comp = 0) const;
991 
998  virtual const VariableSecond & coupledSecondPreviousNL(const std::string & var_name,
999  unsigned int comp = 0) const;
1000 
1007  virtual const VariableValue & coupledDot(const std::string & var_name,
1008  unsigned int comp = 0) const;
1009 
1015  std::vector<const VariableValue *> coupledDots(const std::string & var_name) const;
1016 
1024  virtual const VariableValue & coupledDotDot(const std::string & var_name,
1025  unsigned int comp = 0) const;
1026 
1033  virtual const VariableValue & coupledDotOld(const std::string & var_name,
1034  unsigned int comp = 0) const;
1035 
1043  virtual const VariableValue & coupledDotDotOld(const std::string & var_name,
1044  unsigned int comp = 0) const;
1045 
1053  const ADVariableValue & adCoupledDot(const std::string & var_name, unsigned int comp = 0) const;
1054 
1060  std::vector<const ADVariableValue *> adCoupledDots(const std::string & var_name) const;
1061 
1069  const ADVariableValue & adCoupledDotDot(const std::string & var_name,
1070  unsigned int comp = 0) const;
1071 
1080  const ADVectorVariableValue & adCoupledVectorDot(const std::string & var_name,
1081  unsigned int comp = 0) const;
1082 
1090  virtual const VectorVariableValue & coupledVectorDot(const std::string & var_name,
1091  unsigned int comp = 0) const;
1092 
1100  virtual const VectorVariableValue & coupledVectorDotDot(const std::string & var_name,
1101  unsigned int comp = 0) const;
1102 
1110  virtual const VectorVariableValue & coupledVectorDotOld(const std::string & var_name,
1111  unsigned int comp = 0) const;
1112 
1120  virtual const VectorVariableValue & coupledVectorDotDotOld(const std::string & var_name,
1121  unsigned int comp = 0) const;
1122 
1130  virtual const VariableValue & coupledVectorDotDu(const std::string & var_name,
1131  unsigned int comp = 0) const;
1132 
1140  virtual const VariableValue & coupledVectorDotDotDu(const std::string & var_name,
1141  unsigned int comp = 0) const;
1142 
1150  virtual const ArrayVariableValue & coupledArrayDot(const std::string & var_name,
1151  unsigned int comp = 0) const;
1152 
1160  virtual const ArrayVariableValue & coupledArrayDotDot(const std::string & var_name,
1161  unsigned int comp = 0) const;
1162 
1170  virtual const ArrayVariableValue & coupledArrayDotOld(const std::string & var_name,
1171  unsigned int comp = 0) const;
1172 
1180  virtual const ArrayVariableValue & coupledArrayDotDotOld(const std::string & var_name,
1181  unsigned int comp = 0) const;
1182 
1190  virtual const VariableValue & coupledDotDu(const std::string & var_name,
1191  unsigned int comp = 0) const;
1192 
1200  virtual const VariableValue & coupledDotDotDu(const std::string & var_name,
1201  unsigned int comp = 0) const;
1202 
1210  const VariableValue & coupledArrayDotDu(const std::string & var_name,
1211  unsigned int comp = 0) const;
1212 
1219  template <typename T>
1220  const T & coupledNodalValue(const std::string & var_name, unsigned int comp = 0) const;
1221 
1228  template <typename T>
1229  const typename Moose::ADType<T>::type & adCoupledNodalValue(const std::string & var_name,
1230  unsigned int comp = 0) const;
1231 
1238  template <typename T>
1239  const T & coupledNodalValueOld(const std::string & var_name, unsigned int comp = 0) const;
1240 
1247  template <typename T>
1248  const T & coupledNodalValueOlder(const std::string & var_name, unsigned int comp = 0) const;
1249 
1256  template <typename T>
1257  const T & coupledNodalValuePreviousNL(const std::string & var_name, unsigned int comp = 0) const;
1258 
1266  template <typename T>
1267  const T & coupledNodalDot(const std::string & var_name, unsigned int comp = 0) const;
1268 
1276  virtual const VariableValue & coupledNodalDotDot(const std::string & var_name,
1277  unsigned int comp = 0) const;
1278 
1286  virtual const VariableValue & coupledNodalDotOld(const std::string & var_name,
1287  unsigned int comp = 0) const;
1288 
1296  virtual const VariableValue & coupledNodalDotDotOld(const std::string & var_name,
1297  unsigned int comp = 0) const;
1298  // coupled-dof-values-begin
1305  virtual const VariableValue & coupledDofValues(const std::string & var_name,
1306  unsigned int comp = 0) const;
1307 
1314  std::vector<const VariableValue *> coupledAllDofValues(const std::string & var_name) const;
1315 
1322  virtual const VariableValue & coupledDofValuesOld(const std::string & var_name,
1323  unsigned int comp = 0) const;
1324 
1331  std::vector<const VariableValue *> coupledAllDofValuesOld(const std::string & var_name) const;
1332 
1339  virtual const VariableValue & coupledDofValuesOlder(const std::string & var_name,
1340  unsigned int comp = 0) const;
1341 
1348  std::vector<const VariableValue *> coupledAllDofValuesOlder(const std::string & var_name) const;
1349 
1356  virtual const ArrayVariableValue & coupledArrayDofValues(const std::string & var_name,
1357  unsigned int comp = 0) const;
1358  // coupled-dof-values-end
1359 
1366  virtual const ADVariableValue & adCoupledDofValues(const std::string & var_name,
1367  unsigned int comp = 0) const;
1368 
1373  const ADVariableValue & adZeroValue() const;
1374 
1379  const ADVariableGradient & adZeroGradient() const;
1380 
1384  const ADVariableSecond & adZeroSecond() const;
1385 
1390  template <bool is_ad>
1392 
1397  template <bool is_ad>
1399 
1404  template <bool is_ad>
1406 
1407 protected:
1408  // Reference to the interface's input parameters
1410 
1412  const std::string & _c_name;
1414  const std::string & _c_type;
1415 
1416  // Reference to FEProblemBase
1418 
1420  const SystemBase * const _c_sys;
1421 
1423  std::unordered_map<std::string, std::vector<MooseVariableFieldBase *>> _coupled_vars;
1424 
1426  std::vector<MooseVariableFieldBase *> _coupled_moose_vars;
1427 
1429  std::vector<MooseVariable *> _coupled_standard_moose_vars;
1430 
1432  std::vector<VectorMooseVariable *> _coupled_vector_moose_vars;
1433 
1435  std::vector<ArrayMooseVariable *> _coupled_array_moose_vars;
1436 
1438  std::vector<MooseVariableField<Real> *> _coupled_fv_moose_vars;
1439 
1441  const std::unordered_map<std::string, std::string> & _new_to_deprecated_coupled_vars;
1442 
1444  bool _c_nodal;
1445 
1448 
1449  // Argument to allow element-to-nodal coupling
1451 
1454 
1456  mutable std::unordered_map<std::string, std::vector<std::unique_ptr<VariableValue>>>
1458 
1460  mutable std::unordered_map<std::string, std::unique_ptr<MooseArray<ADReal>>> _ad_default_value;
1461 
1463  mutable std::unordered_map<std::string, std::unique_ptr<VectorVariableValue>>
1465 
1467  mutable std::unordered_map<std::string, std::unique_ptr<ArrayVariableValue>> _default_array_value;
1468 
1470  mutable std::unordered_map<std::string, std::unique_ptr<MooseArray<ADRealVectorValue>>>
1472 
1478 
1481 
1484 
1487 
1490 
1493 
1496 
1501 
1505 
1508 
1518 
1524 
1527 
1530 
1533 
1539 
1542 
1548  bool
1549  checkVar(const std::string & var_name, unsigned int comp = 0, unsigned int comp_bound = 0) const;
1550 
1551 private:
1555  template <typename T>
1556  const typename OutputTools<T>::VariableValue &
1557  vectorTagValueHelper(const std::string & var_names, TagID tag, unsigned int index = 0) const;
1558 
1562  template <typename T>
1563  const typename OutputTools<T>::VariableValue & vectorTagValueHelper(const std::string & var_names,
1564  const std::string & tag_name,
1565  unsigned int index = 0) const;
1566 
1570  template <typename T>
1571  const typename OutputTools<T>::VariableValue &
1572  vectorTagDofValueHelper(const std::string & var_name, TagID tag, unsigned int comp = 0) const;
1573 
1577  template <typename T>
1579  const std::string & var_name, const std::string & tag_name, unsigned int comp = 0) const;
1580 
1586  template <typename T>
1587  void
1588  requestStates(const std::string & var_name, const TagName & tag_name, const unsigned int comp);
1589 
1590  enum class FuncAge
1591  {
1592  Curr,
1593  Old,
1594  Older,
1595  };
1596 
1597  enum class VarType
1598  {
1599  Ignore,
1600  Gradient,
1601  Second,
1602  GradientDot,
1603  Dot,
1604  };
1605 
1606  void checkFuncType(const std::string var_name, VarType t, FuncAge age) const;
1607 
1608 protected:
1617  const MooseVariableFieldBase * getFEVar(const std::string & var_name, unsigned int comp) const;
1618 
1619  /*
1620  * Extract pointer to a base coupled field variable. Could be either a finite volume or finite
1621  * element variable
1622  * @param var_name Name of parameter desired
1623  * @param comp Component number of multiple coupled variables
1624  * @return Pointer to the desired variable
1625  */
1626  const MooseVariableFieldBase * getFieldVar(const std::string & var_name, unsigned int comp) const;
1627 
1628  /*
1629  * Extract pointer to a base coupled field variable. Could be either a finite volume or finite
1630  * element variable
1631  * @param var_name Name of variable desired
1632  * @param comp Component number of multiple coupled variables
1633  * @return Pointer to the desired variable
1634  */
1635  MooseVariableFieldBase * getFieldVar(const std::string & var_name, unsigned int comp);
1636 
1640  template <typename T>
1641  const T * getVarHelper(const std::string & var_name, unsigned int comp) const;
1642 
1646  template <typename T>
1647  T * getVarHelper(const std::string & var_name, unsigned int comp);
1648 
1655  MooseVariable * getVar(const std::string & var_name, unsigned int comp);
1656 
1663  VectorMooseVariable * getVectorVar(const std::string & var_name, unsigned int comp);
1664 
1671  ArrayMooseVariable * getArrayVar(const std::string & var_name, unsigned int comp);
1672 
1679  const MooseVariable * getVar(const std::string & var_name, unsigned int comp) const;
1680 
1687  const VectorMooseVariable * getVectorVar(const std::string & var_name, unsigned int comp) const;
1688 
1695  const ArrayMooseVariable * getArrayVar(const std::string & var_name, unsigned int comp) const;
1696 
1703  void validateExecutionerType(const std::string & name, const std::string & fn_name) const;
1704 
1705  template <typename T, typename Func>
1706  std::vector<T> coupledVectorHelper(const std::string & var_name, const Func & func) const
1707  {
1708  const auto components = coupledComponents(var_name);
1709  std::vector<T> vals(components);
1710  for (MooseIndex(components) comp = 0; comp < components; ++comp)
1711  vals[comp] = func(comp);
1712  return vals;
1713  }
1714 
1717 
1718 public:
1725  const ADVariableValue * getADDefaultValue(const std::string & var_name) const;
1726 
1733  const ADVectorVariableValue * getADDefaultVectorValue(const std::string & var_name) const;
1734 
1741  const ADVariableGradient & getADDefaultGradient() const;
1742 
1750 
1757  const ADVariableSecond & getADDefaultSecond() const;
1758 
1765  const ADVectorVariableCurl & getADDefaultCurl() const;
1766 
1767 private:
1774  const VariableValue * getDefaultValue(const std::string & var_name, unsigned int comp) const;
1775 
1782  const VectorVariableValue * getDefaultVectorValue(const std::string & var_name) const;
1783 
1790  const ArrayVariableValue * getDefaultArrayValue(const std::string & var_name) const;
1791 
1795  template <typename T>
1796  const T & getDefaultNodalValue(const std::string & var_name, unsigned int comp = 0) const;
1797 
1798  template <typename T>
1799  const Moose::Functor<T> & getDefaultFunctor(const std::string & var_name) const;
1800 
1802  unsigned int _coupleable_max_qps;
1803 
1805  std::unordered_map<std::string, std::vector<unsigned int>> _optional_var_index;
1806 
1808  std::unordered_map<std::string, std::vector<MooseVariableScalar *>> _c_coupled_scalar_vars;
1809 
1811 
1813 
1815  const bool _is_fv;
1816 
1817  const MooseObject * const _obj;
1818 
1820  const std::set<std::string> _older_state_tags = {Moose::OLD_SOLUTION_TAG,
1822 
1824  std::vector<std::set<MooseWritableVariable *>> _writable_coupled_variables;
1825 
1829 private:
1831 
1832 #ifdef MOOSE_KOKKOS_SCOPE
1833  Moose::Kokkos::Variable kokkosCoupledVectorTagVariable(const std::string & var_name,
1834  const std::string & tag_name,
1835  unsigned int comp) const;
1836  Moose::Kokkos::Variable kokkosCoupledVectorTagVariables(const std::string & var_name,
1837  const std::string & tag_name) const;
1839 
1840 public:
1842  const std::string & tag_name,
1843  unsigned int comp = 0) const;
1845  kokkosCoupledVectorTagValuesByName(const std::string & var_name,
1846  const std::string & tag_name) const;
1848  const std::string & tag_name,
1849  unsigned int comp = 0) const;
1851  kokkosCoupledVectorTagGradientsByName(const std::string & var_name,
1852  const std::string & tag_name) const;
1854  const std::string & tag_name,
1855  unsigned int comp = 0) const;
1857  kokkosCoupledVectorTagNodalValuesByName(const std::string & var_name,
1858  const std::string & tag_name) const;
1860  const std::string & tag_name,
1861  unsigned int comp = 0) const;
1863  kokkosCoupledVectorTagDofValuesByName(const std::string & var_name,
1864  const std::string & tag_name) const;
1865 
1866  Moose::Kokkos::VariableValue kokkosCoupledVectorTagValue(const std::string & var_name,
1867  const std::string & tag_param_name,
1868  unsigned int comp = 0) const;
1870  kokkosCoupledVectorTagValues(const std::string & var_name,
1871  const std::string & tag_param_name) const;
1873  const std::string & tag_param_name,
1874  unsigned int comp = 0) const;
1876  kokkosCoupledVectorTagGradients(const std::string & var_name,
1877  const std::string & tag_param_name) const;
1879  const std::string & tag_param_name,
1880  unsigned int comp = 0) const;
1882  kokkosCoupledVectorTagNodalValues(const std::string & var_name,
1883  const std::string & tag_param_name) const;
1884  Moose::Kokkos::VariableValue kokkosCoupledVectorTagDofValue(const std::string & var_name,
1885  const std::string & tag_param_name,
1886  unsigned int comp = 0) const;
1888  kokkosCoupledVectorTagDofValues(const std::string & var_name,
1889  const std::string & tag_param_name) const;
1890 
1891  Moose::Kokkos::VariableValue kokkosCoupledValue(const std::string & var_name,
1892  unsigned int comp = 0) const;
1893  Moose::Kokkos::VariableValue kokkosCoupledValues(const std::string & var_name) const;
1894  Moose::Kokkos::VariableGradient kokkosCoupledGradient(const std::string & var_name,
1895  unsigned int comp = 0) const;
1896  Moose::Kokkos::VariableGradient kokkosCoupledGradients(const std::string & var_name) const;
1897  Moose::Kokkos::VariableValue kokkosCoupledNodalValue(const std::string & var_name,
1898  unsigned int comp = 0) const;
1899  Moose::Kokkos::VariableValue kokkosCoupledNodalValues(const std::string & var_name) const;
1900  Moose::Kokkos::VariableValue kokkosCoupledDofValue(const std::string & var_name,
1901  unsigned int comp = 0) const;
1902  Moose::Kokkos::VariableValue kokkosCoupledDofValues(const std::string & var_name) const;
1903 
1904  Moose::Kokkos::VariableValue kokkosCoupledValueOld(const std::string & var_name,
1905  unsigned int comp = 0) const;
1906  Moose::Kokkos::VariableValue kokkosCoupledValuesOld(const std::string & var_name) const;
1907  Moose::Kokkos::VariableGradient kokkosCoupledGradientOld(const std::string & var_name,
1908  unsigned int comp = 0) const;
1909  Moose::Kokkos::VariableGradient kokkosCoupledGradientsOld(const std::string & var_name) const;
1910  Moose::Kokkos::VariableValue kokkosCoupledNodalValueOld(const std::string & var_name,
1911  unsigned int comp = 0) const;
1912  Moose::Kokkos::VariableValue kokkosCoupledNodalValuesOld(const std::string & var_name) const;
1913  Moose::Kokkos::VariableValue kokkosCoupledDofValueOld(const std::string & var_name,
1914  unsigned int comp = 0) const;
1915  Moose::Kokkos::VariableValue kokkosCoupledDofValuesOld(const std::string & var_name) const;
1916 
1917  Moose::Kokkos::VariableValue kokkosCoupledValueOlder(const std::string & var_name,
1918  unsigned int comp = 0) const;
1919  Moose::Kokkos::VariableValue kokkosCoupledValuesOlder(const std::string & var_name) const;
1920  Moose::Kokkos::VariableGradient kokkosCoupledGradientOlder(const std::string & var_name,
1921  unsigned int comp = 0) const;
1922  Moose::Kokkos::VariableGradient kokkosCoupledGradientsOlder(const std::string & var_name) const;
1923  Moose::Kokkos::VariableValue kokkosCoupledNodalValueOlder(const std::string & var_name,
1924  unsigned int comp = 0) const;
1925  Moose::Kokkos::VariableValue kokkosCoupledNodalValuesOlder(const std::string & var_name) const;
1926  Moose::Kokkos::VariableValue kokkosCoupledDofValueOlder(const std::string & var_name,
1927  unsigned int comp = 0) const;
1928  Moose::Kokkos::VariableValue kokkosCoupledDofValuesOlder(const std::string & var_name) const;
1929 
1930  Moose::Kokkos::VariableValue kokkosCoupledDot(const std::string & var_name,
1931  unsigned int comp = 0) const;
1932  Moose::Kokkos::VariableValue kokkosCoupledDots(const std::string & var_name) const;
1933  Moose::Kokkos::VariableValue kokkosCoupledNodalDot(const std::string & var_name,
1934  unsigned int comp = 0) const;
1935  Moose::Kokkos::VariableValue kokkosCoupledNodalDots(const std::string & var_name) const;
1936 
1937  Moose::Kokkos::Scalar<const Real> kokkosCoupledDotDu(const std::string & var_name,
1938  unsigned int comp = 0) const;
1939 
1943 #endif
1944 };
1945 
1946 template <typename T>
1947 T *
1948 Coupleable::getVarHelper(const std::string & var_name_in, unsigned int comp)
1949 {
1950  const auto var_name = _c_parameters.checkForRename(var_name_in);
1951  auto name_to_use = var_name;
1952 
1953  // First check for supplied name
1954  if (!checkVar(var_name, comp, 0))
1955  {
1956  // See if there is an associated deprecated name that the user may have used instead
1957  auto it = _new_to_deprecated_coupled_vars.find(var_name);
1958  if (it == _new_to_deprecated_coupled_vars.end())
1959  return nullptr;
1960  else
1961  {
1962  auto deprecated_name = it->second;
1963  if (checkVar(deprecated_name, comp, 0))
1964  name_to_use = deprecated_name;
1965  else
1966  return nullptr;
1967  }
1968  }
1969 
1970  auto coupled_vars_it = _coupled_vars.find(name_to_use);
1971 
1972  mooseAssert(coupled_vars_it != _coupled_vars.end(),
1973  "Trying to get a coupled var " << name_to_use << " that doesn't exist");
1974 
1975  if (auto coupled_var = dynamic_cast<T *>(coupled_vars_it->second[comp]))
1976  return coupled_var;
1977  else
1978  {
1979  for (auto & var : _coupled_standard_moose_vars)
1980  if (var->name() == name_to_use)
1981  mooseError("The named variable is a standard variable, try a "
1982  "'coupled[Value/Gradient/Dot/etc]...' function instead");
1983  for (auto & var : _coupled_vector_moose_vars)
1984  if (var->name() == name_to_use)
1985  mooseError("The named variable is a vector variable, try a "
1986  "'coupledVector[Value/Gradient/Dot/etc]...' function instead");
1987  for (auto & var : _coupled_array_moose_vars)
1988  if (var->name() == name_to_use)
1989  mooseError("The named variable is an array variable, try a "
1990  "'coupledArray[Value/Gradient/Dot/etc]...' function instead");
1991  for (auto & var : _coupled_fv_moose_vars)
1992  if (var->name() == name_to_use)
1993  mooseError("The named variable is a finite volume variable, which the coupled[...] routine "
1994  "used does not support. Try using the functor system routines instead.");
1995  mooseError(
1996  "Variable '", name_to_use, "' is of a different C++ type than you tried to fetch it as.");
1997  }
1998 }
1999 
2000 template <typename T>
2001 const T *
2002 Coupleable::getVarHelper(const std::string & var_name, unsigned int comp) const
2003 {
2004  return const_cast<Coupleable *>(this)->getVarHelper<T>(var_name, comp);
2005 }
virtual const ArrayVariableValue & coupledArrayDotDotOld(const std::string &var_name, unsigned int comp=0) const
Old second time derivative of a coupled array variable.
Definition: Coupleable.C:1446
virtual const VariableValue & coupledDofValues(const std::string &var_name, unsigned int comp=0) const
Returns DoFs in the current solution vector of a coupled variable for the local element.
Definition: Coupleable.C:2057
virtual const VariableValue & coupledVectorTagValue(const std::string &var_names, TagID tag, unsigned int index=0) const
Returns value of a coupled variable for a given tag.
Definition: Coupleable.C:649
virtual const VariableGradient & coupledVectorTagGradient(const std::string &var_names, TagID tag, unsigned int index=0) const
Returns gradient of a coupled variable for a given tag.
Definition: Coupleable.C:681
virtual 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.
Definition: Coupleable.C:1148
OutputTools< Real >::VariableGradient VariableGradient
Definition: MooseTypes.h:344
const T & coupledNodalDot(const std::string &var_name, unsigned int comp=0) const
Nodal values of time derivative of a coupled variable.
Definition: Coupleable.C:1995
Moose::Kokkos::VariableValue kokkosCoupledDot(const std::string &var_name, unsigned int comp=0) const
OutputTools< RealVectorValue >::VariableDivergence VectorVariableDivergence
Definition: MooseTypes.h:364
Moose::Kokkos::VariableValue kokkosCoupledNodalValues(const std::string &var_name) const
void validateExecutionerType(const std::string &name, const std::string &fn_name) const
Checks to make sure that the current Executioner has set "_is_transient" when old/older values are co...
Definition: Coupleable.C:2148
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
virtual const VectorVariableGradient & coupledVectorGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled vector variable.
Definition: Coupleable.C:1640
const std::vector< ArrayMooseVariable * > & getCoupledArrayMooseVars() const
Get the list of array coupled variables.
Definition: Coupleable.h:111
Moose::Kokkos::VariableValue kokkosCoupledVectorTagDofValueByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
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
Moose::Kokkos::Variable kokkosZeroVariable() const
const std::vector< VectorMooseVariable * > & getCoupledVectorMooseVars() const
Get the list of vector coupled variables.
Definition: Coupleable.h:102
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1529
Moose::GenericType< VectorVariableValue, is_ad > GenericVectorVariableValue
Definition: MooseTypes.h:709
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition: Coupleable.C:324
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
virtual unsigned int coupled(const std::string &var_name, unsigned int comp=0) const
Returns the index for a coupled variable by name.
Definition: Coupleable.C:472
virtual const VectorVariableValue & coupledVectorDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of a coupled vector variable.
Definition: Coupleable.C:1300
const VariablePhiSecond & _second_phi_zero
Zero second derivative of a test function.
Definition: Coupleable.h:1513
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.
Definition: Coupleable.C:1901
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
const ArrayVariableValue * getDefaultArrayValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for an uncoupled array variable...
Definition: Coupleable.C:427
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.
std::vector< const VariableValue * > coupledValuesOlder(const std::string &var_name) const
Returns the older values for all of a coupled variable&#39;s components.
Definition: Coupleable.C:2726
const ADVariableSecond & adZeroSecond() const
Retrieve a zero second for automatic differentiation.
Definition: Coupleable.C:2444
const ADVectorVariableValue * getADDefaultVectorValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default vector value for Automatic Differentiat...
Definition: Coupleable.C:2385
virtual const VariableSecond & coupledSecond(const std::string &var_name, unsigned int comp=0) const
Returns second spatial derivatives of a coupled variable.
Definition: Coupleable.C:1853
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
virtual const VariableValue & coupledDotOld(const std::string &var_name, unsigned int comp=0) const
Old time derivative of a coupled variable.
Definition: Coupleable.C:1234
Moose::Kokkos::VariableValue kokkosCoupledValuesOlder(const std::string &var_name) const
virtual const VectorVariableValue & coupledVectorValueOld(const std::string &var_name, unsigned int comp=0) const
Returns an old value from previous time step of a coupled vector variable.
Definition: Coupleable.C:1098
Moose::Kokkos::Variable kokkosCoupledVectorTagVariable(const std::string &var_name, const std::string &tag_name, unsigned int comp) const
std::vector< const ArrayVariableValue * > coupledArrayValues(const std::string &var_name) const
Returns the values for all of a coupled array variable&#39;s components.
Definition: Coupleable.C:901
std::vector< const VariableValue * > coupledDots(const std::string &var_name) const
Returns the time derivatives for all of a coupled variable&#39;s components.
Definition: Coupleable.C:2777
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.
Definition: Coupleable.C:1126
unsigned int TagID
Definition: MooseTypes.h:238
VariableName coupledName(const std::string &var_name, unsigned int comp=0) const
Names of the variable in the Coupleable interface.
Definition: Coupleable.C:2514
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.
Definition: Coupleable.C:1656
Moose::Kokkos::VariableValue kokkosCoupledNodalValueOld(const std::string &var_name, unsigned int comp=0) const
MooseVariableField< Real > MooseWritableVariable
Definition: Coupleable.h:45
Class for stuff related to variables.
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
std::set< TagID > _fe_coupleable_matrix_tags
Definition: Coupleable.h:1812
const MooseArray< ADRealVectorValue > & _ad_grad_zero
Definition: Coupleable.h:1504
virtual const VectorVariableValue & coupledVectorDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled vector variable.
Definition: Coupleable.C:1284
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.
Definition: Coupleable.C:1493
void checkWritableVar(MooseWritableVariable *var)
Checks that the passed in variable is only accessed writable by one object in a given subdomain...
Definition: Coupleable.C:982
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:323
const bool _is_fv
Whether the MooseObject is a finite volume object.
Definition: Coupleable.h:1815
virtual const VariableValue & coupledDofValuesOld(const std::string &var_name, unsigned int comp=0) const
Returns DoFs in the old solution vector of a coupled variable for the local element.
Definition: Coupleable.C:2077
const TagName OLDER_SOLUTION_TAG
Definition: MooseTypes.C:27
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValueByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
std::vector< const GenericVariableValue< is_ad > * > coupledGenericValues(const std::string &var_name) const
Returns the values for all of a coupled variable&#39;s components for use in templated automatic differen...
std::vector< ArrayMooseVariable * > _coupled_array_moose_vars
Vector of array coupled variables.
Definition: Coupleable.h:1435
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&#39;s degree of freedom indices...
Definition: Coupleable.C:813
const VariableSecond & _second_zero
Zero second derivative of a variable.
Definition: Coupleable.h:1510
std::vector< const VectorVariableValue * > coupledVectorValuesOld(const std::string &var_name) const
Returns the old values for all of a coupled vector variable&#39;s components.
Definition: Coupleable.C:2733
const T & coupledNodalValue(const std::string &var_name, unsigned int comp=0) const
Returns nodal values of a coupled variable.
Definition: Coupleable.C:1919
std::vector< T > coupledVectorHelper(const std::string &var_name, const Func &func) const
Definition: Coupleable.h:1706
virtual const VariableValue & coupledVectorTagDofValue(const std::string &var_name, TagID tag, unsigned int index=0) const
Returns dof value of a coupled variable for a given tag.
Definition: Coupleable.C:797
OutputTools< RealVectorValue >::VariableValue VectorVariableValue
Definition: MooseTypes.h:360
const ADVariableGradient & adCoupledGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable for use in Automatic Differentiation.
Definition: Coupleable.C:2222
VectorVariableDivergence _default_div
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1532
const bool _c_allow_element_to_nodal_coupling
Definition: Coupleable.h:1450
std::vector< const ArrayVariableValue * > coupledVectorTagArrayValues(const std::string &var_names, TagID tag) const
Returns the values for all the coupled variables desired for a given tag.
Definition: Coupleable.C:2604
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...
Definition: Coupleable.C:2118
std::vector< const VariableGradient * > coupledVectorTagGradients(const std::string &var_names, TagID tag) const
Returns gradients for all the coupled variables desired for a given tag.
Definition: Coupleable.C:2627
std::set< TagID > _fe_coupleable_vector_tags
Definition: Coupleable.h:1810
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...
Definition: Coupleable.h:1495
virtual const VariableValue & coupledDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled variable.
Definition: Coupleable.C:1170
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradients(const std::string &var_name, const std::string &tag_param_name) const
THREAD_ID _c_tid
Thread ID of the thread using this object.
Definition: Coupleable.h:1453
const ADVariableValue & adCoupledValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled variable for use in Automatic Differentiation.
Definition: Coupleable.C:2184
Moose::Kokkos::VariableGradient kokkosCoupledGradient(const std::string &var_name, unsigned int comp=0) const
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual const VariableValue & coupledNodalDotDot(const std::string &var_name, unsigned int comp=0) const
Nodal values of second time derivative of a coupled variable.
Definition: Coupleable.C:2009
Moose::Kokkos::Variable kokkosCoupledVectorTagVariables(const std::string &var_name, const std::string &tag_name) const
const ADVariableGradient & getADDefaultGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
Definition: Coupleable.C:2402
const VectorVariableValue * getDefaultVectorValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for an uncoupled vector variable...
Definition: Coupleable.C:392
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:1824
virtual const VariableGradient & coupledGradientDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of the gradient of a coupled variable.
Definition: Coupleable.C:1624
OutputTools< Real >::VariablePhiValue VariablePhiValue
Definition: MooseTypes.h:348
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _c_coupled_scalar_vars
Scalar variables coupled into this object (for error checking)
Definition: Coupleable.h:1808
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:318
const ADVectorVariableCurl & getADDefaultCurl() const
Helper method to return (and insert if necessary) the default curl value for Automatic Differentiatio...
Definition: Coupleable.C:2423
const GenericVariableGradient< is_ad > & genericZeroGradient()
Returns zero gradient templated with automatic differentiation boolean.
Moose::Kokkos::VariableValue kokkosCoupledDofValue(const std::string &var_name, unsigned int comp=0) const
OutputTools< RealVectorValue >::VariableCurl VectorVariableCurl
Definition: MooseTypes.h:363
virtual const ArrayVariableValue & coupledArrayDotOld(const std::string &var_name, unsigned int comp=0) const
Old time derivative of a coupled array variable.
Definition: Coupleable.C:1424
virtual const VariableValue & coupledValueOld(const std::string &var_name, unsigned int comp=0) const
Returns an old value from previous time step of a coupled variable.
Definition: Coupleable.C:1031
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.
Definition: Coupleable.C:1380
Moose::Kokkos::VariableGradient kokkosZeroGradient() const
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...
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.
Definition: Coupleable.C:821
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
const ADVariableGradient & adZeroGradient() const
method that returns _grad_zero to RESIDUAL computing objects and _ad_grad_zero to JACOBIAN computing ...
Definition: Coupleable.C:2437
MooseWritableVariable & writableVariable(const std::string &var_name, unsigned int comp=0)
Returns a writable MooseVariable object for a nodal or elemental variable.
Definition: Coupleable.C:908
Base class for a system (of equations)
Definition: SystemBase.h:84
Moose::Kokkos::Scalar< const Real > kokkosCoupledDotDu(const std::string &var_name, unsigned int comp=0) const
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.
Definition: Coupleable.C:1837
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
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...
Definition: Coupleable.C:944
std::vector< VariableName > coupledNames(const std::string &var_name) const
Names of the variables in the Coupleable interface.
Definition: Coupleable.C:2531
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradientsByName(const std::string &var_name, const std::string &tag_name) const
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValue(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
virtual const VariableGradient & coupledGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable.
Definition: Coupleable.C:1543
Moose::Kokkos::VariableValue kokkosCoupledNodalDot(const std::string &var_name, unsigned int comp=0) const
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.
Definition: Coupleable.h:2002
OutputTools< Real >::VariablePhiSecond VariablePhiSecond
Definition: MooseTypes.h:350
const T & coupledNodalValuePreviousNL(const std::string &var_name, unsigned int comp=0) const
Returns nodal values of a coupled variable for previous Newton iterate.
Definition: Coupleable.C:1979
std::vector< const ADVariableValue * > adCoupledValues(const std::string &var_name) const
Returns the values for all of a coupled variable&#39;s components for use in Automatic Differentiation...
Definition: Coupleable.C:2566
virtual const VariableValue & coupledValueOlder(const std::string &var_name, unsigned int comp=0) const
Returns an old value from two time steps previous of a coupled variable.
Definition: Coupleable.C:1053
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Definition: Coupleable.h:1429
const std::vector< MooseVariable * > & getCoupledStandardMooseVars() const
Get the list of standard coupled variables.
Definition: Coupleable.h:93
const ADVariableValue & adCoupledDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of a coupled variable for ad simulations.
Definition: Coupleable.C:2304
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
virtual const ArrayVariableValue & coupledVectorTagArrayValue(const std::string &var_names, TagID tag, unsigned int index=0) const
Returns value of a coupled array variable for a given tag.
Definition: Coupleable.C:665
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.
Definition: Coupleable.C:1885
Moose::Kokkos::VariableValue kokkosZeroNodalValue() const
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. ...
Definition: Coupleable.C:758
bool _c_is_implicit
True if implicit value is required.
Definition: Coupleable.h:1447
virtual const VariableValue & coupledValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled variable.
Definition: Coupleable.C:527
const 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.
Definition: Coupleable.C:2204
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.
Definition: Coupleable.C:1113
Moose::Kokkos::VariableValue kokkosCoupledValue(const std::string &var_name, unsigned int comp=0) const
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.
Definition: Coupleable.h:1432
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&#39;s system depending on the value ...
Definition: Coupleable.C:578
virtual const VariableValue & coupledValueLower(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled lower-dimensional variable.
Definition: Coupleable.C:632
Coupleable(const MooseObject *moose_object, bool nodal, bool is_fv=false)
Constructing the object.
Definition: Coupleable.C:27
virtual const VariableGradient & coupledGradientOld(const std::string &var_name, unsigned int comp=0) const
Returns an old gradient from previous time step of a coupled variable.
Definition: Coupleable.C:1559
std::vector< const VariableValue * > coupledVectorTagDofValues(const std::string &var_names, TagID tag) const
Returns the dof values for all the coupled variables desired for a given tag.
Definition: Coupleable.C:2673
const Real _kokkos_default_value_zero
kokkos-related variables and methods
Definition: Coupleable.h:1830
OutputTools< RealEigenVector >::VariableValue ArrayVariableValue
Definition: MooseTypes.h:377
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.
Definition: Coupleable.C:1348
void addFEVariableCoupleableVectorTag(TagID tag)
Definition: Coupleable.h:116
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.
Definition: Coupleable.C:1869
Moose::GenericType< VariableValue, is_ad > GenericVariableValue
Definition: MooseTypes.h:707
auto & getWritableCoupledVariables() const
returns a reference to the set of writable coupled variables
Definition: Coupleable.h:137
const TagName OLD_SOLUTION_TAG
Definition: MooseTypes.C:26
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:28
Moose::GenericType< VariableGradient, is_ad > GenericVariableGradient
Definition: MooseTypes.h:711
virtual const ArrayVariableValue & coupledArrayValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled array variable.
Definition: Coupleable.C:879
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.
Definition: Coupleable.C:552
Moose::Kokkos::VariableValue kokkosCoupledValues(const std::string &var_name) const
std::vector< const VariableGradient * > coupledGradientsOld(const std::string &var_name) const
Returns the old gradients for all of a coupled variable&#39;s components.
Definition: Coupleable.C:2770
virtual const ArrayVariableGradient & coupledVectorTagArrayGradient(const std::string &var_names, TagID tag, unsigned int index=0) const
Returns gradient of a coupled array variable for a given tag.
Definition: Coupleable.C:719
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1480
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1489
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 VariableValue * getDefaultValue(const std::string &var_name, unsigned int comp) const
Helper method to return (and insert if necessary) the default value for an uncoupled variable...
Definition: Coupleable.C:365
std::vector< const ADVariableValue * > adCoupledDots(const std::string &var_name) const
Returns the time derivatives for all of a coupled variable&#39;s components for ad simulations.
Definition: Coupleable.C:2784
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...
Moose::Kokkos::VariableGradient kokkosCoupledGradients(const std::string &var_name) const
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValues(const std::string &var_name, const std::string &tag_param_name) const
virtual const VariableGradient & coupledGradientDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of the gradient of a coupled variable.
Definition: Coupleable.C:1608
Moose::Kokkos::VariableValue kokkosCoupledDofValues(const std::string &var_name) const
const ADVariableValue * getADDefaultValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default value for Automatic Differentiation for...
Definition: Coupleable.C:2371
const ADVariableValue & adCoupledDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled variable for ad simulations.
Definition: Coupleable.C:2281
const std::string & _c_name
The name of the object this interface is part of.
Definition: Coupleable.h:1412
Moose::Kokkos::VariableValue kokkosCoupledNodalValueOlder(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::VariableValue kokkosCoupledDofValuesOlder(const std::string &var_name) const
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.
Definition: Coupleable.C:1756
virtual const ADVariableValue & adCoupledDofValues(const std::string &var_name, unsigned int comp=0) const
Returns DOF value of a coupled variable for use in Automatic Differentiation.
Definition: Coupleable.C:2131
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.
Definition: Coupleable.C:2041
Moose::Kokkos::VariableValue kokkosZeroValue() const
std::vector< const VariableValue * > coupledAllDofValuesOld(const std::string &var_name) const
Returns DoFs in the old solution vector of all of a coupled variable&#39;s components for the local eleme...
Definition: Coupleable.C:2090
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValueByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
std::vector< const VariableGradient * > coupledGradients(const std::string &var_name) const
Returns the gradients for all of a coupled variable&#39;s components.
Definition: Coupleable.C:2741
Moose::Kokkos::VariableValue kokkosCoupledDofValueOlder(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::VariableValue kokkosCoupledNodalValuesOlder(const std::string &var_name) const
std::vector< const VariableValue * > coupledAllDofValuesOlder(const std::string &var_name) const
Returns DoFs in the older solution vector of all of a coupled variable&#39;s components for the local ele...
Definition: Coupleable.C:2110
Moose::Kokkos::VariableValue kokkosCoupledNodalValuesOld(const std::string &var_name) const
const std::set< TagID > & getFEVariableCoupleableMatrixTags() const
Definition: Coupleable.h:129
const ADVectorVariableValue & adCoupledVectorDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a vector coupled variable for ad simulations.
Definition: Coupleable.C:2321
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.
Definition: Coupleable.C:2097
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValue(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
const VectorVariableCurl & _vector_curl_zero
Zero value of the curl of a vector variable.
Definition: Coupleable.h:1517
const ADVectorVariableGradient & getADDefaultVectorGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
Definition: Coupleable.C:2409
const ADVariableValue & adZeroValue() const
method that returns _zero to RESIDUAL computing objects and _ad_zero to JACOBIAN computing objects ...
Definition: Coupleable.C:2430
std::vector< unsigned int > coupledIndices(const std::string &var_name) const
Returns the indices for a coupled variable&#39;s components.
Definition: Coupleable.C:2507
Moose::Kokkos::VariableValue kokkosCoupledDofValueOld(const std::string &var_name, unsigned int comp=0) const
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.
Definition: Coupleable.C:1959
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradient(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
Moose::Kokkos::VariableValue kokkosCoupledVectorTagDofValuesByName(const std::string &var_name, const std::string &tag_name) const
const std::vector< MooseVariableFieldBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
Definition: Coupleable.h:84
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...
const MooseObject *const _obj
Definition: Coupleable.h:1817
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1526
Moose::Kokkos::VariableValue kokkosCoupledVectorTagDofValue(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
std::vector< MooseVariableFieldBase * > _coupled_moose_vars
Vector of all coupled variables.
Definition: Coupleable.h:1426
virtual const VectorVariableCurl & coupledCurl(const std::string &var_name, unsigned int comp=0) const
Returns curl of a coupled variable.
Definition: Coupleable.C:1740
OutputTools< Real >::VariableValue VariableValue
Definition: MooseTypes.h:343
std::set< TagID > & getFEVariableCoupleableMatrixTags()
Definition: Coupleable.h:122
virtual const ArrayVariableGradient & coupledArrayGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled array variable.
Definition: Coupleable.C:1688
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.
Definition: Coupleable.C:1468
OutputTools< Real >::VariablePhiGradient VariablePhiGradient
Definition: MooseTypes.h:349
unsigned int coupledComponents(const std::string &var_name) const
Number of coupled components.
Definition: Coupleable.C:188
bool _coupleable_neighbor
Whether or not this object is a "neighbor" object: ie all of it&#39;s coupled values should be neighbor v...
Definition: Coupleable.h:1716
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. ...
Definition: Coupleable.C:1714
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.
Definition: Coupleable.C:1364
std::vector< const ADVariableGradient * > adCoupledGradients(const std::string &var_name) const
Returns the gradients for all of a coupled variable&#39;s components for use in Automatic Differentiation...
Definition: Coupleable.C:2763
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:52
std::vector< MooseVariableField< Real > * > _coupled_fv_moose_vars
Vector of all finite volume coupled variables.
Definition: Coupleable.h:1438
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.
Definition: Coupleable.C:2538
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.
Definition: Coupleable.C:2650
const T & getDefaultNodalValue(const std::string &var_name, unsigned int comp=0) const
Get nodal default value.
Definition: Coupleable.C:449
const std::string & _c_type
The type of the object this interface is part of.
Definition: Coupleable.h:1414
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.
Definition: Coupleable.C:1672
const MooseArray< ADRealTensorValue > & _ad_second_zero
Definition: Coupleable.h:1511
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
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
virtual const VariableValue & coupledValuePreviousNL(const std::string &var_name, unsigned int comp=0) const
Returns value of previous Newton iterate of a coupled variable.
Definition: Coupleable.C:1075
Moose::Kokkos::VariableGradient kokkosCoupledGradientsOld(const std::string &var_name) const
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
virtual const VectorVariableValue & coupledVectorValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled vector variable.
Definition: Coupleable.C:854
const std::set< TagID > & getFEVariableCoupleableVectorTags() const
Definition: Coupleable.h:124
std::string checkForRename(const std::string &name) const
Checks whether the provided name is a renamed parameter name.
virtual const VariableValue & coupledDotDotOld(const std::string &var_name, unsigned int comp=0) const
Old second time derivative of a coupled variable.
Definition: Coupleable.C:1259
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...
Definition: Coupleable.h:1492
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.
Definition: Coupleable.C:1518
std::vector< const VariableValue * > coupledVectorTagValues(const std::string &var_names, TagID tag) const
Returns the values for all the coupled variables desired for a given tag.
Definition: Coupleable.C:2581
const VariablePhiValue & _phi_zero
Definition: Coupleable.h:1499
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition: Coupleable.C:336
virtual const ArrayVariableValue & coupledArrayDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of a coupled array variable.
Definition: Coupleable.C:1402
Moose::Kokkos::VariableValue kokkosCoupledNodalValue(const std::string &var_name, unsigned int comp=0) const
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.
Definition: Coupleable.C:2355
Moose::Kokkos::VariableValue kokkosCoupledDots(const std::string &var_name) const
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:1805
const MooseVariableFieldBase * getFEVar(const std::string &var_name, unsigned int comp) const
Deprecated method.
Definition: Coupleable.C:298
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
std::vector< const VariableValue * > coupledMatrixTagValues(const std::string &var_names, TagID tag) const
Returns the diagonal matrix values for all the coupled variables desired for a given tag...
Definition: Coupleable.C:2696
Moose::GenericType< VariableSecond, is_ad > GenericVariableSecond
Definition: MooseTypes.h:713
const InputParameters & _c_parameters
Definition: Coupleable.h:1409
Moose::Kokkos::VariableValue kokkosCoupledVectorTagDofValues(const std::string &var_name, const std::string &tag_param_name) const
OutputTools< Real >::VariableSecond VariableSecond
Definition: MooseTypes.h:345
Moose::Kokkos::VariableGradient kokkosCoupledGradientsOlder(const std::string &var_name) const
const MooseArray< ADReal > & _ad_zero
Definition: Coupleable.h:1500
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.
Definition: Coupleable.C:1701
Moose::Kokkos::VariableValue kokkosCoupledValuesOld(const std::string &var_name) const
Moose::Kokkos::VariableValue kokkosCoupledValueOlder(const std::string &var_name, unsigned int comp=0) const
const Moose::ADType< T >::type & adCoupledNodalValue(const std::string &var_name, unsigned int comp=0) const
Returns AD nodal values of a coupled variable.
Definition: Coupleable.C:2162
virtual const VariableValue & coupledNodalDotOld(const std::string &var_name, unsigned int comp=0) const
Nodal values of old time derivative of a coupled variable.
Definition: Coupleable.C:2025
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.
Definition: Coupleable.h:1467
OutputTools< RealVectorValue >::VariableGradient VectorVariableGradient
Definition: MooseTypes.h:361
ArrayVariableGradient _default_array_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Definition: Coupleable.h:1541
Moose::Kokkos::VariableGradient kokkosCoupledGradientOld(const std::string &var_name, unsigned int comp=0) const
const ADVariableSecond & getADDefaultSecond() const
Helper method to return (and insert if necessary) the default second derivatives for Automatic Differ...
Definition: Coupleable.C:2416
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 ...
Definition: Coupleable.h:1820
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.
Definition: Coupleable.C:1772
virtual const VectorVariableDivergence & coupledDiv(const std::string &var_name, unsigned int comp=0) const
Returns divergence of a coupled variable.
Definition: Coupleable.C:1805
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValuesByName(const std::string &var_name, const std::string &tag_name) const
virtual const VariableGradient & coupledGradientPreviousNL(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable for previous Newton iterate.
Definition: Coupleable.C:1591
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
Moose::Kokkos::VariableValue kokkosCoupledDofValuesOld(const std::string &var_name) const
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Definition: Coupleable.h:1802
OutputTools< RealEigenVector >::VariableGradient ArrayVariableGradient
Definition: MooseTypes.h:379
void addFEVariableCoupleableMatrixTag(TagID tag)
Definition: Coupleable.h:118
std::vector< const ADVectorVariableValue * > adCoupledVectorValues(const std::string &var_name) const
Returns the values for all of a coupled vector variable&#39;s components for use in Automatic Differentia...
Definition: Coupleable.C:2573
std::vector< const VectorVariableValue * > coupledVectorValues(const std::string &var_name) const
Returns the values for all of a coupled vector variable&#39;s components.
Definition: Coupleable.C:2545
Moose::Kokkos::VariableGradient kokkosCoupledGradientOlder(const std::string &var_name, unsigned int comp=0) const
virtual const VariableValue & coupledDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of a coupled variable.
Definition: Coupleable.C:1195
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradientByName(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
virtual const ArrayVariableGradient & coupledArrayGradientDot(const std::string &var_name, unsigned int comp=0) const
Retun a gradient of a coupled array variable&#39;s time derivative.
Definition: Coupleable.C:1727
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValues(const std::string &var_name, const std::string &tag_param_name) const
std::vector< const GenericVariableGradient< is_ad > * > coupledGenericGradients(const std::string &var_name) const
Returns the gradients for all of a coupled variable&#39;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.
Definition: Coupleable.h:75
std::set< TagID > & getFEVariableCoupleableVectorTags()
Definition: Coupleable.h:120
virtual const VectorVariableValue & coupledVectorDotOld(const std::string &var_name, unsigned int comp=0) const
Old time derivative of a coupled vector variable.
Definition: Coupleable.C:1316
const ADVariableGradient & adCoupledGradientDot(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable&#39;s time derivative for use in Automatic Differentiation.
Definition: Coupleable.C:2239
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.
Definition: Coupleable.C:2256
bool hasWritableCoupledVariables() const
Checks whether the object has any writable coupled variables.
Definition: Coupleable.h:142
virtual const VectorVariableValue & coupledVectorDotDotOld(const std::string &var_name, unsigned int comp=0) const
Old second time derivative of a coupled vector variable.
Definition: Coupleable.C:1332
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.
Definition: Coupleable.C:1788
const ADVectorVariableValue & adCoupledVectorValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled vector variable for use in Automatic Differentiation.
Definition: Coupleable.C:2337
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.
Definition: Coupleable.C:1939
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
std::vector< const VariableValue * > coupledValuesOld(const std::string &var_name) const
Returns the old values for all of a coupled variable&#39;s components.
Definition: Coupleable.C:2719
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.
Definition: Coupleable.C:1575
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
std::vector< const VariableValue * > coupledAllDofValues(const std::string &var_name) const
Returns DoFs in the current solution vector of all of a coupled variable&#39;s components for the local e...
Definition: Coupleable.C:2070
const MooseVariableFieldBase * getFieldVar(const std::string &var_name, unsigned int comp) const
Definition: Coupleable.C:312
Moose::Kokkos::VariableValue kokkosCoupledNodalDots(const std::string &var_name) const
Moose::Kokkos::VariableValue kokkosCoupledValueOld(const std::string &var_name, unsigned int comp=0) 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.
Definition: Coupleable.C:1821