23#include "libmesh/numeric_vector.h"
32template <
typename OutputType>
37 params.
set<
bool>(
"fv") =
true;
40 params.template addParam<bool>(
41 "two_term_boundary_expansion",
43 "Whether to use a two-term Taylor expansion to calculate boundary face values. "
44 "If the two-term expansion is used, then the boundary face value depends on the "
45 "adjoining cell center gradient, which itself depends on the boundary face value. "
46 "Consequently an implicit solve is used to simultaneously solve for the adjoining cell "
47 "center gradient and boundary face value(s).");
48 MooseEnum face_interp_method(
"average skewness-corrected",
"average");
49 params.template addParam<MooseEnum>(
"face_interp_method",
51 "Switch that can select between face interpolation methods.");
52 params.template addParam<bool>(
53 "cache_cell_gradients",
true,
"Whether to cache cell gradients or re-compute them.");
57 "ElementSideNeighborLayers",
62 unsigned short layers = 1;
63 if (obj_params.
get<
MooseEnum>(
"face_interp_method") ==
"skewness-corrected")
66 rm_params.
set<
unsigned short>(
"layers") = layers;
71template <
typename OutputType>
74 _solution(this->_sys.currentSolution()),
75 _phi(this->_assembly.template fePhi<
OutputShape>(FEType(CONSTANT, MONOMIAL))),
76 _grad_phi(this->_assembly.template feGradPhi<
OutputShape>(FEType(CONSTANT, MONOMIAL))),
77 _phi_face(this->_assembly.template fePhiFace<
OutputShape>(FEType(CONSTANT, MONOMIAL))),
78 _grad_phi_face(this->_assembly.template feGradPhiFace<
OutputShape>(FEType(CONSTANT, MONOMIAL))),
80 this->_assembly.template fePhiFaceNeighbor<
OutputShape>(FEType(CONSTANT, MONOMIAL))),
81 _grad_phi_face_neighbor(
82 this->_assembly.template feGradPhiFaceNeighbor<
OutputShape>(FEType(CONSTANT, MONOMIAL))),
83 _phi_neighbor(this->_assembly.template fePhiNeighbor<
OutputShape>(FEType(CONSTANT, MONOMIAL))),
85 this->_assembly.template feGradPhiNeighbor<
OutputShape>(FEType(CONSTANT, MONOMIAL))),
87 _two_term_boundary_expansion(this->isParamValid(
"two_term_boundary_expansion")
88 ? this->template getParam<bool>(
"two_term_boundary_expansion")
90 _cache_cell_gradients(this->isParamValid(
"cache_cell_gradients")
91 ? this->template getParam<bool>(
"cache_cell_gradients")
96 _neighbor_data = std::make_unique<MooseVariableDataFV<OutputType>>(
101 const auto & interp_method = this->
template getParam<MooseEnum>(
"face_interp_method");
102 if (interp_method ==
"average")
104 else if (interp_method ==
"skewness-corrected")
111template <
typename OutputType>
115 _element_data->clearDofIndices();
118template <
typename OutputType>
122 return _element_data->getElementalValue(elem,
Moose::Current, idx);
125template <
typename OutputType>
129 return _element_data->getElementalValue(elem,
Moose::Old, idx);
132template <
typename OutputType>
139template <
typename OutputType>
143 _element_data->insert(residual);
146template <
typename OutputType>
153template <
typename OutputType>
157 _element_data->add(residual);
160template <
typename OutputType>
164 return _element_data->dofValues();
167template <
typename OutputType>
171 return _element_data->dofValuesOld();
174template <
typename OutputType>
178 return _element_data->dofValuesOlder();
181template <
typename OutputType>
185 return _element_data->dofValuesPreviousNL();
188template <
typename OutputType>
192 return _neighbor_data->dofValues();
195template <
typename OutputType>
199 return _neighbor_data->dofValuesOld();
202template <
typename OutputType>
206 return _neighbor_data->dofValuesOlder();
209template <
typename OutputType>
213 return _neighbor_data->dofValuesPreviousNL();
216template <
typename OutputType>
220 return _element_data->dofValuesDot();
223template <
typename OutputType>
227 return _element_data->dofValuesDotDot();
230template <
typename OutputType>
234 return _element_data->dofValuesDotOld();
237template <
typename OutputType>
241 return _element_data->dofValuesDotDotOld();
244template <
typename OutputType>
248 return _neighbor_data->dofValuesDot();
251template <
typename OutputType>
255 return _neighbor_data->dofValuesDotDot();
258template <
typename OutputType>
262 return _neighbor_data->dofValuesDotOld();
265template <
typename OutputType>
269 return _neighbor_data->dofValuesDotDotOld();
272template <
typename OutputType>
276 return _element_data->dofValuesDuDotDu();
279template <
typename OutputType>
283 return _element_data->dofValuesDuDotDotDu();
286template <
typename OutputType>
290 return _neighbor_data->dofValuesDuDotDu();
293template <
typename OutputType>
297 return _neighbor_data->dofValuesDuDotDotDu();
300template <
typename OutputType>
304 _element_data->prepareIC();
307template <
typename OutputType>
312 _element_data->computeValues();
315template <
typename OutputType>
320 _element_data->computeValues();
323template <
typename OutputType>
328 _neighbor_data->computeValues();
331template <
typename OutputType>
336 _neighbor_data->computeValues();
339template <
typename OutputType>
346 const auto facetype = fi.
faceType(std::make_pair(this->number(), this->sys().number()));
351 _element_data->computeValuesFace(fi);
352 _neighbor_data->computeValuesFace(fi);
355 _element_data->computeValuesFace(fi);
357 _neighbor_data->computeValuesFace(fi);
359 mooseError(
"robert wrote broken MooseVariableFV code");
362template <
typename OutputType>
367 mooseAssert(this->_dof_indices.size() == 1,
"Wrong size for dof indices");
368 OutputType value = (*this->_sys.currentSolution())(this->_dof_indices[0]);
372template <
typename OutputType>
379template <
typename OutputType>
383 mooseError(
"FV variables do not support setNodalValue");
386template <
typename OutputType>
390 _element_data->setDofValue(value, index);
393template <
typename OutputType>
397 _element_data->setDofValues(
values);
400template <
typename OutputType>
407template <
typename OutputType>
408std::pair<bool, const FVDirichletBCBase *>
412 if (
auto it = _boundary_id_to_dirichlet_bc.find(bnd_id);
413 it != _boundary_id_to_dirichlet_bc.end())
414 return {
true, it->second};
416 return {
false,
nullptr};
419template <
typename OutputType>
420std::pair<bool, std::vector<const FVFluxBC *>>
423 for (
const auto bnd_id : fi.boundaryIDs())
424 if (auto it = _boundary_id_to_flux_bc.find(bnd_id); it != _boundary_id_to_flux_bc.end())
425 return {
true, it->second};
427 return std::make_pair(
false, std::vector<const FVFluxBC *>());
430template <
typename OutputType>
435 "The elem shall exist! This typically occurs when the "
436 "user wants to evaluate non-existing elements (nullptr) at physical boundaries.");
438 this->hasBlocks(elem->subdomain_id()),
439 "The variable should be defined on the element's subdomain! This typically occurs when the "
440 "user wants to evaluate the elements right next to the boundary of two variables (block "
441 "boundary). The subdomain which is queried: " +
442 Moose::stringify(this->activeSubdomains()) +
" the subdomain of the element " +
443 std::to_string(elem->subdomain_id()));
448 this->_dof_indices.size() == 1,
449 "There should only be one dof-index for a constant monomial variable on any given element");
451 const dof_id_type index = this->_dof_indices[0];
457 const auto & global_soln =
459 ? *this->_sys.currentSolution()
464 if (ADReal::do_derivatives && state.
state == 0 &&
465 this->_sys.number() == this->_subproblem.currentNlSysNum())
471template <
typename OutputType>
477 const auto & pr = getDirichletBC(fi);
483template <
typename OutputType>
486 const Elem *
const libmesh_dbg_var(elem),
489 mooseAssert(isDirichletBoundaryFace(fi, elem, state),
490 "This function should only be called on Dirichlet boundary faces.");
492 const auto & diri_pr = getDirichletBC(fi);
494 mooseAssert(diri_pr.first,
495 "This functor should only be called if we are on a Dirichlet boundary face.");
502template <
typename OutputType>
505 const Elem *
const elem,
508 if (isDirichletBoundaryFace(fi, elem, state))
511 return !this->isInternalFace(fi);
514template <
typename OutputType>
517 const bool two_term_expansion,
518 const bool correct_skewness,
519 const Elem * elem_to_extrapolate_from,
523 isExtrapolatedBoundaryFace(fi, elem_to_extrapolate_from, state) || !two_term_expansion,
524 "We allow Dirichlet boundary conditions to call this method. However, the only way to "
525 "ensure we don't have infinite recursion, with Green Gauss gradients calling back to the "
526 "Dirichlet boundary condition calling back to this method, is to do a one term expansion");
529 bool elem_to_extrapolate_from_is_fi_elem;
530 std::tie(elem_to_extrapolate_from, elem_to_extrapolate_from_is_fi_elem) =
531 [
this, &fi, elem_to_extrapolate_from]() -> std::pair<const Elem *, bool>
533 if (elem_to_extrapolate_from)
535 return {elem_to_extrapolate_from, elem_to_extrapolate_from == fi.
elemPtr()};
538 const auto [elem_guaranteed_to_have_dofs,
540 elem_guaranteed_to_have_dofs_is_fi_elem] =
544 libmesh_ignore(other_elem);
546 return {elem_guaranteed_to_have_dofs, elem_guaranteed_to_have_dofs_is_fi_elem};
550 if (two_term_expansion)
552 const Point vector_to_face = elem_to_extrapolate_from_is_fi_elem
555 boundary_value = adGradSln(elem_to_extrapolate_from, state, correct_skewness) * vector_to_face +
556 getElemValue(elem_to_extrapolate_from, state);
559 boundary_value = getElemValue(elem_to_extrapolate_from, state);
561 return boundary_value;
564template <
typename OutputType>
568 const bool correct_skewness)
const
570 mooseAssert(!this->isInternalFace(fi),
571 "A boundary face value has been requested on an internal face.");
573 if (isDirichletBoundaryFace(fi,
nullptr, state))
574 return getDirichletBoundaryFaceValue(fi,
nullptr, state);
575 else if (isExtrapolatedBoundaryFace(fi,
nullptr, state))
576 return getExtrapolatedBoundaryFaceValue(
577 fi, _two_term_boundary_expansion, correct_skewness,
nullptr, state);
582template <
typename OutputType>
583const VectorValue<ADReal> &
586 const bool correct_skewness)
const
590 if (_cache_cell_gradients && !correct_skewness && state.
state == 0)
592 auto it = _elem_to_grad.find(elem);
594 if (it != _elem_to_grad.end())
599 ElemArg({elem, correct_skewness}), state, *
this, _two_term_boundary_expansion, this->_mesh);
601 if (_cache_cell_gradients && !correct_skewness && state.
state == 0)
603 auto pr = _elem_to_grad.emplace(elem, std::move(grad));
604 mooseAssert(pr.second,
"Insertion should have just happened.");
605 return pr.first->second;
609 _temp_cell_gradient = std::move(grad);
610 return _temp_cell_gradient;
614template <
typename OutputType>
618 const bool correct_skewness)
const
620 const auto face_type = fi.
faceType(std::make_pair(this->number(), this->sys().number()));
622 "Gradient requested on a face where the variable is defined on neither side.");
626 const Elem *
const elem_one = var_defined_on_elem ? &fi.
elem() : fi.
neighborPtr();
627 const Elem *
const elem_two = var_defined_on_elem ? fi.
neighborPtr() : &fi.
elem();
629 const VectorValue<ADReal> elem_one_grad = adGradSln(elem_one, state, correct_skewness);
636 mooseAssert(elem_two,
"Face type indicates BOTH but neighbor information is missing.");
637 const VectorValue<ADReal> & elem_two_grad = adGradSln(elem_two, state, correct_skewness);
643 return elem_one_grad;
646template <
typename OutputType>
650 const bool correct_skewness)
const
652 const bool var_defined_on_elem = this->hasBlocks(fi.
elem().subdomain_id());
653 const Elem *
const elem = &fi.
elem();
656 const bool is_internal_face = this->isInternalFace(fi);
658 const ADReal side_one_value = (!is_internal_face && !var_defined_on_elem)
659 ? getBoundaryFaceValue(fi, state, correct_skewness)
660 : getElemValue(elem, state);
661 const ADReal side_two_value = (var_defined_on_elem && !is_internal_face)
662 ? getBoundaryFaceValue(fi, state, correct_skewness)
663 : getElemValue(neighbor, state);
666 this->isInternalFace(fi)
674 auto face_grad = ((side_two_value - side_one_value) / delta) * fi.
eCN();
677 if (this->_mesh.dimension() > 1)
681 const auto & interpolated_gradient = uncorrectedAdGradSln(fi, state, correct_skewness);
682 face_grad += interpolated_gradient - (interpolated_gradient * fi.
eCN()) * fi.
eCN();
688template <
typename OutputType>
692 if (!_dirichlet_map_setup)
693 determineBoundaryToDirichletBCMap();
694 if (!_flux_map_setup)
695 determineBoundaryToFluxBCMap();
700template <
typename OutputType>
707template <
typename OutputType>
711 _elem_to_grad.clear();
714template <
typename OutputType>
718 unsigned int state = 0;
719 state = std::max(state, _element_data->oldestSolutionStateRequested());
720 state = std::max(state, _neighbor_data->oldestSolutionStateRequested());
724template <
typename OutputType>
728 _element_data->clearDofIndices();
729 _neighbor_data->clearDofIndices();
732template <
typename OutputType>
737 mooseAssert(fi,
"The face information must be non-null");
738 if (isDirichletBoundaryFace(*fi, face.
face_side, state))
739 return getDirichletBoundaryFaceValue(*fi, face.
face_side, state);
740 else if (isExtrapolatedBoundaryFace(*fi, face.
face_side, state))
742 bool two_term_boundary_expansion = _two_term_boundary_expansion;
746 two_term_boundary_expansion =
false;
747 return getExtrapolatedBoundaryFaceValue(
752 mooseAssert(this->isInternalFace(*fi),
753 "We must be either Dirichlet, extrapolated, or internal");
758template <
typename OutputType>
762 const auto & node_to_elem_map = this->_mesh.nodeToElemMap();
763 const auto & elem_ids = libmesh_map_find(node_to_elem_map, node_arg.
node->
id());
765 Real total_weight = 0;
766 mooseAssert(elem_ids.size(),
"There should always be at least one element connected to a node");
767 for (
const auto elem_id : elem_ids)
769 const Elem *
const elem = this->_mesh.queryElemPtr(elem_id);
770 mooseAssert(elem,
"We should have this element available");
771 if (!this->hasBlocks(elem->subdomain_id()))
775 const auto weight = 1 / (*node_arg.
node - elem->vertex_average()).norm();
776 sum += weight * (*this)(elem_point, state);
777 total_weight += weight;
779 return sum / total_weight;
782template <
typename OutputType>
786 mooseError(
"evaluateDot not implemented for this class of finite volume variables");
793 const Elem *
const elem = elem_arg.
elem;
794 mooseAssert(state.
state == 0,
795 "We dot not currently support any time derivative evaluations other than for the "
796 "current time-step");
797 mooseAssert(_time_integrator && _time_integrator->dt(),
798 "A time derivative is being requested but we do not have a time integrator so we'll "
799 "have no idea how to compute it");
804 this->_dof_indices.size() == 1,
805 "There should only be one dof-index for a constant monomial variable on any given element");
807 const dof_id_type dof_index = this->_dof_indices[0];
811 ADReal dot = (*_solution)(dof_index);
812 if (ADReal::do_derivatives && state.
state == 0 &&
813 _sys.number() == _subproblem.currentNlSysNum())
815 _time_integrator->computeADTimeDerivatives(dot, dof_index, _ad_real_dummy);
819 return (*_sys.solutionUDot())(dof_index);
827 mooseAssert(fi,
"The face information must be non-null");
828 if (isDirichletBoundaryFace(*fi, face.
face_side, state))
830 else if (isExtrapolatedBoundaryFace(*fi, face.
face_side, state))
833 "If we are an extrapolated boundary face, then our FunctorBase::checkFace method "
834 "should have assigned a non-null element that we are defined on");
838 return evaluateDot(elem_arg, state);
842 mooseAssert(this->isInternalFace(*fi),
843 "We must be either Dirichlet, extrapolated, or internal");
844 return Moose::FV::interpolate<ADReal, FunctorEvaluationKind::Dot>(*
this, face, state);
852 return evaluateDot(
ElemArg({elem_qp.
elem,
false}), state);
855template <
typename OutputType>
859 _element_data->prepareAux();
860 _neighbor_data->prepareAux();
863template <
typename OutputType>
868 "This routine has not been implemented for threads. Please query this routine before "
869 "a threaded region or contact a MOOSE developer to discuss.");
871 _boundary_id_to_dirichlet_bc.clear();
872 std::vector<FVDirichletBCBase *> bcs;
878 const auto base_query = this->_subproblem.getMooseApp()
881 .template condition<AttribSystem>(
"FVDirichletBC")
882 .template condition<AttribThread>(_tid)
883 .template condition<AttribVar>(_var_num)
884 .template condition<AttribSysNum>(this->_sys.number());
886 for (
const auto bnd_id : this->_mesh.getBoundaryIDs())
888 auto base_query_copy = base_query;
889 base_query_copy.template condition<AttribBoundaries>(std::set<BoundaryID>({bnd_id}))
891 mooseAssert(bcs.size() <= 1,
"cannot have multiple dirichlet BCs on the same boundary");
893 _boundary_id_to_dirichlet_bc.emplace(bnd_id, bcs[0]);
896 _dirichlet_map_setup =
true;
899template <
typename OutputType>
904 "This routine has not been implemented for threads. Please query this routine before "
905 "a threaded region or contact a MOOSE developer to discuss.");
907 _boundary_id_to_flux_bc.clear();
908 std::vector<const FVFluxBC *> bcs;
914 const auto base_query = this->_subproblem.getMooseApp()
917 .template condition<AttribSystem>(
"FVFluxBC")
918 .template condition<AttribThread>(_tid)
919 .template condition<AttribVar>(_var_num)
920 .template condition<AttribSysNum>(this->_sys.number());
922 for (
const auto bnd_id : this->_mesh.getBoundaryIDs())
924 auto base_query_copy = base_query;
925 base_query_copy.template condition<AttribBoundaries>(std::set<BoundaryID>({bnd_id}))
928 _boundary_id_to_flux_bc.emplace(bnd_id, bcs);
931 _flux_map_setup =
true;
934template <
typename OutputType>
938 _element_data->sizeMatrixTagData();
939 _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 std::set< BoundaryID > & boundaryIDs() const
Const getter for every associated boundary ID.
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 setNodalValue(const OutputType &value, unsigned int idx=0) override
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
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.