forked from idaholab/moose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Coupleable.h
1766 lines (1529 loc) · 75.8 KB
/
Coupleable.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include <unordered_map>
#include "MooseTypes.h"
#include "MooseArray.h"
#include "MooseVariableFE.h"
#include "MooseVariableFV.h"
#include "InputParameters.h"
#include "HasMembers.h"
#define usingCoupleableMembers \
using Coupleable::_zero; \
using Coupleable::_grad_zero; \
using Coupleable::_ad_zero; \
using Coupleable::_ad_grad_zero
// Forward declarations
class MooseVariableScalar;
class MooseObject;
namespace libMesh
{
template <typename T>
class DenseVector;
}
template <typename>
class MooseVariableField;
typedef MooseVariableField<Real> MooseWritableVariable;
/**
* Interface for objects that needs coupling capabilities
*
*/
class Coupleable
{
public:
/**
* Constructing the object
* @param parameters Parameters that come from constructing the object
* @param nodal true if we need to couple with nodal values, otherwise false
* @param is_fv Whether the \p MooseObject is a finite volume object
*/
Coupleable(const MooseObject * moose_object, bool nodal, bool is_fv = false);
/**
* Get the list of coupled variables
* @return The list of coupled variables
*/
const std::unordered_map<std::string, std::vector<MooseVariableFieldBase *>> &
getCoupledVars() const
{
return _coupled_vars;
}
/**
* Get the list of all coupled variables
* @return The list of all coupled variables
*/
const std::vector<MooseVariableFieldBase *> & getCoupledMooseVars() const
{
return _coupled_moose_vars;
}
/**
* Get the list of standard coupled variables
* @return The list of standard coupled variables
*/
const std::vector<MooseVariable *> & getCoupledStandardMooseVars() const
{
return _coupled_standard_moose_vars;
}
/**
* Get the list of vector coupled variables
* @return The list of vector coupled variables
*/
const std::vector<VectorMooseVariable *> & getCoupledVectorMooseVars() const
{
return _coupled_vector_moose_vars;
}
/**
* Get the list of array coupled variables
* @return The list of array coupled variables
*/
const std::vector<ArrayMooseVariable *> & getCoupledArrayMooseVars() const
{
return _coupled_array_moose_vars;
}
void addFEVariableCoupleableVectorTag(TagID tag) { _fe_coupleable_vector_tags.insert(tag); }
void addFEVariableCoupleableMatrixTag(TagID tag) { _fe_coupleable_matrix_tags.insert(tag); }
std::set<TagID> & getFEVariableCoupleableVectorTags() { return _fe_coupleable_vector_tags; }
std::set<TagID> & getFEVariableCoupleableMatrixTags() { return _fe_coupleable_matrix_tags; }
const std::set<TagID> & getFEVariableCoupleableVectorTags() const
{
return _fe_coupleable_vector_tags;
}
const std::set<TagID> & getFEVariableCoupleableMatrixTags() const
{
return _fe_coupleable_matrix_tags;
}
/**
* returns a reference to the set of writable coupled variables
*/
auto & getWritableCoupledVariables() const { return _writable_coupled_variables[_c_tid]; }
/**
* Checks whether the object has any writable coupled variables
*/
bool hasWritableCoupledVariables() const { return !getWritableCoupledVariables().empty(); }
protected:
/**
* A call-back function provided by the derived object for actions before coupling a variable
* with functions such as coupledValue.
*/
virtual void coupledCallback(const std::string & /*var_name*/, bool /*is_old*/) const {}
/**
* Returns true if a variables has been coupled as name.
* @param var_name The name the kernel wants to refer to the variable as.
* @param i By default 0, in general the index to test in a vector of MooseVariable pointers.
* @return True if a coupled variable has the supplied name
*/
virtual bool isCoupled(const std::string & var_name, unsigned int i = 0) const;
/**
* Returns true if a variable passed as a coupled value is really a constant
* @param var_name The name the kernel wants to refer to the variable as.
* @return True if the variable is actually a constant
*/
virtual bool isCoupledConstant(const std::string & var_name) const;
/**
* Number of coupled components
* @param var_name Name of the variable
* @return number of components this variable has (usually 1)
*/
unsigned int coupledComponents(const std::string & var_name) const;
/**
* Names of the variable in the Coupleable interface
* @param var_name Name of the variable
* @param comp the component of the variable
* @return name the variable has been coupled as. For constants, returns the constant
*/
VariableName coupledName(const std::string & var_name, unsigned int comp = 0) const;
/**
* Names of the variables in the Coupleable interface
* @param var_name Names of the variables
* @return names the variables have been coupled as
*/
std::vector<VariableName> coupledNames(const std::string & var_name) const;
/**
* Returns the index for a coupled variable by name
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Index of coupled variable, if this is an optionally coupled variable that wasn't
* provided this will return a unique "invalid" index.
*/
virtual unsigned int coupled(const std::string & var_name, unsigned int comp = 0) const;
/**
* Returns the indices for a coupled variable's components
* @param var_name Name of coupled variable
* @return Vector of the indices for all components of the coupled variable \p var_name.
*/
std::vector<unsigned int> coupledIndices(const std::string & var_name) const;
/**
* Returns value of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableValue for the coupled variable
* @see Kernel::_u
*/
virtual const VariableValue & coupledValue(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns the values for all of a coupled variable components
* @param var_name Name of coupled variable
* @return Vector of VariableValue pointers for each component of \p var_name
*/
std::vector<const VariableValue *> coupledValues(const std::string & var_name) const;
/**
* Returns the values for all of a coupled vector variable's components
* @param var_name Name of coupled variable
* @return Vector of VectorVariableValue pointers for each component of \p var_name
*/
std::vector<const VectorVariableValue *> coupledVectorValues(const std::string & var_name) const;
/**
* Returns value of a coupled variable for use in templated automatic differentiation classes
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a GenericVariableValue for the coupled variable
*/
template <bool is_ad>
const GenericVariableValue<is_ad> & coupledGenericValue(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns the values for all of a coupled variable's components for use in templated automatic
* differentiation classes
* @param var_name Name of coupled variable
* @return Vector of GenericVariableValue pointers for each component of \p var_name
*/
template <bool is_ad>
std::vector<const GenericVariableValue<is_ad> *>
coupledGenericValues(const std::string & var_name) const;
/**
* Returns DOF value of a coupled variable for use in templated automatic differentiation classes
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a GenericVariableValue for the coupled variable
*/
template <bool is_ad>
const GenericVariableValue<is_ad> & coupledGenericDofValue(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns value of a coupled lower-dimensional variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableValue for the coupled variable
*/
virtual const VariableValue & coupledValueLower(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns value of a coupled variable for use in Automatic Differentiation
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a ADVariableValue for the coupled variable
*/
const ADVariableValue & adCoupledValue(const std::string & var_name, unsigned int comp = 0) const;
/**
* Returns the values for all of a coupled variable's components for use in Automatic
* Differentiation
* @param var_name Name of coupled variable
* @return Vector of ADVariableValue pointers for each component of \p var_name
*/
std::vector<const ADVariableValue *> adCoupledValues(const std::string & var_name) const;
/**
* Returns value of a coupled lower-dimensional variable for use in Automatic Differentiation
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a ADVariableValue for the coupled variable
*/
const ADVariableValue & adCoupledLowerValue(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns value of a coupled vector variable for use in Automatic Differentiation
* @param var_name Name of coupled vector variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableValue for the coupled variable
* @see Kernel::value
*/
const ADVectorVariableValue & adCoupledVectorValue(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns the values for all of a coupled vector variable's components for use in
* Automatic Differentiation
* @param var_name Name of coupled variable
* @return Vector of ADVariableValue pointers for each component of \p var_name
*/
std::vector<const ADVectorVariableValue *>
adCoupledVectorValues(const std::string & var_name) const;
/**
* Returns value of a coupled variable for a given tag
* @param var_names Name(s) of coupled variable(s)
* @param tag vector tag ID
* @param index Index of the desired variable in the vector of coupled variables
* @return Reference to a VariableValue for the coupled variable
* @see Kernel::_u
*/
virtual const VariableValue &
coupledVectorTagValue(const std::string & var_names, TagID tag, unsigned int index = 0) const;
virtual const VariableValue & coupledVectorTagValue(const std::string & var_names,
const std::string & tag_name,
unsigned int index = 0) const;
/**
* Returns the values for all the coupled variables desired for a given tag
* @param var_names Name(s) of coupled variable(s)
* @param tag vector tag ID
* @return Vector of VariableValue pointers for each variable in \p var_names
*/
std::vector<const VariableValue *> coupledVectorTagValues(const std::string & var_names,
TagID tag) const;
std::vector<const VariableValue *> coupledVectorTagValues(const std::string & var_names,
const std::string & tag_name) const;
/**
* Returns value of a coupled array variable for a given tag
* @param var_names Name(s) of coupled array variable(s)
* @param tag vector tag ID
* @param index Index of the desired variable in the vector of coupled variables
* @return Reference to a VariableValue for the coupled array variable
* @see Kernel::_u
*/
virtual const ArrayVariableValue & coupledVectorTagArrayValue(const std::string & var_names,
TagID tag,
unsigned int index = 0) const;
virtual const ArrayVariableValue & coupledVectorTagArrayValue(const std::string & var_names,
const std::string & tag_name,
unsigned int index = 0) const;
/**
* Returns the values for all the coupled variables desired for a given tag
* @param var_name Name of array coupled variable
* @param tag vector tag ID
* @return Vector of ArrayVariableValue pointers for each variable in \p var_names
*/
std::vector<const ArrayVariableValue *> coupledVectorTagArrayValues(const std::string & var_names,
TagID tag) const;
std::vector<const ArrayVariableValue *>
coupledVectorTagArrayValues(const std::string & var_names, const std::string & tag_name) const;
/**
* Returns gradient of a coupled variable for a given tag
* @param var_names Name(s) of coupled variable(s)
* @param tag vector tag ID
* @param index Index of the desired variable in the vector of coupled variables
* @return Reference to a VariableGradient containing the gradient of the coupled variable
* @see Kernel::gradient
*/
virtual const VariableGradient &
coupledVectorTagGradient(const std::string & var_names, TagID tag, unsigned int index = 0) const;
virtual const VariableGradient & coupledVectorTagGradient(const std::string & var_names,
const std::string & tag_name,
unsigned int index = 0) const;
/**
* Returns gradients for all the coupled variables desired for a given tag
* @param var_names Name(s) of coupled array variable(s)
* @param tag vector tag ID
* @return Vector of VariableGradient pointers for each variables in \p var_name
*/
std::vector<const VariableGradient *> coupledVectorTagGradients(const std::string & var_names,
TagID tag) const;
std::vector<const VariableGradient *>
coupledVectorTagGradients(const std::string & var_names, const std::string & tag_name) const;
/**
* Returns gradient of a coupled array variable for a given tag
* @param var_names Name(s) of coupled array variable(s)
* @param tag vector tag ID
* @param index Index of the desired variable in the vector of coupled variables
* @return Reference to a ArrayVariableGradient containing the gradient of the coupled array
* variable
* @see Kernel::gradient
*/
virtual const ArrayVariableGradient & coupledVectorTagArrayGradient(const std::string & var_names,
TagID tag,
unsigned int index = 0) const;
virtual const ArrayVariableGradient & coupledVectorTagArrayGradient(const std::string & var_names,
const std::string & tag_name,
unsigned int index = 0) const;
/**
* Returns gradients for all the coupled variables desired for a given tag
* @param var_names Name(s) of coupled array variable(s)
* @param tag vector tag ID
* @return Vector of ArrayVariableGradient pointers for each variable in \p var_name
*/
std::vector<const ArrayVariableGradient *>
coupledVectorTagArrayGradients(const std::string & var_names, TagID tag) const;
std::vector<const ArrayVariableGradient *>
coupledVectorTagArrayGradients(const std::string & var_names, const std::string & tag_name) const;
/**
* Returns dof value of a coupled variable for a given tag
* @param var_names Name(s) of coupled variable(s)
* @param tag vector tag ID
* @param index Index of the desired variable in the vector of coupled variables
* @return Reference to a DofValue for the coupled variable
*/
virtual const VariableValue &
coupledVectorTagDofValue(const std::string & var_name, TagID tag, unsigned int index = 0) const;
virtual const VariableValue & coupledVectorTagDofValue(const std::string & var_names,
const std::string & tag_name,
unsigned int index = 0) const;
/**
* Returns evaluations of a tagged vector at the requested variable's degree of freedom indices
* @param var_name Name of coupled variable
* @param tag_name vector tag name
* @return Reference to a ArrayVariableValue for the coupled variable
*/
const ArrayVariableValue & coupledVectorTagArrayDofValue(const std::string & var_name,
const std::string & tag_name,
unsigned int comp = 0) const;
/**
* Returns the dof values for all the coupled variables desired for a given tag
* @param var_names Name(s) of coupled variable(s)
* @param tag vector tag ID
* @return Vector of VariableValue pointers for each variable in \p var_name
*/
std::vector<const VariableValue *> coupledVectorTagDofValues(const std::string & var_names,
TagID tag) const;
std::vector<const VariableValue *> coupledVectorTagDofValues(const std::string & var_names,
const std::string & tag_name) const;
/**
* Returns value of a coupled variable for a given tag. This couples the diag vector of matrix
* @param var_names Name(s) of coupled variable(s)
* @param tag matrix tag ID
* @param index Index of the desired variable in the vector of coupled variables
* @return Reference to a VariableValue for the coupled variable
* @see Kernel::_u
*/
virtual const VariableValue &
coupledMatrixTagValue(const std::string & var_names, TagID tag, unsigned int index = 0) const;
virtual const VariableValue & coupledMatrixTagValue(const std::string & var_names,
const std::string & tag_name,
unsigned int index = 0) const;
/**
* Returns the diagonal matrix values for all the coupled variables desired for a given tag
* @param var_names Name(s) of coupled variable(s)
* @param tag matrix tag ID
* @return Vector of VariableValue pointers for each variable in \p var_name
*/
std::vector<const VariableValue *> coupledMatrixTagValues(const std::string & var_names,
TagID tag) const;
std::vector<const VariableValue *> coupledMatrixTagValues(const std::string & var_names,
const std::string & tag_name) const;
/**
* Returns value of a coupled vector variable
* @param var_name Name of coupled vector variable
* @param comp Component number for vector of coupled vector variables
* @return Reference to a VectorVariableValue for the coupled vector variable
* @see VectorKernel::_u
*/
virtual const VectorVariableValue & coupledVectorValue(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns value of a coupled array variable
* @param var_name Name of coupled vector variable
* @param comp Component number for vector of coupled vector variables
* @return Reference to a ArrayVariableValue for the coupled vector variable
* @see ArrayKernel::_u
*/
virtual const ArrayVariableValue & coupledArrayValue(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns the values for all of a coupled array variable's components
* @param var_name Name of coupled array variable
* @return Vector of ArrayVariableValue pointers for each component of \p var_name
*/
std::vector<const ArrayVariableValue *> coupledArrayValues(const std::string & var_name) const;
/**
* Returns a *writable* MooseVariable object for a nodal or elemental variable. Use
* var.setNodalValue(val[, idx]) in both cases (!) to set the solution DOF values. Only one
* object can obtain a writable reference in a simulation. Note that the written values will
* not ba available in the same system loop! E.g. values written using this API by a nodal
* AuxKernel will not be updated for other nodal AuxKernels during the same iteration over all
* nodes.
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a MooseWritableVariable for the coupled variable
* @see Kernel::value
*/
MooseWritableVariable & writableVariable(const std::string & var_name, unsigned int comp = 0);
/**
* Returns a *writable* reference to a coupled variable for writing to multiple
* AuxVariables from a single AuxKernel or a UserObject. Only one object can obtain
* a writable reference in a simulation.
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableValue for the coupled variable
* @see Kernel::value
*/
virtual VariableValue & writableCoupledValue(const std::string & var_name, unsigned int comp = 0);
/**
* Checks that the passed in variable is only accessed writable by one object in a given subdomain
*/
void checkWritableVar(MooseWritableVariable * var);
/**
* Returns an old value from previous time step of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableValue containing the old value of the coupled variable
* @see Kernel::valueOld
*/
virtual const VariableValue & coupledValueOld(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns the old values for all of a coupled variable's components
* @param var_name Name of coupled variable
* @return Vector of VariableValue pointers for each component of \p var_name
*/
std::vector<const VariableValue *> coupledValuesOld(const std::string & var_name) const;
/**
* Returns an old value from two time steps previous of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableValue containing the older value of the coupled variable
* @see Kernel::valueOlder
*/
virtual const VariableValue & coupledValueOlder(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns the older values for all of a coupled variable's components
* @param var_name Name of coupled variable
* @return Vector of VariableValue pointers for each component of \p var_name
*/
std::vector<const VariableValue *> coupledValuesOlder(const std::string & var_name) const;
/**
* Returns value of previous Newton iterate of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableValue containing the older value of the coupled variable
*/
virtual const VariableValue & coupledValuePreviousNL(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns an old value from previous time step of a coupled vector variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VectorVariableValue containing the old value of the coupled variable
* @see VectorKernel::_u_old
*/
virtual const VectorVariableValue & coupledVectorValueOld(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns an old value from two time steps previous of a coupled vector variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VectorVariableValue containing the older value of the coupled variable
* @see VectorKernel::_u_older
*/
virtual const VectorVariableValue & coupledVectorValueOlder(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns an old value from previous time step of a coupled array variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a ArrayVariableValue containing the old value of the coupled variable
* @see ArrayKernel::_u_old
*/
virtual const ArrayVariableValue & coupledArrayValueOld(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns an old value from two time steps previous of a coupled array variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a ArrayVariableValue containing the older value of the coupled variable
* @see ArrayKernel::_u_older
*/
virtual const ArrayVariableValue & coupledArrayValueOlder(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns gradient of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableGradient containing the gradient of the coupled variable
* @see Kernel::gradient
*/
virtual const VariableGradient & coupledGradient(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns the gradients for all of a coupled variable's components
* @param var_name Name of coupled variable
* @return Vector of VariableGradient pointers for each component of \p var_name
*/
std::vector<const VariableGradient *> coupledGradients(const std::string & var_name) const;
/**
* Returns gradient of a coupled variable for use in Automatic Differentiation
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to an ADVariableGradient containing the gradient of the coupled variable
* @see Kernel::gradient
*/
const ADVariableGradient & adCoupledGradient(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns gradient of a coupled variable's time derivative for use in Automatic Differentiation
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to an ADVariableGradient containing the gradient of the coupled variable's
* time derivative
*/
const ADVariableGradient & adCoupledGradientDot(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns the gradients for all of a coupled variable's components for use in Automatic
* Differentiation
* @param var_name Name of coupled variable
* @return Vector of ADVariableGradient pointers for each component of \p var_name
*/
std::vector<const ADVariableGradient *> adCoupledGradients(const std::string & var_name) const;
/**
* Returns gradient of a coupled variable for use in templated automatic differentiation
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableGradient containing the gradient of the coupled variable
* @see Kernel::gradient
*/
template <bool is_ad>
const GenericVariableGradient<is_ad> & coupledGenericGradient(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns the gradients for all of a coupled variable's components for use in templated automatic
* differentiation
* @param var_name Name of coupled variable
* @return Vector of VariableGradient pointers for each component of \p var_name
*/
template <bool is_ad>
std::vector<const GenericVariableGradient<is_ad> *>
coupledGenericGradients(const std::string & var_name) const;
/**
* Returns gradient of a coupled vector variable for use in Automatic Differentiation
* @param var_name Name of coupled vector variable
* @param comp Component number for vector of coupled vector variables
* @return Reference to a VectorVariableGradient containing the gradient of the coupled variable
* @see Kernel::gradient
*/
const ADVectorVariableGradient & adCoupledVectorGradient(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns second derivatives of a coupled variable for use in Automatic Differentiation
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableSecond containing the second derivatives of the coupled variable
*/
const ADVariableSecond & adCoupledSecond(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns second derivatives of a coupled vector variable for use in Automatic Differentiation
* @param var_name Name of coupled vector variable
* @param comp Component number for vector of coupled vector variables
* @return Reference to a VectorVariableSecond containing the second derivatives of the coupled
* variable
*/
const ADVectorVariableSecond & adCoupledVectorSecond(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns an old gradient from previous time step of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableGradient containing the old gradient of the coupled variable
* @see Kernel::gradientOld
*/
virtual const VariableGradient & coupledGradientOld(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns the old gradients for all of a coupled variable's components
* @param var_name Name of coupled variable
* @return Vector of VariableGradient pointers for each component of \p var_name
*/
std::vector<const VariableGradient *> coupledGradientsOld(const std::string & var_name) const;
/**
* Returns an old gradient from two time steps previous of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableGradient containing the older gradient of the coupled variable
* @see Kernel::gradientOlder
*/
virtual const VariableGradient & coupledGradientOlder(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns gradient of a coupled variable for previous Newton iterate
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableGradient containing the gradient of the coupled variable
*/
virtual const VariableGradient & coupledGradientPreviousNL(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Time derivative of the gradient of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableGradient containing the time derivative of the gradient of a
* coupled variable
*/
virtual const VariableGradient & coupledGradientDot(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Second time derivative of the gradient of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableGradient containing the time derivative of the gradient of a
* coupled variable
*/
virtual const VariableGradient & coupledGradientDotDot(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns gradient of a coupled vector variable
* @param var_name Name of coupled vector variable
* @param comp Component number for vector of coupled vector variables
* @return Reference to a VectorVariableGradient containing the gradient of the coupled vector
* variable
*/
virtual const VectorVariableGradient & coupledVectorGradient(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns an old gradient from previous time step of a coupled vector variable
* @param var_name Name of coupled vector variable
* @param comp Component number for vector of coupled vector variables
* @return Reference to a VectorVariableGradient containing the old gradient of the coupled vector
* variable
*/
virtual const VectorVariableGradient & coupledVectorGradientOld(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns an old gradient from two time steps previous of a coupled vector variable
* @param var_name Name of coupled vector variable
* @param comp Component number for vector of coupled vector variables
* @return Reference to a VectorVariableGradient containing the older gradient of the coupled
* vector variable
*/
virtual const VectorVariableGradient & coupledVectorGradientOlder(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns gradient of a coupled array variable
* @param var_name Name of coupled array variable
* @param comp Component number for vector of coupled array variables
* @return Reference to a VectorVariableGradient containing the gradient of the coupled array
* variable
*/
virtual const ArrayVariableGradient & coupledArrayGradient(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns an old gradient from previous time step of a coupled array variable
* @param var_name Name of coupled array variable
* @param comp Component number for vector of coupled array variables
* @return Reference to a VectorVariableGradient containing the old gradient of the coupled array
* variable
*/
virtual const ArrayVariableGradient & coupledArrayGradientOld(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns an old gradient from two time steps previous of a coupled array variable
* @param var_name Name of coupled array variable
* @param comp Component number for vector of coupled array variables
* @return Reference to a ArrayVariableGradient containing the older gradient of the coupled
* array variable
*/
virtual const ArrayVariableGradient & coupledArrayGradientOlder(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns curl of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VectorVariableCurl containing the curl of the coupled variable
* @see Kernel::_curl_u
*/
virtual const VectorVariableCurl & coupledCurl(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns an old curl from previous time step of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VectorVariableCurl containing the old curl of the coupled variable
* @see Kernel::_curl_u_old
*/
virtual const VectorVariableCurl & coupledCurlOld(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns an old curl from two time steps previous of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VectorVariableCurl containing the older curl of the coupled variable
* @see Kernel::_curl_u_older
*/
virtual const VectorVariableCurl & coupledCurlOlder(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns second spatial derivatives of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableSecond containing the second derivative of the coupled variable
* @see Kernel::second
*/
virtual const VariableSecond & coupledSecond(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns an old second spatial derivatives from previous time step of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableSecond containing the old second derivative of the coupled
* variable
* @see Kernel::secondOld
*/
virtual const VariableSecond & coupledSecondOld(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns an old second derivative from two time steps previous of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableSecond containing the older second derivative of the coupled
* variable
* @see Kernel::secondOlder
*/
virtual const VariableSecond & coupledSecondOlder(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns second derivative of a coupled variable for the previous Newton iterate
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableSecond containing the second derivative of the coupled variable
*/
virtual const VariableSecond & coupledSecondPreviousNL(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Time derivative of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableValue containing the time derivative of the coupled variable
*/
virtual const VariableValue & coupledDot(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Returns the time derivatives for all of a coupled variable's components
* @param var_name Name of coupled variable
* @return Vector of VariableValue pointers for each component of \p var_name
*/
std::vector<const VariableValue *> coupledDots(const std::string & var_name) const;
/**
* Second time derivative of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableValue containing the second time derivative of the coupled
* variable
*/
virtual const VariableValue & coupledDotDot(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Old time derivative of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableValue containing the old time derivative of the coupled variable
*/
virtual const VariableValue & coupledDotOld(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Old second time derivative of a coupled variable
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableValue containing the old second time derivative of the coupled
* variable
*/
virtual const VariableValue & coupledDotDotOld(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Time derivative of a coupled variable for ad simulations
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to a VariableValue containing the time derivative of the coupled variable
* @see Kernel::dot
*/
const ADVariableValue & adCoupledDot(const std::string & var_name, unsigned int comp = 0) const;
/**
* Returns the time derivatives for all of a coupled variable's components for ad simulations
* @param var_name Name of coupled variable
* @return Vector of VariableValue pointers for each component of \p var_name
*/
std::vector<const ADVariableValue *> adCoupledDots(const std::string & var_name) const;
/**
* Second time derivative of a coupled variable for ad simulations
* @param var_name Name of coupled variable
* @param comp Component number for vector of coupled variables
* @return Reference to an ADVariableValue containing the second time derivative of the coupled
* variable
*/
const ADVariableValue & adCoupledDotDot(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Time derivative of a vector coupled variable for ad simulations
* @param var_name Name of vector coupled variable
* @param comp Component number
* @return Reference to a VectorVariableValue containing the time derivative of the coupled
* variable
* @see Kernel::dot
*/
const ADVectorVariableValue & adCoupledVectorDot(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Time derivative of a coupled vector variable
* @param var_name Name of coupled vector variable
* @param comp Component number for vector of coupled vector variables
* @return Reference to a VectorVariableValue containing the time derivative of the coupled
* variable
*/
virtual const VectorVariableValue & coupledVectorDot(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Second time derivative of a coupled vector variable
* @param var_name Name of coupled vector variable
* @param comp Component number for vector of coupled vector variables
* @return Reference to a VectorVariableValue containing the time derivative of the coupled
* variable
*/
virtual const VectorVariableValue & coupledVectorDotDot(const std::string & var_name,
unsigned int comp = 0) const;
/**
* Old time derivative of a coupled vector variable
* @param var_name Name of coupled vector variable
* @param comp Component number for vector of coupled vector variables
* @return Reference to a VectorVariableValue containing the time derivative of the coupled
* variable
*/