23#include "libmesh/numeric_vector.h"
32template <
typename OutputType>
37 params.
set<
bool>(
"fv") =
true;
42 params.
set<
bool>(
"p_refinement") =
false;
45 params.template addParam<bool>(
46 "two_term_boundary_expansion",
48 "Whether to use a two-term Taylor expansion to calculate boundary face values. "
49 "If the two-term expansion is used, then the boundary face value depends on the "
50 "adjoining cell center gradient, which itself depends on the boundary face value. "
51 "Consequently an implicit solve is used to simultaneously solve for the adjoining cell "
52 "center gradient and boundary face value(s).");
53 MooseEnum face_interp_method(
"average skewness-corrected",
"average");
54 params.template addParam<MooseEnum>(
"face_interp_method",
56 "Switch that can select between face interpolation methods.");
57 params.template addParam<bool>(
58 "cache_cell_gradients",
true,
"Whether to cache cell gradients or re-compute them.");
62 "ElementSideNeighborLayers",
67 unsigned short layers = 1;
68 if (obj_params.
get<
MooseEnum>(
"face_interp_method") ==
"skewness-corrected")
71 rm_params.
set<
unsigned short>(
"layers") = layers;
76template <
typename OutputType>
79 _solution(this->_sys.currentSolution()),
80 _phi(this->_assembly.template fePhi<
OutputShape>(this->_fe_type)),
81 _grad_phi(this->_assembly.template feGradPhi<
OutputShape>(this->_fe_type)),
82 _phi_face(this->_assembly.template fePhiFace<
OutputShape>(this->_fe_type)),
83 _grad_phi_face(this->_assembly.template feGradPhiFace<
OutputShape>(this->_fe_type)),
84 _phi_face_neighbor(this->_assembly.template fePhiFaceNeighbor<
OutputShape>(this->_fe_type)),
85 _grad_phi_face_neighbor(
86 this->_assembly.template feGradPhiFaceNeighbor<
OutputShape>(this->_fe_type)),
87 _phi_neighbor(this->_assembly.template fePhiNeighbor<
OutputShape>(this->_fe_type)),
88 _grad_phi_neighbor(this->_assembly.template feGradPhiNeighbor<
OutputShape>(this->_fe_type)),
90 _two_term_boundary_expansion(this->isParamValid(
"two_term_boundary_expansion")
91 ? this->template getParam<bool>(
"two_term_boundary_expansion")
93 _cache_cell_gradients(this->isParamValid(
"cache_cell_gradients")
94 ? this->template getParam<bool>(
"cache_cell_gradients")
97 _element_data = std::make_unique<MooseVariableDataFV<OutputType>>(
99 _neighbor_data = std::make_unique<MooseVariableDataFV<OutputType>>(
104 const auto & interp_method = this->
template getParam<MooseEnum>(
"face_interp_method");
105 if (interp_method ==
"average")
107 else if (interp_method ==
"skewness-corrected")
114template <
typename OutputType>
118 _element_data->clearDofIndices();
121template <
typename OutputType>
125 return _element_data->getElementalValue(elem,
Moose::Current, idx);
128template <
typename OutputType>
132 return _element_data->getElementalValue(elem,
Moose::Old, idx);
135template <
typename OutputType>
139 return _element_data->getElementalValue(elem,
Moose::Older, idx);
142template <
typename OutputType>
146 _element_data->insert(residual);
149template <
typename OutputType>
156template <
typename OutputType>
160 _element_data->add(residual);
163template <
typename OutputType>
167 return _element_data->dofValues();
170template <
typename OutputType>
174 return _element_data->dofValuesOld();
177template <
typename OutputType>
181 return _element_data->dofValuesOlder();
184template <
typename OutputType>
188 return _element_data->dofValuesPreviousNL();
191template <
typename OutputType>
195 return _neighbor_data->dofValues();
198template <
typename OutputType>
202 return _neighbor_data->dofValuesOld();
205template <
typename OutputType>
209 return _neighbor_data->dofValuesOlder();
212template <
typename OutputType>
216 return _neighbor_data->dofValuesPreviousNL();
219template <
typename OutputType>
223 return _element_data->dofValuesDot();
226template <
typename OutputType>
230 return _element_data->dofValuesDotDot();
233template <
typename OutputType>
237 return _element_data->dofValuesDotOld();
240template <
typename OutputType>
244 return _element_data->dofValuesDotDotOld();
247template <
typename OutputType>
251 return _neighbor_data->dofValuesDot();
254template <
typename OutputType>
258 return _neighbor_data->dofValuesDotDot();
261template <
typename OutputType>
265 return _neighbor_data->dofValuesDotOld();
268template <
typename OutputType>
272 return _neighbor_data->dofValuesDotDotOld();
275template <
typename OutputType>
279 return _element_data->dofValuesDuDotDu();
282template <
typename OutputType>
286 return _element_data->dofValuesDuDotDotDu();
289template <
typename OutputType>
293 return _neighbor_data->dofValuesDuDotDu();
296template <
typename OutputType>
300 return _neighbor_data->dofValuesDuDotDotDu();
303template <
typename OutputType>
307 _element_data->prepareIC();
310template <
typename OutputType>
315 _element_data->computeValues();
318template <
typename OutputType>
323 _element_data->computeValues();
326template <
typename OutputType>
331 _neighbor_data->computeValues();
334template <
typename OutputType>
339 _neighbor_data->computeValues();
342template <
typename OutputType>
349 const auto facetype = fi.
faceType(std::make_pair(this->number(), this->sys().number()));
354 _element_data->computeValuesFace(fi);
355 _neighbor_data->computeValuesFace(fi);
358 _element_data->computeValuesFace(fi);
360 _neighbor_data->computeValuesFace(fi);
362 mooseError(
"robert wrote broken MooseVariableFV code");
365template <
typename OutputType>
370 mooseAssert(this->_dof_indices.size() == 1,
"Wrong size for dof indices");
371 OutputType value = (*this->_sys.currentSolution())(this->_dof_indices[0]);
375template <
typename OutputType>
382template <
typename OutputType>
386 mooseError(
"FV variables do not support setNodalValue");
389template <
typename OutputType>
393 _element_data->setDofValue(value, index);
396template <
typename OutputType>
400 _element_data->setDofValues(
values);
403template <
typename OutputType>
410template <
typename OutputType>
411std::pair<bool, const FVDirichletBCBase *>
414 for (
const auto bnd_id : fi.boundaryIDs())
415 if (auto it = _boundary_id_to_dirichlet_bc.find(bnd_id);
416 it != _boundary_id_to_dirichlet_bc.end())
417 return {
true, it->second};
419 return {
false,
nullptr};
422template <
typename OutputType>
423std::pair<bool, std::vector<const FVFluxBC *>>
426 for (
const auto bnd_id : fi.boundaryIDs())
427 if (auto it = _boundary_id_to_flux_bc.find(bnd_id); it != _boundary_id_to_flux_bc.end())
428 return {
true, it->second};
430 return std::make_pair(
false, std::vector<const FVFluxBC *>());
433template <
typename OutputType>
438 "The elem shall exist! This typically occurs when the "
439 "user wants to evaluate non-existing elements (nullptr) at physical boundaries.");
441 this->hasBlocks(elem->subdomain_id()),
442 "The variable should be defined on the element's subdomain! This typically occurs when the "
443 "user wants to evaluate the elements right next to the boundary of two variables (block "
444 "boundary). The subdomain which is queried: " +
446 std::to_string(elem->subdomain_id()));
451 this->_dof_indices.size() == 1,
452 "There should only be one dof-index for a constant monomial variable on any given element");
454 const dof_id_type index = this->_dof_indices[0];
460 const auto & global_soln =
462 ? *this->_sys.currentSolution()
465 ADReal value = global_soln(index);
467 if (ADReal::do_derivatives && state.
state == 0 &&
468 this->_sys.number() == this->_subproblem.currentNlSysNum())
474template <
typename OutputType>
480 const auto & pr = getDirichletBC(fi);
486template <
typename OutputType>
489 const Elem *
const libmesh_dbg_var(elem),
492 mooseAssert(isDirichletBoundaryFace(fi, elem, state),
493 "This function should only be called on Dirichlet boundary faces.");
495 const auto & diri_pr = getDirichletBC(fi);
497 mooseAssert(diri_pr.first,
498 "This functor should only be called if we are on a Dirichlet boundary face.");
505template <
typename OutputType>
508 const Elem *
const elem,
511 if (isDirichletBoundaryFace(fi, elem, state))
514 return !this->isInternalFace(fi);
517template <
typename OutputType>
520 const bool two_term_expansion,
521 const bool correct_skewness,
522 const Elem * elem_to_extrapolate_from,
526 isExtrapolatedBoundaryFace(fi, elem_to_extrapolate_from, state) || !two_term_expansion,
527 "We allow Dirichlet boundary conditions to call this method. However, the only way to "
528 "ensure we don't have infinite recursion, with Green Gauss gradients calling back to the "
529 "Dirichlet boundary condition calling back to this method, is to do a one term expansion");
532 bool elem_to_extrapolate_from_is_fi_elem;
533 std::tie(elem_to_extrapolate_from, elem_to_extrapolate_from_is_fi_elem) =
534 [
this, &fi, elem_to_extrapolate_from]() -> std::pair<const Elem *, bool>
536 if (elem_to_extrapolate_from)
538 return {elem_to_extrapolate_from, elem_to_extrapolate_from == fi.
elemPtr()};
541 const auto [elem_guaranteed_to_have_dofs,
543 elem_guaranteed_to_have_dofs_is_fi_elem] =
547 libmesh_ignore(other_elem);
549 return {elem_guaranteed_to_have_dofs, elem_guaranteed_to_have_dofs_is_fi_elem};
553 if (two_term_expansion)
555 const Point vector_to_face = elem_to_extrapolate_from_is_fi_elem
558 boundary_value = adGradSln(elem_to_extrapolate_from, state, correct_skewness) * vector_to_face +
559 getElemValue(elem_to_extrapolate_from, state);
562 boundary_value = getElemValue(elem_to_extrapolate_from, state);
564 return boundary_value;
567template <
typename OutputType>
571 const bool correct_skewness)
const
573 mooseAssert(!this->isInternalFace(fi),
574 "A boundary face value has been requested on an internal face.");
576 if (isDirichletBoundaryFace(fi,
nullptr, state))
577 return getDirichletBoundaryFaceValue(fi,
nullptr, state);
578 else if (isExtrapolatedBoundaryFace(fi,
nullptr, state))
579 return getExtrapolatedBoundaryFaceValue(
580 fi, _two_term_boundary_expansion, correct_skewness,
nullptr, state);
585template <
typename OutputType>
586const VectorValue<ADReal> &
589 const bool correct_skewness)
const
593 if (_cache_cell_gradients && !correct_skewness && state.
state == 0)
595 auto it = _elem_to_grad.find(elem);
597 if (it != _elem_to_grad.end())
602 ElemArg({elem, correct_skewness}), state, *
this, _two_term_boundary_expansion, this->_mesh);
604 if (_cache_cell_gradients && !correct_skewness && state.
state == 0)
606 auto pr = _elem_to_grad.emplace(elem, std::move(grad));
607 mooseAssert(pr.second,
"Insertion should have just happened.");
608 return pr.first->second;
612 _temp_cell_gradient = std::move(grad);
613 return _temp_cell_gradient;
617template <
typename OutputType>
621 const bool correct_skewness)
const
623 const auto face_type = fi.
faceType(std::make_pair(this->number(), this->sys().number()));
625 "Gradient requested on a face where the variable is defined on neither side.");
629 const Elem *
const elem_one = var_defined_on_elem ? &fi.
elem() : fi.
neighborPtr();
630 const Elem *
const elem_two = var_defined_on_elem ? fi.
neighborPtr() : &fi.
elem();
632 const VectorValue<ADReal> elem_one_grad = adGradSln(elem_one, state, correct_skewness);
639 mooseAssert(elem_two,
"Face type indicates BOTH but neighbor information is missing.");
640 const VectorValue<ADReal> & elem_two_grad = adGradSln(elem_two, state, correct_skewness);
646 return elem_one_grad;
649template <
typename OutputType>
653 const bool correct_skewness)
const
655 const bool var_defined_on_elem = this->hasBlocks(fi.
elem().subdomain_id());
656 const Elem *
const elem = &fi.
elem();
659 const bool is_internal_face = this->isInternalFace(fi);
661 const ADReal side_one_value = (!is_internal_face && !var_defined_on_elem)
662 ? getBoundaryFaceValue(fi, state, correct_skewness)
663 : getElemValue(elem, state);
664 const ADReal side_two_value = (var_defined_on_elem && !is_internal_face)
665 ? getBoundaryFaceValue(fi, state, correct_skewness)
666 : getElemValue(neighbor, state);
669 this->isInternalFace(fi)
677 auto face_grad = ((side_two_value - side_one_value) / delta) * fi.
eCN();
680 if (this->_mesh.dimension() > 1)
684 const auto & interpolated_gradient = uncorrectedAdGradSln(fi, state, correct_skewness);
685 face_grad += interpolated_gradient - (interpolated_gradient * fi.
eCN()) * fi.
eCN();
691template <
typename OutputType>
695 if (!_dirichlet_map_setup)
696 determineBoundaryToDirichletBCMap();
697 if (!_flux_map_setup)
698 determineBoundaryToFluxBCMap();
703template <
typename OutputType>
710template <
typename OutputType>
714 _elem_to_grad.clear();
717template <
typename OutputType>
721 unsigned int state = 0;
722 state = std::max(state, _element_data->oldestSolutionStateRequested());
723 state = std::max(state, _neighbor_data->oldestSolutionStateRequested());
727template <
typename OutputType>
731 _element_data->clearDofIndices();
732 _neighbor_data->clearDofIndices();
735template <
typename OutputType>
740 mooseAssert(fi,
"The face information must be non-null");
741 if (isDirichletBoundaryFace(*fi, face.
face_side, state))
742 return getDirichletBoundaryFaceValue(*fi, face.
face_side, state);
743 else if (isExtrapolatedBoundaryFace(*fi, face.
face_side, state))
745 bool two_term_boundary_expansion = _two_term_boundary_expansion;
749 two_term_boundary_expansion =
false;
750 return getExtrapolatedBoundaryFaceValue(
755 mooseAssert(this->isInternalFace(*fi),
756 "We must be either Dirichlet, extrapolated, or internal");
761template <
typename OutputType>
765 const auto & node_to_elem_map = this->_mesh.nodeToElemMap();
766 const auto & elem_ids = libmesh_map_find(node_to_elem_map, node_arg.
node->
id());
768 Real total_weight = 0;
769 mooseAssert(elem_ids.size(),
"There should always be at least one element connected to a node");
770 for (
const auto elem_id : elem_ids)
772 const Elem *
const elem = this->_mesh.queryElemPtr(elem_id);
773 mooseAssert(elem,
"We should have this element available");
774 if (!this->hasBlocks(elem->subdomain_id()))
778 const auto weight = 1 / (*node_arg.
node - elem->vertex_average()).norm();
779 sum += weight * (*this)(elem_point, state);
780 total_weight += weight;
782 return sum / total_weight;
785template <
typename OutputType>
789 mooseError(
"evaluateDot not implemented for this class of finite volume variables");
796 const Elem *
const elem = elem_arg.
elem;
797 mooseAssert(state.
state == 0,
798 "We dot not currently support any time derivative evaluations other than for the "
799 "current time-step");
800 mooseAssert(_time_integrator && _time_integrator->dt(),
801 "A time derivative is being requested but we do not have a time integrator so we'll "
802 "have no idea how to compute it");
807 this->_dof_indices.size() == 1,
808 "There should only be one dof-index for a constant monomial variable on any given element");
810 const dof_id_type dof_index = this->_dof_indices[0];
814 ADReal dot = (*_solution)(dof_index);
815 if (ADReal::do_derivatives && state.
state == 0 &&
816 _sys.number() == _subproblem.currentNlSysNum())
818 _time_integrator->computeADTimeDerivatives(dot, dof_index, _ad_real_dummy);
822 return (*_sys.solutionUDot())(dof_index);
830 mooseAssert(fi,
"The face information must be non-null");
831 if (isDirichletBoundaryFace(*fi, face.
face_side, state))
833 else if (isExtrapolatedBoundaryFace(*fi, face.
face_side, state))
836 "If we are an extrapolated boundary face, then our FunctorBase::checkFace method "
837 "should have assigned a non-null element that we are defined on");
841 return evaluateDot(elem_arg, state);
845 mooseAssert(this->isInternalFace(*fi),
846 "We must be either Dirichlet, extrapolated, or internal");
847 return Moose::FV::interpolate<ADReal, FunctorEvaluationKind::Dot>(*
this, face, state);
855 return evaluateDot(
ElemArg({elem_qp.
elem,
false}), state);
858template <
typename OutputType>
862 _element_data->prepareAux();
863 _neighbor_data->prepareAux();
866template <
typename OutputType>
871 "This routine has not been implemented for threads. Please query this routine before "
872 "a threaded region or contact a MOOSE developer to discuss.");
874 _boundary_id_to_dirichlet_bc.clear();
875 std::vector<FVDirichletBCBase *> bcs;
881 const auto base_query = this->_subproblem.getMooseApp()
884 .template condition<AttribSystem>(
"FVDirichletBC")
885 .template condition<AttribThread>(_tid)
886 .template condition<AttribVar>(_var_num)
887 .template condition<AttribSysNum>(this->_sys.number());
889 for (
const auto bnd_id : this->_mesh.getBoundaryIDs())
891 auto base_query_copy = base_query;
892 base_query_copy.template condition<AttribBoundaries>(std::set<BoundaryID>({bnd_id}))
894 mooseAssert(bcs.size() <= 1,
"cannot have multiple dirichlet BCs on the same boundary");
896 _boundary_id_to_dirichlet_bc.emplace(bnd_id, bcs[0]);
899 _dirichlet_map_setup =
true;
902template <
typename OutputType>
907 "This routine has not been implemented for threads. Please query this routine before "
908 "a threaded region or contact a MOOSE developer to discuss.");
910 _boundary_id_to_flux_bc.clear();
911 std::vector<const FVFluxBC *> bcs;
917 const auto base_query = this->_subproblem.getMooseApp()
920 .template condition<AttribSystem>(
"FVFluxBC")
921 .template condition<AttribThread>(_tid)
922 .template condition<AttribVar>(_var_num)
923 .template condition<AttribSysNum>(this->_sys.number());
925 for (
const auto bnd_id : this->_mesh.getBoundaryIDs())
927 auto base_query_copy = base_query;
928 base_query_copy.template condition<AttribBoundaries>(std::set<BoundaryID>({bnd_id}))
931 _boundary_id_to_flux_bc.emplace(bnd_id, bcs);
934 _flux_map_setup =
true;
937template <
typename OutputType>
941 _element_data->sizeMatrixTagData();
942 _neighbor_data->sizeMatrixTagData();
DualNumber< Real, DNDerivativeType, true > ADReal
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
registerMooseObject("MooseApp", MooseVariableFVReal)
std::array< Real, 2 > values
if(!dmm->_nl) SETERRQ(PETSC_COMM_WORLD
const Elem *const & elem() const
Return the current element.
const Elem *const & neighbor() const
Return the neighbor element.
Base class for finite volume Dirichlet boundaray conditions.
virtual ADReal boundaryValue(const FaceInfo &fi, const Moose::StateArg &state) const =0
This data structure is used to store geometric and variable related metadata about each cell face in ...
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.
const Point & eCN() const
const Elem & elem() const
const Elem * neighborPtr() const
const Elem * elemPtr() const
const Point & neighborCentroid() const
const Point & elemCentroid() const
Returns the element centroids of the elements on the elem and neighbor sides of the face.
const Point & faceCentroid() const
Returns the coordinates of the face centroid.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Assembly & _assembly
Assembly data.
SystemBase & _sys
System this variable is part of.
virtual void computeNeighborValuesFace() override
Compute values at facial quadrature points for the neighbor.
const DofValues & dofValuesDot() const override
DofValue getElementalValue(const Elem *elem, unsigned int idx=0) const
Get the current value of this variable on an element.
std::unique_ptr< MooseVariableDataFV< OutputType > > _element_data
Holder for all the data associated with the "main" element.
static InputParameters validParams()
const DofValues & dofValuesDotDotOld() const override
DofValue getElementalValueOlder(const Elem *elem, unsigned int idx=0) const
Get the older value of this variable on an element.
const DofValues & dofValuesOld() const override
virtual VectorValue< ADReal > uncorrectedAdGradSln(const FaceInfo &fi, const StateArg &state, const bool correct_skewness=false) const
Retrieve (or potentially compute) the uncorrected gradient on the provided face.
virtual void prepareIC() override
Prepare the initial condition.
void clearDofIndices() override
Clear out the dof indices.
bool isExtrapolatedBoundaryFace(const FaceInfo &fi, const Elem *elem, const Moose::StateArg &state) const override
Returns whether this is an extrapolated boundary face.
void determineBoundaryToDirichletBCMap()
Setup the boundary to Dirichlet BC map.
Moose::FV::InterpMethod _face_interp_method
Decides if an average or skewed corrected average is used for the face interpolation.
OutputTools< OutputType >::OutputGradient getGradient(const Elem *elem) const
Compute the variable gradient value at a point on an element.
const MooseArray< libMesh::Number > & dofValuesDuDotDu() const override
const DofValues & dofValuesOldNeighbor() const override
virtual bool isDirichletBoundaryFace(const FaceInfo &fi, const Elem *elem, const Moose::StateArg &state) const
Determine whether a specified face side is a Dirichlet boundary face.
const MooseArray< libMesh::Number > & dofValuesDuDotDotDu() const override
std::pair< bool, std::vector< const FVFluxBC * > > getFluxBCs(const FaceInfo &fi) const
DofValue getElementalValueOld(const Elem *elem, unsigned int idx=0) const
Get the old value of this variable on an element.
const DofValues & dofValuesDotOldNeighbor() const override
virtual ADReal getExtrapolatedBoundaryFaceValue(const FaceInfo &fi, bool two_term_expansion, bool correct_skewness, const Elem *elem_side_to_extrapolate_from, const StateArg &state) const
Retrieves an extrapolated boundary value for the provided face.
OutputType getValue(const Elem *elem) const
Note: const monomial is always the case - higher order solns are reconstructed - so this is simpler f...
const DofValues & dofValuesPreviousNL() const override
const DofValues & dofValuesDotNeighbor() const override
const DofValues & dofValuesNeighbor() const override
const DofValues & dofValuesDotDot() const override
unsigned int oldestSolutionStateRequested() const override final
The oldest solution state that is requested for this variable (0 = current, 1 = old,...
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 setDofValues(const DenseVector< DofValue > &values) override
Set local DOF values and evaluate the values on quadrature points.
ADReal getElemValue(const Elem *elem, const StateArg &state) const
Get the solution value for the provided element and seed the derivative for the corresponding dof ind...
ADReal getBoundaryFaceValue(const FaceInfo &fi, const StateArg &state, bool correct_skewness=false) const
Retrieve the solution value at a boundary face.
virtual void insert(libMesh::NumericVector< libMesh::Number > &vector) override
Insert the currently cached degree of freedom values into the provided vector.
virtual void residualSetup() override
Gets called just before the residual is computed and before this object is asked to do its job.
const DofValues & dofValuesPreviousNLNeighbor() const override
virtual void setNodalValue(const OutputType &value) override
const DofValues & dofValuesOlder() const override
virtual void computeNeighborValues() override
Compute values at quadrature points for the neighbor.
std::pair< bool, const FVDirichletBCBase * > getDirichletBC(const FaceInfo &fi) const
MooseVariableFV(const InputParameters ¶meters)
virtual void computeElemValuesFace() override
Compute values at facial quadrature points.
void clearAllDofIndices() final
virtual ADReal getDirichletBoundaryFaceValue(const FaceInfo &fi, const Elem *elem, const Moose::StateArg &state) const
Retrieves a Dirichlet boundary value for the provided face.
std::unique_ptr< MooseVariableDataFV< OutputType > > _neighbor_data
Holder for all the data associated with the neighbor element.
virtual void add(libMesh::NumericVector< libMesh::Number > &vector) override
Add the currently cached degree of freedom values into the provided vector.
virtual void setLowerDofValues(const DenseVector< DofValue > &values) override
Set local DOF values for a lower dimensional element and evaluate the values on quadrature points.
virtual void sizeMatrixTagData() override
Size data structures related to matrix tagging.
DotType evaluateDot(const ElemArg &elem, const StateArg &) const override final
Evaluate the functor time derivative with a given element.
void clearCaches()
clear finite volume caches
void determineBoundaryToFluxBCMap()
Setup the boundary to Flux BC map.
virtual void computeFaceValues(const FaceInfo &fi) override
Initializes/computes variable values from the solution vectors for the face represented by fi.
const MooseArray< libMesh::Number > & dofValuesDuDotDuNeighbor() const override
typename MooseVariableField< OutputType >::OutputShape OutputShape
virtual void prepareAux() override final
virtual void computeElemValues() override
Initializes/computes variable values from the solution vectors for the current element being operated...
const DofValues & dofValuesDotOld() const override
const DofValues & dofValuesDotDotNeighbor() const override
const DofValues & dofValues() const override
dof values getters
const ADTemplateVariableGradient< OutputType > & adGradSln() const override
AD grad solution getter.
virtual void jacobianSetup() override
Gets called just before the Jacobian is computed and before this object is asked to do its job.
const DofValues & dofValuesDotDotOldNeighbor() const override
virtual void setDofValue(const DofValue &value, unsigned int index) override
Degree of freedom value setters.
ValueType evaluate(const ElemArg &elem, const StateArg &) const override final
Evaluate the functor with a given element.
const DofValues & dofValuesOlderNeighbor() const override
const MooseArray< libMesh::Number > & dofValuesDuDotDotDuNeighbor() const override
Class for stuff related to variables.
typename MooseVariableDataBase< OutputType >::DofValue DofValue
static InputParameters validParams()
typename MooseVariableDataBase< OutputType >::DofValues DofValues
virtual const OutputTools< T >::VariableSecond & second()
The second derivative of the variable this object is operating on.
Moose::ADType< OutputType >::type ValueType
subdomain_id_type subdomain_id() const
std::tuple< const Elem *, const Elem *, bool > determineElemOneAndTwo(const FaceInfo &fi, const FVVar &var)
This utility determines element one and element two given a FaceInfo fi and variable var.
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...
libMesh::CompareTypes< T, T2 >::supertype linearInterpolation(const T &value1, const T2 &value2, const FaceInfo &fi, const bool one_is_elem, const InterpMethod interp_method=InterpMethod::Average)
A simple linear interpolation of values between cell centers to a cell face.
@ SkewCorrectedAverage
(gc*elem+(1-gc)*neighbor)+gradient*(rf-rf')
@ Average
gc*elem+(1-gc)*neighbor
libMesh::VectorValue< T > greenGaussGradient(const ElemArg &elem_arg, const StateArg &state_arg, const FunctorBase< T > &functor, const bool two_term_boundary_expansion, const MooseMesh &mesh, const bool force_green_gauss=false)
Compute a cell gradient using the method of Green-Gauss.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
std::string stringify(const T &t)
conversion to string
void initDofIndices(T &data, const Elem &elem)
void derivInsert(SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N > > &derivs, libMesh::dof_id_type index, Real value)
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...
Argument for requesting functor evaluation at a quadrature point location in an element.
const libMesh::Elem * elem
The element.
A structure defining a "face" evaluation calling argument for Moose functors.
bool elem_is_upwind
a boolean which states whether the face information element is upwind of the face
bool correct_skewness
Whether to perform skew correction.
Moose::FV::LimiterType limiter_type
a limiter which defines how the functor evaluated on either side of the face should be interpolated t...
const libMesh::Elem * face_side
A member that can be used to indicate whether there is a sidedness to this face.
const FaceInfo * fi
a face information object which defines our location in space
const libMesh::Node * node
The node 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.