https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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"
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
36class MooseObject;
37
38namespace libMesh
39{
40template <typename T>
41class DenseVector;
42}
43
44template <typename>
47
53{
54public:
61 Coupleable(const MooseObject * moose_object, bool nodal, bool is_fv = false);
62
63#ifdef MOOSE_KOKKOS_ENABLED
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 {
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
143
144protected:
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>
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
552 const ADArrayVariableValue & adCoupledArrayValue(const std::string & var_name,
553 unsigned int comp = 0) const;
554
561 std::vector<const ADArrayVariableValue *>
562 adCoupledArrayValues(const std::string & var_name) const;
563
576 MooseWritableVariable & writableVariable(const std::string & var_name, unsigned int comp = 0);
577
587 virtual VariableValue & writableCoupledValue(const std::string & var_name, unsigned int comp = 0);
588
593
601 virtual const VariableValue & coupledValueOld(const std::string & var_name,
602 unsigned int comp = 0) const;
603
609 std::vector<const VariableValue *> coupledValuesOld(const std::string & var_name) const;
610
616 std::vector<const VectorVariableValue *>
617 coupledVectorValuesOld(const std::string & var_name) const;
618
626 virtual const VariableValue & coupledValueOlder(const std::string & var_name,
627 unsigned int comp = 0) const;
628
634 std::vector<const VariableValue *> coupledValuesOlder(const std::string & var_name) const;
635
642 virtual const VariableValue & coupledValuePreviousNL(const std::string & var_name,
643 unsigned int comp = 0) const;
644
652 virtual const VectorVariableValue & coupledVectorValueOld(const std::string & var_name,
653 unsigned int comp = 0) const;
654
662 virtual const VectorVariableValue & coupledVectorValueOlder(const std::string & var_name,
663 unsigned int comp = 0) const;
664
672 virtual const ArrayVariableValue & coupledArrayValueOld(const std::string & var_name,
673 unsigned int comp = 0) const;
674
682 virtual const ArrayVariableValue & coupledArrayValueOlder(const std::string & var_name,
683 unsigned int comp = 0) const;
684
692 virtual const VariableGradient & coupledGradient(const std::string & var_name,
693 unsigned int comp = 0) const;
694
700 std::vector<const VariableGradient *> coupledGradients(const std::string & var_name) const;
701
709 const ADVariableGradient & adCoupledGradient(const std::string & var_name,
710 unsigned int comp = 0) const;
711
719 const ADVariableGradient & adCoupledGradientDot(const std::string & var_name,
720 unsigned int comp = 0) const;
721
728 std::vector<const ADVariableGradient *> adCoupledGradients(const std::string & var_name) const;
729
737 template <bool is_ad>
738 const GenericVariableGradient<is_ad> & coupledGenericGradient(const std::string & var_name,
739 unsigned int comp = 0) const;
740
747 template <bool is_ad>
748 std::vector<const GenericVariableGradient<is_ad> *>
749 coupledGenericGradients(const std::string & var_name) const;
750
758 const ADVectorVariableGradient & adCoupledVectorGradient(const std::string & var_name,
759 unsigned int comp = 0) const;
760
767 const ADVariableSecond & adCoupledSecond(const std::string & var_name,
768 unsigned int comp = 0) const;
769
777 const ADVectorVariableSecond & adCoupledVectorSecond(const std::string & var_name,
778 unsigned int comp = 0) const;
779
787 virtual const VariableGradient & coupledGradientOld(const std::string & var_name,
788 unsigned int comp = 0) const;
789
795 std::vector<const VariableGradient *> coupledGradientsOld(const std::string & var_name) const;
796
804 virtual const VariableGradient & coupledGradientOlder(const std::string & var_name,
805 unsigned int comp = 0) const;
806
813 virtual const VariableGradient & coupledGradientPreviousNL(const std::string & var_name,
814 unsigned int comp = 0) const;
815
823 virtual const VariableGradient & coupledGradientDot(const std::string & var_name,
824 unsigned int comp = 0) const;
825
833 virtual const VariableGradient & coupledGradientDotDot(const std::string & var_name,
834 unsigned int comp = 0) const;
835
843 virtual const VectorVariableGradient & coupledVectorGradient(const std::string & var_name,
844 unsigned int comp = 0) const;
845
853 virtual const VectorVariableGradient & coupledVectorGradientOld(const std::string & var_name,
854 unsigned int comp = 0) const;
855
863 virtual const VectorVariableGradient & coupledVectorGradientOlder(const std::string & var_name,
864 unsigned int comp = 0) const;
865
873 virtual const ArrayVariableGradient & coupledArrayGradient(const std::string & var_name,
874 unsigned int comp = 0) const;
875
884 const ADArrayVariableGradient & adCoupledArrayGradient(const std::string & var_name,
885 unsigned int comp = 0) const;
886
893 std::vector<const ADArrayVariableGradient *>
894 adCoupledArrayGradients(const std::string & var_name) const;
895
903 virtual const ArrayVariableGradient & coupledArrayGradientOld(const std::string & var_name,
904 unsigned int comp = 0) const;
905
913 virtual const ArrayVariableGradient & coupledArrayGradientOlder(const std::string & var_name,
914 unsigned int comp = 0) const;
915
923 virtual const ArrayVariableGradient & coupledArrayGradientDot(const std::string & var_name,
924 unsigned int comp = 0) const;
925
933 virtual const VectorVariableCurl & coupledCurl(const std::string & var_name,
934 unsigned int comp = 0) const;
935
943 virtual const VectorVariableCurl & coupledCurlOld(const std::string & var_name,
944 unsigned int comp = 0) const;
945
953 virtual const VectorVariableCurl & coupledCurlOlder(const std::string & var_name,
954 unsigned int comp = 0) const;
955
963 const ADVectorVariableCurl & adCoupledCurl(const std::string & var_name,
964 unsigned int comp = 0) const;
965
975 const ADVectorVariableDivergence & adCoupledDiv(const std::string & var_name,
976 unsigned int comp = 0) const;
977
986 virtual const VectorVariableDivergence & coupledDiv(const std::string & var_name,
987 unsigned int comp = 0) const;
988
997 virtual const VectorVariableDivergence & coupledDivOld(const std::string & var_name,
998 unsigned int comp = 0) const;
999
1008 virtual const VectorVariableDivergence & coupledDivOlder(const std::string & var_name,
1009 unsigned int comp = 0) const;
1010
1018 virtual const VariableSecond & coupledSecond(const std::string & var_name,
1019 unsigned int comp = 0) const;
1020
1029 virtual const VariableSecond & coupledSecondOld(const std::string & var_name,
1030 unsigned int comp = 0) const;
1031
1040 virtual const VariableSecond & coupledSecondOlder(const std::string & var_name,
1041 unsigned int comp = 0) const;
1042
1049 virtual const VariableSecond & coupledSecondPreviousNL(const std::string & var_name,
1050 unsigned int comp = 0) const;
1051
1058 virtual const VariableValue & coupledDot(const std::string & var_name,
1059 unsigned int comp = 0) const;
1060
1066 std::vector<const VariableValue *> coupledDots(const std::string & var_name) const;
1067
1075 virtual const VariableValue & coupledDotDot(const std::string & var_name,
1076 unsigned int comp = 0) const;
1077
1084 virtual const VariableValue & coupledDotOld(const std::string & var_name,
1085 unsigned int comp = 0) const;
1086
1094 virtual const VariableValue & coupledDotDotOld(const std::string & var_name,
1095 unsigned int comp = 0) const;
1096
1104 const ADVariableValue & adCoupledDot(const std::string & var_name, unsigned int comp = 0) const;
1105
1111 std::vector<const ADVariableValue *> adCoupledDots(const std::string & var_name) const;
1112
1120 const ADVariableValue & adCoupledDotDot(const std::string & var_name,
1121 unsigned int comp = 0) const;
1122
1131 const ADVectorVariableValue & adCoupledVectorDot(const std::string & var_name,
1132 unsigned int comp = 0) const;
1133
1141 virtual const VectorVariableValue & coupledVectorDot(const std::string & var_name,
1142 unsigned int comp = 0) const;
1143
1151 virtual const VectorVariableValue & coupledVectorDotDot(const std::string & var_name,
1152 unsigned int comp = 0) const;
1153
1161 virtual const VectorVariableValue & coupledVectorDotOld(const std::string & var_name,
1162 unsigned int comp = 0) const;
1163
1171 virtual const VectorVariableValue & coupledVectorDotDotOld(const std::string & var_name,
1172 unsigned int comp = 0) const;
1173
1181 virtual const VariableValue & coupledVectorDotDu(const std::string & var_name,
1182 unsigned int comp = 0) const;
1183
1191 virtual const VariableValue & coupledVectorDotDotDu(const std::string & var_name,
1192 unsigned int comp = 0) const;
1193
1201 virtual const ArrayVariableValue & coupledArrayDot(const std::string & var_name,
1202 unsigned int comp = 0) const;
1203
1211 virtual const ArrayVariableValue & coupledArrayDotDot(const std::string & var_name,
1212 unsigned int comp = 0) const;
1213
1221 const ADArrayVariableValue & adCoupledArrayDot(const std::string & var_name,
1222 unsigned int comp = 0) const;
1223
1231 const ADArrayVariableValue & adCoupledArrayDotDot(const std::string & var_name,
1232 unsigned int comp = 0) const;
1233
1241 virtual const ArrayVariableValue & coupledArrayDotOld(const std::string & var_name,
1242 unsigned int comp = 0) const;
1243
1251 virtual const ArrayVariableValue & coupledArrayDotDotOld(const std::string & var_name,
1252 unsigned int comp = 0) const;
1253
1261 virtual const VariableValue & coupledDotDu(const std::string & var_name,
1262 unsigned int comp = 0) const;
1263
1271 virtual const VariableValue & coupledDotDotDu(const std::string & var_name,
1272 unsigned int comp = 0) const;
1273
1281 const VariableValue & coupledArrayDotDu(const std::string & var_name,
1282 unsigned int comp = 0) const;
1283
1290 template <typename T>
1291 const T & coupledNodalValue(const std::string & var_name, unsigned int comp = 0) const;
1292
1299 template <typename T>
1300 const typename Moose::ADType<T>::type & adCoupledNodalValue(const std::string & var_name,
1301 unsigned int comp = 0) const;
1302
1309 template <typename T>
1310 const T & coupledNodalValueOld(const std::string & var_name, unsigned int comp = 0) const;
1311
1318 template <typename T>
1319 const T & coupledNodalValueOlder(const std::string & var_name, unsigned int comp = 0) const;
1320
1327 template <typename T>
1328 const T & coupledNodalValuePreviousNL(const std::string & var_name, unsigned int comp = 0) const;
1329
1337 template <typename T>
1338 const T & coupledNodalDot(const std::string & var_name, unsigned int comp = 0) const;
1339
1347 virtual const VariableValue & coupledNodalDotDot(const std::string & var_name,
1348 unsigned int comp = 0) const;
1349
1357 virtual const VariableValue & coupledNodalDotOld(const std::string & var_name,
1358 unsigned int comp = 0) const;
1359
1367 virtual const VariableValue & coupledNodalDotDotOld(const std::string & var_name,
1368 unsigned int comp = 0) const;
1369 // coupled-dof-values-begin
1376 virtual const VariableValue & coupledDofValues(const std::string & var_name,
1377 unsigned int comp = 0) const;
1378
1385 std::vector<const VariableValue *> coupledAllDofValues(const std::string & var_name) const;
1386
1393 virtual const VariableValue & coupledDofValuesOld(const std::string & var_name,
1394 unsigned int comp = 0) const;
1395
1402 std::vector<const VariableValue *> coupledAllDofValuesOld(const std::string & var_name) const;
1403
1410 virtual const VariableValue & coupledDofValuesOlder(const std::string & var_name,
1411 unsigned int comp = 0) const;
1412
1419 std::vector<const VariableValue *> coupledAllDofValuesOlder(const std::string & var_name) const;
1420
1427 virtual const ArrayVariableValue & coupledArrayDofValues(const std::string & var_name,
1428 unsigned int comp = 0) const;
1429 // coupled-dof-values-end
1430
1437 virtual const ADVariableValue & adCoupledDofValues(const std::string & var_name,
1438 unsigned int comp = 0) const;
1439
1444 const ADVariableValue & adZeroValue() const;
1445
1450 const ADVariableGradient & adZeroGradient() const;
1451
1455 const ADVariableSecond & adZeroSecond() const;
1456
1461 template <bool is_ad>
1463
1468 template <bool is_ad>
1470
1475 template <bool is_ad>
1477
1478protected:
1479 // Reference to the interface's input parameters
1481
1483 const std::string & _c_name;
1485 const std::string & _c_type;
1486
1487 // Reference to FEProblemBase
1489
1491 const SystemBase * const _c_sys;
1492
1494 std::unordered_map<std::string, std::vector<MooseVariableFieldBase *>> _coupled_vars;
1495
1497 std::vector<MooseVariableFieldBase *> _coupled_moose_vars;
1498
1500 std::vector<MooseVariable *> _coupled_standard_moose_vars;
1501
1503 std::vector<VectorMooseVariable *> _coupled_vector_moose_vars;
1504
1506 std::vector<ArrayMooseVariable *> _coupled_array_moose_vars;
1507
1509 std::vector<MooseVariableField<Real> *> _coupled_fv_moose_vars;
1510
1512 const std::unordered_map<std::string, std::string> & _new_to_deprecated_coupled_vars;
1513
1516
1519
1520 // Argument to allow element-to-nodal coupling
1522
1525
1527 mutable std::unordered_map<std::string, std::vector<std::unique_ptr<VariableValue>>>
1529
1531 mutable std::unordered_map<std::string, std::unique_ptr<MooseArray<ADReal>>> _ad_default_value;
1532
1534 mutable std::unordered_map<std::string, std::unique_ptr<VectorVariableValue>>
1536
1538 mutable std::unordered_map<std::string, std::unique_ptr<ArrayVariableValue>> _default_array_value;
1539
1541 mutable std::unordered_map<std::string, std::unique_ptr<ADArrayVariableValue>>
1543
1546 mutable std::unordered_map<std::string, std::unique_ptr<ADArrayVariableGradient>>
1548
1551 mutable std::unordered_map<std::string, std::unique_ptr<ADArrayVariableValue>>
1553
1555 mutable std::unordered_map<std::string, std::unique_ptr<MooseArray<ADRealVectorValue>>>
1557
1563
1566
1569
1572
1575
1578
1581
1585
1590
1594
1597
1607
1613
1616
1619
1622
1628
1631
1637 bool
1638 checkVar(const std::string & var_name, unsigned int comp = 0, unsigned int comp_bound = 0) const;
1639
1640private:
1644 template <typename T>
1645 const typename OutputTools<T>::VariableValue &
1646 vectorTagValueHelper(const std::string & var_names, TagID tag, unsigned int index = 0) const;
1647
1651 template <typename T>
1652 const typename OutputTools<T>::VariableValue & vectorTagValueHelper(const std::string & var_names,
1653 const std::string & tag_name,
1654 unsigned int index = 0) const;
1655
1659 template <typename T>
1660 const typename OutputTools<T>::VariableValue &
1661 vectorTagDofValueHelper(const std::string & var_name, TagID tag, unsigned int comp = 0) const;
1662
1666 template <typename T>
1668 const std::string & var_name, const std::string & tag_name, unsigned int comp = 0) const;
1669
1675 template <typename T>
1676 void
1677 requestStates(const std::string & var_name, const TagName & tag_name, const unsigned int comp);
1678
1679 enum class FuncAge
1680 {
1681 Curr,
1682 Old,
1683 Older,
1684 };
1685
1686 enum class VarType
1687 {
1688 Ignore,
1689 Gradient,
1690 Second,
1692 Dot,
1693 };
1694
1695 void checkFuncType(const std::string var_name, VarType t, FuncAge age) const;
1696
1697protected:
1702 virtual bool usesFaceCoupledValues() const { return false; }
1703
1712 const MooseVariableFieldBase * getFEVar(const std::string & var_name, unsigned int comp) const;
1713
1714 /*
1715 * Extract pointer to a base coupled field variable. Could be either a finite volume or finite
1716 * element variable
1717 * @param var_name Name of parameter desired
1718 * @param comp Component number of multiple coupled variables
1719 * @return Pointer to the desired variable
1720 */
1721 const MooseVariableFieldBase * getFieldVar(const std::string & var_name, unsigned int comp) const;
1722
1723 /*
1724 * Extract pointer to a base coupled field variable. Could be either a finite volume or finite
1725 * element variable
1726 * @param var_name Name of variable desired
1727 * @param comp Component number of multiple coupled variables
1728 * @return Pointer to the desired variable
1729 */
1730 MooseVariableFieldBase * getFieldVar(const std::string & var_name, unsigned int comp);
1731
1732 /*
1733 * Extract pointers to all components of a base coupled field variable.
1734 * Could be either a finite volume or finite element variable
1735 * @param var_name Name of variable desired
1736 * @return Pointers to the desired variables
1737 */
1738 std::vector<const MooseVariableFieldBase *> getFieldVars(const std::string & var_name) const;
1739
1743 template <typename T>
1744 const T * getVarHelper(const std::string & var_name, unsigned int comp) const;
1745
1749 template <typename T>
1750 T * getVarHelper(const std::string & var_name, unsigned int comp);
1751
1757 template <typename T>
1758 std::vector<const T *> getVarsHelper(const std::string & var_name) const;
1759
1766 MooseVariable * getVar(const std::string & var_name, unsigned int comp);
1767
1774 VectorMooseVariable * getVectorVar(const std::string & var_name, unsigned int comp);
1775
1782 ArrayMooseVariable * getArrayVar(const std::string & var_name, unsigned int comp);
1783
1790 const MooseVariable * getVar(const std::string & var_name, unsigned int comp) const;
1791
1798 const VectorMooseVariable * getVectorVar(const std::string & var_name, unsigned int comp) const;
1799
1806 const ArrayMooseVariable * getArrayVar(const std::string & var_name, unsigned int comp) const;
1807
1814 void validateExecutionerType(const std::string & name, const std::string & fn_name) const;
1815
1816 template <typename T, typename Func>
1817 std::vector<T> coupledVectorHelper(const std::string & var_name, const Func & func) const
1818 {
1819 const auto components = coupledComponents(var_name);
1820 std::vector<T> vals(components);
1821 for (MooseIndex(components) comp = 0; comp < components; ++comp)
1822 vals[comp] = func(comp);
1823 return vals;
1824 }
1825
1828
1829public:
1836 const ADVariableValue * getADDefaultValue(const std::string & var_name) const;
1837
1844 const ADVectorVariableValue * getADDefaultVectorValue(const std::string & var_name) const;
1845
1853
1861
1868 const ADVariableSecond & getADDefaultSecond() const;
1869
1876 const ADVectorVariableCurl & getADDefaultCurl() const;
1877
1884
1891 const ADArrayVariableValue * getADDefaultArrayValue(const std::string & var_name) const;
1892
1899 const ADArrayVariableGradient & getADDefaultArrayGradient(const std::string & var_name) const;
1900
1907 const ADArrayVariableValue & getADDefaultArrayValueZero(const std::string & var_name) const;
1908
1909private:
1916 const VariableValue * getDefaultValue(const std::string & var_name, unsigned int comp) const;
1917
1924 const VectorVariableValue * getDefaultVectorValue(const std::string & var_name) const;
1925
1932 const ArrayVariableValue * getDefaultArrayValue(const std::string & var_name) const;
1933
1937 template <typename T>
1938 const T & getDefaultNodalValue(const std::string & var_name, unsigned int comp = 0) const;
1939
1940 template <typename T>
1941 const Moose::Functor<T> & getDefaultFunctor(const std::string & var_name) const;
1942
1945
1947 std::unordered_map<std::string, std::vector<unsigned int>> _optional_var_index;
1948
1950 std::unordered_map<std::string, std::vector<MooseVariableScalar *>> _c_coupled_scalar_vars;
1951
1953
1955
1957 const bool _is_fv;
1958
1959 const MooseObject * const _obj;
1960
1964
1966 std::vector<std::set<MooseWritableVariable *>> _writable_coupled_variables;
1967
1971private:
1973
1974#ifdef MOOSE_KOKKOS_SCOPE
1976 const std::string & tag_name,
1977 unsigned int comp) const;
1979 const std::string & tag_name) const;
1981 const std::string & tag_name,
1982 unsigned int comp) const;
1984 const std::string & tag_name) const;
1986
1987public:
1989 const std::string & tag_name,
1990 unsigned int comp = 0) const;
1992 kokkosCoupledVectorTagValuesByName(const std::string & var_name,
1993 const std::string & tag_name) const;
1995 const std::string & tag_name,
1996 unsigned int comp = 0) const;
1998 kokkosCoupledVectorTagGradientsByName(const std::string & var_name,
1999 const std::string & tag_name) const;
2001 const std::string & tag_name,
2002 unsigned int comp = 0) const;
2004 kokkosCoupledVectorTagNodalValuesByName(const std::string & var_name,
2005 const std::string & tag_name) const;
2007 const std::string & tag_name,
2008 unsigned int comp = 0) const;
2010 kokkosCoupledVectorTagDofValuesByName(const std::string & var_name,
2011 const std::string & tag_name) const;
2012
2014 const std::string & tag_param_name,
2015 unsigned int comp = 0) const;
2017 kokkosCoupledVectorTagValues(const std::string & var_name,
2018 const std::string & tag_param_name) const;
2020 const std::string & tag_param_name,
2021 unsigned int comp = 0) const;
2023 kokkosCoupledVectorTagGradients(const std::string & var_name,
2024 const std::string & tag_param_name) const;
2026 const std::string & tag_param_name,
2027 unsigned int comp = 0) const;
2029 kokkosCoupledVectorTagNodalValues(const std::string & var_name,
2030 const std::string & tag_param_name) const;
2032 const std::string & tag_param_name,
2033 unsigned int comp = 0) const;
2035 kokkosCoupledVectorTagDofValues(const std::string & var_name,
2036 const std::string & tag_param_name) const;
2037
2039 const std::string & var_name, const std::string & tag_name, unsigned int comp = 0) const;
2041 kokkosCoupledVectorTagVectorValuesByName(const std::string & var_name,
2042 const std::string & tag_name) const;
2044 const std::string & var_name, const std::string & tag_name, unsigned int comp = 0) const;
2047 const std::string & tag_name) const;
2049 const std::string & var_name, const std::string & tag_name, unsigned int comp = 0) const;
2052 const std::string & tag_name) const;
2054 const std::string & var_name, const std::string & tag_name, unsigned int comp = 0) const;
2057 const std::string & tag_name) const;
2058
2060 kokkosCoupledVectorTagVectorValue(const std::string & var_name,
2061 const std::string & tag_param_name,
2062 unsigned int comp = 0) const;
2064 kokkosCoupledVectorTagVectorValues(const std::string & var_name,
2065 const std::string & tag_param_name) const;
2067 kokkosCoupledVectorTagVectorGradient(const std::string & var_name,
2068 const std::string & tag_param_name,
2069 unsigned int comp = 0) const;
2071 kokkosCoupledVectorTagVectorGradients(const std::string & var_name,
2072 const std::string & tag_param_name) const;
2074 kokkosCoupledVectorTagVectorNodalValue(const std::string & var_name,
2075 const std::string & tag_param_name,
2076 unsigned int comp = 0) const;
2078 kokkosCoupledVectorTagVectorNodalValues(const std::string & var_name,
2079 const std::string & tag_param_name) const;
2081 kokkosCoupledVectorTagVectorDofValue(const std::string & var_name,
2082 const std::string & tag_param_name,
2083 unsigned int comp = 0) const;
2085 kokkosCoupledVectorTagVectorDofValues(const std::string & var_name,
2086 const std::string & tag_param_name) const;
2087
2089 unsigned int comp = 0) const;
2090 Moose::Kokkos::VariableValue kokkosCoupledValues(const std::string & var_name) const;
2092 unsigned int comp = 0) const;
2093 Moose::Kokkos::VariableGradient kokkosCoupledGradients(const std::string & var_name) const;
2095 unsigned int comp = 0) const;
2096 Moose::Kokkos::VariableValue kokkosCoupledNodalValues(const std::string & var_name) const;
2098 unsigned int comp = 0) const;
2099 Moose::Kokkos::VariableValue kokkosCoupledDofValues(const std::string & var_name) const;
2100
2102 unsigned int comp = 0) const;
2103 Moose::Kokkos::VariableValue kokkosCoupledValuesOld(const std::string & var_name) const;
2105 unsigned int comp = 0) const;
2108 unsigned int comp = 0) const;
2111 unsigned int comp = 0) const;
2112 Moose::Kokkos::VariableValue kokkosCoupledDofValuesOld(const std::string & var_name) const;
2113
2115 unsigned int comp = 0) const;
2116 Moose::Kokkos::VariableValue kokkosCoupledValuesOlder(const std::string & var_name) const;
2118 unsigned int comp = 0) const;
2121 unsigned int comp = 0) const;
2124 unsigned int comp = 0) const;
2126
2128 unsigned int comp = 0) const;
2129 Moose::Kokkos::VariableValue kokkosCoupledDots(const std::string & var_name) const;
2131 unsigned int comp = 0) const;
2132 Moose::Kokkos::VariableValue kokkosCoupledNodalDots(const std::string & var_name) const;
2133
2135 unsigned int comp = 0) const;
2137 unsigned int comp = 0) const;
2139 unsigned int comp = 0) const;
2141 unsigned int comp = 0) const;
2144 kokkosCoupledVectorGradients(const std::string & var_name) const;
2146 kokkosCoupledVectorNodalValues(const std::string & var_name) const;
2148 kokkosCoupledVectorDofValues(const std::string & var_name) const;
2149
2151 unsigned int comp = 0) const;
2153 unsigned int comp = 0) const;
2155 unsigned int comp = 0) const;
2157 unsigned int comp = 0) const;
2159 kokkosCoupledVectorValuesOld(const std::string & var_name) const;
2161 kokkosCoupledVectorGradientsOld(const std::string & var_name) const;
2163 kokkosCoupledVectorNodalValuesOld(const std::string & var_name) const;
2165 kokkosCoupledVectorDofValuesOld(const std::string & var_name) const;
2166
2168 unsigned int comp = 0) const;
2170 kokkosCoupledVectorGradientOlder(const std::string & var_name, unsigned int comp = 0) const;
2172 kokkosCoupledVectorNodalValueOlder(const std::string & var_name, unsigned int comp = 0) const;
2174 unsigned int comp = 0) const;
2176 kokkosCoupledVectorValuesOlder(const std::string & var_name) const;
2178 kokkosCoupledVectorGradientsOlder(const std::string & var_name) const;
2180 kokkosCoupledVectorNodalValuesOlder(const std::string & var_name) const;
2182 kokkosCoupledVectorDofValuesOlder(const std::string & var_name) const;
2183
2185 unsigned int comp = 0) const;
2187 unsigned int comp = 0) const;
2190 kokkosCoupledVectorNodalDots(const std::string & var_name) const;
2191
2193 const std::string & tag_name,
2194 unsigned int comp = 0) const;
2196 kokkosADCoupledVectorTagValuesByName(const std::string & var_name,
2197 const std::string & tag_name) const;
2199 const std::string & var_name, const std::string & tag_name, unsigned int comp = 0) const;
2201 kokkosADCoupledVectorTagGradientsByName(const std::string & var_name,
2202 const std::string & tag_name) const;
2204 const std::string & var_name, const std::string & tag_name, unsigned int comp = 0) const;
2206 kokkosADCoupledVectorTagNodalValuesByName(const std::string & var_name,
2207 const std::string & tag_name) const;
2209 const std::string & var_name, const std::string & tag_name, unsigned int comp = 0) const;
2211 kokkosADCoupledVectorTagDofValuesByName(const std::string & var_name,
2212 const std::string & tag_name) const;
2213
2215 const std::string & tag_param_name,
2216 unsigned int comp = 0) const;
2218 kokkosADCoupledVectorTagValues(const std::string & var_name,
2219 const std::string & tag_param_name) const;
2221 kokkosADCoupledVectorTagGradient(const std::string & var_name,
2222 const std::string & tag_param_name,
2223 unsigned int comp = 0) const;
2225 kokkosADCoupledVectorTagGradients(const std::string & var_name,
2226 const std::string & tag_param_name) const;
2228 kokkosADCoupledVectorTagNodalValue(const std::string & var_name,
2229 const std::string & tag_param_name,
2230 unsigned int comp = 0) const;
2232 kokkosADCoupledVectorTagNodalValues(const std::string & var_name,
2233 const std::string & tag_param_name) const;
2235 kokkosADCoupledVectorTagDofValue(const std::string & var_name,
2236 const std::string & tag_param_name,
2237 unsigned int comp = 0) const;
2239 kokkosADCoupledVectorTagDofValues(const std::string & var_name,
2240 const std::string & tag_param_name) const;
2241
2243 unsigned int comp = 0) const;
2244 Moose::Kokkos::ADVariableValue kokkosADCoupledValues(const std::string & var_name) const;
2246 unsigned int comp = 0) const;
2249 unsigned int comp = 0) const;
2252 unsigned int comp = 0) const;
2254
2256 unsigned int comp = 0) const;
2259 unsigned int comp = 0) const;
2262 unsigned int comp = 0) const;
2265 unsigned int comp = 0) const;
2267
2269 unsigned int comp = 0) const;
2272 unsigned int comp = 0) const;
2274 kokkosADCoupledGradientsOlder(const std::string & var_name) const;
2276 unsigned int comp = 0) const;
2278 kokkosADCoupledNodalValuesOlder(const std::string & var_name) const;
2280 unsigned int comp = 0) const;
2282
2284 unsigned int comp = 0) const;
2285 Moose::Kokkos::ADVariableValue kokkosADCoupledDots(const std::string & var_name) const;
2287 unsigned int comp = 0) const;
2289
2291 unsigned int comp = 0) const;
2292
2296#endif
2297};
2298
2299template <typename T>
2300T *
2301Coupleable::getVarHelper(const std::string & var_name_in, unsigned int comp)
2302{
2303 const auto & var_name = _c_parameters.checkForRename(var_name_in);
2304 auto name_to_use = var_name;
2305
2306 // First check for supplied name
2307 if (!checkVar(var_name, comp, 0))
2308 {
2309 // See if there is an associated deprecated name that the user may have used instead
2310 auto it = _new_to_deprecated_coupled_vars.find(var_name);
2311 if (it == _new_to_deprecated_coupled_vars.end())
2312 return nullptr;
2313 else
2314 {
2315 auto deprecated_name = it->second;
2316 if (checkVar(deprecated_name, comp, 0))
2317 name_to_use = deprecated_name;
2318 else
2319 return nullptr;
2320 }
2321 }
2322
2323 auto coupled_vars_it = _coupled_vars.find(name_to_use);
2324
2325 mooseAssert(coupled_vars_it != _coupled_vars.end(),
2326 "Trying to get a coupled var " << name_to_use << " that doesn't exist");
2327 mooseAssert(comp < coupled_vars_it->second.size(),
2328 "Component index outside of coupled variables vector");
2329 auto * const base_var = coupled_vars_it->second[comp];
2330
2331 if (auto coupled_var = dynamic_cast<T *>(base_var))
2332 return coupled_var;
2333 else
2334 {
2335 for (auto & var : _coupled_standard_moose_vars)
2336 if (var->name() == base_var->name())
2337 mooseError("The named variable is a standard variable, try a "
2338 "'coupled[Value/Gradient/Dot/etc]...' function instead");
2339 for (auto & var : _coupled_vector_moose_vars)
2340 if (var->name() == base_var->name())
2341 mooseError("The named variable is a vector variable, try a "
2342 "'coupledVector[Value/Gradient/Dot/etc]...' function instead");
2343 for (auto & var : _coupled_array_moose_vars)
2344 if (var->name() == base_var->name())
2345 mooseError("The named variable is an array variable, try a "
2346 "'coupledArray[Value/Gradient/Dot/etc]...' function instead");
2347 for (auto & var : _coupled_fv_moose_vars)
2348 if (var->name() == base_var->name())
2349 mooseError("The named variable is a finite volume variable, which the coupled[...] routine "
2350 "used does not support. Try using the functor system routines instead.");
2351 mooseError("Variable '",
2352 base_var->name(),
2353 "' is of a different C++ type than you tried to fetch it as.");
2354 }
2355}
2356
2357template <typename T>
2358const T *
2359Coupleable::getVarHelper(const std::string & var_name, unsigned int comp) const
2360{
2361 return const_cast<Coupleable *>(this)->getVarHelper<T>(var_name, comp);
2362}
2363
2364template <typename T>
2365std::vector<const T *>
2366Coupleable::getVarsHelper(const std::string & var_name) const
2367{
2368 const auto components = coupledComponents(var_name);
2369 std::vector<const T *> vars(components);
2370 for (const auto i : make_range(components))
2371 vars[i] = getVarHelper<T>(var_name, i);
2372 return vars;
2373}
MooseVariableField< Real > MooseWritableVariable
Definition Coupleable.h:46
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
OutputTools< Real >::VariablePhiValue VariablePhiValue
Definition MooseTypes.h:353
OutputTools< RealVectorValue >::VariableCurl VectorVariableCurl
Definition MooseTypes.h:368
OutputTools< Real >::VariableGradient VariableGradient
Definition MooseTypes.h:349
unsigned int TagID
Definition MooseTypes.h:238
OutputTools< RealEigenVector >::VariableValue ArrayVariableValue
Definition MooseTypes.h:382
Moose::GenericType< VariableValue, is_ad > GenericVariableValue
Definition MooseTypes.h:716
Moose::GenericType< VectorVariableValue, is_ad > GenericVectorVariableValue
Definition MooseTypes.h:718
Moose::GenericType< VariableSecond, is_ad > GenericVariableSecond
Definition MooseTypes.h:722
OutputTools< Real >::VariableValue VariableValue
Definition MooseTypes.h:348
OutputTools< RealVectorValue >::VariableDivergence VectorVariableDivergence
Definition MooseTypes.h:369
OutputTools< Real >::VariablePhiGradient VariablePhiGradient
Definition MooseTypes.h:354
Moose::GenericType< VariableGradient, is_ad > GenericVariableGradient
Definition MooseTypes.h:720
OutputTools< RealEigenVector >::VariableGradient ArrayVariableGradient
Definition MooseTypes.h:384
OutputTools< Real >::VariableSecond VariableSecond
Definition MooseTypes.h:350
OutputTools< RealVectorValue >::VariableGradient VectorVariableGradient
Definition MooseTypes.h:366
unsigned int THREAD_ID
Definition MooseTypes.h:237
OutputTools< Real >::VariablePhiSecond VariablePhiSecond
Definition MooseTypes.h:355
OutputTools< RealVectorValue >::VariableValue VectorVariableValue
Definition MooseTypes.h:365
char ** vars
Interface for objects that needs coupling capabilities.
Definition Coupleable.h:53
const ADVariableValue & adZeroValue() const
method that returns _zero to RESIDUAL computing objects and _ad_zero to JACOBIAN computing objects
virtual const VariableValue & coupledNodalDotOld(const std::string &var_name, unsigned int comp=0) const
Nodal values of old time derivative of a coupled variable.
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _c_coupled_scalar_vars
Scalar variables coupled into this object (for error checking)
std::unordered_map< std::string, std::unique_ptr< ArrayVariableValue > > _default_array_value
Will hold the default value for optional array coupled variables.
Moose::Kokkos::VariableValue kokkosCoupledNodalValuesOld(const std::string &var_name) const
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.
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.
bool hasWritableCoupledVariables() const
Checks whether the object has any writable coupled variables.
Definition Coupleable.h:142
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.
virtual const VectorVariableValue & coupledVectorValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled vector variable.
Definition Coupleable.C:855
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorNodalValuesByName(const std::string &var_name, const std::string &tag_name) const
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.
std::vector< const ADArrayVariableGradient * > adCoupledArrayGradients(const std::string &var_name) const
Returns the gradients for all of a coupled array variable's components for use in Automatic Different...
const std::set< TagID > & getFEVariableCoupleableMatrixTags() const
Definition Coupleable.h:129
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagDofValueByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0) 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...
Moose::Kokkos::VariableGradient kokkosCoupledGradientOld(const std::string &var_name, unsigned int comp=0) const
VectorVariableCurl _default_vector_curl
This will always be zero because the default values for optionally coupled variables is always consta...
const ADVariableValue & adCoupledDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of a coupled variable for ad simulations.
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::VariableValue kokkosCoupledNodalDot(const std::string &var_name, unsigned int comp=0) const
bool _c_is_implicit
True if implicit value is required.
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.
Moose::Kokkos::VariableValue kokkosCoupledDofValuesOlder(const std::string &var_name) const
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValueByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
virtual const ArrayVariableGradient & coupledArrayGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled array variable.
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.
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.
virtual const VectorVariableValue & coupledVectorDotOld(const std::string &var_name, unsigned int comp=0) const
Old time derivative of a coupled vector variable.
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorNodalValues(const std::string &var_name) const
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradient(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
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::VariableValue kokkosCoupledNodalValuesOlder(const std::string &var_name) const
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:720
virtual const VectorVariableValue & coupledVectorDotDotOld(const std::string &var_name, unsigned int comp=0) const
Old second time derivative of a coupled vector variable.
const ADVariableGradient & adCoupledGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable for use in Automatic Differentiation.
Moose::Kokkos::VariableValue kokkosCoupledNodalValue(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::Scalar< const Real > kokkosCoupledDotDu(const std::string &var_name, unsigned int comp=0) const
std::vector< ArrayMooseVariable * > _coupled_array_moose_vars
Vector of array coupled variables.
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 kokkosCoupledDots(const std::string &var_name) const
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:177
MooseArray< ADRealTensorValue > _ad_default_second
This will always be zero because the default values for optionally coupled variables is always consta...
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagValuesByName(const std::string &var_name, const std::string &tag_name) const
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagNodalValuesByName(const std::string &var_name, const std::string &tag_name) const
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagDofValues(const std::string &var_name, const std::string &tag_param_name) const
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorValue(const std::string &var_name, unsigned int comp=0) const
const ADArrayVariableGradient & adCoupledArrayGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled array variable for use in Automatic Differentiation.
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:759
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.
virtual const VariableValue & coupledDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled variable.
Moose::Kokkos::VariableValue kokkosCoupledNodalValueOld(const std::string &var_name, unsigned int comp=0) const
virtual const ArrayVariableValue & coupledArrayValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled array variable.
Definition Coupleable.C:880
Moose::Kokkos::VariableGradient kokkosZeroGradient() const
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorNodalValueOld(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorGradientsOld(const std::string &var_name) const
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorValuesOlder(const std::string &var_name) const
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::unordered_map< std::string, std::vector< std::unique_ptr< VariableValue > > > _default_value
Will hold the default value for optional coupled variables.
Moose::Kokkos::VariableValue kokkosCoupledVectorTagDofValueByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorTagVectorGradientsByName(const std::string &var_name, const std::string &tag_name) const
virtual const ArrayVariableValue & coupledArrayDotOld(const std::string &var_name, unsigned int comp=0) const
Old time derivative of a coupled array variable.
void addFEVariableCoupleableVectorTag(TagID tag)
Definition Coupleable.h:116
const GenericVariableGradient< is_ad > & genericZeroGradient()
Returns zero gradient templated with automatic differentiation boolean.
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValuesByName(const std::string &var_name, const std::string &tag_name) const
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorDofValues(const std::string &var_name) const
const ADArrayVariableValue & adCoupledArrayDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of a coupled array variable for use in Automatic Differentiation.
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.
virtual const VariableGradient & coupledGradientDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of the gradient of a coupled variable.
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.
Definition Coupleable.C:814
const GenericVariableSecond< is_ad > & genericZeroSecond()
Returns zero second derivative templated with automatic differentiation boolean.
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:234
virtual const VariableValue & coupledValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled variable.
Definition Coupleable.C:528
Moose::Kokkos::ADVariableValue kokkosADCoupledDofValueOlder(const std::string &var_name, unsigned int comp=0) const
const ADVectorVariableDivergence & adCoupledDiv(const std::string &var_name, unsigned int comp=0) const
Returns divergence 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.
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.
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagNodalValue(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
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.
std::vector< const VariableGradient * > coupledGradientsOld(const std::string &var_name) const
Returns the old gradients for all of a coupled variable's components.
Moose::Kokkos::VariableValue kokkosCoupledValues(const std::string &var_name) const
ArrayVariableValue _default_array_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Moose::Kokkos::VariableValue kokkosCoupledNodalValues(const std::string &var_name) const
Moose::Kokkos::Variable kokkosCoupledVectorTagVectorVariable(const std::string &var_name, const std::string &tag_name, unsigned int comp) 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.
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradientsOlder(const std::string &var_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.
VectorVariableDivergence _default_div
This will always be zero because the default values for optionally coupled variables is always consta...
Moose::Kokkos::VariableValue kokkosCoupledDofValue(const std::string &var_name, unsigned int comp=0) const
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.
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.
const VariableValue & _zero
Zero value of a variable.
auto & getWritableCoupledVariables() const
returns a reference to the set of writable coupled variables
Definition Coupleable.h:137
Moose::Kokkos::VariableValue kokkosCoupledVectorTagDofValues(const std::string &var_name, const std::string &tag_param_name) const
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _coupled_vars
Coupled vars whose values we provide.
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.
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValue(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
Moose::Kokkos::VariableValue kokkosCoupledDofValueOlder(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::ADVariableValue kokkosADCoupledDofValuesOld(const std::string &var_name) const
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorNodalValuesOld(const std::string &var_name) const
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::ADVariableValue kokkosADCoupledNodalValueOlder(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::ADVariableValue kokkosADCoupledDofValue(const std::string &var_name, unsigned int comp=0) const
std::vector< T > coupledVectorHelper(const std::string &var_name, const Func &func) const
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorValues(const std::string &var_name) const
MooseArray< ADReal > _ad_default_div
Will hold the default value for optional vector coupled variable divergences for automatic differenti...
const VariableGradient & _grad_zero
Zero gradient of a variable.
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.
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorValue(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
std::unordered_map< std::string, std::unique_ptr< ADArrayVariableValue > > _ad_default_array_value
Will hold the default value for optional array coupled variables for automatic differentiation.
MooseArray< ADRealTensorValue > _ad_default_vector_gradient
This will always be zero because the default values for optionally coupled vector variables is always...
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.
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< MooseArray< ADReal > > > _ad_default_value
Will hold the default value for optional coupled variables for automatic differentiation.
virtual const VectorVariableCurl & coupledCurl(const std::string &var_name, unsigned int comp=0) const
Returns curl of a coupled variable.
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalValue(const std::string &var_name, unsigned int comp=0) const
const MooseObject *const _obj
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.
Moose::Kokkos::ADVariableValue kokkosADCoupledValuesOlder(const std::string &var_name) const
bool _c_nodal
True if we provide coupling to nodal values.
Moose::Kokkos::VariableGradient kokkosCoupledGradient(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorDot(const std::string &var_name, unsigned int comp=0) const
VectorVariableGradient _default_vector_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorGradientsOlder(const std::string &var_name) const
std::set< TagID > & getFEVariableCoupleableVectorTags()
Definition Coupleable.h:120
Moose::Kokkos::VariableValue kokkosCoupledValueOlder(const std::string &var_name, unsigned int comp=0) const
const MooseArray< ADRealTensorValue > & _ad_second_zero
std::vector< const VariableGradient * > coupledGradients(const std::string &var_name) const
Returns the gradients for all of a coupled variable's components.
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.
const VectorVariableCurl & _vector_curl_zero
Zero value of the curl of a vector variable.
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.
MooseArray< ADRealVectorValue > _ad_default_curl
This will always be zero because the default values for optionally coupled vector variables is always...
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradientByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
std::set< TagID > _fe_coupleable_matrix_tags
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagDofValuesByName(const std::string &var_name, const std::string &tag_name) const
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradients(const std::string &var_name, const std::string &tag_param_name) const
const ADVariableGradient & adZeroGradient() const
method that returns _grad_zero to RESIDUAL computing objects and _ad_grad_zero to JACOBIAN computing ...
virtual const VectorVariableGradient & coupledVectorGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled vector variable.
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< const VectorVariableValue * > coupledVectorValuesOld(const std::string &var_name) const
Returns the old values for all of a coupled vector variable's components.
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.
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalDots(const std::string &var_name) const
const ADVectorVariableValue & adCoupledVectorDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a vector coupled variable for ad simulations.
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled variable.
Definition Coupleable.C:319
Moose::Kokkos::Variable kokkosZeroVariable() const
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalValuesOld(const std::string &var_name) const
const ADVariableSecond & adZeroSecond() const
Retrieve a zero second for automatic differentiation.
const T & coupledNodalDot(const std::string &var_name, unsigned int comp=0) const
Nodal values of time derivative of a coupled variable.
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorDofValue(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
Moose::Kokkos::ADVariableValue kokkosADCoupledValues(const std::string &var_name) const
const T & coupledNodalValue(const std::string &var_name, unsigned int comp=0) const
Returns nodal values of a coupled variable.
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:366
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalDot(const std::string &var_name, unsigned int comp=0) 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...
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorValueOlder(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradients(const std::string &var_name) const
Moose::Kokkos::VariableValue kokkosCoupledNodalDots(const std::string &var_name) 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's components for the local eleme...
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorGradient(const std::string &var_name, unsigned int comp=0) const
void addFEVariableCoupleableMatrixTag(TagID tag)
Definition Coupleable.h:118
VectorVariableValue _default_vector_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
Moose::Kokkos::Variable kokkosCoupledVectorTagVariables(const std::string &var_name, const std::string &tag_name) const
virtual const VectorVariableValue & coupledVectorDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled vector variable.
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValueByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0) 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...
std::unordered_map< std::string, std::unique_ptr< VectorVariableValue > > _default_vector_value
Will hold the default value for optional vector coupled variables.
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradientOlder(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::ADVariableValue kokkosADCoupledDot(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::VariableValue kokkosCoupledVectorTagDofValue(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
std::vector< const VariableGradient * > coupledVectorTagGradients(const std::string &var_names, TagID tag) const
Returns gradients for all the coupled variables desired for a given tag.
Moose::Kokkos::VariableValue kokkosCoupledDofValuesOld(const std::string &var_name) const
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorDofValuesByName(const std::string &var_name, const std::string &tag_name) const
const T & getDefaultNodalValue(const std::string &var_name, unsigned int comp=0) const
Get nodal default value.
Definition Coupleable.C:450
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorValuesByName(const std::string &var_name, const std::string &tag_name) const
Moose::Kokkos::ADVariableGradient kokkosADCoupledVectorTagGradients(const std::string &var_name, const std::string &tag_param_name) const
const ADArrayVariableValue & adCoupledArrayDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled array variable for use in Automatic Differentiation.
Moose::Kokkos::VariableGradient kokkosCoupledGradientOlder(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...
Moose::Kokkos::ADVariableGradient kokkosADCoupledVectorTagGradient(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
const std::string & _c_name
The name of the object this interface is part of.
virtual bool usesFaceCoupledValues() const
Whether this object evaluates coupled variables on element faces, so that it must request coupled AD ...
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorDofValueOlder(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::VariableValue kokkosZeroNodalValue() const
const ADVectorVariableDivergence & getADDefaultDiv() const
Helper method to return (and insert if necessary) the default divergence value for Automatic Differen...
std::unordered_map< std::string, std::unique_ptr< ADArrayVariableGradient > > _ad_default_array_gradient
Will hold the zero default gradient for optional array coupled variables for automatic differentiatio...
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...
Moose::Kokkos::VariableGradient kokkosCoupledGradientsOld(const std::string &var_name) const
const std::vector< ArrayMooseVariable * > & getCoupledArrayMooseVars() const
Get the list of array coupled variables.
Definition Coupleable.h:111
Moose::Kokkos::Variable kokkosCoupledVectorTagVectorVariables(const std::string &var_name, const std::string &tag_name) const
const VariablePhiGradient & _grad_phi_zero
Zero gradient of trial function.
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.
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.
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.
Moose::Kokkos::ADVariableValue kokkosADCoupledValue(const std::string &var_name, unsigned int comp=0) const
const std::vector< MooseVariableFieldBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
Definition Coupleable.h:84
Moose::Kokkos::VariableValue kokkosCoupledValueOld(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagDofValue(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
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:633
VectorMooseVariable * getVectorVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled vector variable.
Definition Coupleable.C:325
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValues(const std::string &var_name, const std::string &tag_param_name) const
std::vector< const ArrayVariableValue * > coupledVectorTagArrayValues(const std::string &var_names, TagID tag) const
Returns the values for all the coupled variables desired for a given tag.
const ADVariableGradient & getADDefaultGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
const GenericVariableValue< is_ad > & genericZeroValue()
Returns zero value templated with automatic differentiation boolean.
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorValues(const std::string &var_name, const std::string &tag_param_name) const
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.
virtual const VariableValue & coupledNodalDotDot(const std::string &var_name, unsigned int comp=0) const
Nodal values of second time derivative of a coupled variable.
std::vector< const VariableValue * > coupledDots(const std::string &var_name) const
Returns the time derivatives for all of a coupled variable's components.
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...
const ADArrayVariableValue & adCoupledArrayValue(const std::string &var_name, unsigned int comp=0) const
Returns value of a coupled array variable for use with Automatic Differentiation.
Definition Coupleable.C:909
const Moose::Functor< T > & getDefaultFunctor(const std::string &var_name) const
FEProblemBase & _c_fe_problem
const MooseVariableFieldBase * getFieldVar(const std::string &var_name, unsigned int comp) const
Definition Coupleable.C:307
const MooseVariableFieldBase * getFEVar(const std::string &var_name, unsigned int comp) const
Deprecated method.
Definition Coupleable.C:293
THREAD_ID _c_tid
Thread ID of the thread using this object.
virtual const VariableValue & coupledDotDotOld(const std::string &var_name, unsigned int comp=0) const
Old second time derivative of a coupled 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 std::set< std::string > _older_state_tags
vector tag names for which we need to request older solution states from the system
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorNodalValue(const std::string &var_name, unsigned int comp=0) const
virtual const VariableSecond & coupledSecond(const std::string &var_name, unsigned int comp=0) const
Returns second spatial derivatives of a coupled variable.
const ADVectorVariableGradient & getADDefaultVectorGradient() const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
std::vector< const VariableValue * > coupledValues(const std::string &var_name) const
Returns the values for all of a coupled variable components.
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::VectorVariableGradient kokkosCoupledVectorTagVectorGradients(const std::string &var_name, const std::string &tag_param_name) const
const VariableSecond & _second_zero
Zero second derivative of a variable.
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorGradientOld(const std::string &var_name, unsigned int comp=0) const
const ADArrayVariableValue * getADDefaultArrayValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default array value for Automatic Differentiati...
const Real _kokkos_default_value_zero
kokkos-related variables and methods
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorTagVectorGradient(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
VariableValue _default_value_zero
This will always be zero because the default values for optionally coupled variables is always consta...
ArrayVariableGradient _default_array_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
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:822
const ADVariableValue & adCoupledDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled variable for ad simulations.
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.
VariableGradient _default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
Moose::Kokkos::VariableGradient kokkosCoupledVectorTagGradientsByName(const std::string &var_name, const std::string &tag_name) const
const InputParameters & _c_parameters
virtual const VariableGradient & coupledGradient(const std::string &var_name, unsigned int comp=0) const
Returns gradient of a coupled variable.
std::set< TagID > _fe_coupleable_vector_tags
std::vector< const T * > getVarsHelper(const std::string &var_name) const
Helper that can be used to retrieve all the component variables of a variable of arbitrary type T.
virtual const ArrayVariableValue & coupledArrayDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of a coupled array variable.
std::vector< const ArrayVariableValue * > coupledArrayValues(const std::string &var_name) const
Returns the values for all of a coupled array variable's components.
Definition Coupleable.C:902
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagValue(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
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.
const ADArrayVariableGradient & getADDefaultArrayGradient(const std::string &var_name) const
Helper method to return (and insert if necessary) the default gradient for Automatic Differentiation ...
virtual const VariableValue & coupledValuePreviousNL(const std::string &var_name, unsigned int comp=0) const
Returns value of previous Newton iterate of a coupled variable.
Moose::Kokkos::ADVariableValue kokkosADCoupledValuesOld(const std::string &var_name) const
Moose::Kokkos::VariableValue kokkosCoupledDot(const std::string &var_name, unsigned int comp=0) const
void checkFuncType(const std::string var_name, VarType t, FuncAge age) const
Definition Coupleable.C:217
Moose::Kokkos::ADVariableValue kokkosADCoupledValueOld(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorNodalDot(const std::string &var_name, unsigned int comp=0) const
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:393
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.
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalValueOld(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalValues(const std::string &var_name) const
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 VectorVariableDivergence & coupledDiv(const std::string &var_name, unsigned int comp=0) const
Returns divergence of a coupled variable.
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorNodalDots(const std::string &var_name) const
unsigned int _coupleable_max_qps
Maximum qps for any element in this system.
Moose::Kokkos::VariableValue kokkosCoupledDofValueOld(const std::string &var_name, unsigned int comp=0) const
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:971
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.
ArrayMooseVariable * getArrayVar(const std::string &var_name, unsigned int comp)
Extract pointer to a coupled array variable.
Definition Coupleable.C:337
Moose::Kokkos::ADVariableValue kokkosADCoupledValueOlder(const std::string &var_name, unsigned int comp=0) const
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.
virtual const VectorVariableValue & coupledVectorDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of a coupled vector variable.
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagValueByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorValueOld(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorNodalValueOlder(const std::string &var_name, unsigned int comp=0) 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.
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorDofValues(const std::string &var_name, const std::string &tag_param_name) const
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:934
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorNodalValueByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
Moose::Kokkos::VariableGradient kokkosCoupledGradientsOlder(const std::string &var_name) const
std::vector< VariableName > coupledNames(const std::string &var_name) const
Names of the variables in the Coupleable interface.
std::vector< const ADArrayVariableValue * > adCoupledArrayValues(const std::string &var_name) const
Returns the values for all of a coupled array variable's components for use in Automatic Differentiat...
Definition Coupleable.C:927
const bool _c_allow_element_to_nodal_coupling
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 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...
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorGradients(const std::string &var_name) const
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorDots(const std::string &var_name) const
const SystemBase *const _c_sys
Pointer to the system object if the moose object this is an interface for has one.
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.
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::ADVariableValue kokkosADCoupledDofValueOld(const std::string &var_name, unsigned int comp=0) const
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.
Moose::Kokkos::VariableGradient kokkosCoupledGradients(const std::string &var_name) const
VariableName coupledName(const std::string &var_name, unsigned int comp=0) const
Names of the variable in the Coupleable interface.
virtual const VariableValue & coupledDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of a coupled variable.
const MooseArray< ADRealVectorValue > & _ad_grad_zero
const ADArrayVariableValue & getADDefaultArrayValueZero(const std::string &var_name) const
Helper method to return (and insert if necessary) the zero default time derivative for Automatic Diff...
const ADVectorVariableValue * getADDefaultVectorValue(const std::string &var_name) const
Helper method to return (and insert if necessary) the default vector value for Automatic Differentiat...
Moose::Kokkos::ADVariableGradient kokkosADCoupledVectorTagGradientsByName(const std::string &var_name, const std::string &tag_name) const
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValue(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
Moose::Kokkos::VariableValue kokkosCoupledVectorTagValuesByName(const std::string &var_name, const std::string &tag_name) const
Moose::Kokkos::Variable kokkosCoupledVectorTagVariable(const std::string &var_name, const std::string &tag_name, unsigned int comp) const
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagNodalValues(const std::string &var_name, const std::string &tag_param_name) const
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorDofValuesOld(const std::string &var_name) const
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorNodalValues(const std::string &var_name, const std::string &tag_param_name) const
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorValuesOld(const std::string &var_name) 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.
unsigned int coupledComponents(const std::string &var_name) const
Number of coupled components.
Definition Coupleable.C:183
std::vector< const VectorVariableValue * > coupledVectorValues(const std::string &var_name) const
Returns the values for all of a coupled vector variable's components.
Moose::Kokkos::VariableValue kokkosZeroValue() const
Moose::Kokkos::VariableValue kokkosCoupledValuesOld(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's components for the local ele...
Moose::Kokkos::VectorVariableGradient kokkosCoupledVectorGradientOlder(const std::string &var_name, unsigned int comp=0) const
std::vector< MooseVariable * > _coupled_standard_moose_vars
Vector of standard coupled variables.
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorValueByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagValues(const std::string &var_name, const std::string &tag_param_name) const
const VectorVariableValue & _vector_zero
Zero value of a vector variable.
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.
const std::set< TagID > & getFEVariableCoupleableVectorTags() const
Definition Coupleable.h:124
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.
const VariablePhiSecond & _second_phi_zero
Zero second derivative of a test function.
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorDofValueOld(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorDofValue(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradientOld(const std::string &var_name, unsigned int comp=0) const
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradient(const std::string &var_name, unsigned int comp=0) const
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:666
virtual const VariableGradient & coupledGradientDotDot(const std::string &var_name, unsigned int comp=0) const
Second time derivative of the gradient of a coupled variable.
Moose::Kokkos::ADVariableGradient kokkosADCoupledVectorTagGradientByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
const std::vector< MooseVariable * > & getCoupledStandardMooseVars() const
Get the list of standard coupled variables.
Definition Coupleable.h:93
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorNodalValuesOlder(const std::string &var_name) const
const std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > & getCoupledVars() const
Get the list of coupled variables.
Definition Coupleable.h:75
const VariablePhiValue & _phi_zero
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::unordered_map< std::string, std::unique_ptr< ADArrayVariableValue > > _ad_default_array_value_zero
Will hold the zero default time derivative for optional array coupled variables for automatic differe...
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:473
virtual const VariableValue & coupledDotOld(const std::string &var_name, unsigned int comp=0) const
Old time derivative of a coupled variable.
const std::vector< VectorMooseVariable * > & getCoupledVectorMooseVars() const
Get the list of vector coupled variables.
Definition Coupleable.h:102
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...
std::vector< const VariableValue * > coupledValuesOlder(const std::string &var_name) const
Returns the older values for all of a coupled variable's components.
Moose::Kokkos::ADVariableValue kokkosADCoupledDots(const std::string &var_name) const
std::set< TagID > & getFEVariableCoupleableMatrixTags()
Definition Coupleable.h:122
const std::unordered_map< std::string, std::string > & _new_to_deprecated_coupled_vars
map from new to deprecated variable names
Moose::Kokkos::ADVariableValue kokkosADCoupledDofValues(const std::string &var_name) const
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 ...
Definition Coupleable.C:579
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
Moose::Kokkos::VariableValue kokkosCoupledValuesOlder(const std::string &var_name) const
Moose::Kokkos::VariableValue kokkosCoupledNodalValueOlder(const std::string &var_name, unsigned int comp=0) const
std::vector< MooseVariableFieldBase * > _coupled_moose_vars
Vector of all coupled variables.
Moose::Kokkos::ADVariableGradient kokkosADCoupledGradientsOld(const std::string &var_name) const
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:154
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:682
const Moose::ADType< T >::type & adCoupledNodalValue(const std::string &var_name, unsigned int comp=0) const
Returns AD nodal values of a coupled variable.
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 ArrayVariableValue & coupledArrayDotDotOld(const std::string &var_name, unsigned int comp=0) const
Old second time derivative of a coupled array variable.
const std::string & _c_type
The type of the object this interface is part of.
Moose::Kokkos::VariableValue kokkosCoupledVectorTagNodalValues(const std::string &var_name, const std::string &tag_param_name) const
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorDofValuesOlder(const std::string &var_name) const
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:553
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:650
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorDofValueByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
std::vector< const MooseVariableFieldBase * > getFieldVars(const std::string &var_name) const
Definition Coupleable.C:313
std::vector< const VariableValue * > coupledValuesOld(const std::string &var_name) const
Returns the old values for all of a coupled variable's components.
Moose::Kokkos::ADVariableValue kokkosADCoupledDofValuesOlder(const std::string &var_name) const
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.
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:798
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...
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.
Moose::Kokkos::VariableValue kokkosCoupledDofValues(const std::string &var_name) const
std::vector< VectorMooseVariable * > _coupled_vector_moose_vars
Vector of vector coupled variables.
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.
const T & coupledNodalValuePreviousNL(const std::string &var_name, unsigned int comp=0) const
Returns nodal values of a coupled variable for previous Newton iterate.
const MooseArray< ADReal > & _ad_zero
const ADVectorVariableCurl & getADDefaultCurl() const
Helper method to return (and insert if necessary) the default curl value for Automatic Differentiatio...
Moose::Kokkos::VectorVariableValue kokkosCoupledVectorTagVectorNodalValue(const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
VariableSecond _default_second
This will always be zero because the default values for optionally coupled variables is always consta...
std::vector< MooseVariableField< Real > * > _coupled_fv_moose_vars
Vector of all finite volume coupled variables.
const bool _is_fv
Whether the MooseObject is a finite volume object.
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::VectorVariableGradient kokkosCoupledVectorTagVectorGradientByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
MooseArray< ADRealVectorValue > _ad_default_gradient
This will always be zero because the default values for optionally coupled variables is always consta...
void checkWritableVar(MooseWritableVariable *var)
Checks that the passed in variable is only accessed writable by one object in a given subdomain.
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:428
Moose::Kokkos::ADVariableValue kokkosADCoupledVectorTagNodalValueByName(const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
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.
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.
Moose::Kokkos::ADVariableValue kokkosADCoupledNodalValuesOlder(const std::string &var_name) const
Moose::Kokkos::VariableValue kokkosCoupledValue(const std::string &var_name, unsigned int comp=0) const
virtual const ArrayVariableValue & coupledArrayDot(const std::string &var_name, unsigned int comp=0) const
Time derivative of a coupled array variable.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const std::string & checkForRename(const std::string &name) const
Checks whether the provided name is a renamed parameter name.
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
This class provides an interface for common operations on field variables of both FE and FV types wit...
Class for stuff related to variables.
Class for scalar variables (they are different).
This is a wrapper that forwards calls to the implementation, which can be switched out at any time wi...
The Kokkos wrapper class that can hold the reference of an arithmetic scalar variable.
The Kokkos wrapper classes for MOOSE-like variable value access.
The Kokkos variable object that carries the coupled variable and tag information.
Base class for a system (of equations)
Definition SystemBase.h:87
const TagName OLDER_SOLUTION_TAG
Definition MooseTypes.C:27
const TagName OLD_SOLUTION_TAG
Definition MooseTypes.C:26
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...