https://mooseframework.inl.gov
MooseVariableScalar.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "MooseVariableScalar.h"
11 #include "SubProblem.h"
12 #include "SystemBase.h"
13 #include "Assembly.h"
14 #include "SystemBase.h"
15 
16 // libMesh
17 #include "libmesh/numeric_vector.h"
18 #include "libmesh/dof_map.h"
19 
20 #include <limits>
21 
23 
26 {
27  auto params = MooseVariableBase::validParams();
28  params.addClassDescription("Moose wrapper class around scalar variables");
29  params.set<MooseEnum>("family") = "SCALAR";
30  return params;
31 }
32 
34  : MooseVariableBase(parameters),
35  Moose::FunctorBase<ADReal>(name()),
36  _need_u_dot(false),
37  _need_u_dotdot(false),
38  _need_u_dot_old(false),
39  _need_u_dotdot_old(false),
40  _need_du_dot_du(false),
41  _need_du_dotdot_du(false),
42  _need_u_old(false),
43  _need_u_older(false),
44  _need_ad(false),
45  _need_ad_u(false),
46  _need_ad_u_dot(false)
47 {
48  auto num_vector_tags = _sys.subproblem().numVectorTags();
49 
50  _vector_tag_u.resize(num_vector_tags);
51  _need_vector_tag_u.resize(num_vector_tags);
52 }
53 
54 void
56 {
57  auto num_matrix_tags = _sys.subproblem().numMatrixTags();
58 
59  _matrix_tag_u.resize(num_matrix_tags);
60  _need_matrix_tag_u.resize(num_matrix_tags);
61 }
62 
64 {
65  _u.release();
66  _u_old.release();
67  _u_older.release();
68 
69  _u_dot.release();
70  _u_dotdot.release();
71  _u_dot_old.release();
72  _u_dotdot_old.release();
73  _du_dot_du.release();
74  _du_dotdot_du.release();
75 
76  for (auto & _tag_u : _vector_tag_u)
77  _tag_u.release();
78 
79  _vector_tag_u.clear();
80 
81  for (auto & _tag_u : _matrix_tag_u)
82  _tag_u.release();
83 
84  _matrix_tag_u.clear();
85 }
86 
87 void
88 MooseVariableScalar::reinit(bool reinit_for_derivative_reordering /* = false*/)
89 {
90  if (reinit_for_derivative_reordering)
91  {
92  // We've already calculated everything in an earlier reinit. All we have to do is re-sort the
93  // derivative vector for AD calculations
94  if (_need_ad)
95  computeAD(/*nodal_ordering=*/true);
96  return;
97  }
98 
99  // We want to make sure that we're not allocating data with any of the
100  // accessors that follow, but _sys is non-const
101  const SystemBase & sys = _sys;
102 
103  const NumericVector<Real> & current_solution = *sys.currentSolution();
104  const NumericVector<Real> * u_dot = sys.solutionUDot();
105  const NumericVector<Real> * u_dotdot = sys.solutionUDotDot();
106  const NumericVector<Real> * u_dot_old = sys.solutionUDotOld();
107  const NumericVector<Real> * u_dotdot_old = sys.solutionUDotDotOld();
108  const Real & du_dot_du = sys.duDotDu(number());
109  const Real & du_dotdot_du = sys.duDotDotDu();
110  auto safe_access_tagged_vectors = sys.subproblem().safeAccessTaggedVectors();
111  auto safe_access_tagged_matrices = sys.subproblem().safeAccessTaggedMatrices();
112  auto & active_coupleable_matrix_tags =
114 
116 
117  auto n = _dof_indices.size();
118  _u.resize(n);
119  if (_need_u_old)
120  _u_old.resize(n);
121  if (_need_u_older)
122  _u_older.resize(n);
123 
124  for (auto & _tag_u : _vector_tag_u)
125  _tag_u.resize(n);
126 
127  for (auto & _tag_u : _matrix_tag_u)
128  _tag_u.resize(n);
129 
130  _du_dot_du.clear();
131  _du_dot_du.resize(n, du_dot_du);
132 
133  if (_need_u_dot)
134  _u_dot.resize(n);
135 
136  if (_need_u_dotdot)
137  _u_dotdot.resize(n);
138 
139  if (_need_u_dot_old)
140  _u_dot_old.resize(n);
141 
142  if (_need_u_dotdot_old)
143  _u_dotdot_old.resize(n);
144 
145  if (_need_du_dot_du)
146  {
147  _du_dot_du.clear();
148  _du_dot_du.resize(n, du_dot_du);
149  }
150 
151  if (_need_du_dotdot_du)
152  {
153  _du_dotdot_du.clear();
154  _du_dotdot_du.resize(n, du_dotdot_du);
155  }
156 
157  // If we have an empty partition, or if we have a partition which
158  // does not include any of the subdomains of a subdomain-restricted
159  // variable, then we do not have access to that variable! Hopefully
160  // we won't need the indices we lack.
162  {
163  current_solution.get(_dof_indices, &_u[0]);
164  if (_need_u_old)
166  if (_need_u_older)
168 
169  for (auto tag : _required_vector_tags)
171  safe_access_tagged_vectors) ||
173  if (sys.hasVector(tag) && _need_vector_tag_u[tag])
174  sys.getVector(tag).get(_dof_indices, &_vector_tag_u[tag][0]);
175 
176  if (safe_access_tagged_matrices)
177  {
178  for (auto tag : active_coupleable_matrix_tags)
179  if (sys.hasMatrix(tag) && sys.getMatrix(tag).closed() && _need_matrix_tag_u[tag])
180  for (std::size_t i = 0; i != n; ++i)
181  {
182  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
183  _matrix_tag_u[tag][i] = sys.getMatrix(tag)(_dof_indices[i], _dof_indices[i]);
184  }
185  }
186 
187  if (_need_u_dot)
188  (*u_dot).get(_dof_indices, &_u_dot[0]);
189 
190  if (_need_u_dotdot)
191  (*u_dotdot).get(_dof_indices, &_u_dotdot[0]);
192 
193  if (_need_u_dot_old)
194  (*u_dot_old).get(_dof_indices, &_u_dot_old[0]);
195 
196  if (_need_u_dotdot_old)
197  (*u_dotdot_old).get(_dof_indices, &_u_dotdot_old[0]);
198  }
199  else
200  {
201  for (std::size_t i = 0; i != n; ++i)
202  {
203  const dof_id_type dof_index = _dof_indices[i];
204  std::vector<dof_id_type> one_dof_index(1, dof_index);
205  if (_dof_map.all_semilocal_indices(one_dof_index))
206  {
207  libmesh_assert_less(i, _u.size());
208 
209  current_solution.get(one_dof_index, &_u[i]);
210  if (_need_u_old)
211  sys.solutionOld().get(one_dof_index, &_u_old[i]);
212  if (_need_u_older)
213  sys.solutionOlder().get(one_dof_index, &_u_older[i]);
214 
215  if (safe_access_tagged_vectors)
216  {
217  for (auto tag : _required_vector_tags)
218  if (sys.hasVector(tag) && _need_vector_tag_u[tag])
219  sys.getVector(tag).get(one_dof_index, &_vector_tag_u[tag][i]);
220  }
221 
222  if (safe_access_tagged_matrices)
223  {
224  for (auto tag : active_coupleable_matrix_tags)
225  if (sys.hasMatrix(tag) && sys.getMatrix(tag).closed() && _need_matrix_tag_u[tag])
226  {
227  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
228  _matrix_tag_u[tag][i] = sys.getMatrix(tag)(dof_index, dof_index);
229  }
230  }
231 
232  if (_need_u_dot)
233  (*u_dot).get(one_dof_index, &_u_dot[i]);
234 
235  if (_need_u_dotdot)
236  (*u_dotdot).get(one_dof_index, &_u_dotdot[i]);
237 
238  if (_need_u_dot_old)
239  (*u_dot_old).get(one_dof_index, &_u_dot_old[i]);
240 
241  if (_need_u_dotdot_old)
242  (*u_dotdot_old).get(one_dof_index, &_u_dotdot_old[i]);
243  }
244  else
245  {
246 #ifdef _GLIBCXX_DEBUG
247  // Let's make it possible to catch invalid accesses to these
248  // variables immediately via a thrown exception, if our
249  // libstdc++ compiler flags allow for that.
250  _u.resize(i);
251  if (_need_u_old)
252  _u_old.resize(i);
253  if (_need_u_older)
254  _u_older.resize(i);
255 
256  for (auto tag : _required_vector_tags)
257  if (sys.hasVector(tag) && _need_vector_tag_u[tag])
258  _vector_tag_u[tag].resize(i);
259 
260  for (auto tag : active_coupleable_matrix_tags)
261  if (sys.hasMatrix(tag) && sys.getMatrix(tag).closed() && _need_matrix_tag_u[tag])
262  _matrix_tag_u[tag].resize(i);
263 
264  if (_need_u_dot)
265  _u_dot.resize(i);
266 
267  if (_need_u_dotdot)
268  _u_dotdot.resize(i);
269 
270  if (_need_u_dot_old)
271  _u_dot_old.resize(i);
272 
273  if (_need_u_dotdot_old)
274  _u_dotdot_old.resize(i);
275 #else
276  // If we can't catch errors at run-time, we can at least
277  // propagate NaN values rather than invalid values, so that
278  // users won't trust the result.
279  _u[i] = std::numeric_limits<Real>::quiet_NaN();
280  if (_need_u_old)
281  _u_old[i] = std::numeric_limits<Real>::quiet_NaN();
282  if (_need_u_older)
283  _u_older[i] = std::numeric_limits<Real>::quiet_NaN();
284 
285  for (auto tag : _required_vector_tags)
286  if (sys.hasVector(tag) && _need_vector_tag_u[tag])
287  _vector_tag_u[tag][i] = std::numeric_limits<Real>::quiet_NaN();
288 
289  for (auto tag : active_coupleable_matrix_tags)
290  if (sys.hasMatrix(tag) && sys.getMatrix(tag).closed() && _need_matrix_tag_u[tag])
291  _matrix_tag_u[tag][i] = std::numeric_limits<Real>::quiet_NaN();
292 
293  if (_need_u_dot)
294  _u_dot[i] = std::numeric_limits<Real>::quiet_NaN();
295 
296  if (_need_u_dotdot)
297  _u_dotdot[i] = std::numeric_limits<Real>::quiet_NaN();
298 
299  if (_need_u_dot_old)
300  _u_dot_old[i] = std::numeric_limits<Real>::quiet_NaN();
301 
302  if (_need_u_dotdot_old)
303  _u_dotdot_old[i] = std::numeric_limits<Real>::quiet_NaN();
304 #endif
305  }
306  }
307  }
308 
309  // Automatic differentiation
310  if (_need_ad)
311  computeAD(/*nodal_ordering=*/false);
312 }
313 
314 void
316 {
317  auto n_dofs = _dof_indices.size();
318  const bool do_derivatives =
319  ADReal::do_derivatives && _sys.number() == _subproblem.currentNlSysNum();
320 
321  if (_need_ad_u)
322  {
323  _ad_u.resize(n_dofs);
324  for (MooseIndex(n_dofs) i = 0; i < n_dofs; ++i)
325  {
326  _ad_u[i] = _u[i];
327  if (do_derivatives)
328  Moose::derivInsert(_ad_u[i].derivatives(), _dof_indices[i], 1.);
329  }
330  }
331 
332  if (_need_ad_u_dot)
333  {
334  _ad_u_dot.resize(n_dofs);
335  for (MooseIndex(n_dofs) i = 0; i < n_dofs; ++i)
336  {
337  _ad_u_dot[i] = _u_dot[i];
338  if (do_derivatives)
339  Moose::derivInsert(_ad_u_dot[i].derivatives(), _dof_indices[i], _du_dot_du[i]);
340  }
341  }
342 }
343 
344 void
345 MooseVariableScalar::setValue(unsigned int i, Number value)
346 {
347 // In debug modes, we might have set a "trap" to catch reads of
348 // uninitialized values, but this trap shouldn't prevent setting
349 // values.
350 #ifdef DEBUG
351  if (i >= _u.size())
352  {
353  libmesh_assert_less(i, _dof_indices.size());
354  _u.resize(i + 1);
355  }
356 #endif
357  _u[i] = value; // update variable value
358 }
359 
360 void
362 {
363  unsigned int n = _dof_indices.size();
364 // In debug modes, we might have set a "trap" to catch reads of
365 // uninitialized values, but this trap shouldn't prevent setting
366 // values.
367 #ifdef DEBUG
368  _u.resize(n);
369 #endif
370  for (unsigned int i = 0; i < n; i++)
371  _u[i] = value;
372 }
373 
374 void
376 {
377  // We may have redundantly computed this value on many different
378  // processors, but only the processor which actually owns it should
379  // be saving it to the solution vector, to avoid O(N_scalar_vars)
380  // unnecessary communication.
381 
382  const dof_id_type first_dof = _dof_map.first_dof();
383  const dof_id_type end_dof = _dof_map.end_dof();
384  if (_dof_indices.size() > 0 && first_dof <= _dof_indices[0] && _dof_indices[0] < end_dof)
385  soln.insert(&_u[0], _dof_indices);
386 }
387 
388 const ADVariableValue &
390 {
391  _need_ad = _need_ad_u = true;
392  return _ad_u;
393 }
394 
395 const VariableValue &
397 {
398  _need_u_old = true;
399  return _u_old;
400 }
401 
402 const VariableValue &
404 {
405  _need_u_older = true;
406  return _u_older;
407 }
408 
409 const VariableValue &
411 {
412  _need_vector_tag_u[tag] = true;
413  return _vector_tag_u[tag];
414 }
415 
416 const VariableValue &
418 {
419  _need_matrix_tag_u[tag] = true;
420  return _matrix_tag_u[tag];
421 }
422 
423 const ADVariableValue &
425 {
426  if (_sys.solutionUDot())
427  {
429  return _ad_u_dot;
430  }
431  else
432  mooseError("MooseVariableScalar: Time derivative of solution (`u_dot`) is not stored. Please "
433  "set uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
434 }
435 
436 const VariableValue &
438 {
439  if (_sys.solutionUDot())
440  {
441  _need_u_dot = true;
442  return _u_dot;
443  }
444  else
445  mooseError("MooseVariableScalar: Time derivative of solution (`u_dot`) is not stored. Please "
446  "set uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
447 }
448 
449 const VariableValue &
451 {
452  if (_sys.solutionUDotDot())
453  {
454  _need_u_dotdot = true;
455  return _u_dotdot;
456  }
457  else
458  mooseError("MooseVariableScalar: Second time derivative of solution (`u_dotdot`) is not "
459  "stored. Please set uDotDotRequested() to true in FEProblemBase before requesting "
460  "`u_dotdot`.");
461 }
462 
463 const VariableValue &
465 {
466  if (_sys.solutionUDotOld())
467  {
468  _need_u_dot_old = true;
469  return _u_dot_old;
470  }
471  else
472  mooseError("MooseVariableScalar: Old time derivative of solution (`u_dot_old`) is not "
473  "stored. Please set uDotOldRequested() to true in FEProblemBase before requesting "
474  "`u_dot_old`.");
475 }
476 
477 const VariableValue &
479 {
480  if (_sys.solutionUDotDotOld())
481  {
482  _need_u_dotdot_old = true;
483  return _u_dotdot_old;
484  }
485  else
486  mooseError("MooseVariableScalar: Old second time derivative of solution (`u_dotdot_old`) is "
487  "not stored. Please set uDotDotOldRequested() to true in FEProblemBase before "
488  "requesting `u_dotdot_old`.");
489 }
490 
491 const VariableValue &
493 {
494  _need_du_dot_du = true;
495  return _du_dot_du;
496 }
497 
498 const VariableValue &
500 {
501  _need_du_dotdot_du = true;
502  return _du_dotdot_du;
503 }
504 
505 unsigned int
507 {
508  if (_need_u_older)
509  return 2;
510  if (_need_u_old)
511  return 1;
512  return 0;
513 }
514 
516 MooseVariableScalar::evaluate(const ElemArg & /*elem_arg*/, const Moose::StateArg & state) const
517 {
518  return evaluate(state);
519 }
520 
522 MooseVariableScalar::evaluate(const FaceArg & /*face*/, const Moose::StateArg & state) const
523 {
524  return evaluate(state);
525 }
526 
528 MooseVariableScalar::evaluate(const ElemQpArg & /*elem_qp*/, const Moose::StateArg & state) const
529 {
530  return evaluate(state);
531 }
532 
535  const Moose::StateArg & state) const
536 {
537  return evaluate(state);
538 }
539 
541 MooseVariableScalar::evaluate(const ElemPointArg & /*elem_point_arg*/,
542  const Moose::StateArg & state) const
543 {
544  return evaluate(state);
545 }
546 
548 MooseVariableScalar::evaluate(const NodeArg & /*node_arg*/, const Moose::StateArg & state) const
549 {
550  return evaluate(state);
551 }
552 
555 {
556  mooseAssert(_dof_indices.size() == 1,
557  "MooseVariableScalar::evaluate may only be used for first-order scalar variables");
558 
559  const auto & solution = getSolution(state);
560  ADReal value = solution(_dof_indices[0]);
561  if (state.state == 0 && Moose::doDerivatives(_subproblem, _sys))
562  Moose::derivInsert(value.derivatives(), _dof_indices[0], 1.0);
563 
564  return value;
565 }
566 
569  const Moose::StateArg & /*state*/) const
570 {
571  return 0;
572 }
573 
576  const Moose::StateArg & /*state*/) const
577 {
578  return 0;
579 }
580 
583  const Moose::StateArg & /*state*/) const
584 {
585  return 0;
586 }
587 
590  const Moose::StateArg & /*state*/) const
591 {
592  return 0;
593 }
594 
597  const Moose::StateArg & /*state*/) const
598 {
599  return 0;
600 }
601 
604  const Moose::StateArg & /*state*/) const
605 {
606  return 0;
607 }
static InputParameters validParams()
std::string name(const ElemQuality q)
const libMesh::NumericVector< libMesh::Number > & getSolution(const Moose::StateArg &state) const
Get the solution corresponding to the provided state.
std::set< TagID > _required_vector_tags
The set of vector tags we need to evaluate.
virtual void insert(const Number *v, const std::vector< numeric_index_type > &dof_indices)
const VariableValue & uDotOld() const
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
dof_id_type end_dof(const processor_id_type proc) const
const VariableValue & uDotDot() const
const ADVariableValue & adUDot() const
Return the first derivative of the solution with derivative information.
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:924
void computeAD(bool nodal_ordering)
Adds derivative information to the scalar variable value arrays.
ADVariableValue _ad_u_dot
The first derivative of the scalar solution with derivative information.
unsigned int TagID
Definition: MooseTypes.h:210
virtual void get(const std::vector< numeric_index_type > &index, Number *values) const
void reinit(bool reinit_for_derivative_reordering=false)
Fill out the VariableValue arrays from the system solution vector.
unsigned int number() const
Get variable number coming from libMesh.
virtual unsigned int currentNlSysNum() const =0
bool _need_u_older
Whether or not the older solution is needed.
virtual bool safeAccessTaggedVectors() const
Is it safe to access the tagged vectors.
Definition: SubProblem.h:734
VariableValue _u
The value of scalar variable.
MooseVariableScalar(const InputParameters &parameters)
const VariableValue & slnOlder() const
bool _need_ad_u
whether ad_u is needed
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
ADVariableValue _ad_u
The scalar solution with derivative information.
virtual void sizeMatrixTagData() override
Size data structures related to matrix tagging.
const VariableValue & duDotDotDu() const
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:360
VariableValue _u_older
The older value of scalar variable.
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:264
NumericVector< Number > & solutionOlder()
Definition: SystemBase.h:198
A structure that is used to evaluate Moose functors at an arbitrary physical point contained within a...
const VariableValue & uDotDotOld() const
Base class for a system (of equations)
Definition: SystemBase.h:84
DualNumber< Real, DNDerivativeType, true > ADReal
Definition: ADRealForward.h:46
typename FunctorReturnType< ADReal, FunctorEvaluationKind::Gradient >::type GradientType
This rigmarole makes it so that a user can create functors that return containers (std::vector...
Definition: MooseFunctor.h:149
THREAD_ID _tid
Thread ID.
void SCALAR_dof_indices(std::vector< dof_id_type > &di, const unsigned int vn, const bool old_dofs=false) const
std::vector< dof_id_type > _dof_indices
DOF indices.
const std::set< TagID > & getActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid) const
Definition: SubProblem.C:431
bool doDerivatives(const SubProblem &subproblem, const SystemBase &sys)
Definition: ADUtils.C:83
std::vector< VariableValue > _vector_tag_u
Tagged vectors.
GradientType evaluateGradient(const ElemArg &elem, const Moose::StateArg &state) const override final
Evaluate the functor gradient with a given element.
const VariableValue & slnOld() const
std::vector< bool > _need_vector_tag_u
Only cache data when need it.
registerMooseObject("MooseApp", MooseVariableScalar)
const VariableValue & uDot() const
const VariableValue & vectorTagSln(TagID tag) const
bool _need_ad
Whether any AD calculations are needed.
const libMesh::DofMap & _dof_map
DOF map.
virtual Number & duDotDotDu()
Definition: SystemBase.h:257
virtual const Number & duDotDu(unsigned int var_num=0) const
Definition: SystemBase.C:1701
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
SubProblem & _subproblem
Problem this variable is part of.
A structure defining a "face" evaluation calling argument for Moose functors.
unsigned int oldestSolutionStateRequested() const
The oldest solution state that is requested for this variable (0 = current, 1 = old, 2 = older, etc).
SystemBase & _sys
System this variable is part of.
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:261
static InputParameters validParams()
SubProblem & subproblem()
Definition: SystemBase.h:101
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:263
virtual Moose::VectorTagType vectorTagType(const TagID tag_id) const
Definition: SubProblem.C:231
void setValue(unsigned int i, Number value)
Set the nodal value for this variable (to keep everything up to date.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
A structure that is used to evaluate Moose functors logically at an element/cell center.
void setValues(Number value)
Set all of the values of this scalar variable to the same value.
Argument for requesting functor evaluation at a quadrature point location in an element.
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1157
std::vector< bool > _need_matrix_tag_u
Only cache data when need it.
const VariableValue & matrixTagSln(TagID tag) const
virtual bool closed() const=0
std::vector< VariableValue > _matrix_tag_u
Tagged matrices.
OutputTools< Real >::VariableValue VariableValue
Definition: MooseTypes.h:315
virtual unsigned int numMatrixTags() const
The total number of tags.
Definition: SubProblem.h:248
bool _need_ad_u_dot
whether ad_u_dot is needed
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual libMesh::SparseMatrix< Number > & getMatrix(TagID tag)
Get a raw SparseMatrix.
Definition: SystemBase.C:1024
const VariableValue & duDotDu() const
unsigned int _var_num
variable number (from libMesh)
bool _need_u_old
Whether or not the old solution is needed.
Class for scalar variables (they are different).
void resize(unsigned int size)
Change the number of elements the array can store.
Definition: MooseArray.h:216
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition: MooseBase.h:267
virtual unsigned int numVectorTags(const Moose::VectorTagType type=Moose::VECTOR_TAG_ANY) const
The total number of tags, which can be limited to the tag type.
Definition: SubProblem.C:195
void insert(NumericVector< Number > &soln)
State argument for evaluating functors.
void derivInsert(SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N >> &derivs, libMesh::dof_id_type index, Real value)
Definition: ADReal.h:21
const ADVariableValue & adSln() const
Return the solution with derivative information.
bool all_semilocal_indices(const std::vector< dof_id_type > &dof_indices) const
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
dof_id_type first_dof(const processor_id_type proc) const
virtual bool safeAccessTaggedMatrices() const
Is it safe to access the tagged matrices.
Definition: SubProblem.h:731
Real Number
virtual NumericVector< Number > * solutionUDotDot()
Definition: SystemBase.h:262
NumericVector< Number > & solutionOld()
Definition: SystemBase.h:197
SystemBase & sys()
Get the system this variable is part of.
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:933
Argument for requesting functor evaluation at quadrature point locations on an element side...
unsigned int state
The state.
Base variable class.
uint8_t dof_id_type
ValueType evaluate(const ElemArg &elem, const Moose::StateArg &state) const override final
Evaluate the functor with a given element.
VariableValue _u_old
The old value of scalar variable.