Line data Source code
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 : #include "Coupleable.h"
11 : #include "Problem.h"
12 : #include "SubProblem.h"
13 : #include "FEProblem.h"
14 : #include "MooseVariableScalar.h"
15 : #include "MooseVariableFE.h"
16 : #include "InputParameters.h"
17 : #include "MooseObject.h"
18 : #include "SystemBase.h"
19 : #include "AuxiliarySystem.h"
20 :
21 : #include "AuxKernel.h"
22 : #include "ElementUserObject.h"
23 : #include "NodalUserObject.h"
24 : #include "NodeFaceConstraint.h"
25 : #include "NodeElemConstraintBase.h"
26 :
27 376716 : Coupleable::Coupleable(const MooseObject * moose_object, bool nodal, bool is_fv)
28 753432 : : _c_parameters(moose_object->parameters()),
29 376716 : _c_name(moose_object->name()),
30 376716 : _c_type(moose_object->type()),
31 1506864 : _c_fe_problem(*_c_parameters.getCheckedPointerParam<FEProblemBase *>("_fe_problem_base")),
32 753432 : _c_sys(_c_parameters.isParamValid("_sys") ? _c_parameters.get<SystemBase *>("_sys") : nullptr),
33 376716 : _new_to_deprecated_coupled_vars(_c_parameters.getNewToDeprecatedVarMap()),
34 376716 : _c_nodal(nodal),
35 376716 : _c_is_implicit(_c_parameters.have_parameter<bool>("implicit")
36 376716 : ? _c_parameters.get<bool>("implicit")
37 : : true),
38 376716 : _c_allow_element_to_nodal_coupling(
39 376716 : _c_parameters.have_parameter<bool>("_allow_nodal_to_elemental_coupling")
40 376716 : ? _c_parameters.get<bool>("_allow_nodal_to_elemental_coupling")
41 : : false),
42 376716 : _c_tid(_c_parameters.get<THREAD_ID>("_tid")),
43 376716 : _zero(_c_fe_problem._zero[_c_tid]),
44 376716 : _phi_zero(_c_fe_problem._phi_zero[_c_tid]),
45 376716 : _ad_zero(_c_fe_problem._ad_zero[_c_tid]),
46 376716 : _grad_zero(_c_fe_problem._grad_zero[_c_tid]),
47 376716 : _ad_grad_zero(_c_fe_problem._ad_grad_zero[_c_tid]),
48 376716 : _grad_phi_zero(_c_fe_problem._grad_phi_zero[_c_tid]),
49 376716 : _second_zero(_c_fe_problem._second_zero[_c_tid]),
50 376716 : _ad_second_zero(_c_fe_problem._ad_second_zero[_c_tid]),
51 376716 : _second_phi_zero(_c_fe_problem._second_phi_zero[_c_tid]),
52 376716 : _vector_zero(_c_fe_problem._vector_zero[_c_tid]),
53 376716 : _vector_curl_zero(_c_fe_problem._vector_curl_zero[_c_tid]),
54 376716 : _coupleable_neighbor(_c_parameters.have_parameter<bool>("_neighbor")
55 376716 : ? _c_parameters.get<bool>("_neighbor")
56 : : false),
57 376716 : _coupleable_max_qps(Moose::constMaxQpsPerElem),
58 376716 : _is_fv(is_fv),
59 376716 : _obj(moose_object),
60 3767160 : _writable_coupled_variables(libMesh::n_threads())
61 : {
62 1506864 : SubProblem & problem = *_c_parameters.getCheckedPointerParam<SubProblem *>("_subproblem");
63 376716 : _obj->getMooseApp().registerInterfaceObject(*this);
64 :
65 376716 : unsigned int optional_var_index_counter = 0;
66 :
67 : // Coupling
68 582162 : for (auto iter = _c_parameters.coupledVarsBegin(); iter != _c_parameters.coupledVarsEnd(); ++iter)
69 : {
70 205452 : std::string name = *iter;
71 :
72 205452 : std::vector<std::string> vars = _c_parameters.getVecMooseType(name);
73 205452 : if (vars.size() > 0)
74 : {
75 157705 : for (const auto & coupled_var_name : vars)
76 : {
77 85728 : if (problem.hasVariable(coupled_var_name))
78 : {
79 : MooseVariableFieldBase * moose_var =
80 84189 : &problem.getVariable(_c_tid,
81 : coupled_var_name,
82 : Moose::VarKindType::VAR_ANY,
83 84189 : Moose::VarFieldType::VAR_FIELD_ANY);
84 84189 : _coupled_vars[name].push_back(moose_var);
85 84189 : _coupled_moose_vars.push_back(moose_var);
86 84189 : if (auto * tmp_var = dynamic_cast<MooseVariable *>(moose_var))
87 77697 : _coupled_standard_moose_vars.push_back(tmp_var);
88 6492 : else if (auto * tmp_var = dynamic_cast<VectorMooseVariable *>(moose_var))
89 1268 : _coupled_vector_moose_vars.push_back(tmp_var);
90 5224 : else if (auto * tmp_var = dynamic_cast<ArrayMooseVariable *>(moose_var))
91 1572 : _coupled_array_moose_vars.push_back(tmp_var);
92 3652 : else if (auto * tmp_var = dynamic_cast<MooseVariableFV<Real> *>(moose_var))
93 3096 : _coupled_fv_moose_vars.push_back(tmp_var);
94 556 : else if (auto * tmp_var = dynamic_cast<MooseLinearVariableFV<Real> *>(moose_var))
95 556 : _coupled_fv_moose_vars.push_back(tmp_var);
96 : else
97 0 : _obj->paramError(name, "provided c++ type for variable parameter is not supported");
98 : }
99 1539 : else if (problem.hasScalarVariable(coupled_var_name))
100 : {
101 : MooseVariableScalar * moose_scalar_var =
102 1533 : &problem.getScalarVariable(_c_tid, coupled_var_name);
103 1533 : _c_coupled_scalar_vars[name].push_back(moose_scalar_var);
104 : }
105 : else
106 6 : _obj->paramError(name, "coupled variable '", coupled_var_name, "' was not found");
107 : }
108 : }
109 : else // This means it was optional coupling. Let's assign a unique id to this variable
110 : {
111 133469 : _optional_var_index[name].assign(_c_parameters.numberDefaultCoupledValues(name), 0);
112 267612 : for (unsigned int j = 0; j < _optional_var_index[name].size(); ++j)
113 134143 : _optional_var_index[name][j] =
114 134143 : std::numeric_limits<unsigned int>::max() - optional_var_index_counter;
115 133469 : ++optional_var_index_counter;
116 : }
117 205446 : }
118 753426 : }
119 :
120 : #ifdef MOOSE_KOKKOS_ENABLED
121 511652 : Coupleable::Coupleable(const Coupleable & object, const Moose::Kokkos::FunctorCopy &)
122 511652 : : _c_parameters(object._c_parameters),
123 511652 : _c_name(object._c_name),
124 511652 : _c_type(object._c_type),
125 511652 : _c_fe_problem(object._c_fe_problem),
126 511652 : _c_sys(object._c_sys),
127 511652 : _new_to_deprecated_coupled_vars(object._new_to_deprecated_coupled_vars),
128 511652 : _c_nodal(object._c_nodal),
129 511652 : _c_is_implicit(object._c_is_implicit),
130 511652 : _c_allow_element_to_nodal_coupling(object._c_allow_element_to_nodal_coupling),
131 511652 : _c_tid(object._c_tid),
132 511652 : _zero(object._zero),
133 511652 : _phi_zero(object._phi_zero),
134 511652 : _ad_zero(object._ad_zero),
135 511652 : _grad_zero(object._grad_zero),
136 511652 : _ad_grad_zero(object._ad_grad_zero),
137 511652 : _grad_phi_zero(object._grad_phi_zero),
138 511652 : _second_zero(object._second_zero),
139 511652 : _ad_second_zero(object._ad_second_zero),
140 511652 : _second_phi_zero(object._second_phi_zero),
141 511652 : _vector_zero(object._vector_zero),
142 511652 : _vector_curl_zero(object._vector_curl_zero),
143 511652 : _coupleable_neighbor(object._coupleable_neighbor),
144 511652 : _coupleable_max_qps(object._coupleable_max_qps),
145 511652 : _is_fv(object._is_fv),
146 511652 : _obj(object._obj),
147 2558260 : _writable_coupled_variables(object._writable_coupled_variables)
148 : {
149 1023304 : }
150 : #endif
151 :
152 : bool
153 288808 : Coupleable::isCoupled(const std::string & var_name_in, unsigned int i) const
154 : {
155 288808 : const auto var_name = _c_parameters.checkForRename(var_name_in);
156 :
157 288808 : auto it = _coupled_vars.find(var_name);
158 288808 : if (it != _coupled_vars.end())
159 167147 : return (i < it->second.size());
160 : else
161 : {
162 : // Make sure the user originally requested this value in the InputParameter syntax
163 121661 : if (!_c_parameters.hasCoupledVar(var_name))
164 3 : mooseError(_c_name,
165 : ": The coupled variable \"",
166 : var_name,
167 : "\" was never added to this object's "
168 : "InputParameters, please double-check your "
169 : "spelling");
170 :
171 121658 : return false;
172 : }
173 288805 : }
174 :
175 : bool
176 1488 : Coupleable::isCoupledConstant(const std::string & var_name) const
177 : {
178 1488 : return _c_parameters.hasDefaultCoupledValue(var_name);
179 : }
180 :
181 : unsigned int
182 92287 : Coupleable::coupledComponents(const std::string & var_name_in) const
183 : {
184 92287 : const auto var_name = _c_parameters.checkForRename(var_name_in);
185 :
186 92287 : if (isCoupled(var_name))
187 : {
188 : mooseAssert(_coupled_vars.find(var_name) != _coupled_vars.end(),
189 : var_name << " must not actually be coupled!");
190 4932 : return _coupled_vars.at(var_name).size();
191 : }
192 : else
193 : {
194 87355 : if (_c_parameters.hasDefaultCoupledValue(var_name))
195 64 : return _c_parameters.numberDefaultCoupledValues(var_name);
196 : else
197 87291 : return 0;
198 : }
199 92287 : }
200 :
201 : void
202 161093 : checkComponent(const MooseObject * obj,
203 : unsigned int comp,
204 : unsigned int bound,
205 : const std::string & var_name)
206 : {
207 161093 : if (bound > 0 && comp >= bound)
208 6 : obj->paramError(
209 : var_name, "component ", comp, " is out of range for this variable (max ", bound - 1, ")");
210 161087 : }
211 :
212 : // calls to this must go *after* get[bla]Var calls and (checking for nullptr
213 : // return). Because checkFuncType calls coupledCallback which should only be
214 : // called if the variables was actually coupled.
215 : void
216 129382 : Coupleable::checkFuncType(const std::string var_name, VarType t, FuncAge age) const
217 : {
218 129382 : if (t == VarType::Gradient && _c_nodal)
219 0 : mooseError(_c_name, ": nodal variables do not have gradients at nodes");
220 :
221 129382 : if (age == FuncAge::Old || age == FuncAge::Older || t == VarType::GradientDot ||
222 : t == VarType::Dot)
223 47624 : validateExecutionerType(var_name, "coupled[Vector][Gradient/Dot]Old[er]");
224 129376 : if (age == FuncAge::Older && !_c_is_implicit)
225 0 : mooseError("object '",
226 0 : _c_name,
227 : "' uses older variable values that are unavailable with explicit schemes");
228 :
229 129376 : coupledCallback(var_name, age == FuncAge::Old || age == FuncAge::Older);
230 129376 : }
231 :
232 : bool
233 161729 : Coupleable::checkVar(const std::string & var_name_in,
234 : unsigned int comp,
235 : unsigned int comp_bound) const
236 : {
237 161729 : const auto var_name = _c_parameters.checkForRename(var_name_in);
238 161729 : auto it = _c_coupled_scalar_vars.find(var_name);
239 161729 : if (it != _c_coupled_scalar_vars.end())
240 : {
241 3 : std::string cvars;
242 6 : for (auto jt : it->second)
243 3 : cvars += " " + jt->name();
244 :
245 3 : _obj->paramError(var_name,
246 : "cannot couple '",
247 : var_name,
248 : "' to a scalar variable (",
249 : cvars,
250 : ") where field variable is expected");
251 0 : }
252 :
253 161726 : if (!isCoupled(var_name, comp))
254 2835 : return false; // return false since variable is *not* coupled
255 :
256 158888 : auto vars_vector_it = _coupled_vars.find(var_name);
257 158888 : if (vars_vector_it == _coupled_vars.end())
258 0 : mooseError(_c_name, ": Trying to get a coupled var ", var_name, " that doesn't exist");
259 :
260 158888 : const auto & vars_vector = vars_vector_it->second;
261 :
262 158888 : auto bound = comp_bound ? comp_bound : vars_vector.size();
263 158888 : checkComponent(_obj, comp, bound, var_name);
264 :
265 : // We should know we have a variable now
266 158888 : const auto * var = vars_vector[comp];
267 158888 : if (!var)
268 0 : mooseError(
269 0 : _c_name,
270 : ": We did all our checks for the existence of a var, yet we still don't have a var!?");
271 :
272 : // Only perform the following checks for objects that feed into residuals/Jacobians, e.g. objects
273 : // that inherit from the TaggingInterface
274 158888 : if (_c_parameters.have_parameter<MultiMooseEnum>("vector_tags"))
275 : {
276 : // Are we attempting to couple to a non-FV var in an FV object?
277 17414 : if (!var->isFV() && _is_fv)
278 0 : mooseError("Attempting to couple non-FV variable ",
279 0 : var->name(),
280 : " into an FV object ",
281 0 : _c_name,
282 : ". This is not currently supported");
283 : }
284 :
285 158888 : if (!(vars_vector[comp])->isNodal() && _c_nodal && !_c_allow_element_to_nodal_coupling)
286 6 : mooseError(_c_name, ": cannot couple elemental variables into nodal objects");
287 :
288 158882 : return true;
289 161717 : }
290 :
291 : const MooseVariableFieldBase *
292 0 : Coupleable::getFEVar(const std::string & var_name, unsigned int comp) const
293 : {
294 0 : mooseDeprecated("Coupleable::getFEVar is deprecated. Please use Coupleable::getFieldVar instead. "
295 : "Note that this method could potentially return a finite volume variable");
296 0 : return getFieldVar(var_name, comp);
297 : }
298 :
299 : MooseVariableFieldBase *
300 7079 : Coupleable::getFieldVar(const std::string & var_name, unsigned int comp)
301 : {
302 7079 : return getVarHelper<MooseVariableFieldBase>(var_name, comp);
303 : }
304 :
305 : const MooseVariableFieldBase *
306 22995 : Coupleable::getFieldVar(const std::string & var_name, unsigned int comp) const
307 : {
308 22995 : return getVarHelper<MooseVariableFieldBase>(var_name, comp);
309 : }
310 :
311 : std::vector<const MooseVariableFieldBase *>
312 0 : Coupleable::getFieldVars(const std::string & var_name) const
313 : {
314 0 : return getVarsHelper<MooseVariableFieldBase>(var_name);
315 : }
316 :
317 : MooseVariable *
318 2879 : Coupleable::getVar(const std::string & var_name, unsigned int comp)
319 : {
320 2879 : return const_cast<MooseVariable *>(getVarHelper<MooseVariable>(var_name, comp));
321 : }
322 :
323 : VectorMooseVariable *
324 673 : Coupleable::getVectorVar(const std::string & var_name, unsigned int comp)
325 : {
326 : auto * const var =
327 673 : const_cast<VectorMooseVariable *>(getVarHelper<VectorMooseVariable>(var_name, comp));
328 :
329 673 : if (_c_nodal && var && var->feType().family != LAGRANGE_VEC)
330 0 : mooseError(_c_name, ": Only LAGRANGE_VEC vector variables are defined at nodes");
331 :
332 673 : return var;
333 : }
334 :
335 : ArrayMooseVariable *
336 680 : Coupleable::getArrayVar(const std::string & var_name, unsigned int comp)
337 : {
338 680 : return const_cast<ArrayMooseVariable *>(getVarHelper<ArrayMooseVariable>(var_name, comp));
339 : }
340 :
341 : const MooseVariable *
342 23769 : Coupleable::getVar(const std::string & var_name, unsigned int comp) const
343 : {
344 23769 : return getVarHelper<MooseVariable>(var_name, comp);
345 : }
346 :
347 : const VectorMooseVariable *
348 1870 : Coupleable::getVectorVar(const std::string & var_name, unsigned int comp) const
349 : {
350 1870 : const auto * const var = getVarHelper<VectorMooseVariable>(var_name, comp);
351 :
352 1870 : if (_c_nodal && var && var->feType().family != LAGRANGE_VEC)
353 0 : mooseError(_c_name, ": Only LAGRANGE_VEC vector variables are defined at nodes");
354 :
355 1870 : return var;
356 : }
357 :
358 : const ArrayMooseVariable *
359 2205 : Coupleable::getArrayVar(const std::string & var_name, unsigned int comp) const
360 : {
361 2205 : return getVarHelper<ArrayMooseVariable>(var_name, comp);
362 : }
363 :
364 : const VariableValue *
365 2054 : Coupleable::getDefaultValue(const std::string & var_name, unsigned int comp) const
366 : {
367 : // make sure we don't access values that were not provided
368 2054 : checkComponent(_obj, comp, _c_parameters.numberDefaultCoupledValues(var_name), var_name);
369 :
370 2051 : auto default_value_it = _default_value.find(var_name);
371 2051 : if (default_value_it == _default_value.end())
372 : {
373 4044 : _default_value[var_name].emplace_back(std::make_unique<VariableValue>(
374 2022 : _coupleable_max_qps, _c_parameters.defaultCoupledValue(var_name, 0)));
375 2051 : for (unsigned int j = 1; j < _c_parameters.numberDefaultCoupledValues(var_name); ++j)
376 58 : _default_value[var_name].emplace_back(std::make_unique<VariableValue>(
377 58 : _coupleable_max_qps, _c_parameters.defaultCoupledValue(var_name, j)));
378 2022 : default_value_it = _default_value.find(var_name);
379 : }
380 :
381 2051 : const auto & default_value_vec = default_value_it->second;
382 2051 : const auto n_default_vals = default_value_vec.size();
383 2051 : if (comp >= n_default_vals)
384 0 : mooseError("Requested comp ",
385 : comp,
386 : " is equal to or greater than the number of default values ",
387 : n_default_vals);
388 4102 : return default_value_vec[comp].get();
389 : }
390 :
391 : const VectorVariableValue *
392 300 : Coupleable::getDefaultVectorValue(const std::string & var_name) const
393 : {
394 300 : auto default_value_it = _default_vector_value.find(var_name);
395 300 : if (default_value_it == _default_vector_value.end())
396 : {
397 300 : auto value = std::make_unique<VectorVariableValue>(_coupleable_max_qps, 0);
398 300 : bool already_warned = false;
399 300300 : for (unsigned int qp = 0; qp < _coupleable_max_qps; ++qp)
400 1200000 : for (const auto i : make_range(Moose::dim))
401 : {
402 : try
403 : {
404 900000 : (*value)[qp](i) = _c_parameters.defaultCoupledValue(var_name, i);
405 : }
406 10000 : catch (const std::out_of_range &)
407 : {
408 10000 : if (!already_warned)
409 10 : mooseWarning(
410 : "You supplied less than 3 arguments for the default vector value for variable ",
411 : var_name,
412 : ". Did you accidently leave something off? We are going to assign 0s, assuming "
413 : "this "
414 : "was intentional.");
415 10000 : already_warned = true;
416 10000 : (*value)[qp](i) = 0;
417 10000 : }
418 : }
419 300 : default_value_it =
420 300 : _default_vector_value.insert(std::make_pair(var_name, std::move(value))).first;
421 300 : }
422 :
423 600 : return default_value_it->second.get();
424 : }
425 :
426 : const ArrayVariableValue *
427 13 : Coupleable::getDefaultArrayValue(const std::string & var_name) const
428 : {
429 13 : auto default_value_it = _default_array_value.find(var_name);
430 13 : if (default_value_it == _default_array_value.end())
431 : {
432 13 : auto value = std::make_unique<ArrayVariableValue>(_coupleable_max_qps);
433 13013 : for (unsigned int qp = 0; qp < _coupleable_max_qps; ++qp)
434 : {
435 13000 : auto n = _c_parameters.numberDefaultCoupledValues(var_name);
436 13000 : (*value)[qp].resize(n);
437 39000 : for (unsigned int i = 0; i < n; ++i)
438 26000 : (*value)[qp](i) = _c_parameters.defaultCoupledValue(var_name, i);
439 : }
440 13 : default_value_it =
441 13 : _default_array_value.insert(std::make_pair(var_name, std::move(value))).first;
442 13 : }
443 :
444 26 : return default_value_it->second.get();
445 : }
446 :
447 : template <typename T>
448 : const T &
449 0 : Coupleable::getDefaultNodalValue(const std::string & var_name, unsigned int comp) const
450 : {
451 0 : auto && default_variable_value = getDefaultValue(var_name, comp);
452 0 : return *default_variable_value->data();
453 : }
454 :
455 : template <>
456 : const RealVectorValue &
457 0 : Coupleable::getDefaultNodalValue<RealVectorValue>(const std::string & var_name, unsigned int) const
458 : {
459 0 : auto && default_variable_value = getDefaultVectorValue(var_name);
460 0 : return *default_variable_value->data();
461 : }
462 :
463 : template <>
464 : const RealEigenVector &
465 0 : Coupleable::getDefaultNodalValue<RealEigenVector>(const std::string & var_name, unsigned int) const
466 : {
467 0 : auto && default_variable_value = getDefaultArrayValue(var_name);
468 0 : return *default_variable_value->data();
469 : }
470 :
471 : unsigned int
472 12416 : Coupleable::coupled(const std::string & var_name, unsigned int comp) const
473 : {
474 12416 : const auto * var = getFieldVar(var_name, comp);
475 12410 : if (!var)
476 : {
477 : mooseAssert(_optional_var_index.find(var_name) != _optional_var_index.end(),
478 : "optional var index for " << var_name << " does not exist!");
479 : // make sure we don't try to access default var ids that were not provided
480 151 : checkComponent(_obj, comp, _optional_var_index.at(var_name).size(), var_name);
481 148 : return _optional_var_index.at(var_name)[comp];
482 : }
483 12259 : checkFuncType(var_name, VarType::Ignore, FuncAge::Curr);
484 :
485 21240 : if (var->kind() == Moose::VAR_SOLVER &&
486 : // are we not an object that feeds into the nonlinear system?
487 8981 : (!_c_sys || _c_sys->varKind() != Moose::VAR_SOLVER ||
488 : // are we an object that impacts the nonlinear system and this variable is within our
489 : // nonlinear system?
490 4775 : var->sys().number() == _c_sys->number()))
491 8793 : return var->number();
492 : else
493 : // Avoid registering coupling to variables outside of our system (e.g. avoid potentially
494 : // creating bad Jacobians)
495 3466 : return std::numeric_limits<unsigned int>::max() - var->number();
496 : }
497 :
498 : template <>
499 : const GenericVariableValue<false> &
500 5510 : Coupleable::coupledGenericValue<false>(const std::string & var_name, unsigned int comp) const
501 : {
502 5510 : return coupledValue(var_name, comp);
503 : }
504 :
505 : template <>
506 : const GenericVariableValue<true> &
507 419 : Coupleable::coupledGenericValue<true>(const std::string & var_name, unsigned int comp) const
508 : {
509 419 : return adCoupledValue(var_name, comp);
510 : }
511 :
512 : template <>
513 : const GenericVectorVariableValue<false> &
514 254 : Coupleable::coupledGenericVectorValue<false>(const std::string & var_name, unsigned int comp) const
515 : {
516 254 : return coupledVectorValue(var_name, comp);
517 : }
518 :
519 : template <>
520 : const GenericVectorVariableValue<true> &
521 13 : Coupleable::coupledGenericVectorValue<true>(const std::string & var_name, unsigned int comp) const
522 : {
523 13 : return adCoupledVectorValue(var_name, comp);
524 : }
525 :
526 : const VariableValue &
527 55532 : Coupleable::coupledValue(const std::string & var_name, unsigned int comp) const
528 : {
529 55532 : const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
530 55532 : if (!var)
531 2054 : return *getDefaultValue(var_name, comp);
532 53478 : checkFuncType(var_name, VarType::Ignore, FuncAge::Curr);
533 :
534 53478 : if (!_coupleable_neighbor)
535 : {
536 51967 : if (_c_nodal)
537 4266 : return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
538 : else
539 47701 : return (_c_is_implicit) ? var->sln() : var->slnOld();
540 : }
541 : else
542 : {
543 1511 : if (_c_nodal)
544 0 : return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
545 : else
546 1511 : return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
547 : }
548 : }
549 :
550 : template <typename T>
551 : const typename OutputTools<T>::VariableValue &
552 1142 : Coupleable::vectorTagValueHelper(const std::string & var_names,
553 : const TagID tag,
554 : const unsigned int index) const
555 : {
556 1142 : const auto * const var = getVarHelper<MooseVariableField<T>>(var_names, index);
557 1142 : if (!var)
558 0 : mooseError(var_names, ": invalid variable name for coupledVectorTagValue");
559 1142 : checkFuncType(var_names, VarType::Ignore, FuncAge::Curr);
560 :
561 1142 : if (!_c_fe_problem.vectorTagExists(tag))
562 0 : mooseError("Attempting to couple to vector tag with ID ",
563 : tag,
564 : "in ",
565 0 : _c_name,
566 : ", but a vector tag with that ID does not exist");
567 :
568 1142 : const_cast<Coupleable *>(this)->addFEVariableCoupleableVectorTag(tag);
569 :
570 1142 : if (_c_nodal)
571 433 : return var->nodalVectorTagValue(tag);
572 : else
573 709 : return var->vectorTagValue(tag);
574 : }
575 :
576 : template <typename T>
577 : void
578 119 : Coupleable::requestStates(const std::string & var_name,
579 : const TagName & tag_name,
580 : const unsigned int comp)
581 : {
582 : auto var =
583 119 : const_cast<MooseVariableField<T> *>(getVarHelper<MooseVariableField<T>>(var_name, comp));
584 119 : if (!var)
585 0 : mooseError(var_name, ": invalid variable name for tag coupling");
586 :
587 119 : auto & var_sys = var->sys();
588 119 : if (tag_name == Moose::OLD_SOLUTION_TAG)
589 93 : var_sys.needSolutionState(1);
590 26 : else if (tag_name == Moose::OLDER_SOLUTION_TAG)
591 26 : var_sys.needSolutionState(2);
592 119 : }
593 :
594 : template <typename T>
595 : const typename OutputTools<T>::VariableValue &
596 1129 : Coupleable::vectorTagValueHelper(const std::string & var_names,
597 : const std::string & tag_param_name,
598 : const unsigned int index) const
599 : {
600 1129 : if (!_c_parameters.isParamValid(tag_param_name))
601 0 : mooseError("Tag name parameter '", tag_param_name, "' is invalid");
602 :
603 1129 : const TagName tag_name = MooseUtils::toUpper(_c_parameters.get<TagName>(tag_param_name));
604 :
605 1129 : const bool older_state_tag = _older_state_tags.count(tag_name);
606 1129 : if (older_state_tag)
607 : // We may need to add solution states and create vector tags
608 93 : const_cast<Coupleable *>(this)->requestStates<T>(var_names, tag_name, index);
609 :
610 1129 : if (!_c_fe_problem.vectorTagExists(tag_name))
611 0 : mooseError("Tagged vector with tag name '", tag_name, "' does not exist");
612 :
613 1129 : TagID tag = _c_fe_problem.getVectorTagID(tag_name);
614 2258 : return vectorTagValueHelper<T>(var_names, tag, index);
615 1129 : }
616 :
617 : template <>
618 : const GenericVariableValue<false> &
619 0 : Coupleable::coupledGenericDofValue<false>(const std::string & var_name, unsigned int comp) const
620 : {
621 0 : return coupledDofValues(var_name, comp);
622 : }
623 :
624 : template <>
625 : const GenericVariableValue<true> &
626 0 : Coupleable::coupledGenericDofValue<true>(const std::string & var_name, unsigned int comp) const
627 : {
628 0 : return adCoupledDofValues(var_name, comp);
629 : }
630 :
631 : const VariableValue &
632 13 : Coupleable::coupledValueLower(const std::string & var_name, const unsigned int comp) const
633 : {
634 13 : const auto * var = getVar(var_name, comp);
635 13 : if (!var)
636 0 : return *getDefaultValue(var_name, comp);
637 13 : checkFuncType(var_name, VarType::Ignore, FuncAge::Curr);
638 :
639 13 : if (_coupleable_neighbor)
640 0 : mooseError(_c_name, ":coupledValueLower cannot be called in a coupleable neighbor object");
641 :
642 13 : if (_c_nodal)
643 13 : return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
644 : else
645 0 : return (_c_is_implicit) ? var->slnLower() : var->slnLowerOld();
646 : }
647 :
648 : const VariableValue &
649 13 : Coupleable::coupledVectorTagValue(const std::string & var_names,
650 : TagID tag,
651 : unsigned int index) const
652 : {
653 13 : return vectorTagValueHelper<Real>(var_names, tag, index);
654 : }
655 :
656 : const VariableValue &
657 1084 : Coupleable::coupledVectorTagValue(const std::string & var_names,
658 : const std::string & tag_name,
659 : unsigned int index) const
660 : {
661 1084 : return vectorTagValueHelper<Real>(var_names, tag_name, index);
662 : }
663 :
664 : const ArrayVariableValue &
665 0 : Coupleable::coupledVectorTagArrayValue(const std::string & var_names,
666 : TagID tag,
667 : unsigned int index) const
668 : {
669 0 : return vectorTagValueHelper<RealEigenVector>(var_names, tag, index);
670 : }
671 :
672 : const ArrayVariableValue &
673 45 : Coupleable::coupledVectorTagArrayValue(const std::string & var_names,
674 : const std::string & tag_name,
675 : unsigned int index) const
676 : {
677 45 : return vectorTagValueHelper<RealEigenVector>(var_names, tag_name, index);
678 : }
679 :
680 : const VariableGradient &
681 0 : Coupleable::coupledVectorTagGradient(const std::string & var_names,
682 : TagID tag,
683 : unsigned int index) const
684 : {
685 0 : const auto * var = getVar(var_names, index);
686 0 : if (!var)
687 0 : mooseError(var_names, ": invalid variable name for coupledVectorTagGradient");
688 0 : checkFuncType(var_names, VarType::Ignore, FuncAge::Curr);
689 :
690 0 : if (!_c_fe_problem.vectorTagExists(tag))
691 0 : mooseError("Attempting to couple to vector tag with ID ",
692 : tag,
693 : "in ",
694 0 : _c_name,
695 : ", but a vector tag with that ID does not exist");
696 :
697 0 : const_cast<Coupleable *>(this)->addFEVariableCoupleableVectorTag(tag);
698 :
699 0 : return var->vectorTagGradient(tag);
700 : }
701 :
702 : const VariableGradient &
703 0 : Coupleable::coupledVectorTagGradient(const std::string & var_names,
704 : const std::string & tag_name,
705 : unsigned int index) const
706 : {
707 0 : if (!_c_parameters.isParamValid(tag_name))
708 0 : mooseError("Tag name parameter '", tag_name, "' is invalid");
709 :
710 0 : TagName tagname = _c_parameters.get<TagName>(tag_name);
711 0 : if (!_c_fe_problem.vectorTagExists(tagname))
712 0 : mooseError("Tagged vector with tag name '", tagname, "' does not exist");
713 :
714 0 : TagID tag = _c_fe_problem.getVectorTagID(tagname);
715 0 : return coupledVectorTagGradient(var_names, tag, index);
716 0 : }
717 :
718 : const ArrayVariableGradient &
719 26 : Coupleable::coupledVectorTagArrayGradient(const std::string & var_names,
720 : TagID tag,
721 : unsigned int index) const
722 : {
723 26 : const auto * var = getArrayVar(var_names, index);
724 26 : if (!var)
725 0 : mooseError(var_names, ": invalid variable name for coupledVectorTagArrayGradient");
726 26 : checkFuncType(var_names, VarType::Ignore, FuncAge::Curr);
727 :
728 26 : if (!_c_fe_problem.vectorTagExists(tag))
729 0 : mooseError("Attempting to couple to vector tag with ID ",
730 : tag,
731 : "in ",
732 0 : _c_name,
733 : ", but a vector tag with that ID does not exist");
734 :
735 26 : const_cast<Coupleable *>(this)->addFEVariableCoupleableVectorTag(tag);
736 :
737 26 : return var->vectorTagGradient(tag);
738 : }
739 :
740 : const ArrayVariableGradient &
741 26 : Coupleable::coupledVectorTagArrayGradient(const std::string & var_names,
742 : const std::string & tag_name,
743 : unsigned int index) const
744 : {
745 26 : if (!_c_parameters.isParamValid(tag_name))
746 0 : mooseError("Tag name parameter '", tag_name, "' is invalid");
747 :
748 26 : TagName tagname = _c_parameters.get<TagName>(tag_name);
749 26 : if (!_c_fe_problem.vectorTagExists(tagname))
750 0 : mooseError("Tagged vector with tag name '", tagname, "' does not exist");
751 :
752 26 : TagID tag = _c_fe_problem.getVectorTagID(tagname);
753 52 : return coupledVectorTagArrayGradient(var_names, tag, index);
754 26 : }
755 :
756 : template <typename T>
757 : const typename OutputTools<T>::VariableValue &
758 131 : Coupleable::vectorTagDofValueHelper(const std::string & var_name,
759 : const TagID tag,
760 : const unsigned int comp) const
761 : {
762 131 : const auto * var = getVarHelper<MooseVariableField<T>>(var_name, comp);
763 131 : if (!var)
764 0 : mooseError(var_name, ": invalid variable name for coupledVectorTagDofValue");
765 131 : checkFuncType(var_name, VarType::Ignore, FuncAge::Curr);
766 :
767 131 : const_cast<Coupleable *>(this)->addFEVariableCoupleableVectorTag(tag);
768 :
769 131 : return var->vectorTagDofValue(tag);
770 : }
771 :
772 : template <typename T>
773 : const typename OutputTools<T>::VariableValue &
774 131 : Coupleable::vectorTagDofValueHelper(const std::string & var_name,
775 : const std::string & tag_param_name,
776 : const unsigned int comp) const
777 : {
778 131 : if (!_c_parameters.isParamValid(tag_param_name))
779 0 : mooseError("Tag name parameter '", tag_param_name, "' is invalid");
780 :
781 131 : const TagName tag_name = MooseUtils::toUpper(_c_parameters.get<TagName>(tag_param_name));
782 :
783 131 : const bool older_state_tag = _older_state_tags.count(tag_name);
784 131 : if (older_state_tag)
785 : // We may need to add solution states and create vector tags
786 26 : const_cast<Coupleable *>(this)->requestStates<T>(var_name, tag_name, comp);
787 :
788 131 : if (!_c_fe_problem.vectorTagExists(tag_name))
789 0 : mooseError("Tagged vector with tag name '", tag_name, "' does not exist");
790 :
791 131 : TagID tag = _c_fe_problem.getVectorTagID(tag_name);
792 :
793 262 : return vectorTagDofValueHelper<T>(var_name, tag, comp);
794 131 : }
795 :
796 : const VariableValue &
797 0 : Coupleable::coupledVectorTagDofValue(const std::string & var_name,
798 : TagID tag,
799 : unsigned int comp) const
800 : {
801 0 : return vectorTagDofValueHelper<Real>(var_name, tag, comp);
802 : }
803 :
804 : const VariableValue &
805 118 : Coupleable::coupledVectorTagDofValue(const std::string & var_name,
806 : const std::string & tag_name,
807 : unsigned int comp) const
808 : {
809 118 : return vectorTagDofValueHelper<Real>(var_name, tag_name, comp);
810 : }
811 :
812 : const ArrayVariableValue &
813 13 : Coupleable::coupledVectorTagArrayDofValue(const std::string & var_name,
814 : const std::string & tag_name,
815 : unsigned int comp) const
816 : {
817 13 : return vectorTagDofValueHelper<RealEigenVector>(var_name, tag_name, comp);
818 : }
819 :
820 : const VariableValue &
821 273 : Coupleable::coupledMatrixTagValue(const std::string & var_names,
822 : TagID tag,
823 : unsigned int index) const
824 : {
825 273 : const auto * var = getVarHelper<MooseVariableField<Real>>(var_names, index);
826 273 : if (!var)
827 0 : mooseError(var_names, ": invalid variable name for coupledMatrixTagValue");
828 273 : checkFuncType(var_names, VarType::Ignore, FuncAge::Curr);
829 :
830 273 : const_cast<Coupleable *>(this)->addFEVariableCoupleableMatrixTag(tag);
831 :
832 273 : if (_c_nodal)
833 225 : return var->nodalMatrixTagValue(tag);
834 48 : return var->matrixTagValue(tag);
835 : }
836 :
837 : const VariableValue &
838 273 : Coupleable::coupledMatrixTagValue(const std::string & var_names,
839 : const std::string & tag_name,
840 : unsigned int index) const
841 : {
842 273 : if (!_c_parameters.isParamValid(tag_name))
843 0 : mooseError("Tag name parameter '", tag_name, "' is invalid");
844 :
845 273 : TagName tagname = _c_parameters.get<TagName>(tag_name);
846 273 : if (!_c_fe_problem.matrixTagExists(tagname))
847 0 : mooseError("Matrix tag name '", tagname, "' does not exist");
848 :
849 273 : TagID tag = _c_fe_problem.getMatrixTagID(tagname);
850 546 : return coupledMatrixTagValue(var_names, tag, index);
851 273 : }
852 :
853 : const VectorVariableValue &
854 1112 : Coupleable::coupledVectorValue(const std::string & var_name, unsigned int comp) const
855 : {
856 1112 : const auto * var = getVectorVar(var_name, comp);
857 1112 : if (!var)
858 300 : return *getDefaultVectorValue(var_name);
859 812 : checkFuncType(var_name, VarType::Ignore, FuncAge::Curr);
860 :
861 812 : if (!_coupleable_neighbor)
862 : {
863 786 : if (_c_nodal)
864 65 : return _c_is_implicit ? var->nodalValueArray() : var->nodalValueOldArray();
865 : else
866 721 : return _c_is_implicit ? var->sln() : var->slnOld();
867 : }
868 : else
869 : {
870 26 : if (_c_nodal)
871 : // Since this is at a node, I don't feel like there should be any "neighbor" logic
872 0 : return _c_is_implicit ? var->nodalValueArray() : var->nodalValueOldArray();
873 : else
874 26 : return _c_is_implicit ? var->slnNeighbor() : var->slnOldNeighbor();
875 : }
876 : }
877 :
878 : const ArrayVariableValue &
879 1240 : Coupleable::coupledArrayValue(const std::string & var_name, unsigned int comp) const
880 : {
881 1240 : const auto * var = getArrayVar(var_name, comp);
882 1240 : if (!var)
883 13 : return *getDefaultArrayValue(var_name);
884 1227 : checkFuncType(var_name, VarType::Ignore, FuncAge::Curr);
885 :
886 1227 : if (!_coupleable_neighbor)
887 : {
888 1227 : if (_c_nodal)
889 187 : return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
890 1040 : return (_c_is_implicit) ? var->sln() : var->slnOld();
891 : }
892 : else
893 : {
894 0 : if (_c_nodal)
895 0 : return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
896 0 : return (_c_is_implicit) ? var->slnNeighbor() : var->slnOldNeighbor();
897 : }
898 : }
899 :
900 : std::vector<const ArrayVariableValue *>
901 16 : Coupleable::coupledArrayValues(const std::string & var_name) const
902 : {
903 32 : auto func = [this, &var_name](unsigned int comp) { return &coupledArrayValue(var_name, comp); };
904 32 : return coupledVectorHelper<const ArrayVariableValue *>(var_name, func);
905 : }
906 :
907 : MooseWritableVariable &
908 254 : Coupleable::writableVariable(const std::string & var_name, unsigned int comp)
909 : {
910 254 : auto * var = getVarHelper<MooseWritableVariable>(var_name, comp);
911 :
912 251 : const auto * aux = dynamic_cast<const AuxKernel *>(this);
913 251 : const auto * euo = dynamic_cast<const ElementUserObject *>(this);
914 251 : const auto * nuo = dynamic_cast<const NodalUserObject *>(this);
915 251 : const auto * nfc = dynamic_cast<const NodeFaceConstraint *>(this);
916 251 : const auto * nec = dynamic_cast<const NodeElemConstraintBase *>(this);
917 :
918 251 : if (!aux && !euo && !nuo && !nfc && !nec)
919 3 : mooseError("writableVariable() can only be called from AuxKernels, ElementUserObjects, "
920 : "NodalUserObjects, NodeFaceConstraints, or NodeElemConstraints. '",
921 3 : _obj->name(),
922 : "' is none of those.");
923 :
924 248 : if (aux && !aux->isNodal() && var->isNodal())
925 3 : mooseError("The elemental AuxKernel '",
926 3 : _obj->name(),
927 : "' cannot obtain a writable reference to the nodal variable '",
928 3 : var->name(),
929 : "'.");
930 245 : if (euo && var->isNodal())
931 3 : mooseError("The ElementUserObject '",
932 3 : _obj->name(),
933 : "' cannot obtain a writable reference to the nodal variable '",
934 3 : var->name(),
935 : "'.");
936 :
937 : // make sure only one object can access a variable
938 242 : checkWritableVar(var);
939 :
940 233 : return *var;
941 : }
942 :
943 : VariableValue &
944 38 : Coupleable::writableCoupledValue(const std::string & var_name, unsigned int comp)
945 : {
946 38 : mooseDeprecated("Coupleable::writableCoupledValue is deprecated, please use "
947 : "Coupleable::writableVariable instead. ");
948 :
949 : // check if the variable exists
950 38 : auto * const var = getVar(var_name, comp);
951 38 : if (!var)
952 3 : mooseError(
953 : "Unable to create a writable reference for '", var_name, "', is it a constant expression?");
954 :
955 : // is the requested variable an AuxiliaryVariable?
956 35 : if (!_c_fe_problem.getAuxiliarySystem().hasVariable(var->name()))
957 3 : mooseError(
958 3 : "'", var->name(), "' must be an auxiliary variable in Coupleable::writableCoupledValue");
959 :
960 : // check that the variable type (elemental/nodal) is compatible with the object type
961 32 : const auto * aux = dynamic_cast<const AuxKernel *>(this);
962 :
963 32 : if (!aux)
964 3 : mooseError("writableCoupledValue() can only be called from AuxKernels, but '",
965 3 : _obj->name(),
966 : "' is not an AuxKernel.");
967 :
968 29 : if (!aux->isNodal() && var->isNodal())
969 3 : mooseError("The elemental AuxKernel '",
970 3 : _obj->name(),
971 : "' cannot obtain a writable reference to the nodal variable '",
972 3 : var->name(),
973 : "'.");
974 :
975 : // make sure only one object can access a variable
976 26 : checkWritableVar(var);
977 :
978 26 : return const_cast<VariableValue &>(coupledValue(var_name, comp));
979 : }
980 :
981 : void
982 268 : Coupleable::checkWritableVar(MooseWritableVariable * var)
983 : {
984 : // check domain restrictions for compatibility
985 268 : const auto * br = dynamic_cast<const BlockRestrictable *>(this);
986 268 : const auto * nfc = dynamic_cast<const NodeFaceConstraint *>(this);
987 :
988 268 : if (br && !var->hasBlocks(br->blockIDs()))
989 3 : mooseError("The variable '",
990 3 : var->name(),
991 : "' must be defined on all blocks '",
992 3 : _obj->name(),
993 : "' is defined on.");
994 :
995 265 : if (nfc && !var->hasBlocks(nfc->getSecondaryConnectedBlocks()))
996 0 : mooseError("The variable '",
997 0 : var->name(),
998 : " must be defined on all blocks '",
999 0 : _obj->name(),
1000 : "'s secondary surface is defined on.");
1001 :
1002 : // make sure only one object can access a variable
1003 1001 : for (const auto & ci : _obj->getMooseApp().getInterfaceObjects<Coupleable>())
1004 742 : if (ci != this && ci->_writable_coupled_variables[_c_tid].count(var))
1005 : {
1006 : // if both this and ci are block restrictable then we check if the block restrictions
1007 : // are not overlapping. If they don't we permit the call.
1008 36 : const auto * br_other = dynamic_cast<const BlockRestrictable *>(ci);
1009 69 : if (br && br_other && br->blockRestricted() && br_other->blockRestricted() &&
1010 33 : !MooseUtils::setsIntersect(br->blockIDs(), br_other->blockIDs()))
1011 30 : continue;
1012 6 : else if (nfc)
1013 0 : continue;
1014 :
1015 6 : mooseError("'",
1016 6 : ci->_obj->name(),
1017 : "' already obtained a writable reference to '",
1018 6 : var->name(),
1019 : "'. Only one object can obtain such a reference per variable and subdomain in a "
1020 : "simulation.");
1021 : }
1022 :
1023 : // var is unique across threads, so we could forego having a separate set per thread, but we
1024 : // need quick access to the list of all variables that need to be inserted into the solution
1025 : // vector by a given thread.
1026 :
1027 259 : _writable_coupled_variables[_c_tid].insert(var);
1028 259 : }
1029 :
1030 : const VariableValue &
1031 11334 : Coupleable::coupledValueOld(const std::string & var_name, unsigned int comp) const
1032 : {
1033 11334 : const auto * var = getVar(var_name, comp);
1034 11334 : if (!var)
1035 0 : return *getDefaultValue(var_name, comp);
1036 11334 : checkFuncType(var_name, VarType::Ignore, FuncAge::Old);
1037 :
1038 11334 : if (!_coupleable_neighbor)
1039 : {
1040 7662 : if (_c_nodal)
1041 89 : return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
1042 7573 : return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
1043 : }
1044 : else
1045 : {
1046 3672 : if (_c_nodal)
1047 0 : return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
1048 3672 : return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
1049 : }
1050 : }
1051 :
1052 : const VariableValue &
1053 11076 : Coupleable::coupledValueOlder(const std::string & var_name, unsigned int comp) const
1054 : {
1055 11076 : const auto * var = getVar(var_name, comp);
1056 11076 : if (!var)
1057 0 : return *getDefaultValue(var_name, comp);
1058 11076 : checkFuncType(var_name, VarType::Ignore, FuncAge::Older);
1059 :
1060 11076 : if (!_coupleable_neighbor)
1061 : {
1062 7410 : if (_c_nodal)
1063 39 : return var->dofValuesOlder();
1064 7371 : return var->slnOlder();
1065 : }
1066 : else
1067 : {
1068 3666 : if (_c_nodal)
1069 0 : return var->dofValuesOlderNeighbor();
1070 3666 : return var->slnOlderNeighbor();
1071 : }
1072 : }
1073 :
1074 : const VariableValue &
1075 76 : Coupleable::coupledValuePreviousNL(const std::string & var_name, unsigned int comp) const
1076 : {
1077 76 : const auto * var = getVar(var_name, comp);
1078 76 : if (!var)
1079 0 : return *getDefaultValue(var_name, comp);
1080 76 : checkFuncType(var_name, VarType::Ignore, FuncAge::Curr);
1081 :
1082 76 : _c_fe_problem.needsPreviousNewtonIteration(true);
1083 76 : if (!_coupleable_neighbor)
1084 : {
1085 76 : if (_c_nodal)
1086 0 : return var->dofValuesPreviousNL();
1087 76 : return var->slnPreviousNL();
1088 : }
1089 : else
1090 : {
1091 0 : if (_c_nodal)
1092 0 : return var->dofValuesPreviousNLNeighbor();
1093 0 : return var->slnPreviousNLNeighbor();
1094 : }
1095 : }
1096 :
1097 : const VectorVariableValue &
1098 52 : Coupleable::coupledVectorValueOld(const std::string & var_name, unsigned int comp) const
1099 : {
1100 52 : const auto * var = getVectorVar(var_name, comp);
1101 52 : if (!var)
1102 0 : return *getDefaultVectorValue(var_name);
1103 52 : checkFuncType(var_name, VarType::Ignore, FuncAge::Old);
1104 :
1105 52 : if (_c_nodal)
1106 26 : return (_c_is_implicit) ? var->nodalValueOldArray() : var->nodalValueOlderArray();
1107 26 : if (!_coupleable_neighbor)
1108 26 : return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
1109 0 : return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
1110 : }
1111 :
1112 : const VectorVariableValue &
1113 0 : Coupleable::coupledVectorValueOlder(const std::string & var_name, unsigned int comp) const
1114 : {
1115 0 : const auto * var = getVectorVar(var_name, comp);
1116 0 : if (!var)
1117 0 : return *getDefaultVectorValue(var_name);
1118 0 : checkFuncType(var_name, VarType::Ignore, FuncAge::Older);
1119 :
1120 0 : if (!_coupleable_neighbor)
1121 0 : return var->slnOlder();
1122 0 : return var->slnOlderNeighbor();
1123 : }
1124 :
1125 : const ArrayVariableValue &
1126 0 : Coupleable::coupledArrayValueOld(const std::string & var_name, unsigned int comp) const
1127 : {
1128 0 : const auto * var = getArrayVar(var_name, comp);
1129 0 : if (!var)
1130 0 : return *getDefaultArrayValue(var_name);
1131 0 : checkFuncType(var_name, VarType::Ignore, FuncAge::Old);
1132 :
1133 0 : if (!_coupleable_neighbor)
1134 : {
1135 0 : if (_c_nodal)
1136 0 : return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
1137 0 : return (_c_is_implicit) ? var->slnOld() : var->slnOlder();
1138 : }
1139 : else
1140 : {
1141 0 : if (_c_nodal)
1142 0 : return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
1143 0 : return (_c_is_implicit) ? var->slnOldNeighbor() : var->slnOlderNeighbor();
1144 : }
1145 : }
1146 :
1147 : const ArrayVariableValue &
1148 0 : Coupleable::coupledArrayValueOlder(const std::string & var_name, unsigned int comp) const
1149 : {
1150 0 : const auto * var = getArrayVar(var_name, comp);
1151 0 : if (!var)
1152 0 : return *getDefaultArrayValue(var_name);
1153 0 : checkFuncType(var_name, VarType::Ignore, FuncAge::Older);
1154 :
1155 0 : if (!_coupleable_neighbor)
1156 : {
1157 0 : if (_c_nodal)
1158 0 : return var->dofValuesOlder();
1159 0 : return var->slnOlder();
1160 : }
1161 : else
1162 : {
1163 0 : if (_c_nodal)
1164 0 : return var->dofValuesOlderNeighbor();
1165 0 : return var->slnOlderNeighbor();
1166 : }
1167 : }
1168 :
1169 : const VariableValue &
1170 272 : Coupleable::coupledDot(const std::string & var_name, unsigned int comp) const
1171 : {
1172 272 : const auto * var = getVar(var_name, comp);
1173 272 : if (!var)
1174 : {
1175 0 : _default_value_zero.resize(_coupleable_max_qps, 0);
1176 0 : return _default_value_zero;
1177 : }
1178 272 : checkFuncType(var_name, VarType::Dot, FuncAge::Curr);
1179 :
1180 269 : if (!_coupleable_neighbor)
1181 : {
1182 243 : if (_c_nodal)
1183 39 : return var->dofValuesDot();
1184 204 : return var->uDot();
1185 : }
1186 : else
1187 : {
1188 26 : if (_c_nodal)
1189 0 : return var->dofValuesDotNeighbor();
1190 26 : return var->uDotNeighbor();
1191 : }
1192 : }
1193 :
1194 : const VariableValue &
1195 166 : Coupleable::coupledDotDot(const std::string & var_name, unsigned int comp) const
1196 : {
1197 166 : const auto * var = getVar(var_name, comp);
1198 166 : if (!var)
1199 : {
1200 0 : _default_value_zero.resize(_coupleable_max_qps, 0);
1201 0 : return _default_value_zero;
1202 : }
1203 166 : checkFuncType(var_name, VarType::Dot, FuncAge::Curr);
1204 :
1205 166 : if (!_coupleable_neighbor)
1206 : {
1207 140 : if (_c_nodal)
1208 3 : return var->dofValuesDotDot();
1209 137 : return var->uDotDot();
1210 : }
1211 : else
1212 : {
1213 26 : if (_c_nodal)
1214 0 : return var->dofValuesDotDotNeighbor();
1215 26 : return var->uDotDotNeighbor();
1216 : }
1217 : }
1218 :
1219 : template <>
1220 : const GenericVariableValue<false> &
1221 78 : Coupleable::coupledGenericDotDot<false>(const std::string & var_name, unsigned int comp) const
1222 : {
1223 78 : return coupledDotDot(var_name, comp);
1224 : }
1225 :
1226 : template <>
1227 : const GenericVariableValue<true> &
1228 39 : Coupleable::coupledGenericDotDot<true>(const std::string & var_name, unsigned int comp) const
1229 : {
1230 39 : return adCoupledDotDot(var_name, comp);
1231 : }
1232 :
1233 : const VariableValue &
1234 0 : Coupleable::coupledDotOld(const std::string & var_name, unsigned int comp) const
1235 : {
1236 0 : const auto * var = getVar(var_name, comp);
1237 0 : if (!var)
1238 : {
1239 0 : _default_value_zero.resize(_coupleable_max_qps, 0);
1240 0 : return _default_value_zero;
1241 : }
1242 0 : checkFuncType(var_name, VarType::Dot, FuncAge::Old);
1243 :
1244 0 : if (!_coupleable_neighbor)
1245 : {
1246 0 : if (_c_nodal)
1247 0 : return var->dofValuesDotOld();
1248 0 : return var->uDotOld();
1249 : }
1250 : else
1251 : {
1252 0 : if (_c_nodal)
1253 0 : return var->dofValuesDotOldNeighbor();
1254 0 : return var->uDotOldNeighbor();
1255 : }
1256 : }
1257 :
1258 : const VariableValue &
1259 0 : Coupleable::coupledDotDotOld(const std::string & var_name, unsigned int comp) const
1260 : {
1261 0 : const auto * var = getVar(var_name, comp);
1262 0 : if (!var)
1263 : {
1264 0 : _default_value_zero.resize(_coupleable_max_qps, 0);
1265 0 : return _default_value_zero;
1266 : }
1267 0 : checkFuncType(var_name, VarType::Dot, FuncAge::Old);
1268 :
1269 0 : if (!_coupleable_neighbor)
1270 : {
1271 0 : if (_c_nodal)
1272 0 : return var->dofValuesDotDotOld();
1273 0 : return var->uDotDotOld();
1274 : }
1275 : else
1276 : {
1277 0 : if (_c_nodal)
1278 0 : return var->dofValuesDotDotOldNeighbor();
1279 0 : return var->uDotDotOldNeighbor();
1280 : }
1281 : }
1282 :
1283 : const VectorVariableValue &
1284 114 : Coupleable::coupledVectorDot(const std::string & var_name, unsigned int comp) const
1285 : {
1286 114 : const auto * var = getVectorVar(var_name, comp);
1287 114 : if (!var)
1288 : {
1289 0 : _default_vector_value_zero.resize(_coupleable_max_qps);
1290 0 : return _default_vector_value_zero;
1291 : }
1292 114 : checkFuncType(var_name, VarType::Dot, FuncAge::Curr);
1293 :
1294 114 : if (!_coupleable_neighbor)
1295 88 : return var->uDot();
1296 26 : return var->uDotNeighbor();
1297 : }
1298 :
1299 : const VectorVariableValue &
1300 39 : Coupleable::coupledVectorDotDot(const std::string & var_name, unsigned int comp) const
1301 : {
1302 39 : const auto * var = getVectorVar(var_name, comp);
1303 39 : if (!var)
1304 : {
1305 0 : _default_vector_value_zero.resize(_coupleable_max_qps);
1306 0 : return _default_vector_value_zero;
1307 : }
1308 39 : checkFuncType(var_name, VarType::Dot, FuncAge::Curr);
1309 :
1310 39 : if (!_coupleable_neighbor)
1311 26 : return var->uDotDot();
1312 13 : return var->uDotDotNeighbor();
1313 : }
1314 :
1315 : const VectorVariableValue &
1316 0 : Coupleable::coupledVectorDotOld(const std::string & var_name, unsigned int comp) const
1317 : {
1318 0 : const auto * var = getVectorVar(var_name, comp);
1319 0 : if (!var)
1320 : {
1321 0 : _default_vector_value_zero.resize(_coupleable_max_qps);
1322 0 : return _default_vector_value_zero;
1323 : }
1324 0 : checkFuncType(var_name, VarType::Dot, FuncAge::Old);
1325 :
1326 0 : if (!_coupleable_neighbor)
1327 0 : return var->uDotOld();
1328 0 : return var->uDotOldNeighbor();
1329 : }
1330 :
1331 : const VectorVariableValue &
1332 0 : Coupleable::coupledVectorDotDotOld(const std::string & var_name, unsigned int comp) const
1333 : {
1334 0 : const auto * var = getVectorVar(var_name, comp);
1335 0 : if (!var)
1336 : {
1337 0 : _default_vector_value_zero.resize(_coupleable_max_qps);
1338 0 : return _default_vector_value_zero;
1339 : }
1340 0 : checkFuncType(var_name, VarType::Dot, FuncAge::Old);
1341 :
1342 0 : if (!_coupleable_neighbor)
1343 0 : return var->uDotDotOld();
1344 0 : return var->uDotDotOldNeighbor();
1345 : }
1346 :
1347 : const VariableValue &
1348 114 : Coupleable::coupledVectorDotDu(const std::string & var_name, unsigned int comp) const
1349 : {
1350 114 : const auto * var = getVectorVar(var_name, comp);
1351 114 : if (!var)
1352 : {
1353 0 : _default_value_zero.resize(_coupleable_max_qps, 0);
1354 0 : return _default_value_zero;
1355 : }
1356 114 : checkFuncType(var_name, VarType::Dot, FuncAge::Curr);
1357 :
1358 114 : if (!_coupleable_neighbor)
1359 88 : return var->duDotDu();
1360 26 : return var->duDotDuNeighbor();
1361 : }
1362 :
1363 : const VariableValue &
1364 39 : Coupleable::coupledVectorDotDotDu(const std::string & var_name, unsigned int comp) const
1365 : {
1366 39 : const auto * var = getVectorVar(var_name, comp);
1367 39 : if (!var)
1368 : {
1369 0 : _default_value_zero.resize(_coupleable_max_qps, 0);
1370 0 : return _default_value_zero;
1371 : }
1372 39 : checkFuncType(var_name, VarType::Dot, FuncAge::Curr);
1373 :
1374 39 : if (!_coupleable_neighbor)
1375 26 : return var->duDotDotDu();
1376 13 : return var->duDotDotDuNeighbor();
1377 : }
1378 :
1379 : const ArrayVariableValue &
1380 43 : Coupleable::coupledArrayDot(const std::string & var_name, unsigned int comp) const
1381 : {
1382 43 : const auto * var = getArrayVar(var_name, comp);
1383 43 : if (!var)
1384 0 : return _default_array_value_zero;
1385 43 : checkFuncType(var_name, VarType::Dot, FuncAge::Curr);
1386 :
1387 43 : if (!_coupleable_neighbor)
1388 : {
1389 43 : if (_c_nodal)
1390 0 : return var->dofValuesDot();
1391 43 : return var->uDot();
1392 : }
1393 : else
1394 : {
1395 0 : if (_c_nodal)
1396 0 : return var->dofValuesDotNeighbor();
1397 0 : return var->uDotNeighbor();
1398 : }
1399 : }
1400 :
1401 : const ArrayVariableValue &
1402 0 : Coupleable::coupledArrayDotDot(const std::string & var_name, unsigned int comp) const
1403 : {
1404 0 : const auto * var = getArrayVar(var_name, comp);
1405 0 : if (!var)
1406 0 : return _default_array_value_zero;
1407 0 : checkFuncType(var_name, VarType::Dot, FuncAge::Curr);
1408 :
1409 0 : if (!_coupleable_neighbor)
1410 : {
1411 0 : if (_c_nodal)
1412 0 : return var->dofValuesDotDot();
1413 0 : return var->uDotDot();
1414 : }
1415 : else
1416 : {
1417 0 : if (_c_nodal)
1418 0 : return var->dofValuesDotDotNeighbor();
1419 0 : return var->uDotDotNeighbor();
1420 : }
1421 : }
1422 :
1423 : const ArrayVariableValue &
1424 0 : Coupleable::coupledArrayDotOld(const std::string & var_name, unsigned int comp) const
1425 : {
1426 0 : const auto * var = getArrayVar(var_name, comp);
1427 0 : if (!var)
1428 0 : return _default_array_value_zero;
1429 0 : checkFuncType(var_name, VarType::Dot, FuncAge::Old);
1430 :
1431 0 : if (!_coupleable_neighbor)
1432 : {
1433 0 : if (_c_nodal)
1434 0 : return var->dofValuesDotOld();
1435 0 : return var->uDotOld();
1436 : }
1437 : else
1438 : {
1439 0 : if (_c_nodal)
1440 0 : return var->dofValuesDotOldNeighbor();
1441 0 : return var->uDotOldNeighbor();
1442 : }
1443 : }
1444 :
1445 : const ArrayVariableValue &
1446 0 : Coupleable::coupledArrayDotDotOld(const std::string & var_name, unsigned int comp) const
1447 : {
1448 0 : const auto * var = getArrayVar(var_name, comp);
1449 0 : if (!var)
1450 0 : return _default_array_value_zero;
1451 0 : checkFuncType(var_name, VarType::Dot, FuncAge::Old);
1452 :
1453 0 : if (!_coupleable_neighbor)
1454 : {
1455 0 : if (_c_nodal)
1456 0 : return var->dofValuesDotDotOld();
1457 0 : return var->uDotDotOld();
1458 : }
1459 : else
1460 : {
1461 0 : if (_c_nodal)
1462 0 : return var->dofValuesDotDotOldNeighbor();
1463 0 : return var->uDotDotOldNeighbor();
1464 : }
1465 : }
1466 :
1467 : const VariableValue &
1468 166 : Coupleable::coupledDotDu(const std::string & var_name, unsigned int comp) const
1469 : {
1470 166 : const auto * var = getVar(var_name, comp);
1471 166 : if (!var)
1472 : {
1473 0 : _default_value_zero.resize(_coupleable_max_qps, 0);
1474 0 : return _default_value_zero;
1475 : }
1476 166 : checkFuncType(var_name, VarType::Dot, FuncAge::Curr);
1477 :
1478 166 : if (!_coupleable_neighbor)
1479 : {
1480 127 : if (_c_nodal)
1481 0 : return var->dofValuesDuDotDu();
1482 127 : return var->duDotDu();
1483 : }
1484 : else
1485 : {
1486 39 : if (_c_nodal)
1487 0 : return var->dofValuesDuDotDuNeighbor();
1488 39 : return var->duDotDuNeighbor();
1489 : }
1490 : }
1491 :
1492 : const VariableValue &
1493 117 : Coupleable::coupledDotDotDu(const std::string & var_name, unsigned int comp) const
1494 : {
1495 117 : const auto * var = getVar(var_name, comp);
1496 117 : if (!var)
1497 : {
1498 0 : _default_value_zero.resize(_coupleable_max_qps, 0);
1499 0 : return _default_value_zero;
1500 : }
1501 117 : checkFuncType(var_name, VarType::Dot, FuncAge::Curr);
1502 :
1503 117 : if (!_coupleable_neighbor)
1504 : {
1505 78 : if (_c_nodal)
1506 0 : return var->dofValuesDuDotDotDu();
1507 78 : return var->duDotDotDu();
1508 : }
1509 : else
1510 : {
1511 39 : if (_c_nodal)
1512 0 : return var->dofValuesDuDotDotDuNeighbor();
1513 39 : return var->duDotDotDuNeighbor();
1514 : }
1515 : }
1516 :
1517 : const VariableValue &
1518 43 : Coupleable::coupledArrayDotDu(const std::string & var_name, unsigned int comp) const
1519 : {
1520 43 : const auto * const var = getArrayVar(var_name, comp);
1521 43 : if (!var)
1522 : {
1523 0 : _default_value_zero.resize(_coupleable_max_qps, 0);
1524 0 : return _default_value_zero;
1525 : }
1526 43 : checkFuncType(var_name, VarType::Dot, FuncAge::Curr);
1527 :
1528 43 : if (!_coupleable_neighbor)
1529 : {
1530 43 : if (_c_nodal)
1531 0 : return var->dofValuesDuDotDu();
1532 43 : return var->duDotDu();
1533 : }
1534 : else
1535 : {
1536 0 : if (_c_nodal)
1537 0 : return var->dofValuesDuDotDuNeighbor();
1538 0 : return var->duDotDuNeighbor();
1539 : }
1540 : }
1541 :
1542 : const VariableGradient &
1543 31181 : Coupleable::coupledGradient(const std::string & var_name, unsigned int comp) const
1544 : {
1545 31181 : const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
1546 31178 : if (!var)
1547 : {
1548 34 : _default_gradient.resize(_coupleable_max_qps);
1549 34 : return _default_gradient;
1550 : }
1551 31144 : checkFuncType(var_name, VarType::Gradient, FuncAge::Curr);
1552 :
1553 31144 : if (!_coupleable_neighbor)
1554 31131 : return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
1555 13 : return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
1556 : }
1557 :
1558 : const VariableGradient &
1559 3 : Coupleable::coupledGradientOld(const std::string & var_name, unsigned int comp) const
1560 : {
1561 3 : const auto * var = getVar(var_name, comp);
1562 3 : if (!var)
1563 : {
1564 0 : _default_gradient.resize(_coupleable_max_qps);
1565 0 : return _default_gradient;
1566 : }
1567 3 : checkFuncType(var_name, VarType::Gradient, FuncAge::Old);
1568 :
1569 0 : if (!_coupleable_neighbor)
1570 0 : return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
1571 0 : return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
1572 : }
1573 :
1574 : const VariableGradient &
1575 0 : Coupleable::coupledGradientOlder(const std::string & var_name, unsigned int comp) const
1576 : {
1577 0 : const auto * var = getVar(var_name, comp);
1578 0 : if (!var)
1579 : {
1580 0 : _default_gradient.resize(_coupleable_max_qps);
1581 0 : return _default_gradient;
1582 : }
1583 0 : checkFuncType(var_name, VarType::Gradient, FuncAge::Older);
1584 :
1585 0 : if (!_coupleable_neighbor)
1586 0 : return var->gradSlnOlder();
1587 0 : return var->gradSlnOlderNeighbor();
1588 : }
1589 :
1590 : const VariableGradient &
1591 0 : Coupleable::coupledGradientPreviousNL(const std::string & var_name, unsigned int comp) const
1592 : {
1593 0 : const auto * var = getVar(var_name, comp);
1594 0 : _c_fe_problem.needsPreviousNewtonIteration(true);
1595 0 : if (!var)
1596 : {
1597 0 : _default_gradient.resize(_coupleable_max_qps);
1598 0 : return _default_gradient;
1599 : }
1600 0 : checkFuncType(var_name, VarType::Gradient, FuncAge::Curr);
1601 :
1602 0 : if (!_coupleable_neighbor)
1603 0 : return var->gradSlnPreviousNL();
1604 0 : return var->gradSlnPreviousNLNeighbor();
1605 : }
1606 :
1607 : const VariableGradient &
1608 23 : Coupleable::coupledGradientDot(const std::string & var_name, unsigned int comp) const
1609 : {
1610 23 : const auto * var = getVar(var_name, comp);
1611 23 : if (!var)
1612 : {
1613 0 : _default_gradient.resize(_coupleable_max_qps);
1614 0 : return _default_gradient;
1615 : }
1616 23 : checkFuncType(var_name, VarType::GradientDot, FuncAge::Curr);
1617 :
1618 23 : if (!_coupleable_neighbor)
1619 23 : return var->gradSlnDot();
1620 0 : return var->gradSlnNeighborDot();
1621 : }
1622 :
1623 : const VariableGradient &
1624 0 : Coupleable::coupledGradientDotDot(const std::string & var_name, unsigned int comp) const
1625 : {
1626 0 : const auto * var = getVar(var_name, comp);
1627 0 : if (!var)
1628 : {
1629 0 : _default_gradient.resize(_coupleable_max_qps);
1630 0 : return _default_gradient;
1631 : }
1632 0 : checkFuncType(var_name, VarType::GradientDot, FuncAge::Curr);
1633 :
1634 0 : if (!_coupleable_neighbor)
1635 0 : return var->gradSlnDotDot();
1636 0 : return var->gradSlnNeighborDotDot();
1637 : }
1638 :
1639 : const VectorVariableGradient &
1640 13 : Coupleable::coupledVectorGradient(const std::string & var_name, unsigned int comp) const
1641 : {
1642 13 : const auto * var = getVectorVar(var_name, comp);
1643 13 : if (!var)
1644 : {
1645 0 : _default_vector_gradient.resize(_coupleable_max_qps);
1646 0 : return _default_vector_gradient;
1647 : }
1648 13 : checkFuncType(var_name, VarType::Gradient, FuncAge::Curr);
1649 :
1650 13 : if (!_coupleable_neighbor)
1651 13 : return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
1652 0 : return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
1653 : }
1654 :
1655 : const VectorVariableGradient &
1656 13 : Coupleable::coupledVectorGradientOld(const std::string & var_name, unsigned int comp) const
1657 : {
1658 13 : const auto * var = getVectorVar(var_name, comp);
1659 13 : if (!var)
1660 : {
1661 0 : _default_vector_gradient.resize(_coupleable_max_qps);
1662 0 : return _default_vector_gradient;
1663 : }
1664 13 : checkFuncType(var_name, VarType::Gradient, FuncAge::Old);
1665 :
1666 13 : if (!_coupleable_neighbor)
1667 13 : return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
1668 0 : return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
1669 : }
1670 :
1671 : const VectorVariableGradient &
1672 13 : Coupleable::coupledVectorGradientOlder(const std::string & var_name, unsigned int comp) const
1673 : {
1674 13 : const auto * var = getVectorVar(var_name, comp);
1675 13 : if (!var)
1676 : {
1677 0 : _default_vector_gradient.resize(_coupleable_max_qps);
1678 0 : return _default_vector_gradient;
1679 : }
1680 13 : checkFuncType(var_name, VarType::Gradient, FuncAge::Older);
1681 :
1682 13 : if (!_coupleable_neighbor)
1683 13 : return var->gradSlnOlder();
1684 0 : return var->gradSlnOlderNeighbor();
1685 : }
1686 :
1687 : const ArrayVariableGradient &
1688 840 : Coupleable::coupledArrayGradient(const std::string & var_name, unsigned int comp) const
1689 : {
1690 840 : const auto * var = getArrayVar(var_name, comp);
1691 840 : if (!var)
1692 0 : return _default_array_gradient;
1693 840 : checkFuncType(var_name, VarType::Gradient, FuncAge::Curr);
1694 :
1695 840 : if (!_coupleable_neighbor)
1696 840 : return (_c_is_implicit) ? var->gradSln() : var->gradSlnOld();
1697 0 : return (_c_is_implicit) ? var->gradSlnNeighbor() : var->gradSlnOldNeighbor();
1698 : }
1699 :
1700 : const ArrayVariableGradient &
1701 0 : Coupleable::coupledArrayGradientOld(const std::string & var_name, unsigned int comp) const
1702 : {
1703 0 : const auto * var = getArrayVar(var_name, comp);
1704 0 : if (!var)
1705 0 : return _default_array_gradient;
1706 0 : checkFuncType(var_name, VarType::Gradient, FuncAge::Old);
1707 :
1708 0 : if (!_coupleable_neighbor)
1709 0 : return (_c_is_implicit) ? var->gradSlnOld() : var->gradSlnOlder();
1710 0 : return (_c_is_implicit) ? var->gradSlnOldNeighbor() : var->gradSlnOlderNeighbor();
1711 : }
1712 :
1713 : const ArrayVariableGradient &
1714 0 : Coupleable::coupledArrayGradientOlder(const std::string & var_name, unsigned int comp) const
1715 : {
1716 0 : const auto * var = getArrayVar(var_name, comp);
1717 0 : if (!var)
1718 0 : return _default_array_gradient;
1719 0 : checkFuncType(var_name, VarType::Gradient, FuncAge::Older);
1720 :
1721 0 : if (!_coupleable_neighbor)
1722 0 : return var->gradSlnOlder();
1723 0 : return var->gradSlnOlderNeighbor();
1724 : }
1725 :
1726 : const ArrayVariableGradient &
1727 13 : Coupleable::coupledArrayGradientDot(const std::string & var_name, unsigned int comp) const
1728 : {
1729 13 : const auto * const var = getArrayVar(var_name, comp);
1730 13 : if (!var)
1731 0 : return _default_array_gradient;
1732 13 : checkFuncType(var_name, VarType::Gradient, FuncAge::Older);
1733 :
1734 13 : if (!_coupleable_neighbor)
1735 13 : return var->gradSlnDot();
1736 0 : return var->gradSlnNeighborDot();
1737 : }
1738 :
1739 : const VectorVariableCurl &
1740 0 : Coupleable::coupledCurl(const std::string & var_name, unsigned int comp) const
1741 : {
1742 0 : const auto * var = getVectorVar(var_name, comp);
1743 0 : if (!var)
1744 : {
1745 0 : _default_vector_curl.resize(_coupleable_max_qps);
1746 0 : return _default_vector_curl;
1747 : }
1748 0 : checkFuncType(var_name, VarType::Gradient, FuncAge::Curr);
1749 :
1750 0 : if (!_coupleable_neighbor)
1751 0 : return (_c_is_implicit) ? var->curlSln() : var->curlSlnOld();
1752 0 : return (_c_is_implicit) ? var->curlSlnNeighbor() : var->curlSlnOldNeighbor();
1753 : }
1754 :
1755 : const VectorVariableCurl &
1756 0 : Coupleable::coupledCurlOld(const std::string & var_name, unsigned int comp) const
1757 : {
1758 0 : const auto * var = getVectorVar(var_name, comp);
1759 0 : if (!var)
1760 : {
1761 0 : _default_vector_curl.resize(_coupleable_max_qps);
1762 0 : return _default_vector_curl;
1763 : }
1764 0 : checkFuncType(var_name, VarType::Gradient, FuncAge::Old);
1765 :
1766 0 : if (!_coupleable_neighbor)
1767 0 : return (_c_is_implicit) ? var->curlSlnOld() : var->curlSlnOlder();
1768 0 : return (_c_is_implicit) ? var->curlSlnOldNeighbor() : var->curlSlnOlderNeighbor();
1769 : }
1770 :
1771 : const VectorVariableCurl &
1772 0 : Coupleable::coupledCurlOlder(const std::string & var_name, unsigned int comp) const
1773 : {
1774 0 : const auto * var = getVectorVar(var_name, comp);
1775 0 : if (!var)
1776 : {
1777 0 : _default_vector_curl.resize(_coupleable_max_qps);
1778 0 : return _default_vector_curl;
1779 : }
1780 0 : checkFuncType(var_name, VarType::Gradient, FuncAge::Older);
1781 :
1782 0 : if (!_coupleable_neighbor)
1783 0 : return var->curlSlnOlder();
1784 0 : return var->curlSlnOlderNeighbor();
1785 : }
1786 :
1787 : const ADVectorVariableCurl &
1788 13 : Coupleable::adCoupledCurl(const std::string & var_name, unsigned int comp) const
1789 : {
1790 13 : const auto * var = getVectorVar(var_name, comp);
1791 :
1792 13 : if (!var)
1793 0 : return getADDefaultCurl();
1794 13 : checkFuncType(var_name, VarType::Gradient, FuncAge::Curr);
1795 :
1796 13 : if (!_c_is_implicit)
1797 0 : mooseError("Not implemented");
1798 :
1799 13 : if (!_coupleable_neighbor)
1800 13 : return var->adCurlSln();
1801 0 : return var->adCurlSlnNeighbor();
1802 : }
1803 :
1804 : const VectorVariableDivergence &
1805 156 : Coupleable::coupledDiv(const std::string & var_name, unsigned int comp) const
1806 : {
1807 156 : const auto * var = getVectorVar(var_name, comp);
1808 156 : if (!var)
1809 : {
1810 0 : _default_div.resize(_coupleable_max_qps);
1811 0 : return _default_div;
1812 : }
1813 156 : checkFuncType(var_name, VarType::Gradient, FuncAge::Curr);
1814 :
1815 156 : if (!_coupleable_neighbor)
1816 156 : return (_c_is_implicit) ? var->divSln() : var->divSlnOld();
1817 0 : return (_c_is_implicit) ? var->divSlnNeighbor() : var->divSlnOldNeighbor();
1818 : }
1819 :
1820 : const VectorVariableDivergence &
1821 0 : Coupleable::coupledDivOld(const std::string & var_name, unsigned int comp) const
1822 : {
1823 0 : const auto * var = getVectorVar(var_name, comp);
1824 0 : if (!var)
1825 : {
1826 0 : _default_div.resize(_coupleable_max_qps);
1827 0 : return _default_div;
1828 : }
1829 0 : checkFuncType(var_name, VarType::Gradient, FuncAge::Old);
1830 :
1831 0 : if (!_coupleable_neighbor)
1832 0 : return (_c_is_implicit) ? var->divSlnOld() : var->divSlnOlder();
1833 0 : return (_c_is_implicit) ? var->divSlnOldNeighbor() : var->divSlnOlderNeighbor();
1834 : }
1835 :
1836 : const VectorVariableDivergence &
1837 0 : Coupleable::coupledDivOlder(const std::string & var_name, unsigned int comp) const
1838 : {
1839 0 : const auto * var = getVectorVar(var_name, comp);
1840 0 : if (!var)
1841 : {
1842 0 : _default_div.resize(_coupleable_max_qps);
1843 0 : return _default_div;
1844 : }
1845 0 : checkFuncType(var_name, VarType::Gradient, FuncAge::Older);
1846 :
1847 0 : if (!_coupleable_neighbor)
1848 0 : return var->divSlnOlder();
1849 0 : return var->divSlnOlderNeighbor();
1850 : }
1851 :
1852 : const VariableSecond &
1853 47 : Coupleable::coupledSecond(const std::string & var_name, unsigned int comp) const
1854 : {
1855 47 : const auto * var = getVar(var_name, comp);
1856 47 : if (!var)
1857 : {
1858 34 : _default_second.resize(_coupleable_max_qps);
1859 34 : return _default_second;
1860 : }
1861 13 : checkFuncType(var_name, VarType::Second, FuncAge::Curr);
1862 :
1863 13 : if (!_coupleable_neighbor)
1864 13 : return (_c_is_implicit) ? var->secondSln() : var->secondSlnOlder();
1865 0 : return (_c_is_implicit) ? var->secondSlnNeighbor() : var->secondSlnOlderNeighbor();
1866 : }
1867 :
1868 : const VariableSecond &
1869 0 : Coupleable::coupledSecondOld(const std::string & var_name, unsigned int comp) const
1870 : {
1871 0 : const auto * var = getVar(var_name, comp);
1872 0 : if (!var)
1873 : {
1874 0 : _default_second.resize(_coupleable_max_qps);
1875 0 : return _default_second;
1876 : }
1877 0 : checkFuncType(var_name, VarType::Second, FuncAge::Old);
1878 :
1879 0 : if (!_coupleable_neighbor)
1880 0 : return (_c_is_implicit) ? var->secondSlnOld() : var->secondSlnOlder();
1881 0 : return (_c_is_implicit) ? var->secondSlnOldNeighbor() : var->secondSlnOlderNeighbor();
1882 : }
1883 :
1884 : const VariableSecond &
1885 0 : Coupleable::coupledSecondOlder(const std::string & var_name, unsigned int comp) const
1886 : {
1887 0 : const auto * var = getVar(var_name, comp);
1888 0 : if (!var)
1889 : {
1890 0 : _default_second.resize(_coupleable_max_qps);
1891 0 : return _default_second;
1892 : }
1893 0 : checkFuncType(var_name, VarType::Second, FuncAge::Older);
1894 :
1895 0 : if (!_coupleable_neighbor)
1896 0 : return var->secondSlnOlder();
1897 0 : return var->secondSlnOlderNeighbor();
1898 : }
1899 :
1900 : const VariableSecond &
1901 0 : Coupleable::coupledSecondPreviousNL(const std::string & var_name, unsigned int comp) const
1902 : {
1903 0 : const auto * var = getVar(var_name, comp);
1904 0 : _c_fe_problem.needsPreviousNewtonIteration(true);
1905 0 : if (!var)
1906 : {
1907 0 : _default_second.resize(_coupleable_max_qps);
1908 0 : return _default_second;
1909 : }
1910 0 : checkFuncType(var_name, VarType::Second, FuncAge::Curr);
1911 :
1912 0 : if (!_coupleable_neighbor)
1913 0 : return var->secondSlnPreviousNL();
1914 0 : return var->secondSlnPreviousNLNeighbor();
1915 : }
1916 :
1917 : template <typename T>
1918 : const T &
1919 42 : Coupleable::coupledNodalValue(const std::string & var_name, unsigned int comp) const
1920 : {
1921 42 : const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1922 42 : if (!var)
1923 0 : return getDefaultNodalValue<T>(var_name, comp);
1924 42 : checkFuncType(var_name, VarType::Ignore, FuncAge::Curr);
1925 :
1926 42 : if (!var->isNodal())
1927 3 : mooseError(_c_name,
1928 : ": Trying to get nodal values of variable '",
1929 3 : var->name(),
1930 : "', but it is not nodal.");
1931 :
1932 39 : if (!_coupleable_neighbor)
1933 39 : return (_c_is_implicit) ? var->nodalValue() : var->nodalValueOld();
1934 0 : return (_c_is_implicit) ? var->nodalValueNeighbor() : var->nodalValueOldNeighbor();
1935 : }
1936 :
1937 : template <typename T>
1938 : const T &
1939 3 : Coupleable::coupledNodalValueOld(const std::string & var_name, unsigned int comp) const
1940 : {
1941 3 : const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1942 3 : if (!var)
1943 0 : return getDefaultNodalValue<T>(var_name, comp);
1944 3 : checkFuncType(var_name, VarType::Ignore, FuncAge::Old);
1945 :
1946 3 : if (!var->isNodal())
1947 3 : mooseError(_c_name,
1948 : ": Trying to get old nodal values of variable '",
1949 3 : var->name(),
1950 : "', but it is not nodal.");
1951 :
1952 0 : if (!_coupleable_neighbor)
1953 0 : return (_c_is_implicit) ? var->nodalValueOld() : var->nodalValueOlder();
1954 0 : return (_c_is_implicit) ? var->nodalValueOldNeighbor() : var->nodalValueOlderNeighbor();
1955 : }
1956 :
1957 : template <typename T>
1958 : const T &
1959 3 : Coupleable::coupledNodalValueOlder(const std::string & var_name, unsigned int comp) const
1960 : {
1961 3 : const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1962 3 : if (!var)
1963 0 : return getDefaultNodalValue<T>(var_name, comp);
1964 3 : checkFuncType(var_name, VarType::Ignore, FuncAge::Older);
1965 :
1966 3 : if (!var->isNodal())
1967 3 : mooseError(_c_name,
1968 : ": Trying to get older nodal values of variable '",
1969 3 : var->name(),
1970 : "', but it is not nodal.");
1971 :
1972 0 : if (!_coupleable_neighbor)
1973 0 : return var->nodalValueOlder();
1974 0 : return var->nodalValueOlderNeighbor();
1975 : }
1976 :
1977 : template <typename T>
1978 : const T &
1979 0 : Coupleable::coupledNodalValuePreviousNL(const std::string & var_name, unsigned int comp) const
1980 : {
1981 0 : const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1982 0 : if (!var)
1983 0 : return getDefaultNodalValue<T>(var_name, comp);
1984 0 : checkFuncType(var_name, VarType::Ignore, FuncAge::Curr);
1985 :
1986 0 : _c_fe_problem.needsPreviousNewtonIteration(true);
1987 :
1988 0 : if (!_coupleable_neighbor)
1989 0 : return var->nodalValuePreviousNL();
1990 0 : return var->nodalValuePreviousNLNeighbor();
1991 : }
1992 :
1993 : template <typename T>
1994 : const T &
1995 0 : Coupleable::coupledNodalDot(const std::string & var_name, unsigned int comp) const
1996 : {
1997 0 : static const T zero = 0;
1998 0 : const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
1999 0 : if (!var)
2000 0 : return zero;
2001 0 : checkFuncType(var_name, VarType::Dot, FuncAge::Curr);
2002 :
2003 0 : if (!_coupleable_neighbor)
2004 0 : return var->nodalValueDot();
2005 0 : mooseError("Neighbor version not implemented");
2006 : }
2007 :
2008 : const VariableValue &
2009 0 : Coupleable::coupledNodalDotDot(const std::string & var_name, unsigned int comp) const
2010 : {
2011 0 : const auto * var = getVar(var_name, comp);
2012 0 : if (!var)
2013 : {
2014 0 : _default_value_zero.resize(_coupleable_max_qps, 0);
2015 0 : return _default_value_zero;
2016 : }
2017 0 : checkFuncType(var_name, VarType::Dot, FuncAge::Curr);
2018 :
2019 0 : if (!_coupleable_neighbor)
2020 0 : return var->dofValuesDotDot();
2021 0 : return var->dofValuesDotDotNeighbor();
2022 : }
2023 :
2024 : const VariableValue &
2025 0 : Coupleable::coupledNodalDotOld(const std::string & var_name, unsigned int comp) const
2026 : {
2027 0 : const auto * var = getVar(var_name, comp);
2028 0 : if (!var)
2029 : {
2030 0 : _default_value_zero.resize(_coupleable_max_qps, 0);
2031 0 : return _default_value_zero;
2032 : }
2033 0 : checkFuncType(var_name, VarType::Dot, FuncAge::Old);
2034 :
2035 0 : if (!_coupleable_neighbor)
2036 0 : return var->dofValuesDotOld();
2037 0 : return var->dofValuesDotOldNeighbor();
2038 : }
2039 :
2040 : const VariableValue &
2041 0 : Coupleable::coupledNodalDotDotOld(const std::string & var_name, unsigned int comp) const
2042 : {
2043 0 : const auto * var = getVar(var_name, comp);
2044 0 : if (!var)
2045 : {
2046 0 : _default_value_zero.resize(_coupleable_max_qps, 0);
2047 0 : return _default_value_zero;
2048 : }
2049 0 : checkFuncType(var_name, VarType::Dot, FuncAge::Old);
2050 :
2051 0 : if (!_coupleable_neighbor)
2052 0 : return var->dofValuesDotDotOld();
2053 0 : return var->dofValuesDotDotOldNeighbor();
2054 : }
2055 :
2056 : const VariableValue &
2057 155 : Coupleable::coupledDofValues(const std::string & var_name, unsigned int comp) const
2058 : {
2059 155 : const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2060 155 : if (!var)
2061 0 : return *getDefaultValue(var_name, comp);
2062 155 : checkFuncType(var_name, VarType::Ignore, FuncAge::Curr);
2063 :
2064 155 : if (!_coupleable_neighbor)
2065 142 : return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
2066 13 : return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
2067 : }
2068 :
2069 : std::vector<const VariableValue *>
2070 32 : Coupleable::coupledAllDofValues(const std::string & var_name) const
2071 : {
2072 64 : auto func = [this, &var_name](unsigned int comp) { return &coupledDofValues(var_name, comp); };
2073 32 : checkFuncType(var_name, VarType::Ignore, FuncAge::Curr);
2074 64 : return coupledVectorHelper<const VariableValue *>(var_name, func);
2075 : }
2076 :
2077 : const VariableValue &
2078 13 : Coupleable::coupledDofValuesOld(const std::string & var_name, unsigned int comp) const
2079 : {
2080 13 : const auto * var = getVar(var_name, comp);
2081 13 : if (!var)
2082 0 : return *getDefaultValue(var_name, comp);
2083 13 : checkFuncType(var_name, VarType::Ignore, FuncAge::Old);
2084 :
2085 13 : if (!_coupleable_neighbor)
2086 13 : return (_c_is_implicit) ? var->dofValuesOld() : var->dofValuesOlder();
2087 0 : return (_c_is_implicit) ? var->dofValuesOldNeighbor() : var->dofValuesOlderNeighbor();
2088 : }
2089 :
2090 : std::vector<const VariableValue *>
2091 0 : Coupleable::coupledAllDofValuesOld(const std::string & var_name) const
2092 : {
2093 0 : auto func = [this, &var_name](unsigned int comp) { return &coupledDofValuesOld(var_name, comp); };
2094 0 : return coupledVectorHelper<const VariableValue *>(var_name, func);
2095 : }
2096 :
2097 : const VariableValue &
2098 0 : Coupleable::coupledDofValuesOlder(const std::string & var_name, unsigned int comp) const
2099 : {
2100 0 : const auto * var = getVar(var_name, comp);
2101 0 : if (!var)
2102 0 : return *getDefaultValue(var_name, comp);
2103 0 : checkFuncType(var_name, VarType::Ignore, FuncAge::Older);
2104 :
2105 0 : if (!_coupleable_neighbor)
2106 0 : return var->dofValuesOlder();
2107 0 : return var->dofValuesOlderNeighbor();
2108 : }
2109 :
2110 : std::vector<const VariableValue *>
2111 0 : Coupleable::coupledAllDofValuesOlder(const std::string & var_name) const
2112 : {
2113 0 : auto func = [this, &var_name](unsigned int comp)
2114 0 : { return &coupledDofValuesOlder(var_name, comp); };
2115 0 : return coupledVectorHelper<const VariableValue *>(var_name, func);
2116 : }
2117 :
2118 : const ArrayVariableValue &
2119 0 : Coupleable::coupledArrayDofValues(const std::string & var_name, unsigned int comp) const
2120 : {
2121 0 : const auto * var = getArrayVar(var_name, comp);
2122 0 : if (!var)
2123 0 : return *getDefaultArrayValue(var_name);
2124 0 : checkFuncType(var_name, VarType::Ignore, FuncAge::Curr);
2125 :
2126 0 : if (!_coupleable_neighbor)
2127 0 : return (_c_is_implicit) ? var->dofValues() : var->dofValuesOld();
2128 0 : return (_c_is_implicit) ? var->dofValuesNeighbor() : var->dofValuesOldNeighbor();
2129 : }
2130 :
2131 : const ADVariableValue &
2132 0 : Coupleable::adCoupledDofValues(const std::string & var_name, unsigned int comp) const
2133 : {
2134 0 : const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2135 :
2136 0 : if (!var)
2137 0 : return *getADDefaultValue(var_name);
2138 0 : checkFuncType(var_name, VarType::Ignore, FuncAge::Curr);
2139 :
2140 0 : if (!_c_is_implicit)
2141 0 : mooseError("Not implemented");
2142 :
2143 0 : if (!_coupleable_neighbor)
2144 0 : return var->adDofValues();
2145 0 : return var->adDofValuesNeighbor();
2146 : }
2147 :
2148 : void
2149 24025 : Coupleable::validateExecutionerType(const std::string & name, const std::string & fn_name) const
2150 : {
2151 24025 : if (!_c_fe_problem.isTransient())
2152 6 : mooseError(_c_name,
2153 : ": Calling \"",
2154 : fn_name,
2155 : "\" on variable \"",
2156 : name,
2157 : "\" when using a \"Steady\" executioner is not allowed. This value is available "
2158 : "only in transient simulations.");
2159 24019 : }
2160 :
2161 : template <typename T>
2162 : const typename Moose::ADType<T>::type &
2163 21 : Coupleable::adCoupledNodalValue(const std::string & var_name, unsigned int comp) const
2164 : {
2165 21 : static const typename Moose::ADType<T>::type zero = 0;
2166 21 : if (!isCoupled(var_name))
2167 0 : return zero;
2168 :
2169 21 : if (!_c_nodal)
2170 0 : mooseError("The adCoupledNodalValue method should only be called for nodal computing objects");
2171 21 : if (_coupleable_neighbor)
2172 0 : mooseError(
2173 : "The adCoupledNodalValue method shouldn't be called for neighbor computing objects. I "
2174 : "don't even know what that would mean, although maybe someone could explain it to me.");
2175 21 : if (!_c_is_implicit)
2176 0 : mooseError("If you're going to use an explicit scheme, then use coupledNodalValue instead of "
2177 : "adCoupledNodalValue");
2178 :
2179 21 : const auto * var = getVarHelper<MooseVariableFE<T>>(var_name, comp);
2180 :
2181 21 : return var->adNodalValue();
2182 : }
2183 :
2184 : const ADVariableValue &
2185 3408 : Coupleable::adCoupledValue(const std::string & var_name, unsigned int comp) const
2186 : {
2187 3408 : const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2188 :
2189 3408 : if (!var)
2190 204 : return *getADDefaultValue(var_name);
2191 3204 : checkFuncType(var_name, VarType::Ignore, FuncAge::Curr);
2192 :
2193 3204 : if (!_c_is_implicit)
2194 0 : mooseError("Not implemented");
2195 :
2196 3204 : if (_c_nodal)
2197 121 : return var->adDofValues();
2198 :
2199 3083 : if (!_coupleable_neighbor)
2200 2230 : return var->adSln();
2201 853 : return var->adSlnNeighbor();
2202 : }
2203 :
2204 : const ADVariableValue &
2205 26 : Coupleable::adCoupledLowerValue(const std::string & var_name, unsigned int comp) const
2206 : {
2207 26 : auto var = getVarHelper<MooseVariableFE<Real>>(var_name, comp);
2208 :
2209 26 : if (!var)
2210 0 : return *getADDefaultValue(var_name);
2211 26 : checkFuncType(var_name, VarType::Ignore, FuncAge::Curr);
2212 :
2213 26 : if (!_c_is_implicit)
2214 0 : mooseError("adCoupledLowerValue cannot be called in a coupleable neighbor object");
2215 :
2216 26 : if (_c_nodal)
2217 0 : return var->adDofValues();
2218 : else
2219 26 : return var->adSlnLower();
2220 : }
2221 :
2222 : const ADVariableGradient &
2223 339 : Coupleable::adCoupledGradient(const std::string & var_name, unsigned int comp) const
2224 : {
2225 339 : const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2226 :
2227 339 : if (!var)
2228 0 : return getADDefaultGradient();
2229 339 : checkFuncType(var_name, VarType::Gradient, FuncAge::Curr);
2230 :
2231 339 : if (!_c_is_implicit)
2232 0 : mooseError("Not implemented");
2233 :
2234 339 : if (!_coupleable_neighbor)
2235 248 : return var->adGradSln();
2236 91 : return var->adGradSlnNeighbor();
2237 : }
2238 :
2239 : const ADVariableGradient &
2240 0 : Coupleable::adCoupledGradientDot(const std::string & var_name, unsigned int comp) const
2241 : {
2242 0 : const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2243 :
2244 0 : if (!var)
2245 0 : return getADDefaultGradient();
2246 0 : checkFuncType(var_name, VarType::GradientDot, FuncAge::Curr);
2247 :
2248 0 : if (!_c_is_implicit)
2249 0 : mooseError("Not implemented");
2250 :
2251 0 : if (!_coupleable_neighbor)
2252 0 : return var->adGradSlnDot();
2253 0 : return var->adGradSlnNeighborDot();
2254 : }
2255 :
2256 : const ADVariableSecond &
2257 0 : Coupleable::adCoupledSecond(const std::string & var_name, unsigned int comp) const
2258 : {
2259 0 : const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2260 :
2261 0 : if (!var)
2262 0 : return getADDefaultSecond();
2263 0 : checkFuncType(var_name, VarType::Second, FuncAge::Curr);
2264 :
2265 0 : if (!_c_is_implicit)
2266 0 : mooseError("Not implemented");
2267 :
2268 0 : if (!_coupleable_neighbor)
2269 0 : return var->adSecondSln();
2270 : else
2271 0 : return var->adSecondSlnNeighbor();
2272 : }
2273 :
2274 : const ADVectorVariableSecond &
2275 0 : adCoupledVectorSecond(const std::string & /*var_name*/, unsigned int /*comp = 0*/)
2276 : {
2277 0 : mooseError("Automatic differentiation using second derivatives of vector variables is not "
2278 : "implemented.");
2279 : }
2280 :
2281 : const ADVariableValue &
2282 91 : Coupleable::adCoupledDot(const std::string & var_name, unsigned int comp) const
2283 : {
2284 91 : const auto * var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2285 :
2286 91 : if (!var)
2287 0 : return *getADDefaultValue(var_name);
2288 91 : checkFuncType(var_name, VarType::Dot, FuncAge::Curr);
2289 :
2290 91 : if (!_coupleable_neighbor)
2291 : {
2292 78 : if (_c_nodal)
2293 13 : return var->adDofValuesDot();
2294 65 : return var->adUDot();
2295 : }
2296 : else
2297 : {
2298 13 : if (_c_nodal)
2299 0 : mooseError("AD neighbor nodal dof dot not implemented");
2300 13 : return var->adUDotNeighbor();
2301 : }
2302 : }
2303 :
2304 : const ADVariableValue &
2305 65 : Coupleable::adCoupledDotDot(const std::string & var_name, unsigned int comp) const
2306 : {
2307 65 : const auto * const var = getVarHelper<MooseVariableField<Real>>(var_name, comp);
2308 :
2309 65 : if (!var)
2310 0 : return *getADDefaultValue(var_name);
2311 65 : checkFuncType(var_name, VarType::Dot, FuncAge::Curr);
2312 :
2313 65 : if (_c_nodal)
2314 0 : mooseError("Not implemented");
2315 :
2316 65 : if (!_coupleable_neighbor)
2317 52 : return var->adUDotDot();
2318 13 : return var->adUDotDotNeighbor();
2319 : }
2320 :
2321 : const ADVectorVariableValue &
2322 0 : Coupleable::adCoupledVectorDot(const std::string & var_name, unsigned int comp) const
2323 : {
2324 0 : const auto * var = getVectorVar(var_name, comp);
2325 0 : if (!var)
2326 0 : return *getADDefaultVectorValue(var_name);
2327 0 : checkFuncType(var_name, VarType::Dot, FuncAge::Curr);
2328 :
2329 0 : if (_c_nodal)
2330 0 : mooseError("Not implemented");
2331 :
2332 0 : if (!_coupleable_neighbor)
2333 0 : return var->adUDot();
2334 0 : return var->adUDotNeighbor();
2335 : }
2336 :
2337 : const ADVectorVariableValue &
2338 153 : Coupleable::adCoupledVectorValue(const std::string & var_name, unsigned int comp) const
2339 : {
2340 153 : const auto * var = getVectorVar(var_name, comp);
2341 153 : if (!var)
2342 26 : return *getADDefaultVectorValue(var_name);
2343 127 : checkFuncType(var_name, VarType::Ignore, FuncAge::Curr);
2344 :
2345 127 : if (_c_nodal)
2346 0 : mooseError("Not implemented");
2347 127 : if (!_c_is_implicit)
2348 0 : mooseError("Not implemented");
2349 :
2350 127 : if (!_coupleable_neighbor)
2351 101 : return var->adSln();
2352 26 : return var->adSlnNeighbor();
2353 : }
2354 :
2355 : const ADVectorVariableGradient &
2356 39 : Coupleable::adCoupledVectorGradient(const std::string & var_name, unsigned int comp) const
2357 : {
2358 39 : const auto * var = getVectorVar(var_name, comp);
2359 39 : if (!var)
2360 13 : return getADDefaultVectorGradient();
2361 26 : checkFuncType(var_name, VarType::Gradient, FuncAge::Curr);
2362 :
2363 26 : if (!_c_is_implicit)
2364 0 : mooseError("Not implemented");
2365 :
2366 26 : if (!_coupleable_neighbor)
2367 26 : return var->adGradSln();
2368 0 : return var->adGradSlnNeighbor();
2369 : }
2370 :
2371 : const ADVariableValue *
2372 204 : Coupleable::getADDefaultValue(const std::string & var_name) const
2373 : {
2374 204 : auto default_value_it = _ad_default_value.find(var_name);
2375 204 : if (default_value_it == _ad_default_value.end())
2376 : {
2377 204 : auto value = std::make_unique<ADVariableValue>(_coupleable_max_qps,
2378 204 : _c_parameters.defaultCoupledValue(var_name));
2379 204 : default_value_it = _ad_default_value.insert(std::make_pair(var_name, std::move(value))).first;
2380 204 : }
2381 :
2382 408 : return default_value_it->second.get();
2383 : }
2384 :
2385 : const ADVectorVariableValue *
2386 26 : Coupleable::getADDefaultVectorValue(const std::string & var_name) const
2387 : {
2388 26 : auto default_value_it = _ad_default_vector_value.find(var_name);
2389 26 : if (default_value_it == _ad_default_vector_value.end())
2390 : {
2391 26 : RealVectorValue default_vec;
2392 91 : for (unsigned int i = 0; i < _c_parameters.numberDefaultCoupledValues(var_name); ++i)
2393 65 : default_vec(i) = _c_parameters.defaultCoupledValue(var_name, i);
2394 26 : auto value = std::make_unique<ADVectorVariableValue>(_coupleable_max_qps, default_vec);
2395 26 : default_value_it =
2396 26 : _ad_default_vector_value.insert(std::make_pair(var_name, std::move(value))).first;
2397 26 : }
2398 :
2399 52 : return default_value_it->second.get();
2400 : }
2401 :
2402 : const ADVariableGradient &
2403 0 : Coupleable::getADDefaultGradient() const
2404 : {
2405 0 : _ad_default_gradient.resize(_coupleable_max_qps);
2406 0 : return _ad_default_gradient;
2407 : }
2408 :
2409 : const ADVectorVariableGradient &
2410 13 : Coupleable::getADDefaultVectorGradient() const
2411 : {
2412 13 : _ad_default_vector_gradient.resize(_coupleable_max_qps);
2413 13 : return _ad_default_vector_gradient;
2414 : }
2415 :
2416 : const ADVariableSecond &
2417 0 : Coupleable::getADDefaultSecond() const
2418 : {
2419 0 : _ad_default_second.resize(_coupleable_max_qps);
2420 0 : return _ad_default_second;
2421 : }
2422 :
2423 : const ADVectorVariableCurl &
2424 0 : Coupleable::getADDefaultCurl() const
2425 : {
2426 0 : _ad_default_curl.resize(_coupleable_max_qps);
2427 0 : return _ad_default_curl;
2428 : }
2429 :
2430 : const ADVariableValue &
2431 0 : Coupleable::adZeroValue() const
2432 : {
2433 0 : mooseDeprecated("Method adZeroValue() is deprecated. Use '_ad_zero' instead.");
2434 0 : return _ad_zero;
2435 : }
2436 :
2437 : const ADVariableGradient &
2438 0 : Coupleable::adZeroGradient() const
2439 : {
2440 0 : mooseDeprecated("Method adZeroGradient() is deprecated. Use '_ad_grad_zero' instead.");
2441 0 : return _ad_grad_zero;
2442 : }
2443 :
2444 : const ADVariableSecond &
2445 0 : Coupleable::adZeroSecond() const
2446 : {
2447 0 : mooseDeprecated("Method adZeroSecond() is deprecated. Use '_ad_second_zero' instead.");
2448 0 : return _ad_second_zero;
2449 : }
2450 :
2451 : template <>
2452 : const GenericVariableValue<false> &
2453 255 : Coupleable::genericZeroValue<false>()
2454 : {
2455 255 : return _zero;
2456 : }
2457 :
2458 : template <>
2459 : const GenericVariableValue<true> &
2460 216 : Coupleable::genericZeroValue<true>()
2461 : {
2462 216 : return _ad_zero;
2463 : }
2464 :
2465 : template <>
2466 : const GenericVariableGradient<false> &
2467 0 : Coupleable::genericZeroGradient<false>()
2468 : {
2469 0 : return _grad_zero;
2470 : }
2471 :
2472 : template <>
2473 : const GenericVariableGradient<true> &
2474 0 : Coupleable::genericZeroGradient<true>()
2475 : {
2476 0 : return _ad_grad_zero;
2477 : }
2478 :
2479 : template <>
2480 : const GenericVariableSecond<false> &
2481 0 : Coupleable::genericZeroSecond<false>()
2482 : {
2483 0 : return _second_zero;
2484 : }
2485 :
2486 : template <>
2487 : const GenericVariableSecond<true> &
2488 0 : Coupleable::genericZeroSecond<true>()
2489 : {
2490 0 : return _ad_second_zero;
2491 : }
2492 :
2493 : template <>
2494 : const GenericVariableGradient<false> &
2495 88 : Coupleable::coupledGenericGradient<false>(const std::string & var_name, unsigned int comp) const
2496 : {
2497 88 : return coupledGradient(var_name, comp);
2498 : }
2499 :
2500 : template <>
2501 : const GenericVariableGradient<true> &
2502 117 : Coupleable::coupledGenericGradient<true>(const std::string & var_name, unsigned int comp) const
2503 : {
2504 117 : return adCoupledGradient(var_name, comp);
2505 : }
2506 :
2507 : std::vector<unsigned int>
2508 73 : Coupleable::coupledIndices(const std::string & var_name) const
2509 : {
2510 129 : auto func = [this, &var_name](unsigned int comp) { return coupled(var_name, comp); };
2511 146 : return coupledVectorHelper<unsigned int>(var_name, func);
2512 : }
2513 :
2514 : VariableName
2515 5291 : Coupleable::coupledName(const std::string & var_name, unsigned int comp) const
2516 : {
2517 5291 : if (getFieldVar(var_name, comp))
2518 5288 : return getFieldVar(var_name, comp)->name();
2519 : // Detect if we are in the case where a constant was passed in lieu of a variable
2520 3 : else if (isCoupledConstant(var_name))
2521 3 : mooseError(_c_name,
2522 : ": a variable name was queried but a constant was passed for parameter '",
2523 : var_name,
2524 : "Either pass a true variable or contact a developer to shield the call to "
2525 : "'coupledName' with 'isCoupledConstant'");
2526 : else
2527 0 : mooseError(
2528 0 : _c_name, ": Variable '", var_name, "' does not exist, yet its coupled name is requested");
2529 : }
2530 :
2531 : std::vector<VariableName>
2532 231 : Coupleable::coupledNames(const std::string & var_name) const
2533 : {
2534 163 : auto func = [this, &var_name](unsigned int comp) { return coupledName(var_name, comp); };
2535 462 : return coupledVectorHelper<VariableName>(var_name, func);
2536 : }
2537 :
2538 : std::vector<const VariableValue *>
2539 1883 : Coupleable::coupledValues(const std::string & var_name) const
2540 : {
2541 1433 : auto func = [this, &var_name](unsigned int comp) { return &coupledValue(var_name, comp); };
2542 3766 : return coupledVectorHelper<const VariableValue *>(var_name, func);
2543 : }
2544 :
2545 : std::vector<const VectorVariableValue *>
2546 39 : Coupleable::coupledVectorValues(const std::string & var_name) const
2547 : {
2548 52 : auto func = [this, &var_name](unsigned int comp) { return &coupledVectorValue(var_name, comp); };
2549 78 : return coupledVectorHelper<const VectorVariableValue *>(var_name, func);
2550 : }
2551 :
2552 : template <>
2553 : std::vector<const GenericVariableValue<false> *>
2554 84 : Coupleable::coupledGenericValues<false>(const std::string & var_name) const
2555 : {
2556 84 : return coupledValues(var_name);
2557 : }
2558 :
2559 : template <>
2560 : std::vector<const GenericVariableValue<true> *>
2561 60 : Coupleable::coupledGenericValues<true>(const std::string & var_name) const
2562 : {
2563 60 : return adCoupledValues(var_name);
2564 : }
2565 :
2566 : std::vector<const ADVariableValue *>
2567 60 : Coupleable::adCoupledValues(const std::string & var_name) const
2568 : {
2569 60 : auto func = [this, &var_name](unsigned int comp) { return &adCoupledValue(var_name, comp); };
2570 120 : return coupledVectorHelper<const ADVariableValue *>(var_name, func);
2571 : }
2572 :
2573 : std::vector<const ADVectorVariableValue *>
2574 0 : Coupleable::adCoupledVectorValues(const std::string & var_name) const
2575 : {
2576 0 : auto func = [this, &var_name](unsigned int comp)
2577 0 : { return &adCoupledVectorValue(var_name, comp); };
2578 0 : return coupledVectorHelper<const ADVectorVariableValue *>(var_name, func);
2579 : }
2580 :
2581 : std::vector<const VariableValue *>
2582 13 : Coupleable::coupledVectorTagValues(const std::string & var_names, TagID tag) const
2583 : {
2584 13 : auto func = [this, &var_names, &tag](unsigned int comp)
2585 13 : { return &coupledVectorTagValue(var_names, tag, comp); };
2586 26 : return coupledVectorHelper<const VariableValue *>(var_names, func);
2587 : }
2588 :
2589 : std::vector<const VariableValue *>
2590 13 : Coupleable::coupledVectorTagValues(const std::string & var_names,
2591 : const std::string & tag_name) const
2592 : {
2593 13 : if (!_c_parameters.isParamValid(tag_name))
2594 0 : mooseError("Tag name parameter '", tag_name, "' is invalid");
2595 :
2596 13 : TagName tagname = _c_parameters.get<TagName>(tag_name);
2597 13 : if (!_c_fe_problem.vectorTagExists(tagname))
2598 0 : mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2599 :
2600 13 : TagID tag = _c_fe_problem.getVectorTagID(tagname);
2601 26 : return coupledVectorTagValues(var_names, tag);
2602 13 : }
2603 :
2604 : std::vector<const ArrayVariableValue *>
2605 0 : Coupleable::coupledVectorTagArrayValues(const std::string & var_names, TagID tag) const
2606 : {
2607 0 : auto func = [this, &var_names, &tag](unsigned int index)
2608 0 : { return &coupledVectorTagArrayValue(var_names, tag, index); };
2609 0 : return coupledVectorHelper<const ArrayVariableValue *>(var_names, func);
2610 : }
2611 :
2612 : std::vector<const ArrayVariableValue *>
2613 0 : Coupleable::coupledVectorTagArrayValues(const std::string & var_names,
2614 : const std::string & tag_name) const
2615 : {
2616 0 : if (!_c_parameters.isParamValid(tag_name))
2617 0 : mooseError("Tag name parameter '", tag_name, "' is invalid");
2618 :
2619 0 : TagName tagname = _c_parameters.get<TagName>(tag_name);
2620 0 : if (!_c_fe_problem.vectorTagExists(tagname))
2621 0 : mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2622 :
2623 0 : TagID tag = _c_fe_problem.getVectorTagID(tagname);
2624 0 : return coupledVectorTagArrayValues(var_names, tag);
2625 0 : }
2626 :
2627 : std::vector<const VariableGradient *>
2628 0 : Coupleable::coupledVectorTagGradients(const std::string & var_names, TagID tag) const
2629 : {
2630 0 : auto func = [this, &var_names, &tag](unsigned int index)
2631 0 : { return &coupledVectorTagGradient(var_names, tag, index); };
2632 0 : return coupledVectorHelper<const VariableGradient *>(var_names, func);
2633 : }
2634 :
2635 : std::vector<const VariableGradient *>
2636 0 : Coupleable::coupledVectorTagGradients(const std::string & var_names,
2637 : const std::string & tag_name) const
2638 : {
2639 0 : if (!_c_parameters.isParamValid(tag_name))
2640 0 : mooseError("Tag name parameter '", tag_name, "' is invalid");
2641 :
2642 0 : TagName tagname = _c_parameters.get<TagName>(tag_name);
2643 0 : if (!_c_fe_problem.vectorTagExists(tagname))
2644 0 : mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2645 :
2646 0 : TagID tag = _c_fe_problem.getVectorTagID(tagname);
2647 0 : return coupledVectorTagGradients(var_names, tag);
2648 0 : }
2649 :
2650 : std::vector<const ArrayVariableGradient *>
2651 0 : Coupleable::coupledVectorTagArrayGradients(const std::string & var_names, TagID tag) const
2652 : {
2653 0 : auto func = [this, &var_names, &tag](unsigned int index)
2654 0 : { return &coupledVectorTagArrayGradient(var_names, tag, index); };
2655 0 : return coupledVectorHelper<const ArrayVariableGradient *>(var_names, func);
2656 : }
2657 :
2658 : std::vector<const ArrayVariableGradient *>
2659 0 : Coupleable::coupledVectorTagArrayGradients(const std::string & var_names,
2660 : const std::string & tag_name) const
2661 : {
2662 0 : if (!_c_parameters.isParamValid(tag_name))
2663 0 : mooseError("Tag name parameter '", tag_name, "' is invalid");
2664 :
2665 0 : TagName tagname = _c_parameters.get<TagName>(tag_name);
2666 0 : if (!_c_fe_problem.vectorTagExists(tagname))
2667 0 : mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2668 :
2669 0 : TagID tag = _c_fe_problem.getVectorTagID(tagname);
2670 0 : return coupledVectorTagArrayGradients(var_names, tag);
2671 0 : }
2672 :
2673 : std::vector<const VariableValue *>
2674 0 : Coupleable::coupledVectorTagDofValues(const std::string & var_names, TagID tag) const
2675 : {
2676 0 : auto func = [this, &var_names, &tag](unsigned int comp)
2677 0 : { return &coupledVectorTagDofValue(var_names, tag, comp); };
2678 0 : return coupledVectorHelper<const VariableValue *>(var_names, func);
2679 : }
2680 :
2681 : std::vector<const VariableValue *>
2682 0 : Coupleable::coupledVectorTagDofValues(const std::string & var_names,
2683 : const std::string & tag_name) const
2684 : {
2685 0 : if (!_c_parameters.isParamValid(tag_name))
2686 0 : mooseError("Tag name parameter '", tag_name, "' is invalid");
2687 :
2688 0 : TagName tagname = _c_parameters.get<TagName>(tag_name);
2689 0 : if (!_c_fe_problem.vectorTagExists(tagname))
2690 0 : mooseError("Tagged vector with tag name '", tagname, "' does not exist");
2691 :
2692 0 : TagID tag = _c_fe_problem.getVectorTagID(tagname);
2693 0 : return coupledVectorTagDofValues(var_names, tag);
2694 0 : }
2695 :
2696 : std::vector<const VariableValue *>
2697 0 : Coupleable::coupledMatrixTagValues(const std::string & var_names, TagID tag) const
2698 : {
2699 0 : auto func = [this, &var_names, &tag](unsigned int comp)
2700 0 : { return &coupledMatrixTagValue(var_names, tag, comp); };
2701 0 : return coupledVectorHelper<const VariableValue *>(var_names, func);
2702 : }
2703 :
2704 : std::vector<const VariableValue *>
2705 0 : Coupleable::coupledMatrixTagValues(const std::string & var_names,
2706 : const std::string & tag_name) const
2707 : {
2708 0 : if (!_c_parameters.isParamValid(tag_name))
2709 0 : mooseError("Tag name parameter '", tag_name, "' is invalid");
2710 :
2711 0 : TagName tagname = _c_parameters.get<TagName>(tag_name);
2712 0 : if (!_c_fe_problem.matrixTagExists(tagname))
2713 0 : mooseError("Matrix tag name '", tagname, "' does not exist");
2714 :
2715 0 : TagID tag = _c_fe_problem.getMatrixTagID(tagname);
2716 0 : return coupledMatrixTagValues(var_names, tag);
2717 0 : }
2718 :
2719 : std::vector<const VariableValue *>
2720 468 : Coupleable::coupledValuesOld(const std::string & var_name) const
2721 : {
2722 10998 : auto func = [this, &var_name](unsigned int comp) { return &coupledValueOld(var_name, comp); };
2723 936 : return coupledVectorHelper<const VariableValue *>(var_name, func);
2724 : }
2725 :
2726 : std::vector<const VariableValue *>
2727 468 : Coupleable::coupledValuesOlder(const std::string & var_name) const
2728 : {
2729 10998 : auto func = [this, &var_name](unsigned int comp) { return &coupledValueOlder(var_name, comp); };
2730 936 : return coupledVectorHelper<const VariableValue *>(var_name, func);
2731 : }
2732 :
2733 : std::vector<const VectorVariableValue *>
2734 26 : Coupleable::coupledVectorValuesOld(const std::string & var_name) const
2735 : {
2736 52 : auto func = [this, &var_name](unsigned int comp)
2737 52 : { return &coupledVectorValueOld(var_name, comp); };
2738 52 : return coupledVectorHelper<const VectorVariableValue *>(var_name, func);
2739 : }
2740 :
2741 : std::vector<const VariableGradient *>
2742 0 : Coupleable::coupledGradients(const std::string & var_name) const
2743 : {
2744 0 : auto func = [this, &var_name](unsigned int comp) { return &coupledGradient(var_name, comp); };
2745 0 : return coupledVectorHelper<const VariableGradient *>(var_name, func);
2746 : }
2747 :
2748 : template <>
2749 : std::vector<const GenericVariableGradient<false> *>
2750 0 : Coupleable::coupledGenericGradients<false>(const std::string & var_name) const
2751 : {
2752 0 : return coupledGradients(var_name);
2753 : }
2754 :
2755 : template <>
2756 : std::vector<const GenericVariableGradient<true> *>
2757 0 : Coupleable::coupledGenericGradients<true>(const std::string & var_name) const
2758 : {
2759 0 : auto func = [this, &var_name](unsigned int comp) { return &adCoupledGradient(var_name, comp); };
2760 0 : return coupledVectorHelper<const GenericVariableGradient<true> *>(var_name, func);
2761 : }
2762 :
2763 : std::vector<const ADVariableGradient *>
2764 0 : Coupleable::adCoupledGradients(const std::string & var_name) const
2765 : {
2766 0 : auto func = [this, &var_name](unsigned int comp) { return &adCoupledGradient(var_name, comp); };
2767 0 : return coupledVectorHelper<const ADVariableGradient *>(var_name, func);
2768 : }
2769 :
2770 : std::vector<const VariableGradient *>
2771 0 : Coupleable::coupledGradientsOld(const std::string & var_name) const
2772 : {
2773 0 : auto func = [this, &var_name](unsigned int comp) { return &coupledGradientOld(var_name, comp); };
2774 0 : return coupledVectorHelper<const VariableGradient *>(var_name, func);
2775 : }
2776 :
2777 : std::vector<const VariableValue *>
2778 0 : Coupleable::coupledDots(const std::string & var_name) const
2779 : {
2780 0 : auto func = [this, &var_name](unsigned int comp) { return &coupledDot(var_name, comp); };
2781 0 : return coupledVectorHelper<const VariableValue *>(var_name, func);
2782 : }
2783 :
2784 : std::vector<const ADVariableValue *>
2785 0 : Coupleable::adCoupledDots(const std::string & var_name) const
2786 : {
2787 0 : auto func = [this, &var_name](unsigned int comp) { return &adCoupledDot(var_name, comp); };
2788 0 : return coupledVectorHelper<const ADVariableValue *>(var_name, func);
2789 : }
2790 :
2791 : template <>
2792 : const GenericVariableValue<false> &
2793 146 : Coupleable::coupledGenericDot<false>(const std::string & var_name, unsigned int comp) const
2794 : {
2795 146 : return coupledDot(var_name, comp);
2796 : }
2797 :
2798 : template <>
2799 : const GenericVariableValue<true> &
2800 52 : Coupleable::coupledGenericDot<true>(const std::string & var_name, unsigned int comp) const
2801 : {
2802 52 : return adCoupledDot(var_name, comp);
2803 : }
2804 :
2805 : // Explicit instantiations
2806 :
2807 : template const Real & Coupleable::getDefaultNodalValue<Real>(const std::string & var_name,
2808 : unsigned int comp) const;
2809 :
2810 : template const Real & Coupleable::coupledNodalValue<Real>(const std::string & var_name,
2811 : unsigned int comp) const;
2812 : template const ADReal & Coupleable::adCoupledNodalValue<Real>(const std::string & var_name,
2813 : unsigned int comp) const;
2814 : template const ADRealVectorValue &
2815 : Coupleable::adCoupledNodalValue<RealVectorValue>(const std::string & var_name,
2816 : unsigned int comp) const;
2817 :
2818 : template const RealVectorValue &
2819 : Coupleable::coupledNodalValue<RealVectorValue>(const std::string & var_name,
2820 : unsigned int comp) const;
2821 : template const Real & Coupleable::coupledNodalValueOld<Real>(const std::string & var_name,
2822 : unsigned int comp) const;
2823 : template const RealVectorValue &
2824 : Coupleable::coupledNodalValueOld<RealVectorValue>(const std::string & var_name,
2825 : unsigned int comp) const;
2826 : template const Real & Coupleable::coupledNodalValueOlder<Real>(const std::string & var_name,
2827 : unsigned int comp) const;
2828 : template const RealVectorValue &
2829 : Coupleable::coupledNodalValueOlder<RealVectorValue>(const std::string & var_name,
2830 : unsigned int comp) const;
2831 : template const Real & Coupleable::coupledNodalValuePreviousNL<Real>(const std::string & var_name,
2832 : unsigned int comp) const;
2833 : template const RealVectorValue &
2834 : Coupleable::coupledNodalValuePreviousNL<RealVectorValue>(const std::string & var_name,
2835 : unsigned int comp) const;
2836 : template const Real & Coupleable::coupledNodalDot<Real>(const std::string & var_name,
2837 : unsigned int comp) const;
2838 : template const RealVectorValue &
2839 : Coupleable::coupledNodalDot<RealVectorValue>(const std::string & var_name, unsigned int comp) const;
|