https://mooseframework.inl.gov
MooseLinearVariableFV.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 "MooseLinearVariableFV.h"
11 #include "TimeIntegrator.h"
12 #include "NonlinearSystemBase.h"
13 #include "DisplacedSystem.h"
14 #include "SystemBase.h"
15 #include "LinearSystem.h"
16 #include "AuxiliarySystem.h"
17 #include "SubProblem.h"
18 #include "Assembly.h"
19 #include "MathFVUtils.h"
20 #include "FVUtils.h"
21 #include "FVFluxBC.h"
22 #include "FVDirichletBCBase.h"
23 #include "GreenGaussGradient.h"
26 
27 #include "libmesh/numeric_vector.h"
28 
29 #include <climits>
30 #include <typeinfo>
31 
32 using namespace Moose;
33 
35 
36 template <typename OutputType>
39 {
41  params.set<bool>("fv") = true;
42  params.set<MooseEnum>("family") = "MONOMIAL";
43  params.set<MooseEnum>("order") = "CONSTANT";
44  return params;
45 }
46 
47 template <typename OutputType>
49  : MooseVariableField<OutputType>(parameters),
50  _needs_cell_gradients(false),
51  _grad_container(this->_sys.gradientContainer()),
52  _sys_num(this->_sys.number()),
53  _solution(this->_sys.currentSolution()),
54  // The following members are needed to be able to interface with the postprocessor and
55  // auxiliary systems
56  _phi(this->_assembly.template fePhi<OutputShape>(FEType(CONSTANT, MONOMIAL))),
57  _grad_phi(this->_assembly.template feGradPhi<OutputShape>(FEType(CONSTANT, MONOMIAL))),
58  _phi_face(this->_assembly.template fePhiFace<OutputShape>(FEType(CONSTANT, MONOMIAL))),
59  _grad_phi_face(this->_assembly.template feGradPhiFace<OutputShape>(FEType(CONSTANT, MONOMIAL))),
60  _phi_face_neighbor(
61  this->_assembly.template fePhiFaceNeighbor<OutputShape>(FEType(CONSTANT, MONOMIAL))),
62  _grad_phi_face_neighbor(
63  this->_assembly.template feGradPhiFaceNeighbor<OutputShape>(FEType(CONSTANT, MONOMIAL))),
64  _phi_neighbor(this->_assembly.template fePhiNeighbor<OutputShape>(FEType(CONSTANT, MONOMIAL))),
65  _grad_phi_neighbor(
66  this->_assembly.template feGradPhiNeighbor<OutputShape>(FEType(CONSTANT, MONOMIAL)))
67 {
68  if (!dynamic_cast<LinearSystem *>(&_sys) && !dynamic_cast<AuxiliarySystem *>(&_sys))
69  this->paramError("solver_sys",
70  "The assigned system is not a linear or an auxiliary system! Linear variables "
71  "can only be assigned to linear or auxiliary systems!");
72  _element_data = std::make_unique<MooseVariableDataLinearFV<OutputType>>(
74  _neighbor_data = std::make_unique<MooseVariableDataLinearFV<OutputType>>(
76 
77  if (libMesh::n_threads() > 1)
78  mooseError("MooseLinearVariableFV does not support threading at the moment!");
79 }
80 
81 template <typename OutputType>
82 bool
84  const FaceInfo & /*fi*/, const Elem * const /*elem*/, const Moose::StateArg & /*state*/) const
85 {
87  return false;
88 }
89 
90 template <typename OutputType>
91 Real
93  const StateArg & state) const
94 {
95  mooseAssert(
96  this->hasBlocks(elem_info.subdomain_id()),
97  "The variable should be defined on the element's subdomain! This typically occurs when the "
98  "user wants to evaluate the elements right next to the boundary of two variables (block "
99  "boundary). The subdomain which is queried: " +
100  Moose::stringify(this->activeSubdomains()) + " the subdomain of the element " +
101  std::to_string(elem_info.subdomain_id()));
102 
103  // It's not safe to use solutionState(0) because it returns the libMesh System solution member
104  // which is wrong during things like finite difference Jacobian evaluation, e.g. when PETSc
105  // perturbs the solution vector we feed these perturbations into the current_local_solution
106  // while the libMesh solution is frozen in the non-perturbed state
107  const auto & global_soln = (state.state == 0)
108  ? *this->_sys.currentSolution()
109  : this->_sys.solutionState(state.state, state.iteration_type);
110 
111  return global_soln(elem_info.dofIndices()[this->_sys_num][this->_var_num]);
112 }
113 
114 template <typename OutputType>
115 const VectorValue<Real>
117 {
118  if (_needs_cell_gradients)
119  {
120  _cell_gradient.zero();
121  for (const auto i : make_range(this->_mesh.dimension()))
122  _cell_gradient(i) =
123  (*_grad_container[i])(elem_info.dofIndices()[this->_sys_num][this->_var_num]);
124  }
125 
126  return _cell_gradient;
127 }
128 
129 template <typename OutputType>
132 {
133  const bool var_defined_on_elem = this->hasBlocks(fi.elem().subdomain_id());
134  const auto * const elem_one = var_defined_on_elem ? fi.elemInfo() : fi.neighborInfo();
135  const auto * const elem_two = var_defined_on_elem ? fi.neighborInfo() : fi.elemInfo();
136 
137  const auto elem_one_grad = gradSln(*elem_one);
138 
139  // If we have a neighbor then we interpolate between the two to the face.
140  if (elem_two && this->hasBlocks(elem_two->subdomain_id()))
141  {
142  const auto elem_two_grad = gradSln(*elem_two);
143  return Moose::FV::linearInterpolation(elem_one_grad, elem_two_grad, fi, var_defined_on_elem);
144  }
145  else
146  return elem_one_grad;
147 }
148 
149 template <typename OutputType>
150 void
152 {
154  cacheBoundaryBCMap();
155 }
156 
157 template <typename OutputType>
160 {
161  const FaceInfo * const fi = face.fi;
162 
163  mooseAssert(fi, "The face information must be non-null");
164 
165  const auto face_type = fi->faceType(std::make_pair(this->_var_num, this->_sys_num));
166 
167  if (face_type == FaceInfo::VarFaceNeighbors::BOTH)
168  return Moose::FV::interpolate(*this, face, state);
169  else if (auto * bc_pointer = this->getBoundaryCondition(*fi->boundaryIDs().begin()))
170  {
171  mooseAssert(fi->boundaryIDs().size() == 1, "We should only have one boundary on every face.");
172  bc_pointer->setupFaceData(fi, face_type);
173  return bc_pointer->computeBoundaryValue();
174  }
175  // If no boundary condition is defined but we are evaluating on a boundary, just return the
176  // element value
177  else if (face_type == FaceInfo::VarFaceNeighbors::ELEM)
178  {
179  const auto & elem_info = this->_mesh.elemInfo(fi->elemPtr()->id());
180  return getElemValue(elem_info, state);
181  }
182  else if (face_type == FaceInfo::VarFaceNeighbors::NEIGHBOR)
183  {
184  const auto & elem_info = this->_mesh.elemInfo(fi->neighborPtr()->id());
185  return getElemValue(elem_info, state);
186  }
187  else
188  mooseError("We should never get here!");
189 }
190 
191 template <typename OutputType>
194  const StateArg & /*state*/) const
195 {
196  mooseError("Not implemented yet");
197 }
198 
199 template <typename OutputType>
202 {
203  timeIntegratorError();
204 }
205 
206 template <>
207 ADReal
209  const StateArg & /*state*/) const
210 {
212 }
213 
214 template <typename OutputType>
215 void
217 {
218  _boundary_id_to_bc.clear();
219  std::vector<LinearFVBoundaryCondition *> bcs;
220 
221  // I believe because query() returns by value but condition returns by reference that binding to a
222  // const lvalue reference results in the query() getting destructed and us holding onto a dangling
223  // reference. I think that condition returned by value we would be able to bind to a const lvalue
224  // reference here. But as it is we'll bind to a regular lvalue
225  auto base_query = this->_subproblem.getMooseApp()
226  .theWarehouse()
227  .query()
228  .template condition<AttribSystem>("LinearFVBoundaryCondition")
229  .template condition<AttribThread>(_tid)
230  .template condition<AttribVar>(_var_num)
231  .template condition<AttribSysNum>(this->_sys.number());
232 
233  for (const auto bnd_id : this->_mesh.getBoundaryIDs())
234  {
235  auto base_query_copy = base_query;
236  base_query_copy.template condition<AttribBoundaries>(std::set<BoundaryID>({bnd_id}))
237  .queryInto(bcs);
238  mooseAssert(bcs.size() <= 1, "cannot have multiple BCs on the same boundary");
239  if (!bcs.empty())
240  _boundary_id_to_bc.emplace(bnd_id, bcs[0]);
241  }
242 }
243 
244 template <typename OutputType>
247 {
248  const auto iter = _boundary_id_to_bc.find(bd_id);
249  if (iter == _boundary_id_to_bc.end())
250  return nullptr;
251  else
252  return iter->second;
253 }
254 
255 template <typename OutputType>
256 const Elem * const &
258 {
259  return this->_assembly.elem();
260 }
261 
262 template <typename OutputType>
263 bool
265 {
266  for (const auto bnd_id : fi.boundaryIDs())
267  if (auto it = _boundary_id_to_bc.find(bnd_id); it != _boundary_id_to_bc.end())
268  if (dynamic_cast<LinearFVAdvectionDiffusionFunctorDirichletBC *>(it->second))
269  return true;
270 
271  return false;
272 }
273 
274 // ****************************************************************************
275 // The functions below are used for interfacing the auxiliary and
276 // postprocessor/userobject systems. Most of the postprocessors/
277 // auxkernels require quadrature-based evaluations and we provide that
278 // interface with the functions below.
279 // ****************************************************************************
280 
281 template <typename OutputType>
282 void
284  std::vector<dof_id_type> & dof_indices) const
285 {
286  dof_indices.clear();
287  const auto & elem_info = this->_mesh.elemInfo(elem->id());
288  dof_indices.push_back(elem_info.dofIndices()[this->_sys_num][this->number()]);
289 }
290 
291 template <typename OutputType>
292 void
294 {
295  _element_data->setDofValue(value, index);
296 }
297 
298 template <typename OutputType>
299 void
300 MooseLinearVariableFV<OutputType>::setDofValues(const DenseVector<OutputData> & values)
301 {
302  _element_data->setDofValues(values);
303 }
304 
305 template <typename OutputType>
306 void
308 {
309  _element_data->clearDofIndices();
310 }
311 
312 template <typename OutputType>
315 {
316  return _element_data->dofValues();
317 }
318 
319 template <typename OutputType>
322 {
323  return _neighbor_data->dofValues();
324 }
325 
326 template <typename OutputType>
329 {
330  return _element_data->dofValuesOld();
331 }
332 
333 template <typename OutputType>
336 {
337  return _element_data->dofValuesOlder();
338 }
339 
340 template <typename OutputType>
343 {
344  return _element_data->dofValuesPreviousNL();
345 }
346 
347 template <typename OutputType>
350 {
351  return _neighbor_data->dofValuesOld();
352 }
353 
354 template <typename OutputType>
357 {
358  return _neighbor_data->dofValuesOlder();
359 }
360 
361 template <typename OutputType>
364 {
365  return _neighbor_data->dofValuesPreviousNL();
366 }
367 
368 template <typename OutputType>
371 {
372  timeIntegratorError();
373 }
374 
375 template <typename OutputType>
378 {
379  timeIntegratorError();
380 }
381 
382 template <typename OutputType>
385 {
386  timeIntegratorError();
387 }
388 
389 template <typename OutputType>
392 {
393  timeIntegratorError();
394 }
395 
396 template <typename OutputType>
399 {
400  timeIntegratorError();
401 }
402 
403 template <typename OutputType>
406 {
407  timeIntegratorError();
408 }
409 
410 template <typename OutputType>
413 {
414  timeIntegratorError();
415 }
416 
417 template <typename OutputType>
420 {
421  timeIntegratorError();
422 }
423 
424 template <typename OutputType>
425 const MooseArray<Number> &
427 {
428  timeIntegratorError();
429 }
430 
431 template <typename OutputType>
432 const MooseArray<Number> &
434 {
435  timeIntegratorError();
436 }
437 
438 template <typename OutputType>
439 const MooseArray<Number> &
441 {
442  timeIntegratorError();
443 }
444 
445 template <typename OutputType>
446 const MooseArray<Number> &
448 {
449  timeIntegratorError();
450 }
451 
452 template <typename OutputType>
453 void
455 {
456  _element_data->setGeometry(Moose::Volume);
457  _element_data->computeValues();
458 }
459 
460 template <typename OutputType>
461 void
463 {
464  _element_data->setGeometry(Moose::Face);
465  _element_data->computeValues();
466 }
467 
468 template <typename OutputType>
469 void
471 {
472  _neighbor_data->setGeometry(Moose::Face);
473  _neighbor_data->computeValues();
474 }
475 
476 template <typename OutputType>
477 void
479 {
480  _neighbor_data->setGeometry(Moose::Volume);
481  _neighbor_data->computeValues();
482 }
483 
484 template <typename OutputType>
485 void
487 {
488  lowerDError();
489 }
490 
491 template <typename OutputType>
492 void
494 {
495  nodalError();
496 }
497 
498 template <typename OutputType>
499 void
501 {
502  nodalError();
503 }
504 
505 template <typename OutputType>
506 const std::vector<dof_id_type> &
508 {
509  return _element_data->dofIndices();
510 }
511 
512 template <typename OutputType>
513 const std::vector<dof_id_type> &
515 {
516  return _neighbor_data->dofIndices();
517 }
518 
519 template <typename OutputType>
520 void
522 {
523  lowerDError();
524 }
525 
526 template <typename OutputType>
527 unsigned int
529 {
530  unsigned int state = 0;
531  state = std::max(state, _element_data->oldestSolutionStateRequested());
532  state = std::max(state, _neighbor_data->oldestSolutionStateRequested());
533  return state;
534 }
535 
536 template <typename OutputType>
537 void
539 {
540  _element_data->clearDofIndices();
541  _neighbor_data->clearDofIndices();
542 }
543 
544 template <typename OutputType>
545 void
546 MooseLinearVariableFV<OutputType>::setNodalValue(const OutputType & /*value*/, unsigned int /*idx*/)
547 {
548  nodalError();
549 }
550 
551 template <typename OutputType>
554 {
555  nodalError();
556 }
557 
558 template <typename OutputType>
561 {
562  nodalError();
563 }
564 
565 template <typename OutputType>
566 const std::vector<dof_id_type> &
568 {
569  lowerDError();
570 }
571 
572 template <typename OutputType>
575 {
576  lowerDError();
577 }
578 
579 template <typename OutputType>
580 void
582 {
583  _element_data->insert(vector);
584 }
585 
586 template <typename OutputType>
587 void
589 {
590  mooseError("We don't support value insertion to residuals in MooseLinearVariableFV!");
591 }
592 
593 template <typename OutputType>
594 void
596 {
597  mooseError("We don't support value addition to residuals in MooseLinearVariableFV!");
598 }
599 
600 template <typename OutputType>
601 void
603 {
604  _element_data->setActiveTags(vtags);
605  _neighbor_data->setActiveTags(vtags);
606 }
607 
608 template <typename OutputType>
611 {
612  nodalError();
613 }
614 
615 template <typename OutputType>
618 {
619  nodalError();
620 }
621 
622 template <typename OutputType>
625 {
626  nodalError();
627 }
628 
629 template <typename OutputType>
630 std::size_t
632 {
633  lowerDError();
634 }
635 
636 template <typename OutputType>
639 {
640  return _element_data->vectorTagValue(tag);
641 }
642 
643 template <typename OutputType>
646 {
647  return _element_data->vectorTagDofValue(tag);
648 }
649 
650 template <typename OutputType>
653 {
654  return _element_data->matrixTagValue(tag);
655 }
656 
657 template <typename OutputType>
660 {
661  mooseError("We don't currently implement second derivatives for FV");
662 }
663 
664 template <typename OutputType>
667 {
668  mooseError("We don't currently implement curl for FV");
669 }
670 
671 template <typename OutputType>
674 {
675  mooseError("We don't currently implement divergence for FV");
676 }
677 
678 template <typename OutputType>
681 {
682  mooseError("We don't currently implement second derivatives for FV");
683 }
684 
685 template <typename OutputType>
688 {
689  mooseError("We don't currently implement second derivatives for FV");
690 }
691 
692 template <typename OutputType>
695 {
696  mooseError("We don't currently implement second derivatives for FV");
697 }
698 
699 template <typename OutputType>
702 {
703  return _element_data->sln(Moose::Current);
704 }
705 
706 template <typename OutputType>
709 {
710  return _element_data->sln(Moose::Old);
711 }
712 
713 template <typename OutputType>
716 {
717  return _element_data->sln(Moose::Older);
718 }
719 
720 template <typename OutputType>
723 {
724  return _element_data->gradSln(Moose::Current);
725 }
726 
727 template <typename OutputType>
730 {
731  return _element_data->gradSln(Moose::Old);
732 }
733 
734 template <typename OutputType>
737 {
738  return _neighbor_data->sln(Moose::Current);
739 }
740 
741 template <typename OutputType>
744 {
745  return _neighbor_data->sln(Moose::Old);
746 }
747 
748 template <typename OutputType>
751 {
752  return _neighbor_data->gradSln(Moose::Current);
753 }
754 
755 template <typename OutputType>
758 {
759  return _neighbor_data->gradSln(Moose::Old);
760 }
761 
762 template <typename OutputType>
765 {
766  adError();
767 }
768 
769 template <typename OutputType>
772 {
773  adError();
774 }
775 
776 template <typename OutputType>
779 {
780  adError();
781 }
782 
783 template <typename OutputType>
786 {
787  adError();
788 }
789 
790 template <typename OutputType>
793 {
794  adError();
795 }
796 
797 template <typename OutputType>
800 {
801  adError();
802 }
803 
804 template <typename OutputType>
807 {
808  adError();
809 }
810 
811 template <typename OutputType>
814 {
815  adError();
816 }
817 
818 template <typename OutputType>
821 {
822  adError();
823 }
824 
825 template <typename OutputType>
828 {
829  adError();
830 }
831 
832 template <typename OutputType>
835 {
836  adError();
837 }
838 
839 template <typename OutputType>
842 {
843  adError();
844 }
845 
846 template <typename OutputType>
849 {
850  adError();
851 }
852 
853 template <typename OutputType>
856 {
857  adError();
858 }
859 
860 template <typename OutputType>
861 const MooseArray<ADReal> &
863 {
864  adError();
865 }
866 
867 template <typename OutputType>
868 const MooseArray<ADReal> &
870 {
871  adError();
872 }
873 
874 template <typename OutputType>
875 const MooseArray<ADReal> &
877 {
878  adError();
879 }
880 
881 template <typename OutputType>
882 const dof_id_type &
884 {
885  nodalError();
886 }
887 
888 template <typename OutputType>
889 const dof_id_type &
891 {
892  nodalError();
893 }
894 
895 template <typename OutputType>
896 void
898 {
899  _element_data->sizeMatrixTagData();
900 }
901 
902 template class MooseLinearVariableFV<Real>;
virtual const DoFValue & vectorTagDofValue(TagID tag) const override
virtual void clearAllDofIndices() override final
typename OutputTools< typename Moose::ADType< T >::type >::VariableSecond ADTemplateVariableSecond
Definition: MooseTypes.h:610
const Elem *const & elem() const
Return the current element.
Definition: Assembly.h:375
virtual const MooseArray< libMesh::Number > & dofValuesDuDotDotDuNeighbor() const override
virtual void setActiveTags(const std::set< TagID > &vtags) override
Set the active vector tags.
typename OutputTools< typename Moose::ADType< T >::type >::VariableCurl ADTemplateVariableCurl
Definition: MooseTypes.h:612
virtual bool isExtrapolatedBoundaryFace(const FaceInfo &fi, const Elem *elem, const Moose::StateArg &state) const override
Returns whether this (sided) face is an extrapolated boundary face for this functor.
virtual const DoFValue & dofValuesOldNeighbor() const override
virtual void computeElemValuesFace() override
Compute values at facial quadrature points.
Base class for boundary conditions for linear FV systems.
virtual const MooseArray< OutputType > & nodalValueOlderArray() const override
virtual const ADTemplateVariableCurl< OutputType > & adCurlSln() const override
AD curl solution getter.
unsigned int n_threads()
const std::set< BoundaryID > & boundaryIDs() const
Const getter for every associated boundary ID.
Definition: FaceInfo.h:120
virtual DotType evaluateDot(const ElemArg &elem, const StateArg &) const override final
Evaluate the functor time derivative with a given element.
virtual const FieldVariableValue & sln() const override
virtual const DoFValue & dofValuesOlder() const override
virtual bool isDirichletBoundaryFace(const FaceInfo &fi) const
If the variable has a dirichlet boundary condition at face described by fi .
void paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Definition: MooseBase.h:435
unsigned int TagID
Definition: MooseTypes.h:210
Class for stuff related to variables.
virtual const MooseArray< OutputType > & nodalValueArray() const override
Methods for retrieving values of variables at the nodes in a MooseArray for AuxKernelBase.
virtual const Elem *const & currentElem() const override
Current element this variable is evaluated at.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:333
virtual void setDofValues(const DenseVector< OutputData > &values) override
Set local DOF values and evaluate the values on quadrature points.
virtual const ADTemplateVariableGradient< OutputType > & adGradSlnDot() const override
AD grad of time derivative solution getter.
virtual const DoFValue & dofValuesDotOld() const override
virtual const FieldVariablePhiSecond & secondPhiFace() const override final
Return the rank-2 tensor of second derivatives of the variable&#39;s shape functions on an element face...
typename MooseVariableField< OutputType >::FieldVariablePhiSecond FieldVariablePhiSecond
const Elem & elem() const
Definition: FaceInfo.h:81
const FieldVariablePhiDivergence & divPhi() const override final
Divergence of the shape functions.
virtual const FieldVariablePhiSecond & secondPhiFaceNeighbor() const override final
Return the rank-2 tensor of second derivatives of the variable&#39;s shape functions on a neighboring ele...
virtual const ADTemplateVariableValue< OutputType > & adSln() const override
AD solution getter.
virtual const FieldVariableGradient & gradSlnOldNeighbor() const override
virtual const DoFValue & nodalMatrixTagValue(TagID tag) const override
const ElemInfo * neighborInfo() const
Definition: FaceInfo.h:86
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
virtual const DoFValue & dofValues() const override
dof values getters
registerMooseObject("MooseApp", MooseLinearVariableFVReal)
typename OutputTools< typename Moose::ADType< T >::type >::VariableValue ADTemplateVariableValue
Definition: MooseTypes.h:604
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual const MooseArray< ADReal > & adDofValues() const override
Return the AD dof values.
virtual void getDofIndices(const Elem *elem, std::vector< dof_id_type > &dof_indices) const override
virtual const DoFValue & dofValuesPreviousNL() const override
const ElemInfo * elemInfo() const
Definition: FaceInfo.h:85
virtual void setNodalValue(const OutputType &value, unsigned int idx=0) override
LinearFVBoundaryCondition * getBoundaryCondition(const BoundaryID bd_id) const
Get the boundary condition object which corresponds to the given boundary ID.
virtual const std::vector< dof_id_type > & dofIndicesNeighbor() const final
Get neighbor DOF indices for currently selected element.
virtual const DoFValue & dofValuesDotNeighbor() const override
virtual const FieldVariablePhiSecond & secondPhi() const override final
Return the rank-2 tensor of second derivatives of the variable&#39;s elemental shape functions.
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job...
libMesh::CompareTypes< T, T2 >::supertype linearInterpolation(const T &value1, const T2 &value2, const FaceInfo &fi, const bool one_is_elem, const InterpMethod interp_method=InterpMethod::Average)
A simple linear interpolation of values between cell centers to a cell face.
Definition: MathFVUtils.h:150
DualNumber< Real, DNDerivativeType, true > ADReal
Definition: ADRealForward.h:46
void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job...
virtual void clearDofIndices() override
Clear out the dof indices.
virtual const std::vector< dof_id_type > & dofIndices() const final
Get local DoF indices.
virtual void computeElemValues() override
Compute values at interior quadrature points.
THREAD_ID _tid
Thread ID.
auto max(const L &left, const R &right)
virtual const ADTemplateVariableCurl< OutputType > & adCurlSlnNeighbor() const override
AD curl neighbor solution getter.
Moose::DOFType< Real >::type OutputData
static InputParameters validParams()
virtual const MooseArray< libMesh::Number > & dofValuesDuDotDuNeighbor() const override
virtual const FieldVariablePhiSecond & secondPhiNeighbor() const override final
Return the rank-2 tensor of second derivatives of the variable&#39;s shape functions on a neighboring ele...
virtual const ADTemplateVariableValue< OutputType > & adUDotDot() const override
AD second time derivative getter.
virtual const ADTemplateVariableGradient< OutputType > & adGradSlnNeighbor() const override
AD grad neighbor solution getter.
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition: FaceInfo.h:36
CONSTANT
virtual const FieldVariableValue & slnOld() const override
typename MooseVariableField< OutputType >::FieldVariablePhiValue FieldVariablePhiValue
const Elem * neighborPtr() const
Definition: FaceInfo.h:84
void timeIntegratorError() const
Throw an error when somebody requests time-related data from this variable.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
A structure defining a "face" evaluation calling argument for Moose functors.
virtual const MooseArray< ADReal > & adDofValuesNeighbor() const override
Return the AD neighbor dof values.
virtual void insertLower(libMesh::NumericVector< libMesh::Number > &vector) override
Insert the currently cached degree of freedom values for a lower-dimensional element into the provide...
const FaceInfo * fi
a face information object which defines our location in space
virtual const FieldVariablePhiValue & phiLower() const override
Return the variable&#39;s shape functions on a lower-dimensional element.
SystemBase & _sys
System this variable is part of.
SolutionIterationType iteration_type
The solution iteration type, e.g. time or nonlinear.
boundary_id_type BoundaryID
virtual const FieldVariableValue & matrixTagValue(TagID tag) const override
typename OutputTools< typename Moose::ADType< T >::type >::VariableGradient ADTemplateVariableGradient
Definition: MooseTypes.h:607
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
std::unique_ptr< MooseVariableDataLinearFV< OutputType > > _element_data
Holder for all the data associated with the "main" element.
virtual const ADTemplateVariableGradient< OutputType > & adGradSlnNeighborDot() const override
AD grad of time derivative neighbor solution getter.
A structure that is used to evaluate Moose functors logically at an element/cell center.
typename MooseVariableField< OutputType >::FieldVariableGradient FieldVariableGradient
MooseLinearVariableFV(const InputParameters &parameters)
virtual const dof_id_type & nodalDofIndex() const override final
virtual const MooseArray< libMesh::Number > & dofValuesDuDotDu() const override
virtual const ADTemplateVariableSecond< OutputType > & adSecondSln() const override
AD second solution getter.
const FieldVariablePhiValue & curlPhi() const override final
Curl of the shape functions.
virtual const DoFValue & dofValuesDotDotNeighbor() const override
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:64
virtual void setDofValue(const OutputData &, unsigned int) override
Degree of freedom value setters.
virtual const std::vector< dof_id_type > & dofIndicesLower() const override final
Get dof indices for the current lower dimensional element (this is meaningful when performing mortar ...
virtual const FieldVariableValue & slnNeighbor() const override
virtual const FieldVariableGradient & gradSlnNeighbor() const override
neighbor solution gradients
MONOMIAL
virtual const FieldVariableGradient & gradSlnOld() const override
const Elem * elemPtr() const
Definition: FaceInfo.h:82
virtual const MooseArray< OutputType > & nodalValueOldArray() const override
virtual const DoFValue & dofValuesOlderNeighbor() const override
const std::vector< std::vector< dof_id_type > > & dofIndices() const
Definition: ElemInfo.h:39
virtual const DoFValue & dofValuesDotDotOldNeighbor() const override
virtual void computeNodalNeighborValues() override final
Compute nodal values of this variable in the neighbor.
virtual void add(libMesh::NumericVector< libMesh::Number > &vector) override
Add the currently cached degree of freedom values into the provided vector.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void computeNeighborValuesFace() override
Compute values at facial quadrature points for the neighbor.
virtual const DoFValue & dofValuesNeighbor() const override
virtual const FieldVariableValue & vectorTagValue(TagID tag) const override
tag values getters
Assembly & _assembly
Assembly data.
virtual void sizeMatrixTagData() override
Size data structures related to matrix tagging.
std::unique_ptr< MooseVariableDataLinearFV< OutputType > > _neighbor_data
Holder for all the data associated with the "neighbor" element.
virtual void computeNodalValues() override final
Compute nodal values of this variable.
virtual void setLowerDofValues(const DenseVector< OutputData > &values) override
Set local DOF values for a lower dimensional element and evaluate the values on quadrature points...
static InputParameters validParams()
virtual const DoFValue & dofValuesOld() const override
virtual const dof_id_type & nodalDofIndexNeighbor() const override final
typename MooseVariableField< OutputType >::FieldVariablePhiDivergence FieldVariablePhiDivergence
Real getElemValue(const ElemInfo &elem_info, const StateArg &state) const
Get the solution value for the provided element and seed the derivative for the corresponding dof ind...
virtual void computeLowerDValues() override final
compute values at quadrature points on the lower dimensional element
void cacheBoundaryBCMap()
Setup the boundary to Dirichlet BC map.
const Elem *const & neighbor() const
Return the neighbor element.
Definition: Assembly.h:431
virtual std::size_t phiLowerSize() const override final
Return the number of shape functions on the lower dimensional element for this variable.
virtual const DoFValue & dofValuesDot() const override
IntRange< T > make_range(T beg, T end)
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
typename MooseVariableField< OutputType >::FieldVariableValue FieldVariableValue
virtual const DoFValue & dofValuesPreviousNLNeighbor() const override
virtual const DoFValue & dofValuesDotOldNeighbor() const override
virtual void insert(libMesh::NumericVector< libMesh::Number > &vector) override
Insert the currently cached degree of freedom values into the provided vector.
virtual const ADTemplateVariableValue< OutputType > & adUDotNeighbor() const override
AD neighbor time derivative getter.
State argument for evaluating functors.
virtual const OutputTools< T >::VariableSecond & second()
The second derivative of the variable this object is operating on.
virtual const ADTemplateVariableValue< OutputType > & adSlnNeighbor() const override
AD neighbor solution getter.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
virtual const DoFValue & dofValuesDotDot() const override
virtual const ADTemplateVariableSecond< OutputType > & adSecondSlnNeighbor() const override
AD second neighbor solution getter.
virtual void computeNeighborValues() override
Compute values at quadrature points for the neighbor.
Class used for caching additional information for elements such as the volume and centroid...
Definition: ElemInfo.h:25
virtual const MooseArray< libMesh::Number > & dofValuesDuDotDotDu() const override
virtual unsigned int oldestSolutionStateRequested() const override final
The oldest solution state that is requested for this variable (0 = current, 1 = old, 2 = older, etc).
virtual const DoFValue & dofValuesDotDotOld() const override
void interpolate(InterpMethod m, T &result, const T2 &value1, const T3 &value2, const FaceInfo &fi, const bool one_is_elem)
Provides interpolation of face values for non-advection-specific purposes (although it can/will still...
Definition: MathFVUtils.h:282
virtual const MooseArray< ADReal > & adDofValuesDot() const override
Return the AD time derivatives at dofs.
typename MooseVariableField< OutputType >::DoFValue DoFValue
virtual const FieldVariableValue & slnOlder() const override
virtual const ADTemplateVariableValue< OutputType > & adUDot() const override
AD time derivative getter.
virtual const FieldVariableGradient & gradSln() const override
element gradients
virtual const ADTemplateVariableGradient< OutputType > & adGradSln() const override
AD grad solution getter.
Moose::ShapeType< Real >::type OutputShape
virtual const DoFValue & nodalVectorTagValue(TagID) const override
SubdomainID subdomain_id() const
We return the subdomain ID of the corresponding libmesh element.
Definition: ElemInfo.h:43
unsigned int state
The state.
uint8_t dof_id_type
virtual const FieldVariableValue & slnOldNeighbor() const override
VarFaceNeighbors faceType(const std::pair< unsigned int, unsigned int > &var_sys) const
Returns which side(s) the given variable-system number pair is defined on for this face...
Definition: FaceInfo.h:225
virtual ValueType evaluate(const ElemArg &elem, const StateArg &) const override final
Evaluate the functor with a given element.
virtual const ADTemplateVariableValue< OutputType > & adUDotDotNeighbor() const override
AD neighbor second time derivative getter.