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