https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MooseLinearVariableFV.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
11#include "TimeIntegrator.h"
12#include "NonlinearSystemBase.h"
13#include "DisplacedSystem.h"
14#include "SystemBase.h"
15#include "LinearSystem.h"
16#include "AuxiliarySystem.h"
17#include "FEProblemBase.h"
18#include "SubProblem.h"
19#include "Assembly.h"
20#include "MathFVUtils.h"
21#include "FVUtils.h"
22#include "FVFluxBC.h"
23#include "FVDirichletBCBase.h"
26#include "FVGradientMethod.h"
27
28#include "libmesh/numeric_vector.h"
29
30#include <climits>
31#include <typeinfo>
32
33using namespace Moose;
34
36
37template <typename OutputType>
40{
42 params.set<bool>("fv") = true;
43 params.set<MooseEnum>("family") = "MONOMIAL";
44 params.set<MooseEnum>("order") = "CONSTANT";
45 params.addParam<GradientMethodName>(
46 "gradient_method",
47 "green-gauss",
48 "Default gradient computation method to register when a consumer requests gradients from "
49 "this variable. This may be a built-in method name like 'green-gauss' or "
50 "'green-gauss-venkatakrishnan', or the name of an object in [FVGradientMethods].");
51 return params;
52}
53
54template <typename OutputType>
56 : MooseVariableField<OutputType>(parameters),
57 _needs_cell_gradients(false),
58 _linear_system(dynamic_cast<LinearSystem *>(&this->_sys)),
59 _auxiliary_system(dynamic_cast<AuxiliarySystem *>(&this->_sys)),
60 _gradient_reader(nullptr),
61 _default_gradient_method_name(this->template getParam<GradientMethodName>("gradient_method")),
62 _sys_num(this->_sys.number()),
63 _solution(this->_sys.currentSolution()),
64 // The following members are needed to be able to interface with the postprocessor and
65 // auxiliary systems
66 _phi(this->_assembly.template fePhi<OutputShape>(FEType(CONSTANT, MONOMIAL))),
67 _grad_phi(this->_assembly.template feGradPhi<OutputShape>(FEType(CONSTANT, MONOMIAL))),
68 _phi_face(this->_assembly.template fePhiFace<OutputShape>(FEType(CONSTANT, MONOMIAL))),
69 _grad_phi_face(this->_assembly.template feGradPhiFace<OutputShape>(FEType(CONSTANT, MONOMIAL))),
70 _phi_face_neighbor(
71 this->_assembly.template fePhiFaceNeighbor<OutputShape>(FEType(CONSTANT, MONOMIAL))),
72 _grad_phi_face_neighbor(
73 this->_assembly.template feGradPhiFaceNeighbor<OutputShape>(FEType(CONSTANT, MONOMIAL))),
74 _phi_neighbor(this->_assembly.template fePhiNeighbor<OutputShape>(FEType(CONSTANT, MONOMIAL))),
75 _grad_phi_neighbor(
76 this->_assembly.template feGradPhiNeighbor<OutputShape>(FEType(CONSTANT, MONOMIAL)))
77{
79 this->paramError("solver_sys",
80 "The assigned system is not a linear or an auxiliary system! Linear variables "
81 "can only be assigned to linear or auxiliary systems!");
82 _element_data = std::make_unique<MooseVariableDataLinearFV<OutputType>>(
84 _neighbor_data = std::make_unique<MooseVariableDataLinearFV<OutputType>>(
86
87 if (libMesh::n_threads() > 1)
88 mooseError("MooseLinearVariableFV does not support threading at the moment!");
89}
90
91template <typename OutputType>
94{
95 const auto & reader = requestCellGradients(_default_gradient_method_name, oldest_state);
97 _gradient_reader = &reader;
98 return reader;
99}
100
101template <typename OutputType>
102void
105 requestCellGradients();
106}
107
108template <typename OutputType>
110MooseLinearVariableFV<OutputType>::requestCellGradients(const GradientMethodName & method_name,
111 const unsigned int oldest_state)
112{
113 const auto & method = _linear_system ? _linear_system->resolveFVGradientMethod(method_name)
114 : _auxiliary_system->resolveFVGradientMethod(method_name);
115
116 return requestCellGradients(method, oldest_state);
118
119template <typename OutputType>
122 const unsigned int oldest_state)
123{
124 _needs_cell_gradients = true;
125 _oldest_gradient_state_requested = std::max(_oldest_gradient_state_requested, oldest_state);
126
127 auto new_reader =
128 _linear_system ? _linear_system->registerFVGradient(this->_var_num, method, oldest_state)
129 : _auxiliary_system->registerFVGradient(this->_var_num, method, oldest_state);
130
131 const auto it = _gradient_readers_by_method.find(&method);
132 if (it != _gradient_readers_by_method.end())
133 return *it->second;
134
135 auto reader = std::make_unique<LinearFVGradientReader>(std::move(new_reader));
136
137 auto & reader_ref = *reader;
138 _gradient_readers_by_method.emplace(&method, std::move(reader));
139
140 return reader_ref;
141}
142
143template <typename OutputType>
144bool
146 const FaceInfo & /*fi*/, const Elem * const /*elem*/, const Moose::StateArg & /*state*/) const
147{
149 return false;
150}
151
152template <typename OutputType>
153Real
155 const StateArg & state) const
157 mooseAssert(
158 this->hasBlocks(elem_info.subdomain_id()),
159 "The variable should be defined on the element's subdomain! This typically occurs when the "
160 "user wants to evaluate the elements right next to the boundary of two variables (block "
161 "boundary). The subdomain which is queried: " +
162 Moose::stringify(this->activeSubdomains()) + " the subdomain of the element " +
163 std::to_string(elem_info.subdomain_id()));
165 // It's not safe to use solutionState(0) because it returns the libMesh System solution member
166 // which is wrong during things like finite difference Jacobian evaluation, e.g. when PETSc
167 // perturbs the solution vector we feed these perturbations into the current_local_solution
168 // while the libMesh solution is frozen in the non-perturbed state
169 const auto & global_soln = (state.state == 0)
170 ? *this->_sys.currentSolution()
171 : this->_sys.solutionState(state.state, state.iteration_type);
172
173 return global_soln(elem_info.dofIndices()[this->_sys_num][this->_var_num]);
174}
176template <typename OutputType>
177VectorValue<Real>
178MooseLinearVariableFV<OutputType>::gradSln(const ElemInfo & elem_info, const StateArg & state) const
179{
180 mooseAssert(_gradient_reader, "Gradient requested without calling requestCellGradients().");
181 return _gradient_reader->gradient(elem_info, state);
182}
183
184template <typename OutputType>
185Real
187 const unsigned int component) const
188{
189 return gradSlnComponent(elem_info, component, Moose::currentState());
190}
192template <typename OutputType>
193Real
195 const unsigned int component,
196 const StateArg & state) const
197{
198 mooseAssert(_gradient_reader,
199 "Gradient component requested without calling requestCellGradients().");
200 return _gradient_reader->component(elem_info, component, state);
201}
202
203template <typename OutputType>
204VectorValue<Real>
206{
207 mooseAssert(_gradient_reader, "Gradient requested without calling requestCellGradients().");
208 return _gradient_reader->gradient(fi, state);
209}
210
211template <typename OutputType>
212void
219template <typename OutputType>
220void
226
227template <typename OutputType>
230{
231 const FaceInfo * const fi = face.fi;
232
233 mooseAssert(fi, "The face information must be non-null");
234
235 const auto face_type = fi->faceType(std::make_pair(this->_var_num, this->_sys_num));
236
237 if (face_type == FaceInfo::VarFaceNeighbors::BOTH)
238 return Moose::FV::interpolate(*this, face, state);
239 else if (auto * bc_pointer = this->getBoundaryCondition(*fi->boundaryIDs().begin()))
241 mooseAssert(fi->boundaryIDs().size() == 1, "We should only have one boundary on every face.");
242 bc_pointer->setupFaceData(fi, face_type);
243 return bc_pointer->computeBoundaryValue();
244 }
245 // If no boundary condition is defined but we are evaluating on a boundary, just return the
246 // element value
247 else if (face_type == FaceInfo::VarFaceNeighbors::ELEM)
248 {
249 const auto & elem_info = *(face.fi->elemInfo());
250 return getElemValue(elem_info, state);
251 }
252 else if (face_type == FaceInfo::VarFaceNeighbors::NEIGHBOR)
253 {
254 const auto & elem_info = *(face.fi->neighborInfo());
255 return getElemValue(elem_info, state);
256 }
257 else
258 mooseError("We should never get here!");
259}
260
261template <typename OutputType>
264 const StateArg & /*state*/) const
265{
266 mooseError("Not implemented yet");
267}
268
269template <typename OutputType>
272{
273 timeIntegratorError();
274}
275
276template <>
277ADReal
279 const StateArg & /*state*/) const
280{
281 timeIntegratorError();
282}
283
284template <typename OutputType>
285void
287{
288 _boundary_id_to_bc.clear();
289 std::vector<LinearFVBoundaryCondition *> bcs;
290
291 // I believe because query() returns by value but condition returns by reference that binding to a
292 // const lvalue reference results in the query() getting destructed and us holding onto a dangling
293 // reference. I think that condition returned by value we would be able to bind to a const lvalue
294 // reference here. But as it is we'll bind to a regular lvalue
295 auto base_query = this->_subproblem.getMooseApp()
296 .theWarehouse()
297 .query()
298 .template condition<AttribSystem>("LinearFVBoundaryCondition")
299 .template condition<AttribThread>(_tid)
300 .template condition<AttribVar>(_var_num)
301 .template condition<AttribSysNum>(this->_sys.number());
302
303 for (const auto bnd_id : this->_mesh.getBoundaryIDs())
304 {
305 auto base_query_copy = base_query;
306 base_query_copy.template condition<AttribBoundaries>(std::set<BoundaryID>({bnd_id}))
307 .queryInto(bcs);
308 mooseAssert(bcs.size() <= 1, "cannot have multiple BCs on the same boundary");
309 if (!bcs.empty())
310 _boundary_id_to_bc.emplace(bnd_id, bcs[0]);
311 }
312}
313
314template <typename OutputType>
317{
318 const auto iter = _boundary_id_to_bc.find(bd_id);
319 if (iter == _boundary_id_to_bc.end())
320 return nullptr;
321 else
322 return iter->second;
323}
324
325template <typename OutputType>
326const Elem * const &
328{
329 return this->_assembly.elem();
330}
331
332template <typename OutputType>
333bool
336 for (const auto bnd_id : fi.boundaryIDs())
337 if (auto it = _boundary_id_to_bc.find(bnd_id); it != _boundary_id_to_bc.end())
338 if (dynamic_cast<LinearFVAdvectionDiffusionFunctorDirichletBC *>(it->second))
339 return true;
341 return false;
342}
343
344// ****************************************************************************
345// The functions below are used for interfacing the auxiliary and
346// postprocessor/userobject systems. Most of the postprocessors/
347// auxkernels require quadrature-based evaluations and we provide that
348// interface with the functions below.
349// ****************************************************************************
351template <typename OutputType>
352void
354 std::vector<dof_id_type> & dof_indices) const
355{
356 dof_indices.clear();
357 const auto & elem_info = this->_mesh.elemInfo(elem->id());
358 dof_indices.push_back(elem_info.dofIndices()[this->_sys_num][this->number()]);
359}
360
361template <typename OutputType>
362void
364{
365 _element_data->setDofValue(value, index);
366}
368template <typename OutputType>
369void
371{
372 _element_data->setDofValues(values);
373}
374
375template <typename OutputType>
376void
378{
379 _element_data->clearDofIndices();
382template <typename OutputType>
386 return _element_data->dofValues();
387}
389template <typename OutputType>
392{
393 return _neighbor_data->dofValues();
396template <typename OutputType>
400 return _element_data->dofValuesOld();
402
403template <typename OutputType>
407 return _element_data->dofValuesOlder();
408}
409
410template <typename OutputType>
413{
414 return _element_data->dofValuesPreviousNL();
415}
416
417template <typename OutputType>
420{
421 return _neighbor_data->dofValuesOld();
422}
423
424template <typename OutputType>
427{
428 return _neighbor_data->dofValuesOlder();
429}
430
431template <typename OutputType>
435 return _neighbor_data->dofValuesPreviousNL();
437
438template <typename OutputType>
442 timeIntegratorError();
445template <typename OutputType>
449 timeIntegratorError();
452template <typename OutputType>
455{
456 timeIntegratorError();
458
459template <typename OutputType>
463 timeIntegratorError();
465
466template <typename OutputType>
470 timeIntegratorError();
473template <typename OutputType>
477 timeIntegratorError();
480template <typename OutputType>
484 timeIntegratorError();
486
487template <typename OutputType>
491 timeIntegratorError();
494template <typename OutputType>
497{
498 timeIntegratorError();
499}
500
501template <typename OutputType>
502const MooseArray<Number> &
504{
505 timeIntegratorError();
506}
507
508template <typename OutputType>
509const MooseArray<Number> &
511{
512 timeIntegratorError();
513}
514
515template <typename OutputType>
516const MooseArray<Number> &
518{
519 timeIntegratorError();
520}
521
522template <typename OutputType>
523void
525{
526 if (_compute_qp_data)
527 {
528 _element_data->setGeometry(Moose::Volume);
529 _element_data->computeValues();
530 }
531}
532
533template <typename OutputType>
534void
536{
537 if (_compute_qp_data)
538 {
539 _element_data->setGeometry(Moose::Face);
540 _element_data->computeValues();
541 }
542}
543
544template <typename OutputType>
545void
547{
548 if (_compute_qp_data)
549 {
550 _neighbor_data->setGeometry(Moose::Face);
551 _neighbor_data->computeValues();
552 }
553}
554
555template <typename OutputType>
556void
558{
559 if (_compute_qp_data)
560 {
561 _neighbor_data->setGeometry(Moose::Volume);
562 _neighbor_data->computeValues();
563 }
564}
565
566template <typename OutputType>
567void
572
573template <typename OutputType>
574void
579
580template <typename OutputType>
581void
586
587template <typename OutputType>
588const std::vector<dof_id_type> &
590{
591 return _element_data->dofIndices();
592}
593
594template <typename OutputType>
595const std::vector<dof_id_type> &
597{
598 return _neighbor_data->dofIndices();
599}
600
601template <typename OutputType>
602void
604{
605 lowerDError();
606}
607
608template <typename OutputType>
609unsigned int
611{
612 unsigned int state = _oldest_gradient_state_requested;
613 state = std::max(state, _element_data->oldestSolutionStateRequested());
614 state = std::max(state, _neighbor_data->oldestSolutionStateRequested());
615 return state;
616}
617
618template <typename OutputType>
619void
621{
622 _element_data->prepareIC();
623}
624
625template <typename OutputType>
626void
628{
629 _element_data->clearDofIndices();
630 _neighbor_data->clearDofIndices();
631}
632
633template <typename OutputType>
634void
635MooseLinearVariableFV<OutputType>::setNodalValue(const OutputType & /*value*/, unsigned int /*idx*/)
636{
637 nodalError();
638}
639
640template <typename OutputType>
646
647template <typename OutputType>
653
654template <typename OutputType>
655const std::vector<dof_id_type> &
657{
658 lowerDError();
659}
660
661template <typename OutputType>
664{
665 lowerDError();
666}
667
668template <typename OutputType>
669void
670MooseLinearVariableFV<OutputType>::insert(NumericVector<Number> & vector)
671{
672 _element_data->insert(vector);
673}
674
675template <typename OutputType>
676void
677MooseLinearVariableFV<OutputType>::insertLower(NumericVector<Number> & /*residual*/)
678{
679 mooseError("We don't support value insertion to residuals in MooseLinearVariableFV!");
680}
681
682template <typename OutputType>
683void
684MooseLinearVariableFV<OutputType>::add(NumericVector<Number> & /*residual*/)
685{
686 mooseError("We don't support value addition to residuals in MooseLinearVariableFV!");
687}
688
689template <typename OutputType>
690void
692{
693 _element_data->setActiveTags(vtags);
694 _neighbor_data->setActiveTags(vtags);
695}
696
697template <typename OutputType>
700{
701 nodalError();
702}
703
704template <typename OutputType>
710
711template <typename OutputType>
717
718template <typename OutputType>
719std::size_t
721{
722 lowerDError();
723}
724
725template <typename OutputType>
728{
729 return _element_data->vectorTagValue(tag);
730}
731
732template <typename OutputType>
735{
736 return _element_data->vectorTagDofValue(tag);
737}
738
739template <typename OutputType>
742{
743 return _element_data->matrixTagValue(tag);
744}
745
746template <typename OutputType>
749{
750 mooseError("We don't currently implement second derivatives for FV");
751}
752
753template <typename OutputType>
756{
757 mooseError("We don't currently implement curl for FV");
758}
759
760template <typename OutputType>
763{
764 mooseError("We don't currently implement divergence for FV");
765}
766
767template <typename OutputType>
770{
771 mooseError("We don't currently implement second derivatives for FV");
772}
773
774template <typename OutputType>
777{
778 mooseError("We don't currently implement second derivatives for FV");
779}
780
781template <typename OutputType>
784{
785 mooseError("We don't currently implement second derivatives for FV");
786}
787
788template <typename OutputType>
791{
792 return _element_data->sln(Moose::Current);
793}
794
795template <typename OutputType>
798{
799 return _element_data->sln(Moose::Old);
800}
801
802template <typename OutputType>
805{
806 return _element_data->sln(Moose::Older);
807}
808
809template <typename OutputType>
812{
813 return _element_data->gradSln(Moose::Current);
814}
815
816template <typename OutputType>
819{
820 return _element_data->gradSln(Moose::Old);
821}
822
823template <typename OutputType>
826{
827 return _neighbor_data->sln(Moose::Current);
828}
829
830template <typename OutputType>
833{
834 return _neighbor_data->sln(Moose::Old);
835}
836
837template <typename OutputType>
840{
841 return _neighbor_data->gradSln(Moose::Current);
842}
843
844template <typename OutputType>
847{
848 return _neighbor_data->gradSln(Moose::Old);
849}
850
851template <typename OutputType>
854{
855 adError();
856}
857
858template <typename OutputType>
861{
862 adError();
863}
864
865template <typename OutputType>
868{
869 adError();
870}
871
872template <typename OutputType>
875{
876 adError();
877}
878
879template <typename OutputType>
885
886template <typename OutputType>
892
893template <typename OutputType>
899
900template <typename OutputType>
906
907template <typename OutputType>
913
914template <typename OutputType>
920
921template <typename OutputType>
924{
925 adError();
926}
927
928template <typename OutputType>
931{
932 adError();
933}
934
935template <typename OutputType>
938{
939 adError();
940}
941
942template <typename OutputType>
948
949template <typename OutputType>
952{
953 adError();
954}
955
956template <typename OutputType>
962
963template <typename OutputType>
969
970template <typename OutputType>
971const dof_id_type &
973{
974 nodalError();
975}
976
977template <typename OutputType>
978const dof_id_type &
983
984template <typename OutputType>
985void
987{
988 _element_data->sizeMatrixTagData();
989}
990
991template 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
registerMooseObject("MooseApp", 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
const Elem *const & elem() const
Return the current element.
Definition Assembly.h:405
const Elem *const & neighbor() const
Return the neighbor element.
Definition Assembly.h:461
A system that holds auxiliary variables.
Class used for caching additional information for elements such as the volume and centroid.
Definition ElemInfo.h:26
SubdomainID subdomain_id() const
We return the subdomain ID of the corresponding libmesh element.
Definition ElemInfo.h:43
const std::vector< std::vector< dof_id_type > > & dofIndices() const
Definition ElemInfo.h:39
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
VarFaceNeighbors faceType(const std::pair< unsigned int, unsigned int > &var_sys) const
Returns which side(s) the given variable-system number pair is defined on for this face.
Definition FaceInfo.h:229
const std::set< BoundaryID > & boundaryIDs() const
Const getter for every associated boundary ID.
Definition FaceInfo.h:124
const ElemInfo * elemInfo() const
Definition FaceInfo.h:89
const ElemInfo * neighborInfo() const
Definition FaceInfo.h:90
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Class implementing a Dirichlet boundary condition for linear finite volume variables.
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.
forward declarations
Definition MooseArray.h:18
void paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
Definition MooseBase.h:457
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
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 FieldVariablePhiSecond & secondPhi() const override final
Return the rank-2 tensor of second derivatives of the variable's elemental shape functions.
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.
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.
virtual const DofValues & dofValuesOlderNeighbor() const override
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 setNodalValue(const OutputType &value, unsigned int idx=0) override
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 ...
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 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 const FieldVariablePhiSecond & secondPhiFace() const override final
Return the rank-2 tensor of second derivatives of the variable's shape functions on an element 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.
LinearSystem *const _linear_system
Owning concrete system pointers. One will be null.
virtual const FieldVariableValue & slnOldNeighbor() const override
virtual const DofValues & dofValuesDotDotOldNeighbor() const override
virtual const ADTemplateVariableCurl< OutputType > & adCurlSlnNeighbor() const override
AD curl neighbor solution getter.
typename MooseVariableField< OutputType >::FieldVariablePhiDivergence FieldVariablePhiDivergence
virtual const FieldVariableValue & slnOlder() const override
virtual void computeNodalNeighborValues() override final
Compute nodal values of this variable in the neighbor.
typename MooseVariableField< OutputType >::FieldVariableValue FieldVariableValue
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.
virtual const MooseArray< libMesh::Number > & dofValuesDuDotDuNeighbor() const override
virtual void sizeMatrixTagData() override
Size data structures related to matrix tagging.
virtual const MooseArray< libMesh::Number > & dofValuesDuDotDotDuNeighbor() const override
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 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
const FieldVariablePhiDivergence & divPhi() const override final
Divergence of the shape functions.
virtual const MooseArray< libMesh::Number > & dofValuesDuDotDotDu() const override
virtual const ADTemplateVariableGradient< OutputType > & adGradSln() const override
AD grad solution getter.
virtual const DofValues & dofValuesDotOldNeighbor() const override
MooseLinearVariableFV(const InputParameters &parameters)
virtual const MooseArray< OutputType > & nodalValueOlderArray() const override
virtual const ADTemplateVariableValue< OutputType > & adUDotNeighbor() const override
AD neighbor time derivative getter.
virtual void computeNodalValues() override final
Compute nodal values of this variable.
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.
virtual const FieldVariableValue & sln() const override
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 setActiveTags(const std::set< TagID > &vtags) override
Set the active vector tags.
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
virtual const DofValues & nodalVectorTagValue(TagID) const override
virtual const FieldVariableGradient & gradSln() const override
element gradients
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 const DofValues & dofValuesDotDot() const override
virtual void setDofValues(const DenseVector< DofValue > &values) override
Set local DOF values and evaluate the values on quadrature points.
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 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.
virtual const FieldVariableValue & slnOld() const override
typename MooseVariableField< OutputType >::OutputShape OutputShape
virtual const DofValues & dofValuesOlder() const override
virtual void computeElemValuesFace() override
Compute values at facial quadrature points.
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.
static InputParameters validParams()
Input parameters for a linear finite-volume variable.
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,...
THREAD_ID _tid
Thread ID.
Assembly & _assembly
Assembly data.
SystemBase & _sys
System this variable is part of.
Class for stuff related to variables.
virtual void timestepSetup() override
Gets called at the beginning of the timestep before this object is asked to do its job.
static InputParameters validParams()
virtual const OutputTools< T >::VariableSecond & second()
The second derivative of the variable this object is operating on.
virtual void initialSetup()
Gets called at the beginning of the simulation before this object is asked to do its job.
void interpolate(InterpMethod m, T &result, const T2 &value1, const T3 &value2, const FaceInfo &fi, const bool one_is_elem)
Provides interpolation of face values for non-advection-specific purposes (although it can/will still...
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
@ Current
Definition MooseTypes.h:263
std::string stringify(const T &t)
conversion to string
Definition Conversion.h:64
StateArg currentState()
unsigned int n_threads()
A structure that is used to evaluate Moose functors logically at an element/cell center.
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.
SolutionIterationType iteration_type
The solution iteration type, e.g. time or nonlinear.
unsigned int state
The state.