20#include "libmesh/numeric_vector.h"
25 const unsigned int variable_number)
27 _system_number(sys.number()),
28 _components(components),
30 _variable_number(variable_number)
37 mooseAssert(index <
_components.size(),
"Gradient component index out of range.");
45 RealVectorValue value;
47 for (
const auto component_index : make_range(elem_info.
elem()->dim()))
48 value(component_index) =
component(elem_info, component_index);
58 "Gradient requested on a face where the variable is defined on neither side.");
65 const auto elem_one_grad =
gradient(*elem_one);
69 mooseAssert(elem_two,
"Face type indicates BOTH but neighbor information is missing.");
70 const auto elem_two_grad =
gradient(*elem_two);
Class used for caching additional information for elements such as the volume and centroid.
const Elem * elem() const
const std::vector< std::vector< dof_id_type > > & dofIndices() const
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 ...
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 ElemInfo * elemInfo() const
const ElemInfo * neighborInfo() const
LinearFVGradientReader(const SystemBase &sys, const GradientContainer &components, const FVGradientMethod &method, unsigned int variable_number)
Real component(const ElemInfo &elem_info, unsigned int index) const
Read one gradient component at an element.
const GradientContainer & _components
Component vectors keyed by spatial direction.
std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > GradientContainer
One vector per spatial component of the cell-centered gradient.
RealVectorValue gradient(const ElemInfo &elem_info) const
Read the full gradient at an element.
const unsigned int _variable_number
Variable number whose gradients are read by this object.
const unsigned int _system_number
System number cached for hot lookups (from faces to dofs).
Base class for a system (of equations)
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.