https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
30template <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
77template <typename OutputType>
78void
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
98template <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
113template <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
129template <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
145template <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
161template <typename OutputType>
164{
165 _var.requireQpComputations();
167}
168
169template <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
184template <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
200template <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
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
238template <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
268template <typename OutputType>
269void
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
379template <typename OutputType>
380void
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
410template <typename OutputType>
411const std::vector<dof_id_type> &
413{
414 Moose::initDofIndices(*this, *_elem);
415 return _dof_indices;
416}
417
418template <typename OutputType>
419void
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
509template <typename OutputType>
510void
511MooseVariableDataFV<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
606template <typename OutputType>
607void
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
624template <typename OutputType>
625void
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
634template <typename OutputType>
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
659template <typename OutputType>
660void
662 std::vector<dof_id_type> & dof_indices) const
663{
664 _dof_map.dof_indices(elem, dof_indices, _var_num);
665}
666
667template <typename OutputType>
670{
671 if (_sys.solutionUDot())
672 {
673 _need_dof_values_dot = true;
674 return _dof_values_dot;
675 }
676 else
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
682template <typename OutputType>
685{
686 if (_sys.solutionUDotDot())
687 {
688 _need_dof_values_dotdot = true;
689 return _dof_values_dotdot;
690 }
691 else
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
698template <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
713template <typename OutputType>
716{
717 if (_sys.solutionUDotDotOld())
718 {
719 _need_dof_values_dotdot_old = true;
720 return _dof_values_dotdot_old;
721 }
722 else
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
729template <typename OutputType>
730const MooseArray<Number> &
732{
733 _need_dof_du_dot_du = true;
734 return _dof_du_dot_du;
735}
736
737template <typename OutputType>
738const MooseArray<Number> &
740{
741 _need_dof_du_dotdot_du = true;
742 return _dof_du_dotdot_du;
743}
744
745template <typename OutputType>
746void
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
764template <typename OutputType>
765void
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
777template <typename OutputType>
778void
780{
781 _prev_elem = nullptr;
782}
783
784template <typename OutputType>
785const MooseArray<ADReal> &
787{
788 _var.requireQpComputations();
789 _need_ad = true;
790 return _ad_dof_values;
791}
792
793template <typename OutputType>
794const MooseArray<ADReal> &
796{
797 _var.requireQpComputations();
798 _need_ad = _need_ad_u_dot = true;
799 return _ad_dofs_dot;
800}
801
802template <typename OutputType>
805{
806 _var.requireQpComputations();
807 _need_ad = _need_ad_u = true;
808 return _ad_u;
809}
810
811template <typename OutputType>
814{
815 _var.requireQpComputations();
816 _need_ad = _need_ad_grad_u = true;
817 return _ad_grad_u;
818}
819
820template <typename OutputType>
823{
824 _var.requireQpComputations();
825 _need_ad = _need_ad_second_u = true;
826 return _ad_second_u;
827}
828
829template <typename OutputType>
832{
833 _var.requireQpComputations();
834
835 _need_ad = _need_ad_u_dot = true;
836
837 if (!safeToComputeADUDot())
838 // We will just copy the value of _u_dot into _ad_u_dot
839 _need_u_dot = true;
840
841 return _ad_u_dot;
842}
843
844template class MooseVariableDataFV<Real>;
845// TODO: implement vector fv variable support. This will require some template
846// specializations for various member functions in this and the FV variable
847// classes. And then you will need to uncomment out the line below:
848// template class MooseVariableDataFV<RealVectorValue>;
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
typename OutputTools< typename Moose::ADType< T >::type >::VariableSecond ADTemplateVariableSecond
Definition MooseTypes.h:659
typename OutputTools< typename Moose::ADType< T >::type >::VariableValue ADTemplateVariableValue
Definition MooseTypes.h:653
unsigned int THREAD_ID
Definition MooseTypes.h:237
typename OutputTools< typename Moose::ADType< T >::type >::VariableGradient ADTemplateVariableGradient
Definition MooseTypes.h:656
std::array< Real, 2 > values
Definition MortarUtils.C:52
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition FaceInfo.h:38
Interface for notifications that the mesh has changed.
TheWarehouse & theWarehouse()
Definition MooseApp.h:143
unsigned int size() const
The number of elements that can currently be stored in the array.
Definition MooseArray.h:259
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Definition MooseBase.h:87
const FieldVariableValue & sln(Moose::SolutionState state) const
Local solution getter.
const SubProblem & _subproblem
The subproblem which we can query for information related to tagged vectors and matrices.
const FieldVariableValue & uDotDot() const
void computeValues()
compute the variable values
MooseVariableDataFV(const MooseVariableFV< OutputType > &var, SystemBase &sys, THREAD_ID tid, Moose::ElementType element_type, const Elem *const &elem)
void setGeometry(Moose::GeometryType gm_type)
Set the geometry type before calculating variables values.
const DofValue & dofValuesDot() const
void fetchADDofValues()
Helper methods for assigning nodal values from their corresponding solution values (dof values as the...
const MooseArray< libMesh::Number > & dofValuesDuDotDu() const
Moose::DOFType< OutputType >::type OutputData
const FieldVariableValue & uDotDotOld() const
const MooseArray< libMesh::Number > & dofValuesDuDotDotDu() const
const DofValue & dofValuesDotDotOld() const
const MooseArray< ADReal > & adDofValues() const
Return the AD dof values.
const FieldVariableGradient & gradSlnDotDot() const
Local second time derivative of solution gradient getter.
const DofValue & dofValuesDotOld() const
void computeValuesFace(const FaceInfo &fi)
compute the variable values
const MooseArray< ADReal > & adDofValuesDot() const
Return the AD dof time derivatives.
void meshChanged() override
Called on this object when the mesh changes.
const FieldVariableValue & uDotOld() const
void computeAD(const unsigned int num_dofs, const unsigned int nqp)
compute AD things
const ADTemplateVariableValue< OutputType > & adUDot() const
TheWarehouse::QueryCache _fv_flux_kernel_query_cache
Cached warehouse query for FVFluxKernels.
const ADTemplateVariableValue< OutputType > & adSln() const
void setDofValues(const DenseVector< OutputData > &values)
Set local DOF values and evaluate the values on quadrature points.
const FieldVariableCurl & curlSln(Moose::SolutionState state) const
Local solution curl getter.
const FieldVariableValue & sln(Moose::SolutionState state) const
Local solution value.
OutputData getElementalValue(const Elem *elem, Moose::SolutionState state, unsigned int idx=0) const
void setDofValue(const OutputData &value, unsigned int index)
dof value setters
const FieldVariableValue & uDot() const
const std::vector< dof_id_type > & initDofIndices()
TheWarehouse::QueryCache _fv_elemental_kernel_query_cache
Cached warehouse query for FVElementalKernels.
const FieldVariableSecond & secondSln(Moose::SolutionState state) const
Local solution second spatial derivative getter.
const FieldVariableGradient & gradSlnDot() const
Local time derivative of solution gradient getter.
const ADTemplateVariableGradient< OutputType > & adGradSln() const
void getDofIndices(const Elem *elem, std::vector< dof_id_type > &dof_indices) const
const DofValue & dofValuesDotDot() const
void prepareIC()
prepare the initial condition
const ADTemplateVariableSecond< OutputType > & adSecondSln() const
This class provides variable solution values for other classes/objects to bind to when looping over f...
Base class for a system (of equations)
Definition SystemBase.h:87
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
SolutionState
Definition MooseTypes.h:262
@ Current
Definition MooseTypes.h:263
@ PreviousNL
Definition MooseTypes.h:266
StateArg currentState()
void initDofIndices(T &data, const Elem &elem)
void derivInsert(SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N > > &derivs, libMesh::dof_id_type index, Real value)
Definition ADReal.h:21