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"
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#include <memory>
27#include <unordered_map>
28
29template <typename>
31
33class AuxiliarySystem;
35class FVFluxBC;
38class LinearSystem;
39
40namespace libMesh
41{
42template <typename>
43class NumericVector;
44}
45
49template <typename OutputType>
50class MooseLinearVariableFV : public MooseVariableField<OutputType>
51{
52public:
56
62
67
72
89
92
97
98 virtual bool isFV() const override { return true; }
99
104 virtual bool isDirichletBoundaryFace(const FaceInfo & fi) const;
105
111 const LinearFVGradientReader & requestCellGradients(unsigned int oldest_state = 0);
112
118
124 const LinearFVGradientReader & requestCellGradients(const GradientMethodName & method_name,
125 unsigned int oldest_state = 0);
126
133 unsigned int oldest_state = 0);
134
138 virtual bool needsGradientVectorStorage() const override { return _needs_cell_gradients; }
139
140 virtual bool isExtrapolatedBoundaryFace(const FaceInfo & fi,
141 const Elem * elem,
142 const Moose::StateArg & state) const override;
143
149 VectorValue<Real> gradSln(const ElemInfo & elem_info, const StateArg & state) const;
150
156 Real gradSlnComponent(const ElemInfo & elem_info, unsigned int component) const;
157
164 Real gradSlnComponent(const ElemInfo & elem_info,
165 unsigned int component,
166 const StateArg & state) const;
167
173 VectorValue<Real> gradSln(const FaceInfo & fi, const StateArg & state) const;
174
175 virtual void initialSetup() override;
176 virtual void timestepSetup() override;
177
185 Real getElemValue(const ElemInfo & elem_info, const StateArg & state) const;
186
192
194 const std::unordered_map<BoundaryID, LinearFVBoundaryCondition *> &
196 {
197 return _boundary_id_to_bc;
198 }
199
200 virtual void prepareIC() override;
201
202 virtual bool isNodal() const override final { return false; }
203
204 virtual bool hasDoFsOnNodes() const override final { return false; }
205
206 virtual bool isNodalDefined() const override final { return false; }
207
208 virtual bool supportsFaceArg() const override final { return true; }
209 virtual bool supportsElemSideQpArg() const override final { return false; }
210
211 virtual const Elem * const & currentElem() const override;
212
213 virtual bool computingSecond() const override final { return false; }
214 virtual bool computingCurl() const override final { return false; }
215 virtual bool computingDiv() const override final { return false; }
216 virtual bool usesSecondPhiNeighbor() const override final { return false; }
217
218 virtual void sizeMatrixTagData() override;
219
220 void requireQpComputations() const override { _compute_qp_data = true; }
221 bool supportsQpBasedLoops() const override { return _compute_qp_data; }
222 bool supportsGeometricInfoBasedLoops() const override { return true; }
223
224protected:
226 [[noreturn]] void timeIntegratorError() const;
227
229 [[noreturn]] void lowerDError() const;
230
232 [[noreturn]] void nodalError() const;
233
235 [[noreturn]] void adError() const;
236
240 void cacheBoundaryBCMap();
241
243
245 mutable bool _compute_qp_data = false;
246
249
252
256
259
261 std::unordered_map<const FVGradientMethod *, std::unique_ptr<LinearFVGradientReader>>
263
265 const GradientMethodName _default_gradient_method_name;
266
270 std::unique_ptr<MooseVariableDataLinearFV<OutputType>> _element_data;
271
275 std::unique_ptr<MooseVariableDataLinearFV<OutputType>> _neighbor_data;
276
279 std::unordered_map<BoundaryID, LinearFVBoundaryCondition *> _boundary_id_to_bc;
280
282 const unsigned int _sys_num;
283
284 friend void Moose::initDofIndices<>(MooseLinearVariableFV<OutputType> &, const Elem &);
285
286private:
287 using MooseVariableField<OutputType>::evaluate;
288 using MooseVariableField<OutputType>::evaluateGradient;
289 using MooseVariableField<OutputType>::evaluateDot;
290
291 virtual ValueType evaluate(const ElemArg & elem, const StateArg &) const override final;
292 virtual ValueType evaluate(const FaceArg & face, const StateArg &) const override final;
293 virtual ValueType evaluate(const NodeArg & node, const StateArg &) const override final;
294 virtual ValueType evaluate(const ElemPointArg & elem_point,
295 const StateArg & state) const override final;
296 virtual ValueType evaluate(const ElemQpArg & elem_qp,
297 const StateArg & state) const override final;
298 virtual ValueType evaluate(const ElemSideQpArg & elem_side_qp,
299 const StateArg & state) const override final;
301 const StateArg &) const override final;
302 virtual GradientType evaluateGradient(const ElemArg & elem_arg,
303 const StateArg &) const override final;
305 const StateArg &) const override final;
306 virtual DotType evaluateDot(const ElemArg & elem, const StateArg &) const override final;
307
312
323
324public:
325 // *********************************************************************************
326 // *********************************************************************************
327 // The following functions are separated here because they are not essential for the
328 // solver but are necessary to interface with the auxiliary and postprocessor
329 // systems.
330 // *********************************************************************************
331 // *********************************************************************************
332
333 virtual void setDofValue(const DofValue & /*value*/, unsigned int /*index*/) override;
334
335 virtual void getDofIndices(const Elem * elem,
336 std::vector<dof_id_type> & dof_indices) const override;
337
338 virtual void setDofValues(const DenseVector<DofValue> & values) override;
339
340 virtual void clearDofIndices() override;
341
342 virtual unsigned int numberOfDofs() const override final { return 1; }
343 virtual unsigned int numberOfDofsNeighbor() override final { return 1; }
344
345 virtual unsigned int oldestSolutionStateRequested() const override final;
346
347 virtual void clearAllDofIndices() override final;
348
349 [[noreturn]] virtual const std::vector<dof_id_type> & dofIndicesLower() const override final;
350 [[noreturn]] virtual const FieldVariablePhiValue & phiLower() const override;
351
352 // Overriding these to make sure nothing happens during residual/jacobian setup.
353 // The only time this can actually happen is when residual setup is called on the auxiliary
354 // system.
355 virtual void residualSetup() override {}
356 virtual void jacobianSetup() override {}
357
358 virtual libMesh::FEContinuity getContinuity() const override
359 {
360 return _element_data->getContinuity();
361 };
362
363 virtual void setNodalValue(const OutputType & value, unsigned int idx = 0) override;
364
365 [[noreturn]] virtual const DofValues & nodalVectorTagValue(TagID) const override;
366
367 virtual const std::vector<dof_id_type> & dofIndices() const final;
368 virtual const std::vector<dof_id_type> & dofIndicesNeighbor() const final;
369
370 virtual void prepare() override final {}
371 virtual void prepareNeighbor() override final {}
372 virtual void prepareAux() override final {}
373 virtual void reinitNode() override final {}
374 virtual void reinitNodes(const std::vector<dof_id_type> & /*nodes*/) override final {}
375 virtual void reinitNodesNeighbor(const std::vector<dof_id_type> & /*nodes*/) override final {}
376 virtual void reinitAux() override final {}
377 virtual void reinitAuxNeighbor() override final {}
378 virtual void prepareLowerD() override final {}
379
380 virtual void computeElemValuesFace() override;
381 virtual void computeNeighborValuesFace() override;
382 virtual void computeNeighborValues() override;
383 virtual void computeLowerDValues() override final;
384
385 virtual void computeNodalNeighborValues() override final;
386 virtual void computeNodalValues() override final;
387
388 virtual void computeElemValues() override;
389 virtual void computeFaceValues(const FaceInfo & /*fi*/) override {}
390
391 virtual void setLowerDofValues(const DenseVector<DofValue> & values) override;
392
393 virtual void insert(libMesh::NumericVector<libMesh::Number> & vector) override;
394 virtual void insertLower(libMesh::NumericVector<libMesh::Number> & vector) override;
395 virtual void add(libMesh::NumericVector<libMesh::Number> & vector) override;
396
397 virtual void setActiveTags(const std::set<TagID> & vtags) override;
398
399 [[noreturn]] virtual const MooseArray<OutputType> & nodalValueArray() const override;
400 [[noreturn]] virtual const MooseArray<OutputType> & nodalValueOldArray() const override;
401 [[noreturn]] virtual const MooseArray<OutputType> & nodalValueOlderArray() const override;
402
403 virtual const FieldVariablePhiValue & phi() const override final { return _phi; }
404 virtual const FieldVariablePhiGradient & gradPhi() const override final { return _grad_phi; }
405 [[noreturn]] virtual const FieldVariablePhiSecond & secondPhi() const override final;
406 [[noreturn]] const FieldVariablePhiValue & curlPhi() const override final;
407 [[noreturn]] const FieldVariablePhiDivergence & divPhi() const override final;
408
409 virtual const FieldVariablePhiValue & phiFace() const override final { return _phi_face; }
410 virtual const FieldVariablePhiGradient & gradPhiFace() const override final
411 {
412 return _grad_phi_face;
413 }
414 [[noreturn]] virtual const FieldVariablePhiSecond & secondPhiFace() const override final;
415
416 virtual const FieldVariablePhiValue & phiFaceNeighbor() const override final
417 {
418 return _phi_face_neighbor;
419 }
420 virtual const FieldVariablePhiGradient & gradPhiFaceNeighbor() const override final
421 {
423 }
424 [[noreturn]] virtual const FieldVariablePhiSecond & secondPhiFaceNeighbor() const override final;
425
426 virtual const FieldVariablePhiValue & phiNeighbor() const override final { return _phi_neighbor; }
427 virtual const FieldVariablePhiGradient & gradPhiNeighbor() const override final
428 {
429 return _grad_phi_neighbor;
430 }
431 [[noreturn]] virtual const FieldVariablePhiSecond & secondPhiNeighbor() const override final;
432
433 virtual const FieldVariableValue & vectorTagValue(TagID tag) const override;
434 virtual const DofValues & vectorTagDofValue(TagID tag) const override;
435 [[noreturn]] virtual const DofValues & nodalMatrixTagValue(TagID tag) const override;
436 virtual const FieldVariableValue & matrixTagValue(TagID tag) const override;
437
438 virtual const FieldVariableValue & sln() const override;
439 virtual const FieldVariableValue & slnOld() const override;
440 virtual const FieldVariableValue & slnOlder() const override;
441 virtual const FieldVariableGradient & gradSln() const override;
442 virtual const FieldVariableGradient & gradSlnOld() const override;
443 virtual const FieldVariableValue & slnNeighbor() const override;
444 virtual const FieldVariableValue & slnOldNeighbor() const override;
445 virtual const FieldVariableGradient & gradSlnNeighbor() const override;
446 virtual const FieldVariableGradient & gradSlnOldNeighbor() const override;
447
448 [[noreturn]] virtual const ADTemplateVariableSecond<OutputType> & adSecondSln() const override;
449 [[noreturn]] virtual const ADTemplateVariableValue<OutputType> & adUDot() const override;
450 [[noreturn]] virtual const ADTemplateVariableValue<OutputType> & adUDotDot() const override;
451 [[noreturn]] virtual const ADTemplateVariableGradient<OutputType> & adGradSlnDot() const override;
452 [[noreturn]] virtual const ADTemplateVariableValue<OutputType> & adSlnNeighbor() const override;
453 [[noreturn]] virtual const ADTemplateVariableGradient<OutputType> &
454 adGradSlnNeighbor() const override;
455 [[noreturn]] virtual const ADTemplateVariableSecond<OutputType> &
456 adSecondSlnNeighbor() const override;
457 [[noreturn]] virtual const ADTemplateVariableValue<OutputType> & adUDotNeighbor() const override;
458 [[noreturn]] virtual const ADTemplateVariableValue<OutputType> &
459 adUDotDotNeighbor() const override;
460 [[noreturn]] virtual const ADTemplateVariableGradient<OutputType> &
461 adGradSlnNeighborDot() const override;
462 [[noreturn]] virtual const ADTemplateVariableValue<OutputType> & adSln() const override;
463 [[noreturn]] virtual const ADTemplateVariableGradient<OutputType> & adGradSln() const override;
464 [[noreturn]] virtual const ADTemplateVariableCurl<OutputType> & adCurlSln() const override;
465 [[noreturn]] virtual const ADTemplateVariableCurl<OutputType> &
466 adCurlSlnNeighbor() const override;
467
468 virtual const DofValues & dofValues() const override;
469 virtual const DofValues & dofValuesOld() const override;
470
471 virtual const DofValues & dofValuesOlder() const override;
472 virtual const DofValues & dofValuesPreviousNL() const override;
473 virtual const DofValues & dofValuesNeighbor() const override;
474 virtual const DofValues & dofValuesOldNeighbor() const override;
475 virtual const DofValues & dofValuesOlderNeighbor() const override;
476 virtual const DofValues & dofValuesPreviousNLNeighbor() const override;
477 [[noreturn]] virtual const DofValues & dofValuesDot() const override;
478 [[noreturn]] virtual const DofValues & dofValuesDotNeighbor() const override;
479 [[noreturn]] virtual const DofValues & dofValuesDotOld() const override;
480 [[noreturn]] virtual const DofValues & dofValuesDotOldNeighbor() const override;
481 [[noreturn]] virtual const DofValues & dofValuesDotDot() const override;
482 [[noreturn]] virtual const DofValues & dofValuesDotDotNeighbor() const override;
483 [[noreturn]] virtual const DofValues & dofValuesDotDotOld() const override;
484 [[noreturn]] virtual const DofValues & dofValuesDotDotOldNeighbor() const override;
485 [[noreturn]] virtual const MooseArray<libMesh::Number> & dofValuesDuDotDu() const override;
486 [[noreturn]] virtual const MooseArray<libMesh::Number> &
487 dofValuesDuDotDuNeighbor() const override;
488 [[noreturn]] virtual const MooseArray<libMesh::Number> & dofValuesDuDotDotDu() const override;
489 [[noreturn]] virtual const MooseArray<libMesh::Number> &
490 dofValuesDuDotDotDuNeighbor() const override;
491
492 [[noreturn]] virtual const ADDofValues & adDofValues() const override;
493 [[noreturn]] virtual const ADDofValues & adDofValuesNeighbor() const override;
494 [[noreturn]] virtual const ADDofValues & adDofValuesDot() const override;
495 [[noreturn]] virtual const dof_id_type & nodalDofIndex() const override final;
496 [[noreturn]] virtual const dof_id_type & nodalDofIndexNeighbor() const override final;
497
498 virtual std::size_t phiSize() const override final { return _phi.size(); }
499 virtual std::size_t phiFaceSize() const override final { return _phi_face.size(); }
500 virtual std::size_t phiNeighborSize() const override final { return _phi_neighbor.size(); }
501 virtual std::size_t phiFaceNeighborSize() const override final
502 {
503 return _phi_face_neighbor.size();
504 }
505 [[noreturn]] virtual std::size_t phiLowerSize() const override final;
506};
507
508template <typename OutputType>
509typename MooseLinearVariableFV<OutputType>::ValueType
510MooseLinearVariableFV<OutputType>::evaluate(const ElemArg & elem_arg, const StateArg & state) const
511{
512 const auto & elem_info = this->_mesh.elemInfo(elem_arg.elem->id());
513 return getElemValue(elem_info, state);
514}
515
516template <typename OutputType>
519 const StateArg & state) const
520{
521 const auto & elem_info = this->_mesh.elemInfo(elem_point.elem->id());
522 return getElemValue(elem_info, state);
523}
524
525template <typename OutputType>
528{
529 const auto & elem_info = this->_mesh.elemInfo(elem_qp.elem->id());
530 return getElemValue(elem_info, state);
531}
532
533template <typename OutputType>
536 const StateArg & state) const
537{
538 return (*this)(ElemPointArg{elem_side_qp.elem, elem_side_qp.point, false}, state);
539}
540
541template <typename OutputType>
544 const StateArg & state) const
545{
546 const auto & elem_info = this->_mesh.elemInfo(qp_arg.elem->id());
547 return gradSln(elem_info, state);
548}
549
550template <typename OutputType>
553 const StateArg & state) const
554{
555 const auto & elem_info = this->_mesh.elemInfo(elem_arg.elem->id());
556 return gradSln(elem_info, state);
557}
558
559template <typename OutputType>
562 const StateArg & state) const
563{
564 mooseAssert(face.fi, "We must have a non-null face information");
565 return gradSln(*face.fi, state);
566}
567
568template <typename OutputType>
569void
571{
572 mooseError("MooseLinearVariableFV does not support time integration at the moment! The variable "
573 "which is causing the issue: ",
574 this->name());
575}
576
577template <typename OutputType>
578void
580{
581 mooseError("Lower dimensional element support not implemented for finite volume variables!The "
582 "variable which is causing the issue: ",
583 this->name());
584}
585
586template <typename OutputType>
587void
589{
590 mooseError("FV variables don't support nodal variable treatment! The variable which is causing "
591 "the issue: ",
592 this->name());
593}
594
595template <typename OutputType>
596void
598{
599 mooseError("Linear FV variable does not support automatic differentiation, the variable which is "
600 "attempting it is: ",
601 this->name());
602}
603
604// Declare all the specializations, as the template specialization declarations below must know
605template <>
606ADReal MooseLinearVariableFV<Real>::evaluateDot(const ElemArg & elem, const StateArg & state) const;
607
608// Prevent implicit instantiation in other translation units where these classes are used
609extern 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
Base class for linear finite-volume cell-gradient methods.
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.
Read-only view of one variable's cell-centered linear finite-volume gradient values.
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
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 default 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
std::unordered_map< const FVGradientMethod *, std::unique_ptr< LinearFVGradientReader > > _gradient_readers_by_method
Gradient readers keyed by the methods that produced them.
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.
const LinearFVGradientReader & requestCellGradients(unsigned int oldest_state=0)
Register the configured default gradient method with time-state storage.
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()
Backward-compatible interface for requesting cell gradients.
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
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
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.
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
Boundary-condition map keyed by boundary ID for this variable.
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
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.
const LinearFVGradientReader * _gradient_reader
Read-only reader for the default cell gradient stored by the owning concrete system.
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
unsigned int _oldest_gradient_state_requested
Oldest time state requested for any cell gradient method.
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.
const GradientMethodName _default_gradient_method_name
Default gradient method registered when consumers request gradients from this variable.
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()
Input parameters for a linear finite-volume variable.
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:4000
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
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.