https://mooseframework.inl.gov
MooseLinearVariableFV.h
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 #pragma once
11 
12 #include "MooseTypes.h"
13 #include "MooseVariableField.h"
14 #include "SubProblem.h"
15 #include "MooseMesh.h"
17 #include "GradientLimiterType.h"
18 
19 #include "libmesh/numeric_vector.h"
20 #include "libmesh/dof_map.h"
21 #include "libmesh/elem.h"
22 #include "libmesh/quadrature.h"
23 #include "libmesh/dense_vector.h"
24 #include "libmesh/enum_fe_family.h"
25 
26 template <typename>
28 
30 class AuxiliarySystem;
31 class FVDirichletBCBase;
32 class FVFluxBC;
34 class LinearSystem;
35 
36 namespace libMesh
37 {
38 template <typename>
39 class NumericVector;
40 }
41 
45 template <typename OutputType>
46 class MooseLinearVariableFV : public MooseVariableField<OutputType>
47 {
48 public:
52 
58 
63 
68 
85 
88 
89  virtual bool isFV() const override { return true; }
90 
94  virtual bool isDirichletBoundaryFace(const FaceInfo & fi) const;
95 
100 
106  void computeCellGradients(const Moose::FV::GradientLimiterType limiter_type);
107 
115 
119  virtual bool needsGradientVectorStorage() const override { return _needs_cell_gradients; }
120 
121  virtual bool isExtrapolatedBoundaryFace(const FaceInfo & fi,
122  const Elem * elem,
123  const Moose::StateArg & state) const override;
124 
130  VectorValue<Real> gradSln(const ElemInfo & elem_info, const StateArg & state) const;
131 
137  Real gradSlnComponent(const ElemInfo & elem_info, unsigned int component) const;
138 
145  VectorValue<Real> gradSln(const ElemInfo & elem_info,
146  const StateArg & state,
147  const Moose::FV::GradientLimiterType limiter_type) const;
148 
155  VectorValue<Real> limitedGradSln(const ElemInfo & elem_info,
156  const StateArg & state,
157  const Moose::FV::GradientLimiterType limiter_type) const;
158 
164  VectorValue<Real> gradSln(const FaceInfo & fi, const StateArg & state) const;
165 
173  const StateArg & state,
174  const Moose::FV::GradientLimiterType limiter_type) const;
175 
183  const StateArg & state,
184  const Moose::FV::GradientLimiterType limiter_type) const;
185 
186  virtual void initialSetup() override;
187  virtual void timestepSetup() override;
188 
196  Real getElemValue(const ElemInfo & elem_info, const StateArg & state) const;
197 
203 
204  const std::unordered_map<BoundaryID, LinearFVBoundaryCondition *> & getBoundaryConditionMap()
205  {
206  return _boundary_id_to_bc;
207  }
208 
209  virtual void prepareIC() override;
210 
211  virtual bool isNodal() const override final { return false; }
212 
213  virtual bool hasDoFsOnNodes() const override final { return false; }
214 
215  virtual bool isNodalDefined() const override final { return false; }
216 
217  virtual bool supportsFaceArg() const override final { return true; }
218  virtual bool supportsElemSideQpArg() const override final { return false; }
219 
220  virtual const Elem * const & currentElem() const override;
221 
222  virtual bool computingSecond() const override final { return false; }
223  virtual bool computingCurl() const override final { return false; }
224  virtual bool computingDiv() const override final { return false; }
225  virtual bool usesSecondPhiNeighbor() const override final { return false; }
226 
227  virtual void sizeMatrixTagData() override;
228 
229  void requireQpComputations() const override { _compute_qp_data = true; }
230  bool supportsQpBasedLoops() const override { return _compute_qp_data; }
231  bool supportsGeometricInfoBasedLoops() const override { return true; }
232 
233 protected:
235  [[noreturn]] void timeIntegratorError() const;
236 
238  [[noreturn]] void lowerDError() const;
239 
241  [[noreturn]] void nodalError() const;
242 
244  [[noreturn]] void adError() const;
245 
247  [[noreturn]] void gradientStateError(const StateArg & state) const;
248 
252  void cacheBoundaryBCMap();
253 
255 
257  mutable bool _compute_qp_data = false;
258 
261 
264 
268 
270  const std::vector<std::unique_ptr<libMesh::NumericVector<libMesh::Number>>> & _grad_container;
271 
275  std::unique_ptr<MooseVariableDataLinearFV<OutputType>> _element_data;
276 
280  std::unique_ptr<MooseVariableDataLinearFV<OutputType>> _neighbor_data;
281 
284  std::unordered_map<BoundaryID, LinearFVBoundaryCondition *> _boundary_id_to_bc;
285 
287  const unsigned int _sys_num;
288 
289  friend void Moose::initDofIndices<>(MooseLinearVariableFV<OutputType> &, const Elem &);
290 
291 private:
295 
296  virtual ValueType evaluate(const ElemArg & elem, const StateArg &) const override final;
297  virtual ValueType evaluate(const FaceArg & face, const StateArg &) const override final;
298  virtual ValueType evaluate(const NodeArg & node, const StateArg &) const override final;
299  virtual ValueType evaluate(const ElemPointArg & elem_point,
300  const StateArg & state) const override final;
301  virtual ValueType evaluate(const ElemQpArg & elem_qp,
302  const StateArg & state) const override final;
303  virtual ValueType evaluate(const ElemSideQpArg & elem_side_qp,
304  const StateArg & state) const override final;
305  virtual GradientType evaluateGradient(const ElemQpArg & qp_arg,
306  const StateArg &) const override final;
307  virtual GradientType evaluateGradient(const ElemArg & elem_arg,
308  const StateArg &) const override final;
309  virtual GradientType evaluateGradient(const FaceArg & face,
310  const StateArg &) const override final;
311  virtual DotType evaluateDot(const ElemArg & elem, const StateArg &) const override final;
312 
317 
328 
329 public:
330  // *********************************************************************************
331  // *********************************************************************************
332  // The following functions are separated here because they are not essential for the
333  // solver but are necessary to interface with the auxiliary and postprocessor
334  // systems.
335  // *********************************************************************************
336  // *********************************************************************************
337 
338  virtual void setDofValue(const DofValue & /*value*/, unsigned int /*index*/) override;
339 
340  virtual void getDofIndices(const Elem * elem,
341  std::vector<dof_id_type> & dof_indices) const override;
342 
343  virtual void setDofValues(const DenseVector<DofValue> & values) override;
344 
345  virtual void clearDofIndices() override;
346 
347  virtual unsigned int numberOfDofs() const override final { return 1; }
348  virtual unsigned int numberOfDofsNeighbor() override final { return 1; }
349 
350  virtual unsigned int oldestSolutionStateRequested() const override final;
351 
352  virtual void clearAllDofIndices() override final;
353 
354  [[noreturn]] virtual const std::vector<dof_id_type> & dofIndicesLower() const override final;
355  [[noreturn]] virtual const FieldVariablePhiValue & phiLower() const override;
356 
357  // Overriding these to make sure nothing happens during residual/jacobian setup.
358  // The only time this can actually happen is when residual setup is called on the auxiliary
359  // system.
360  virtual void residualSetup() override {}
361  virtual void jacobianSetup() override {}
362 
363  virtual libMesh::FEContinuity getContinuity() const override
364  {
365  return _element_data->getContinuity();
366  };
367 
368  virtual void setNodalValue(const OutputType & value, unsigned int idx = 0) override;
369 
370  [[noreturn]] virtual const DofValues & nodalVectorTagValue(TagID) const override;
371 
372  virtual const std::vector<dof_id_type> & dofIndices() const final;
373  virtual const std::vector<dof_id_type> & dofIndicesNeighbor() const final;
374 
375  virtual void prepare() override final {}
376  virtual void prepareNeighbor() override final {}
377  virtual void prepareAux() override final {}
378  virtual void reinitNode() override final {}
379  virtual void reinitNodes(const std::vector<dof_id_type> & /*nodes*/) override final {}
380  virtual void reinitNodesNeighbor(const std::vector<dof_id_type> & /*nodes*/) override final {}
381  virtual void reinitAux() override final {}
382  virtual void reinitAuxNeighbor() override final {}
383  virtual void prepareLowerD() override final {}
384 
385  virtual void computeElemValuesFace() override;
386  virtual void computeNeighborValuesFace() override;
387  virtual void computeNeighborValues() override;
388  virtual void computeLowerDValues() override final;
389 
390  virtual void computeNodalNeighborValues() override final;
391  virtual void computeNodalValues() override final;
392 
393  virtual void computeElemValues() override;
394  virtual void computeFaceValues(const FaceInfo & /*fi*/) override {}
395 
396  virtual void setLowerDofValues(const DenseVector<DofValue> & values) override;
397 
398  virtual void insert(libMesh::NumericVector<libMesh::Number> & vector) override;
399  virtual void insertLower(libMesh::NumericVector<libMesh::Number> & vector) override;
400  virtual void add(libMesh::NumericVector<libMesh::Number> & vector) override;
401 
402  virtual void setActiveTags(const std::set<TagID> & vtags) override;
403 
404  [[noreturn]] virtual const MooseArray<OutputType> & nodalValueArray() const override;
405  [[noreturn]] virtual const MooseArray<OutputType> & nodalValueOldArray() const override;
406  [[noreturn]] virtual const MooseArray<OutputType> & nodalValueOlderArray() const override;
407 
408  virtual const FieldVariablePhiValue & phi() const override final { return _phi; }
409  virtual const FieldVariablePhiGradient & gradPhi() const override final { return _grad_phi; }
410  [[noreturn]] virtual const FieldVariablePhiSecond & secondPhi() const override final;
411  [[noreturn]] const FieldVariablePhiValue & curlPhi() const override final;
412  [[noreturn]] const FieldVariablePhiDivergence & divPhi() const override final;
413 
414  virtual const FieldVariablePhiValue & phiFace() const override final { return _phi_face; }
415  virtual const FieldVariablePhiGradient & gradPhiFace() const override final
416  {
417  return _grad_phi_face;
418  }
419  [[noreturn]] virtual const FieldVariablePhiSecond & secondPhiFace() const override final;
420 
421  virtual const FieldVariablePhiValue & phiFaceNeighbor() const override final
422  {
423  return _phi_face_neighbor;
424  }
425  virtual const FieldVariablePhiGradient & gradPhiFaceNeighbor() const override final
426  {
428  }
429  [[noreturn]] virtual const FieldVariablePhiSecond & secondPhiFaceNeighbor() const override final;
430 
431  virtual const FieldVariablePhiValue & phiNeighbor() const override final { return _phi_neighbor; }
432  virtual const FieldVariablePhiGradient & gradPhiNeighbor() const override final
433  {
434  return _grad_phi_neighbor;
435  }
436  [[noreturn]] virtual const FieldVariablePhiSecond & secondPhiNeighbor() const override final;
437 
438  virtual const FieldVariableValue & vectorTagValue(TagID tag) const override;
439  virtual const DofValues & vectorTagDofValue(TagID tag) const override;
440  [[noreturn]] virtual const DofValues & nodalMatrixTagValue(TagID tag) const override;
441  virtual const FieldVariableValue & matrixTagValue(TagID tag) const override;
442 
443  virtual const FieldVariableValue & sln() const override;
444  virtual const FieldVariableValue & slnOld() const override;
445  virtual const FieldVariableValue & slnOlder() const override;
446  virtual const FieldVariableGradient & gradSln() const override;
447  virtual const FieldVariableGradient & gradSlnOld() const override;
448  virtual const FieldVariableValue & slnNeighbor() const override;
449  virtual const FieldVariableValue & slnOldNeighbor() const override;
450  virtual const FieldVariableGradient & gradSlnNeighbor() const override;
451  virtual const FieldVariableGradient & gradSlnOldNeighbor() const override;
452 
453  [[noreturn]] virtual const ADTemplateVariableSecond<OutputType> & adSecondSln() const override;
454  [[noreturn]] virtual const ADTemplateVariableValue<OutputType> & adUDot() const override;
455  [[noreturn]] virtual const ADTemplateVariableValue<OutputType> & adUDotDot() const override;
456  [[noreturn]] virtual const ADTemplateVariableGradient<OutputType> & adGradSlnDot() const override;
457  [[noreturn]] virtual const ADTemplateVariableValue<OutputType> & adSlnNeighbor() const override;
458  [[noreturn]] virtual const ADTemplateVariableGradient<OutputType> &
459  adGradSlnNeighbor() const override;
460  [[noreturn]] virtual const ADTemplateVariableSecond<OutputType> &
461  adSecondSlnNeighbor() const override;
462  [[noreturn]] virtual const ADTemplateVariableValue<OutputType> & adUDotNeighbor() const override;
463  [[noreturn]] virtual const ADTemplateVariableValue<OutputType> &
464  adUDotDotNeighbor() const override;
465  [[noreturn]] virtual const ADTemplateVariableGradient<OutputType> &
466  adGradSlnNeighborDot() const override;
467  [[noreturn]] virtual const ADTemplateVariableValue<OutputType> & adSln() const override;
468  [[noreturn]] virtual const ADTemplateVariableGradient<OutputType> & adGradSln() const override;
469  [[noreturn]] virtual const ADTemplateVariableCurl<OutputType> & adCurlSln() const override;
470  [[noreturn]] virtual const ADTemplateVariableCurl<OutputType> &
471  adCurlSlnNeighbor() const override;
472 
473  virtual const DofValues & dofValues() const override;
474  virtual const DofValues & dofValuesOld() const override;
475 
476  virtual const DofValues & dofValuesOlder() const override;
477  virtual const DofValues & dofValuesPreviousNL() const override;
478  virtual const DofValues & dofValuesNeighbor() const override;
479  virtual const DofValues & dofValuesOldNeighbor() const override;
480  virtual const DofValues & dofValuesOlderNeighbor() const override;
481  virtual const DofValues & dofValuesPreviousNLNeighbor() const override;
482  [[noreturn]] virtual const DofValues & dofValuesDot() const override;
483  [[noreturn]] virtual const DofValues & dofValuesDotNeighbor() const override;
484  [[noreturn]] virtual const DofValues & dofValuesDotOld() const override;
485  [[noreturn]] virtual const DofValues & dofValuesDotOldNeighbor() const override;
486  [[noreturn]] virtual const DofValues & dofValuesDotDot() const override;
487  [[noreturn]] virtual const DofValues & dofValuesDotDotNeighbor() const override;
488  [[noreturn]] virtual const DofValues & dofValuesDotDotOld() const override;
489  [[noreturn]] virtual const DofValues & dofValuesDotDotOldNeighbor() const override;
490  [[noreturn]] virtual const MooseArray<libMesh::Number> & dofValuesDuDotDu() const override;
491  [[noreturn]] virtual const MooseArray<libMesh::Number> &
492  dofValuesDuDotDuNeighbor() const override;
493  [[noreturn]] virtual const MooseArray<libMesh::Number> & dofValuesDuDotDotDu() const override;
494  [[noreturn]] virtual const MooseArray<libMesh::Number> &
495  dofValuesDuDotDotDuNeighbor() const override;
496 
497  [[noreturn]] virtual const ADDofValues & adDofValues() const override;
498  [[noreturn]] virtual const ADDofValues & adDofValuesNeighbor() const override;
499  [[noreturn]] virtual const ADDofValues & adDofValuesDot() const override;
500  [[noreturn]] virtual const dof_id_type & nodalDofIndex() const override final;
501  [[noreturn]] virtual const dof_id_type & nodalDofIndexNeighbor() const override final;
502 
503  virtual std::size_t phiSize() const override final { return _phi.size(); }
504  virtual std::size_t phiFaceSize() const override final { return _phi_face.size(); }
505  virtual std::size_t phiNeighborSize() const override final { return _phi_neighbor.size(); }
506  virtual std::size_t phiFaceNeighborSize() const override final
507  {
508  return _phi_face_neighbor.size();
509  }
510  [[noreturn]] virtual std::size_t phiLowerSize() const override final;
511 };
512 
513 template <typename OutputType>
514 typename MooseLinearVariableFV<OutputType>::ValueType
515 MooseLinearVariableFV<OutputType>::evaluate(const ElemArg & elem_arg, const StateArg & state) const
516 {
517  const auto & elem_info = this->_mesh.elemInfo(elem_arg.elem->id());
518  return getElemValue(elem_info, state);
519 }
520 
521 template <typename OutputType>
524  const StateArg & state) const
525 {
526  const auto & elem_info = this->_mesh.elemInfo(elem_point.elem->id());
527  return getElemValue(elem_info, state);
528 }
529 
530 template <typename OutputType>
533 {
534  const auto & elem_info = this->_mesh.elemInfo(elem_qp.elem->id());
535  return getElemValue(elem_info, state);
536 }
537 
538 template <typename OutputType>
541  const StateArg & state) const
542 {
543  return (*this)(ElemPointArg{elem_side_qp.elem, elem_side_qp.point, false}, state);
544 }
545 
546 template <typename OutputType>
549  const StateArg & state) const
550 {
551  const auto & elem_info = this->_mesh.elemInfo(qp_arg.elem->id());
552  return gradSln(elem_info, state);
553 }
554 
555 template <typename OutputType>
558  const StateArg & state) const
559 {
560  const auto & elem_info = this->_mesh.elemInfo(elem_arg.elem->id());
561  return gradSln(elem_info, state);
562 }
563 
564 template <typename OutputType>
567  const StateArg & state) const
568 {
569  mooseAssert(face.fi, "We must have a non-null face information");
570  return gradSln(*face.fi, state);
571 }
572 
573 template <typename OutputType>
574 void
576 {
577  mooseError("MooseLinearVariableFV does not support time integration at the moment! The variable "
578  "which is causing the issue: ",
579  this->name());
580 }
581 
582 template <typename OutputType>
583 void
585 {
586  mooseError("MooseLinearVariableFV does not currently support ElemInfo/FaceInfo gradient "
587  "evaluation for non-current states. Requested state index ",
588  state.state,
589  " for variable '",
590  this->name(),
591  "'. Old-state requests typically use state index 1.");
592 }
593 
594 template <typename OutputType>
595 void
597 {
598  mooseError("Lower dimensional element support not implemented for finite volume variables!The "
599  "variable which is causing the issue: ",
600  this->name());
601 }
602 
603 template <typename OutputType>
604 void
606 {
607  mooseError("FV variables don't support nodal variable treatment! The variable which is causing "
608  "the issue: ",
609  this->name());
610 }
611 
612 template <typename OutputType>
613 void
615 {
616  mooseError("Linear FV variable does not support automatic differentiation, the variable which is "
617  "attempting it is: ",
618  this->name());
619 }
620 
621 // Declare all the specializations, as the template specialization declarations below must know
622 template <>
623 ADReal MooseLinearVariableFV<Real>::evaluateDot(const ElemArg & elem, const StateArg & state) const;
624 
625 // Prevent implicit instantiation in other translation units where these classes are used
626 extern template class MooseLinearVariableFV<Real>;
virtual const FieldVariablePhiGradient & gradPhiFace() const override final
Return the gradients of the variable&#39;s shape functions on an element face.
virtual void clearAllDofIndices() override final
typename OutputTools< typename Moose::ADType< T >::type >::VariableSecond ADTemplateVariableSecond
Definition: MooseTypes.h:654
virtual const MooseArray< libMesh::Number > & dofValuesDuDotDotDuNeighbor() const override
virtual void setActiveTags(const std::set< TagID > &vtags) override
Set the active vector tags.
GradientLimiterType
Cell-gradient limiter variants used for MUSCL-style reconstructions.
typename OutputTools< typename Moose::ADType< T >::type >::VariableCurl ADTemplateVariableCurl
Definition: MooseTypes.h:656
MooseLinearVariableFV< Real > MooseLinearVariableFVReal
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 void prepare() override final
Prepare the elemental degrees of freedom.
virtual void computeElemValuesFace() override
Compute values at facial quadrature points.
virtual const DofValues & dofValuesDotDot() const override
Base class for boundary conditions for linear FV systems.
virtual const MooseArray< OutputType > & nodalValueOlderArray() const override
virtual void reinitAuxNeighbor() override final
virtual const ADTemplateVariableCurl< OutputType > & adCurlSln() const override
AD curl solution getter.
virtual DotType evaluateDot(const ElemArg &elem, const StateArg &) const override final
Evaluate the functor time derivative with a given element.
void adError() const
Throw an error when somebody wants to use this variable with automatic differentiation.
bool supportsQpBasedLoops() const override
Whether this variable supports QP-indexed loops.
std::unordered_map< BoundaryID, LinearFVBoundaryCondition * > _boundary_id_to_bc
Map for easily accessing the boundary conditions based on the boundary IDs.
virtual const FieldVariableValue & sln() const override
virtual bool isDirichletBoundaryFace(const FaceInfo &fi) const
If the variable has a dirichlet boundary condition at face described by fi .
virtual const DofValues & dofValuesDotOld() const override
unsigned int TagID
Definition: MooseTypes.h:238
const FieldVariablePhiGradient & _grad_phi_face
Class for stuff related to variables.
const FieldVariablePhiGradient & _grad_phi_face_neighbor
virtual const MooseArray< OutputType > & nodalValueArray() const override
Methods for retrieving values of variables at the nodes in a MooseArray for AuxKernelBase.
const FieldVariablePhiGradient & _grad_phi_neighbor
LinearSystem *const _linear_system
Owning concrete system pointers. One will be null.
VectorValue< Real > limitedGradSln(const ElemInfo &elem_info, const StateArg &state, const Moose::FV::GradientLimiterType limiter_type) const
Get the limited gradient at a cell center.
virtual const Elem *const & currentElem() const override
Current element this variable is evaluated at.
virtual const DofValues & dofValuesDotDotNeighbor() const override
virtual const ADTemplateVariableGradient< OutputType > & adGradSlnDot() const override
AD grad of time derivative solution getter.
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...
virtual bool isNodal() const override final
Is this variable nodal.
typename MooseVariableField< OutputType >::FieldVariablePhiSecond FieldVariablePhiSecond
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 DofValues & dofValues() const override
dof values getters
virtual const ADTemplateVariableValue< OutputType > & adSln() const override
AD solution getter.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
virtual const FieldVariableGradient & gradSlnOldNeighbor() const override
Real gradSlnComponent(const ElemInfo &elem_info, unsigned int component) const
Get one raw gradient component at a cell center without materializing the full gradient.
virtual void residualSetup() override
virtual const DofValues & nodalVectorTagValue(TagID) const override
Base class for finite volume Dirichlet boundaray conditions.
const unsigned int _sys_num
Cache the number of the system this variable belongs to.
virtual std::size_t phiFaceSize() const override final
Return phiFace size.
typename OutputTools< typename Moose::ADType< T >::type >::VariableValue ADTemplateVariableValue
Definition: MooseTypes.h:648
virtual const DofValues & dofValuesPreviousNL() const override
virtual const DofValues & nodalMatrixTagValue(TagID tag) const override
virtual const DofValues & dofValuesPreviousNLNeighbor() const override
virtual const FieldVariablePhiValue & phiFace() const override final
Return the variable&#39;s shape functions on an element face.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void setLowerDofValues(const DenseVector< DofValue > &values) override
virtual void getDofIndices(const Elem *elem, std::vector< dof_id_type > &dof_indices) const override
virtual const DofValues & dofValuesDotDotOldNeighbor() const override
virtual const FieldVariablePhiValue & phi() const override final
Return the variable&#39;s elemental shape functions.
virtual const FieldVariablePhiGradient & gradPhi() const override final
Return the gradients of the variable&#39;s elemental shape functions.
RealVectorValue _cell_gradient
Temporary storage for the cell gradient to avoid unnecessary allocations.
virtual void prepareNeighbor() override final
Prepare the neighbor element degrees of freedom.
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 FieldVariablePhiSecond & secondPhi() const override final
Return the rank-2 tensor of second derivatives of the variable&#39;s elemental shape functions.
A structure that is used to evaluate Moose functors at an arbitrary physical point contained within a...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
virtual void initialSetup() override
Gets called at the beginning of the simulation before this object is asked to do its job...
const FieldVariablePhiValue & _phi_face_neighbor
DualNumber< Real, DNDerivativeType, true > ADReal
Definition: ADRealForward.h:42
virtual const DofValues & dofValuesDotDotOld() const override
virtual bool supportsElemSideQpArg() const override final
Whether this functor supports evaluation with ElemSideQpArg.
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.
typename FunctorReturnType< Moose::ADType< OutputType >::type, FunctorEvaluationKind::Gradient >::type GradientType
This rigmarole makes it so that a user can create functors that return containers (std::vector...
Definition: MooseFunctor.h:149
virtual const ADTemplateVariableCurl< OutputType > & adCurlSlnNeighbor() const override
AD curl neighbor solution getter.
void lowerDError() const
Throw and error when somebody requests lower-dimensional data from this variable. ...
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 void prepareLowerD() override final
Prepare a lower dimensional element&#39;s degrees of freedom.
libMesh::TensorTools::DecrementRank< OutputShape >::type OutputShapeDivergence
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:37
virtual const ADDofValues & adDofValuesNeighbor() const override
Return the AD neighbor dof values.
const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:103
virtual bool supportsFaceArg() const override final
Whether this functor supports evaluation with FaceArg.
virtual bool isFV() const override
virtual const DofValues & dofValuesDotNeighbor() const override
virtual const FieldVariableValue & slnOld() const override
typename MooseVariableField< OutputType >::FieldVariablePhiValue FieldVariablePhiValue
bool supportsGeometricInfoBasedLoops() const override
Whether this variable supports geometric-info-based loops, such as ElemInfo/FaceInfo loops...
void timeIntegratorError() const
Throw an error when somebody requests time-related data from this variable.
dof_id_type id() const
virtual std::size_t phiSize() const override final
Return phi size.
A structure defining a "face" evaluation calling argument for Moose functors.
const std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > & _grad_container
Pointer to the unlimited cell gradient stored by the owning concrete system.
typename MooseVariableField< OutputType >::FieldVariablePhiGradient FieldVariablePhiGradient
void computeCellLimitedGradients(const Moose::FV::GradientLimiterType limiter_type)
Switch to request limited cell gradient computations.
virtual const DofValues & vectorTagDofValue(TagID tag) const override
virtual void setDofValue(const DofValue &, unsigned int) override
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.
boundary_id_type BoundaryID
Point point
The physical location of the quadrature point.
typename MooseVariableField< OutputType >::DofValues DofValues
virtual void reinitNode() override final
const FieldVariablePhiGradient & _grad_phi
virtual const FieldVariableValue & matrixTagValue(TagID tag) const override
const libMesh::Elem * elem
typename OutputTools< typename Moose::ADType< T >::type >::VariableGradient ADTemplateVariableGradient
Definition: MooseTypes.h:651
const libMesh::Elem * elem
virtual void reinitNodes(const std::vector< dof_id_type > &) override final
Provides an interface for computing residual contributions from finite volume numerical fluxes comput...
Definition: FVFluxBC.h:23
virtual const DofValues & dofValuesNeighbor() const override
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.
virtual const DofValues & dofValuesOlder() const override
virtual unsigned int numberOfDofsNeighbor() override final
A structure that is used to evaluate Moose functors logically at an element/cell center.
AuxiliarySystem *const _auxiliary_system
virtual void prepareIC() override
Prepare the initial condition.
typename MooseVariableField< OutputType >::FieldVariableGradient FieldVariableGradient
MooseLinearVariableFV(const InputParameters &parameters)
Argument for requesting functor evaluation at a quadrature point location in an element.
virtual const dof_id_type & nodalDofIndex() const override final
virtual const MooseArray< libMesh::Number > & dofValuesDuDotDu() const override
const libMesh::Elem * elem
The element.
virtual const ADTemplateVariableSecond< OutputType > & adSecondSln() const override
AD second solution getter.
const FieldVariablePhiValue & curlPhi() const override final
Curl of the shape functions.
void nodalError() const
Throw an error when somebody wants to use this variable as a nodal variable.
virtual void jacobianSetup() override
virtual void prepareAux() override final
virtual void reinitNodesNeighbor(const std::vector< dof_id_type > &) override final
virtual bool hasDoFsOnNodes() const override final
Does this variable have DoFs on nodes.
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 bool computingSecond() const override final
Whether or not this variable is computing any second derivatives.
virtual const FieldVariablePhiGradient & gradPhiFaceNeighbor() const override final
Return the gradients of the variable&#39;s shape functions on a neighboring element face.
virtual const FieldVariableValue & slnNeighbor() const override
virtual bool isNodalDefined() const override final
Is this variable defined at nodes.
virtual const ADDofValues & adDofValuesDot() const override
Return the AD time derivatives at dofs.
virtual const FieldVariableGradient & gradSlnNeighbor() const override
neighbor solution gradients
virtual const FieldVariableGradient & gradSlnOld() const override
virtual const FieldVariablePhiValue & phiNeighbor() const override final
Return the variable&#39;s shape functions on a neighboring element.
virtual const MooseArray< OutputType > & nodalValueOldArray() const override
MooseMesh & _mesh
mesh the variable is active in
typename MooseVariableDataBase< Real >::ADDofValue ADDofValue
virtual void timestepSetup() override
virtual const DofValues & dofValuesDotOldNeighbor() const override
virtual void computeNodalNeighborValues() override final
Compute nodal values of this variable in the neighbor.
bool _compute_qp_data
Whether QP computation has been requested for this variable (opt-in)
virtual const DofValues & dofValuesOldNeighbor() const override
virtual void reinitAux() override final
virtual void add(libMesh::NumericVector< libMesh::Number > &vector) override
Add the currently cached degree of freedom values into the provided vector.
typename MooseVariableField< OutputType >::ADDofValues ADDofValues
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 bool usesSecondPhiNeighbor() const override final
Whether or not this variable is actually using the shape function second derivatives.
virtual const FieldVariableValue & vectorTagValue(TagID tag) const override
tag values getters
const FieldVariablePhiValue & _phi_face
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.
typename MooseVariableDataBase< Real >::ADDofValues ADDofValues
const std::unordered_map< BoundaryID, LinearFVBoundaryCondition * > & getBoundaryConditionMap()
static InputParameters validParams()
virtual std::size_t phiFaceNeighborSize() const override final
Return phiFaceNeighbor size.
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.
void requireQpComputations() const override
Request that quadrature point data be (pre)computed.
virtual std::size_t phiLowerSize() const override final
Return the number of shape functions on the lower dimensional element for this variable.
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:271
const FieldVariablePhiValue & _phi
Shape functions, only used when we are postprocessing or using this variable in an auxiliary system...
typename MooseVariableField< OutputType >::FieldVariableValue FieldVariableValue
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 std::size_t phiNeighborSize() const override final
Return phiNeighbor size.
Linear system to be solved.
Definition: LinearSystem.h:48
typename MooseVariableDataBase< Real >::DofValues DofValues
virtual void computeFaceValues(const FaceInfo &) override
Compute values at face quadrature points for the element+neighbor (both sides of the face)...
virtual const ADTemplateVariableValue< OutputType > & adSlnNeighbor() const override
AD neighbor solution getter.
virtual bool needsGradientVectorStorage() const override
Check if cell gradient computations were requested for this variable.
void gradientStateError(const StateArg &state) const
Throw an error when somebody requests gradients at a non-current solution state.
virtual bool computingCurl() const override final
Whether or not this variable is computing any curl quantities.
libMesh::TensorTools::DecrementRank< Real >::type OutputDivergence
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 DofValues & dofValuesOlderNeighbor() const override
virtual libMesh::FEContinuity getContinuity() const override
Return the continuity of this variable.
const libMesh::NumericVector< libMesh::Number > *const & _solution
The current (ghosted) solution.
Real Number
virtual const FieldVariablePhiGradient & gradPhiNeighbor() const override final
Return the gradients of the variable&#39;s shape functions on a neighboring element.
void computeCellGradients()
Switch to request cell gradient computations.
virtual const MooseArray< libMesh::Number > & dofValuesDuDotDotDu() const override
virtual const ADDofValues & adDofValues() const override
Return the AD dof values.
std::array< Real, 2 > values
Definition: MortarUtils.C:52
virtual unsigned int oldestSolutionStateRequested() const override final
The oldest solution state that is requested for this variable (0 = current, 1 = old, 2 = older, etc).
typename MooseVariableDataBase< Real >::DofValue DofValue
virtual void setDofValues(const DenseVector< DofValue > &values) override
const libMesh::Elem * elem
The element.
virtual const DofValues & dofValuesOld() const override
const FieldVariablePhiValue & _phi_neighbor
This class provides variable solution interface for linear finite volume problems.
Definition: FVUtils.h:24
virtual unsigned int numberOfDofs() const override final
Get the number of local DoFs.
virtual const FieldVariableValue & slnOlder() const override
virtual const ADTemplateVariableValue< OutputType > & adUDot() const override
AD time derivative getter.
virtual bool computingDiv() const override final
Whether or not this variable is computing any divergence quantities.
virtual const FieldVariableGradient & gradSln() const override
element gradients
A system that holds auxiliary variables.
virtual const ADTemplateVariableGradient< OutputType > & adGradSln() const override
AD grad solution getter.
virtual GradientType evaluateGradient(const ElemQpArg &qp_arg, const StateArg &) const override final
Argument for requesting functor evaluation at quadrature point locations on an element side...
virtual const FieldVariablePhiValue & phiFaceNeighbor() const override final
Return the variable&#39;s shape functions on a neighboring element face.
const ElemInfo & elemInfo(const dof_id_type id) const
Accessor for the elemInfo object for a given element ID.
Definition: MooseMesh.C:3991
Moose::ShapeType< Real >::type OutputShape
virtual const DofValues & dofValuesDot() const override
unsigned int state
The state.
uint8_t dof_id_type
bool _needs_cell_gradients
Boolean to check if this variable needs gradient computations.
virtual const FieldVariableValue & slnOldNeighbor() const override
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.