https://mooseframework.inl.gov
MooseVariableDataFV.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 "MooseVariableDataFV.h"
11 #include "MooseVariableField.h"
12 #include "Assembly.h"
13 #include "MooseError.h"
14 #include "DisplacedSystem.h"
15 #include "TimeIntegrator.h"
16 #include "MooseVariableFV.h"
17 #include "MooseTypes.h"
18 #include "MooseMesh.h"
19 #include "Attributes.h"
20 #include "FVDirichletBCBase.h"
21 #include "SubProblem.h"
22 #include "FVKernel.h"
23 #include "ADUtils.h"
24 
25 #include "libmesh/quadrature.h"
26 #include "libmesh/fe_base.h"
27 #include "libmesh/system.h"
28 #include "libmesh/type_n_tensor.h"
29 
30 template <typename OutputType>
32  SystemBase & sys,
33  THREAD_ID tid,
34  Moose::ElementType element_type,
35  const Elem * const & elem)
36 
37  : MooseVariableDataBase<OutputType>(var, sys, tid),
38  MeshChangedInterface(var.parameters()),
39  _var(var),
40  _fe_type(_var.feType()),
41  _var_num(_var.number()),
42  _assembly(_subproblem.assembly(_tid, var.kind() == Moose::VAR_SOLVER ? sys.number() : 0)),
43  _element_type(element_type),
44  _ad_zero(0),
45  _need_second(false),
46  _need_second_old(false),
47  _need_second_older(false),
48  _need_second_previous_nl(false),
49  _need_curl(false),
50  _need_curl_old(false),
51  _need_curl_older(false),
52  // for FV variables, they use each other's ad_u values to compute ghost cell
53  // values - we don't have any way to propagate these inter-variable-data
54  // dependencies. So if something needs an ad_u value, that need isn't
55  // propagated through to both the element and the neighbor
56  // data structures. So instead just set _need_ad+_need_ad_u values to true always.
57  _need_ad(true),
58  _need_ad_u(true),
59  _need_ad_u_dot(false),
60  _need_ad_u_dotdot(false),
61  _need_ad_grad_u(false),
62  _need_ad_grad_u_dot(false),
63  _need_ad_second_u(false),
64  _time_integrator(_sys.queryTimeIntegrator(_var_num)),
65  _elem(elem),
66  _displaced(dynamic_cast<const DisplacedSystem *>(&_sys) ? true : false),
67  _qrule(nullptr)
68 {
70  _subproblem.getMooseApp().theWarehouse().query().template condition<AttribSystem>(
71  "FVElementalKernel");
73  _subproblem.getMooseApp().theWarehouse().query().template condition<AttribSystem>(
74  "FVFluxKernel");
75 }
76 
77 template <typename OutputType>
78 void
80 {
81  switch (gm_type)
82  {
83  case Moose::Volume:
84  {
85  _qrule = _assembly.qRule();
86  // TODO: set integration multiplier to cell volume
87  break;
88  }
89  case Moose::Face:
90  {
91  _qrule = _assembly.qRuleFace();
92  // TODO: set integration multiplier to face area
93  break;
94  }
95  }
96 }
97 
98 template <typename OutputType>
101 {
102  if (_sys.solutionUDot())
103  {
104  _var.requireQpComputations();
105  _need_u_dot = true;
106  return _u_dot;
107  }
108  else
109  mooseError("MooseVariableFE: Time derivative of solution (`u_dot`) is not stored. Please set "
110  "uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
111 }
112 
113 template <typename OutputType>
116 {
117  if (_sys.solutionUDotDot())
118  {
119  _var.requireQpComputations();
120  _need_u_dotdot = true;
121  return _u_dotdot;
122  }
123  else
124  mooseError("MooseVariableFE: Second time derivative of solution (`u_dotdot`) is not stored. "
125  "Please set uDotDotRequested() to true in FEProblemBase before requesting "
126  "`u_dotdot`.");
127 }
128 
129 template <typename OutputType>
132 {
133  if (_sys.solutionUDotOld())
134  {
135  _var.requireQpComputations();
136  _need_u_dot_old = true;
137  return _u_dot_old;
138  }
139  else
140  mooseError("MooseVariableFE: Old time derivative of solution (`u_dot_old`) is not stored. "
141  "Please set uDotOldRequested() to true in FEProblemBase before requesting "
142  "`u_dot_old`.");
143 }
144 
145 template <typename OutputType>
148 {
149  if (_sys.solutionUDotDotOld())
150  {
151  _var.requireQpComputations();
152  _need_u_dotdot_old = true;
153  return _u_dotdot_old;
154  }
155  else
156  mooseError("MooseVariableFE: Old second time derivative of solution (`u_dotdot_old`) is not "
157  "stored. Please set uDotDotOldRequested() to true in FEProblemBase before "
158  "requesting `u_dotdot_old`");
159 }
160 
161 template <typename OutputType>
164 {
165  _var.requireQpComputations();
167 }
168 
169 template <typename OutputType>
172 {
173  if (_sys.solutionUDot())
174  {
175  _var.requireQpComputations();
176  _need_grad_dot = true;
177  return _grad_u_dot;
178  }
179  else
180  mooseError("MooseVariableFE: Time derivative of solution (`u_dot`) is not stored. Please set "
181  "uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
182 }
183 
184 template <typename OutputType>
187 {
188  if (_sys.solutionUDotDot())
189  {
190  _var.requireQpComputations();
191  _need_grad_dotdot = true;
192  return _grad_u_dotdot;
193  }
194  else
195  mooseError("MooseVariableFE: Second time derivative of solution (`u_dotdot`) is not stored. "
196  "Please set uDotDotRequested() to true in FEProblemBase before requesting "
197  "`u_dotdot`.");
198 }
199 
200 template <typename OutputType>
203 {
204  _var.requireQpComputations();
205  switch (state)
206  {
207  case Moose::Current:
208  {
209  _need_second = true;
210  return _second_u;
211  }
212 
213  case Moose::Old:
214  {
215  _need_second_old = true;
216  return _second_u_old;
217  }
218 
219  case Moose::Older:
220  {
221  _need_second_older = true;
222  return _second_u_older;
223  }
224 
225  case Moose::PreviousNL:
226  {
227  _need_second_previous_nl = true;
228  return _second_u_previous_nl;
229  }
230 
231  default:
232  // We should never get here but gcc requires that we have a default. See
233  // htpps://stackoverflow.com/questions/18680378/after-defining-case-for-all-enum-values-compiler-still-says-control-reaches-e
234  mooseError("Unknown SolutionState!");
235  }
236 }
237 
238 template <typename OutputType>
241 {
242  _var.requireQpComputations();
243  switch (state)
244  {
245  case Moose::Current:
246  {
247  _need_curl = true;
248  return _curl_u;
249  }
250 
251  case Moose::Old:
252  {
253  _need_curl_old = true;
254  return _curl_u_old;
255  }
256 
257  case Moose::Older:
258  {
259  _need_curl_older = true;
260  return _curl_u_older;
261  }
262 
263  default:
264  mooseError("We don't currently support curl from the previous non-linear iteration");
265  }
266 }
267 
268 template <typename OutputType>
269 void
271 {
272  auto && active_coupleable_matrix_tags =
273  _sys.subproblem().getActiveFEVariableCoupleableMatrixTags(_tid);
274  mooseAssert(_qrule, "We should have a non-null qrule");
275  const auto nqp = _qrule->n_points();
276 
277  for (auto tag : _required_vector_tags)
278  if (_need_vector_tag_u[tag])
279  {
280  _vector_tag_u[tag].resize(nqp);
281  assignForAllQps(0, _vector_tag_u[tag], nqp);
282  }
283 
284  for (auto tag : active_coupleable_matrix_tags)
285  if (_need_matrix_tag_u[tag])
286  {
287  _matrix_tag_u[tag].resize(nqp);
288  assignForAllQps(0, _matrix_tag_u[tag], nqp);
289  }
290 
291  if (_need_second)
292  {
293  _second_u.resize(nqp);
294  assignForAllQps(0, _second_u, nqp);
295  }
296 
297  if (_need_curl)
298  {
299  _curl_u.resize(nqp);
300  assignForAllQps(0, _curl_u, nqp);
301  }
302 
303  if (_need_second_previous_nl)
304  {
305  _second_u_previous_nl.resize(nqp);
306  assignForAllQps(0, _second_u_previous_nl, nqp);
307  }
308 
309  if (_subproblem.isTransient())
310  {
311  if (_need_u_dot)
312  {
313  _u_dot.resize(nqp);
314  assignForAllQps(0, _u_dot, nqp);
315  }
316 
317  if (_need_u_dotdot)
318  {
319  _u_dotdot.resize(nqp);
320  assignForAllQps(0, _u_dotdot, nqp);
321  }
322 
323  if (_need_u_dot_old)
324  {
325  _u_dot_old.resize(nqp);
326  assignForAllQps(0, _u_dot_old, nqp);
327  }
328 
329  if (_need_u_dotdot_old)
330  {
331  _u_dotdot_old.resize(nqp);
332  assignForAllQps(0, _u_dotdot_old, nqp);
333  }
334 
335  if (_need_du_dot_du)
336  {
337  _du_dot_du.resize(nqp);
338  assignForAllQps(0, _du_dot_du, nqp);
339  }
340 
341  if (_need_du_dotdot_du)
342  {
343  _du_dotdot_du.resize(nqp);
344  assignForAllQps(0, _du_dotdot_du, nqp);
345  }
346 
347  if (_need_grad_dot)
348  {
349  _grad_u_dot.resize(nqp);
350  assignForAllQps(0, _grad_u_dot, nqp);
351  }
352 
353  if (_need_grad_dotdot)
354  {
355  _grad_u_dotdot.resize(nqp);
356  assignForAllQps(0, _grad_u_dotdot, nqp);
357  }
358 
359  if (_need_second_old)
360  {
361  _second_u_old.resize(nqp);
362  assignForAllQps(0, _second_u_old, nqp);
363  }
364 
365  if (_need_curl_old)
366  {
367  _curl_u_old.resize(nqp);
368  assignForAllQps(0, _curl_u_old, nqp);
369  }
370 
371  if (_need_second_older)
372  {
373  _second_u_older.resize(nqp);
374  assignForAllQps(0, _second_u_older, nqp);
375  }
376  }
377 }
378 
379 template <typename OutputType>
380 void
382 {
383  _has_dirichlet_bc = false;
384  _dof_map.dof_indices(_elem, _dof_indices, _var_num);
385 
386  // TODO: compute reconstructed values somehow. For now, just do the trivial
387  // reconstruction where we take the const cell value from the centroid and
388  // use that value on the face. How will users affect the reconstruction
389  // method used here? After reconstruction, we should cache the computed
390  // soln/gradients per element so we don't have to recompute them again for
391  // other faces that share an element with this face.
392  //
393  // TODO: Also we need to be able to track (AD) derivatives through the
394  // reconstruction process - how will we do that?
395 
396  computeValues();
397 
398  // TODO: maybe initialize a separate _grad_u_interface here that is
399  // only used for diffusion terms that need an interface gradient. Also -
400  // it would need cross-diffusion corrections for non-orthogonal meshes
401  // eventually. Or maybe we just leave this alone zero and have users
402  // calculate whatever grad_interface value they want and provide some
403  // helper functions for cross-diffusion correction.
404 
405  // TODO: figure out how to store old/older values of reconstructed
406  // solutions/gradient states without having to re-reconstruct them from
407  // older dof/soln values.
408 }
409 
410 template <typename OutputType>
411 const std::vector<dof_id_type> &
413 {
414  Moose::initDofIndices(*this, *_elem);
415  return _dof_indices;
416 }
417 
418 template <typename OutputType>
419 void
421 {
422  initDofIndices();
423  initializeSolnVars();
424 
425  unsigned int num_dofs = _dof_indices.size();
426 
427  if (num_dofs > 0)
428  fetchDoFValues();
429  else
430  // We don't have any dofs. There's nothing to do
431  return;
432 
433  mooseAssert(num_dofs == 1 && _vector_tags_dof_u[_solution_tag].size() == 1,
434  "There should only be one dof per elem for FV variables");
435 
436  bool is_transient = _subproblem.isTransient();
437  const auto nqp = _qrule->n_points();
438  auto && active_coupleable_matrix_tags =
439  _sys.subproblem().getActiveFEVariableCoupleableMatrixTags(_tid);
440 
441  bool second_required =
442  _need_second || _need_second_old || _need_second_older || _need_second_previous_nl;
443  bool curl_required = _need_curl || _need_curl_old;
444 
445  for (const auto qp : make_range(nqp))
446  {
447  if (is_transient)
448  {
449  if (_need_u_dot)
450  _u_dot[qp] = _dof_values_dot[0];
451 
452  if (_need_u_dotdot)
453  _u_dotdot[qp] = _dof_values_dotdot[0];
454 
455  if (_need_u_dot_old)
456  _u_dot_old[qp] = _dof_values_dot_old[0];
457 
458  if (_need_u_dotdot_old)
459  _u_dotdot_old[qp] = _dof_values_dotdot_old[0];
460 
461  if (_need_du_dot_du)
462  _du_dot_du[qp] = _dof_du_dot_du[0];
463 
464  if (_need_du_dotdot_du)
465  _du_dotdot_du[qp] = _dof_du_dotdot_du[0];
466  }
467 
468  if (second_required)
469  {
470  if (_need_second)
471  _second_u[qp] = 0.;
472 
473  if (_need_second_previous_nl)
474  _second_u_previous_nl[qp] = 0.;
475 
476  if (is_transient)
477  {
478  if (_need_second_old)
479  _second_u_old[qp] = 0.;
480 
481  if (_need_second_older)
482  _second_u_older[qp] = 0.;
483  }
484  }
485 
486  if (curl_required)
487  {
488  if (_need_curl)
489  _curl_u[qp] = 0.;
490 
491  if (is_transient && _need_curl_old)
492  _curl_u_old[qp] = 0.;
493  }
494 
495  for (auto tag : _required_vector_tags)
496  if (_need_vector_tag_u[tag])
497  _vector_tag_u[tag][qp] = _vector_tags_dof_u[tag][0];
498 
499  for (auto tag : active_coupleable_matrix_tags)
500  if (_need_matrix_tag_u[tag])
501  _matrix_tag_u[tag][qp] = _matrix_tags_dof_u[tag][0];
502  }
503 
504  // Automatic differentiation
505  if (_need_ad)
506  computeAD(num_dofs, nqp);
507 }
508 
509 template <typename OutputType>
510 void
511 MooseVariableDataFV<OutputType>::computeAD(const unsigned int num_dofs, const unsigned int nqp)
512 {
513  // This query and if check prevent running this code when we have FV
514  // variables, but no kernels. When this happens, maxVarNDofsPerElem is
515  // not computed (because no kernels) and is zero giving nonsense offsets for
516  // AD stuff. So we just skip all this when that is the case. Maybe there
517  // is a better way to do this - like just checking if getMaxVarNDofsPerElem
518  // returns zero?
519  std::vector<FVKernel *> ks;
520  _fv_elemental_kernel_query_cache.queryInto(ks);
521  if (ks.size() == 0)
522  {
523  _fv_flux_kernel_query_cache.queryInto(ks);
524  if (ks.size() == 0)
525  return;
526  }
527 
528  _ad_dof_values.resize(num_dofs);
529  if (_need_ad_u)
530  _ad_u.resize(nqp);
531 
532  if (_need_ad_grad_u)
533  _ad_grad_u.resize(nqp);
534 
535  if (_need_ad_second_u)
536  _ad_second_u.resize(nqp);
537 
538  if (_need_ad_u_dot)
539  {
540  _ad_dofs_dot.resize(num_dofs);
541  _ad_u_dot.resize(nqp);
542  }
543 
544  if (_need_ad_u_dotdot)
545  {
546  _ad_dofs_dotdot.resize(num_dofs);
547  _ad_u_dotdot.resize(nqp);
548  }
549 
550  if (_need_ad_second_u)
551  assignForAllQps(0, _ad_second_u, nqp);
552 
553  if (_need_ad_u_dot)
554  assignForAllQps(_ad_zero, _ad_u_dot, nqp);
555 
556  if (_need_ad_u_dotdot)
557  assignForAllQps(_ad_zero, _ad_u_dotdot, nqp);
558 
559  const bool do_derivatives =
560  ADReal::do_derivatives && _sys.number() == _subproblem.currentNlSysNum();
561 
562  for (unsigned int i = 0; i < num_dofs; i++)
563  {
564  _ad_dof_values[i] = (*_sys.currentSolution())(_dof_indices[i]);
565 
566  // NOTE! You have to do this AFTER setting the value!
567  if (do_derivatives)
568  Moose::derivInsert(_ad_dof_values[i].derivatives(), _dof_indices[i], 1.);
569 
570  if (_need_ad_u_dot && safeToComputeADUDot() && _time_integrator->dt())
571  {
572  _ad_dofs_dot[i] = _ad_dof_values[i];
573  _time_integrator->computeADTimeDerivatives(_ad_dofs_dot[i],
574  _dof_indices[i],
575  _need_ad_u_dotdot ? _ad_dofs_dotdot[i]
576  : _ad_real_dummy);
577  }
578  }
579 
580  if (_need_ad_u)
581  assignForAllQps(_ad_dof_values[0], _ad_u, nqp);
582 
583  if (_need_ad_grad_u)
584  assignForAllQps(static_cast<const MooseVariableFV<OutputType> &>(_var).adGradSln(
585  _elem, Moose::currentState()),
586  _ad_grad_u,
587  nqp);
588 
589  if (_need_ad_u_dot)
590  {
591  if (safeToComputeADUDot())
592  {
593  assignForAllQps(_ad_dofs_dot[0], _ad_u_dot, nqp);
594  if (_need_ad_u_dotdot)
595  assignForAllQps(_ad_dofs_dotdot[0], _ad_u_dotdot, nqp);
596  }
597  else
598  {
599  assignForAllQps(_u_dot[0], _ad_u_dot, nqp);
600  if (_need_ad_u_dotdot)
601  assignForAllQps(_u_dotdot[0], _ad_u_dotdot, nqp);
602  }
603  }
604 }
605 
606 template <typename OutputType>
607 void
609 {
610  mooseAssert(index == 0, "We only ever have one dof value locally");
611  _vector_tags_dof_u[_solution_tag][index] = value;
612  _has_dof_values = true;
613 
614  auto & u = _vector_tag_u[_solution_tag];
615  // Update the qp values as well
616  for (const auto qp : index_range(u))
617  u[qp] = value;
618 
619  if (_need_ad_u)
620  for (const auto qp : index_range(_ad_u))
621  _ad_u[qp] = value;
622 }
623 
624 template <typename OutputType>
625 void
626 MooseVariableDataFV<OutputType>::setDofValues(const DenseVector<OutputData> & values)
627 {
628  auto & dof_values = _vector_tags_dof_u[_solution_tag];
629  for (unsigned int i = 0; i < values.size(); i++)
630  dof_values[i] = values(i);
631  _has_dof_values = true;
632 }
633 
634 template <typename OutputType>
637  Moose::SolutionState state,
638  unsigned int idx) const
639 {
640  std::vector<dof_id_type> dof_indices;
641  _dof_map.dof_indices(elem, dof_indices, _var_num);
642 
643  switch (state)
644  {
645  case Moose::Current:
646  return (*_sys.currentSolution())(dof_indices[idx]);
647 
648  case Moose::Old:
649  return _sys.solutionOld()(dof_indices[idx]);
650 
651  case Moose::Older:
652  return _sys.solutionOlder()(dof_indices[idx]);
653 
654  default:
655  mooseError("PreviousNL not currently supported for getElementalValue");
656  }
657 }
658 
659 template <typename OutputType>
660 void
662  std::vector<dof_id_type> & dof_indices) const
663 {
664  _dof_map.dof_indices(elem, dof_indices, _var_num);
665 }
666 
667 template <typename OutputType>
670 {
671  if (_sys.solutionUDot())
672  {
673  _need_dof_values_dot = true;
674  return _dof_values_dot;
675  }
676  else
677  mooseError(
678  "MooseVariableDataFV: Time derivative of solution (`u_dot`) is not stored. Please set "
679  "uDotRequested() to true in FEProblemBase before requesting `u_dot`.");
680 }
681 
682 template <typename OutputType>
685 {
686  if (_sys.solutionUDotDot())
687  {
688  _need_dof_values_dotdot = true;
689  return _dof_values_dotdot;
690  }
691  else
692  mooseError(
693  "MooseVariableDataFV: Second time derivative of solution (`u_dotdot`) is not stored. "
694  "Please set uDotDotRequested() to true in FEProblemBase before requesting "
695  "`u_dotdot`.");
696 }
697 
698 template <typename OutputType>
701 {
702  if (_sys.solutionUDotOld())
703  {
704  _need_dof_values_dot_old = true;
705  return _dof_values_dot_old;
706  }
707  else
708  mooseError("MooseVariableDataFV: Old time derivative of solution (`u_dot_old`) is not stored. "
709  "Please set uDotOldRequested() to true in FEProblemBase before requesting "
710  "`u_dot_old`.");
711 }
712 
713 template <typename OutputType>
716 {
717  if (_sys.solutionUDotDotOld())
718  {
719  _need_dof_values_dotdot_old = true;
720  return _dof_values_dotdot_old;
721  }
722  else
723  mooseError(
724  "MooseVariableDataFV: Old second time derivative of solution (`u_dotdot_old`) is not "
725  "stored. Please set uDotDotOldRequested() to true in FEProblemBase before "
726  "requesting `u_dotdot_old`.");
727 }
728 
729 template <typename OutputType>
730 const MooseArray<Number> &
732 {
733  _need_dof_du_dot_du = true;
734  return _dof_du_dot_du;
735 }
736 
737 template <typename OutputType>
738 const MooseArray<Number> &
740 {
741  _need_dof_du_dotdot_du = true;
742  return _dof_du_dotdot_du;
743 }
744 
745 template <typename OutputType>
746 void
748 {
749  auto n = _dof_indices.size();
750  libmesh_assert(n);
751  _ad_dof_values.resize(n);
752 
753  const bool do_derivatives =
754  ADReal::do_derivatives && _sys.number() == _subproblem.currentNlSysNum();
755 
756  for (decltype(n) i = 0; i < n; ++i)
757  {
758  _ad_dof_values[i] = _vector_tags_dof_u[_solution_tag][i];
759  if (do_derivatives)
760  Moose::derivInsert(_ad_dof_values[i].derivatives(), _dof_indices[i], 1.);
761  }
762 }
763 
764 template <typename OutputType>
765 void
767 {
768  // TODO: implement this function
769  initDofIndices();
770  _vector_tags_dof_u[_solution_tag].resize(_dof_indices.size());
771 
772  mooseAssert(_qrule, "We should have a non-null qrule");
773  const auto nqp = _qrule->n_points();
774  _vector_tag_u[_solution_tag].resize(nqp);
775 }
776 
777 template <typename OutputType>
778 void
780 {
781  _prev_elem = nullptr;
782 }
783 
784 template class MooseVariableDataFV<Real>;
785 // TODO: implement vector fv variable support. This will require some template
786 // specializations for various member functions in this and the FV variable
787 // classes. And then you will need to uncomment out the line below:
788 // template class MooseVariableDataFV<RealVectorValue>;
void initDofIndices(T &data, const Elem &elem)
Moose::DOFType< OutputType >::type OutputData
const std::vector< dof_id_type > & initDofIndices()
const FieldVariableValue & uDotOld() const
const FieldVariableValue & uDot() const
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
void setDofValue(const OutputData &value, unsigned int index)
dof value setters
const MooseArray< libMesh::Number > & dofValuesDuDotDu() const
const FieldVariableValue & uDotDotOld() const
void setGeometry(Moose::GeometryType gm_type)
Set the geometry type before calculating variables values.
ElementType
Definition: MooseTypes.h:763
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
Base class for a system (of equations)
Definition: SystemBase.h:84
void fetchADDoFValues()
Helper methods for assigning nodal values from their corresponding solution values (dof values as the...
TheWarehouse::QueryCache _fv_flux_kernel_query_cache
Cached warehouse query for FVFluxKernels.
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Definition: MooseBase.h:45
void getDofIndices(const Elem *elem, std::vector< dof_id_type > &dof_indices) const
const DoFValue & dofValuesDotDot() const
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition: FaceInfo.h:36
const FieldVariableValue & sln(Moose::SolutionState state) const
Local solution value.
Interface for notifications that the mesh has changed.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
void setDofValues(const DenseVector< OutputData > &values)
Set local DOF values and evaluate the values on quadrature points.
void prepareIC()
prepare the initial condition
libmesh_assert(ctx)
const FieldVariableValue & uDotDot() const
const DoFValue & dofValuesDot() const
const DoFValue & dofValuesDotOld() const
const MooseArray< libMesh::Number > & dofValuesDuDotDotDu() const
const DoFValue & dofValuesDotDotOld() const
void computeValues()
compute the variable values
Moose::DOFType< OutputType >::type OutputData
GeometryType
Definition: MooseTypes.h:248
void meshChanged() override
Called on this object when the mesh changes.
SolutionState
Definition: MooseTypes.h:233
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse...
Definition: TheWarehouse.h:466
void computeValuesFace(const FaceInfo &fi)
compute the variable values
MooseVariableDataFV(const MooseVariableFV< OutputType > &var, SystemBase &sys, THREAD_ID tid, Moose::ElementType element_type, const Elem *const &elem)
IntRange< T > make_range(T beg, T end)
OutputData getElementalValue(const Elem *elem, Moose::SolutionState state, unsigned int idx=0) const
const FieldVariableValue & sln(Moose::SolutionState state) const
Local solution getter.
void derivInsert(SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N >> &derivs, libMesh::dof_id_type index, Real value)
Definition: ADReal.h:21
TheWarehouse & theWarehouse()
Definition: MooseApp.h:130
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
This class provides variable solution values for other classes/objects to bind to when looping over f...
const FieldVariableCurl & curlSln(Moose::SolutionState state) const
Local solution curl getter.
const FieldVariableSecond & secondSln(Moose::SolutionState state) const
Local solution second spatial derivative getter.
void computeAD(const unsigned int num_dofs, const unsigned int nqp)
compute AD things
const FieldVariableGradient & gradSlnDot() const
Local time derivative of solution gradient getter.
StateArg currentState()
auto index_range(const T &sizable)
const FieldVariableGradient & gradSlnDotDot() const
Local second time derivative of solution gradient getter.
unsigned int THREAD_ID
Definition: MooseTypes.h:209
unsigned int idx(const ElemType type, const unsigned int nx, const unsigned int i, const unsigned int j)
TheWarehouse::QueryCache _fv_elemental_kernel_query_cache
Cached warehouse query for FVElementalKernels.