https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Moose::FunctorEnvelope< T > Class Template Referencefinal

This is a wrapper that forwards calls to the implementation, which can be switched out at any time without disturbing references to FunctorBase. More...

#include <MooseFunctor.h>

Inheritance diagram for Moose::FunctorEnvelope< T >:
[legend]

Public Types

using FunctorType = FunctorBase< T >
 
using ValueType = T
 
using GradientType = typename FunctorReturnType< T, FunctorEvaluationKind::Gradient >::type
 This rigmarole makes it so that a user can create functors that return containers (std::vector, std::array).
 
using DotType = ValueType
 

Public Member Functions

 FunctorEnvelope (const FunctorBase< T > &wrapped)
 
 FunctorEnvelope (std::unique_ptr< FunctorBase< T > > &&wrapped)
 
 FunctorEnvelope (FunctorBase< T > &&)=delete
 Prevent wrapping of a temporary object.
 
void assign (const FunctorBase< T > &wrapped)
 
void assign (std::unique_ptr< FunctorBase< T > > &&wrapped)
 
void assign (FunctorBase< T > &&)=delete
 Prevent wrapping of a temporary object.
 
 FunctorEnvelope (const FunctorEnvelope &)=delete
 
 FunctorEnvelope (FunctorEnvelope &&)=delete
 
FunctorEnvelope & operator= (const FunctorEnvelope &)=delete
 
FunctorEnvelope & operator= (FunctorEnvelope &&)=delete
 
virtual ~FunctorEnvelope ()=default
 
virtual bool wrapsNull () const override
 
virtual std::string returnType () const override
 
virtual bool ownsWrappedFunctor () const override
 
template<typename T2 >
bool wrapsType () const
 
virtual bool isExtrapolatedBoundaryFace (const FaceInfo &fi, const Elem *const elem, const StateArg &state) const override
 Returns whether this (sided) face is an extrapolated boundary face for this functor.
 
virtual bool isConstant () const override
 Returns true if this functor is a constant.
 
virtual bool hasBlocks (const SubdomainID id) const override
 Returns whether the functor is defined on this block.
 
virtual bool hasFaceSide (const FaceInfo &fi, const bool fi_elem_side) const override
 
bool supportsFaceArg () const override final
 Whether this functor supports evaluation with FaceArg.
 
bool supportsElemSideQpArg () const override final
 Whether this functor supports evaluation with ElemSideQpArg.
 
template<FunctorEvaluationKind FET, typename Space , typename State >
FunctorReturnType< T, FET >::type genericEvaluate (const Space &r, const State &state) const
 Perform a generic evaluation based on the supplied template argument FET and supplied spatial and temporal arguments.
 
const MooseFunctorName & functorName () const
 Return the functor name.
 
virtual void residualSetup () override
 
virtual void jacobianSetup () override
 
virtual void timestepSetup () override
 
virtual void customSetup (const ExecFlagType &exec_type) override
 
void setCacheClearanceSchedule (const std::set< ExecFlagType > &clearance_schedule)
 Set how often to clear the functor evaluation cache.
 
bool isInternalFace (const FaceInfo &) const
 Returns true if the face is an internal face.
 
void checkFace (const Moose::FaceArg &face) const
 Examines the incoming face argument.
 
ValueType operator() (const ElemArg &elem, const StateArg &state) const
 Same as their evaluate overloads with the same arguments but allows for caching implementation.
 
ValueType operator() (const FaceArg &face, const StateArg &state) const
 
ValueType operator() (const ElemQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemSideQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemPointArg &elem_point, const StateArg &state) const
 
ValueType operator() (const NodeArg &node, const StateArg &state) const
 
ValueType operator() (const PointArg &point, const StateArg &state) const
 
GradientType gradient (const ElemArg &elem, const StateArg &state) const
 Same as their evaluateGradient overloads with the same arguments but allows for caching implementation.
 
GradientType gradient (const FaceArg &face, const StateArg &state) const
 
GradientType gradient (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradient (const NodeArg &node, const StateArg &state) const
 
GradientType gradient (const PointArg &point, const StateArg &state) const
 
DotType dot (const ElemArg &elem, const StateArg &state) const
 Same as their evaluateDot overloads with the same arguments but allows for caching implementation.
 
DotType dot (const FaceArg &face, const StateArg &state) const
 
DotType dot (const ElemQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemSideQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemPointArg &elem_point, const StateArg &state) const
 
DotType dot (const NodeArg &node, const StateArg &state) const
 
DotType dot (const PointArg &point, const StateArg &state) const
 
GradientType gradDot (const ElemArg &elem, const StateArg &state) const
 Same as their evaluateGradDot overloads with the same arguments but allows for caching implementation.
 
GradientType gradDot (const FaceArg &face, const StateArg &state) const
 
GradientType gradDot (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradDot (const NodeArg &node, const StateArg &state) const
 
GradientType gradDot (const PointArg &point, const StateArg &state) const
 

Protected Member Functions

virtual ValueType evaluate (const ElemArg &elem, const StateArg &state) const override
 Forward calls to wrapped object.
 
virtual ValueType evaluate (const FaceArg &face, const StateArg &state) const override
 
virtual ValueType evaluate (const ElemQpArg &qp, const StateArg &state) const override
 
virtual ValueType evaluate (const ElemSideQpArg &qp, const StateArg &state) const override
 
virtual ValueType evaluate (const ElemPointArg &elem_point, const StateArg &state) const override
 Evaluate the functor with a given element and point.
 
virtual ValueType evaluate (const NodeArg &node, const StateArg &state) const override
 
virtual ValueType evaluate (const PointArg &point, const StateArg &state) const override
 Evaluate the functor at a physical point without any mesh information.
 
virtual GradientType evaluateGradient (const ElemArg &elem, const StateArg &state) const override
 Evaluate the functor gradient with a given element.
 
virtual GradientType evaluateGradient (const FaceArg &face, const StateArg &state) const override
 
virtual GradientType evaluateGradient (const ElemQpArg &qp, const StateArg &state) const override
 
virtual GradientType evaluateGradient (const ElemSideQpArg &qp, const StateArg &state) const override
 
virtual GradientType evaluateGradient (const ElemPointArg &elem_point, const StateArg &state) const override
 Evaluate the functor gradient with a given element and point.
 
virtual GradientType evaluateGradient (const NodeArg &node, const StateArg &state) const override
 
virtual GradientType evaluateGradient (const PointArg &point, const StateArg &state) const override
 
virtual DotType evaluateDot (const ElemArg &elem, const StateArg &state) const override
 Evaluate the functor time derivative with a given element.
 
virtual DotType evaluateDot (const FaceArg &face, const StateArg &state) const override
 
virtual DotType evaluateDot (const ElemQpArg &qp, const StateArg &state) const override
 
virtual DotType evaluateDot (const ElemSideQpArg &qp, const StateArg &state) const override
 
virtual DotType evaluateDot (const ElemPointArg &elem_point, const StateArg &state) const override
 Evaluate the functor time derivative with a given element and point.
 
virtual DotType evaluateDot (const NodeArg &node, const StateArg &state) const override
 
virtual DotType evaluateDot (const PointArg &point, const StateArg &state) const override
 
virtual GradientType evaluateGradDot (const ElemArg &elem, const StateArg &state) const override
 Evaluate the functor gradient-dot with a given element.
 
virtual GradientType evaluateGradDot (const FaceArg &face, const StateArg &state) const override
 
virtual GradientType evaluateGradDot (const ElemQpArg &qp, const StateArg &state) const override
 
virtual GradientType evaluateGradDot (const ElemSideQpArg &qp, const StateArg &state) const override
 
virtual GradientType evaluateGradDot (const ElemPointArg &elem_point, const StateArg &state) const override
 Evaluate the functor gradient-dot with a given element and point.
 
virtual GradientType evaluateGradDot (const NodeArg &node, const StateArg &state) const override
 
virtual GradientType evaluateGradDot (const PointArg &point, const StateArg &state) const override
 

Private Member Functions

void clearCacheData ()
 clear cache data
 
template<typename SpaceArg , typename StateArg >
ValueType queryQpCache (unsigned int qp, const libMesh::QBase &qrule, std::vector< std::pair< bool, T > > &qp_cache_data, const SpaceArg &space, const StateArg &state) const
 check a qp cache and if invalid then evaluate
 
template<typename SpaceArg >
ValueType queryFVArgCache (std::map< SpaceArg, ValueType > &cache_data, const SpaceArg &space) const
 check a finite volume spatial argument cache and if invalid then evaluate
 

Private Attributes

std::unique_ptr< FunctorBase< T > > _owned
 Our wrapped object.
 
const FunctorBase< T > * _wrapped
 
std::set< ExecFlagType > _clearance_schedule
 How often to clear the material property cache.
 
bool _always_evaluate
 Boolean to check if we always need evaluation.
 
dof_id_type _current_qp_map_key = libMesh::DofObject::invalid_id
 Current key for qp map cache.
 
std::vector< std::pair< bool, ValueType > > * _current_qp_map_value = nullptr
 Current value for qp map cache.
 
std::unordered_map< dof_id_type, std::vector< std::pair< bool, ValueType > > > _qp_to_value
 Cached element quadrature point functor property evaluations.
 
dof_id_type _current_side_qp_map_key = libMesh::DofObject::invalid_id
 Current key for side-qp map cache.
 
std::vector< std::vector< std::pair< bool, ValueType > > > * _current_side_qp_map_value
 Current value for side-qp map cache.
 
std::unordered_map< dof_id_type, std::vector< std::vector< std::pair< bool, ValueType > > > > _side_qp_to_value
 Cached element quadrature point functor property evaluations.
 
std::map< ElemArg, ValueType > _elem_arg_to_value
 Map from element arguments to their cached evaluations.
 
std::map< FaceArg, ValueType > _face_arg_to_value
 Map from face arguments to their cached evaluations.
 
std::map< NodeArg, ValueType > _node_arg_to_value
 Map from nodal arguments to their cached evaluations.
 
MooseFunctorName _functor_name
 name of the functor
 

Friends

class ::SubProblem
 

Detailed Description

template<typename T>
class Moose::FunctorEnvelope< T >

This is a wrapper that forwards calls to the implementation, which can be switched out at any time without disturbing references to FunctorBase.

Implementation motivated by https://stackoverflow.com/a/65455485/4493669

Definition at line 1102 of file MooseFunctor.h.

Member Typedef Documentation

◆ DotType

template<typename T >
using Moose::FunctorBase< T >::DotType = ValueType
inherited

Definition at line 150 of file MooseFunctor.h.

◆ FunctorType

template<typename T >
using Moose::FunctorBase< T >::FunctorType = FunctorBase<T>
inherited

Definition at line 140 of file MooseFunctor.h.

◆ GradientType

template<typename T >
using Moose::FunctorBase< T >::GradientType = typename FunctorReturnType<T, FunctorEvaluationKind::Gradient>::type
inherited

This rigmarole makes it so that a user can create functors that return containers (std::vector, std::array).

This logic will make it such that if a user requests a functor type T that is a container of algebraic types, for example Reals, then the GradientType will be a container of the gradients of those algebraic types, in this example VectorValue<Reals>. So if T is std::vector<Real>, then GradientType will be std::vector<VectorValue<Real>>. As another example: T = std::array<VectorValue<Real>, 1> -> GradientType = std::array<TensorValue<Real>, 1>

Definition at line 149 of file MooseFunctor.h.

◆ ValueType

template<typename T >
using Moose::FunctorBase< T >::ValueType = T
inherited

Definition at line 141 of file MooseFunctor.h.

Constructor & Destructor Documentation

◆ FunctorEnvelope() [1/5]

template<typename T >
Moose::FunctorEnvelope< T >::FunctorEnvelope ( const FunctorBase< T > &  wrapped)
inline
Parameters
wrappedThe functor to wrap. We will not not own the wrapped object

Definition at line 1112 of file MooseFunctor.h.

1113 : FunctorBase<T>("wraps_" + wrapped.functorName()), FunctorEnvelopeBase(), _wrapped(&wrapped)
1114 {
1115 }
const FunctorBase< T > * _wrapped

◆ FunctorEnvelope() [2/5]

template<typename T >
Moose::FunctorEnvelope< T >::FunctorEnvelope ( std::unique_ptr< FunctorBase< T > > &&  wrapped)
inline
Parameters
wrappedA unique pointer around the functor to wrap. We will own the wrapped object, e.g. if we are ever destructed or we are reassigned to wrap another functor, then this functor will be destructed

Definition at line 1122 of file MooseFunctor.h.

1123 : FunctorBase<T>("wraps_" + wrapped->functorName()),
1125 _owned(std::move(wrapped)),
1126 _wrapped(_owned.get())
1127 {
1128 }
std::unique_ptr< FunctorBase< T > > _owned
Our wrapped object.

◆ FunctorEnvelope() [3/5]

template<typename T >
Moose::FunctorEnvelope< T >::FunctorEnvelope ( FunctorBase< T > &&  )
delete

Prevent wrapping of a temporary object.

If we are to own a functor, the unique_ptr constructor overload should be used

◆ FunctorEnvelope() [4/5]

template<typename T >
Moose::FunctorEnvelope< T >::FunctorEnvelope ( const FunctorEnvelope< T > &  )
delete

◆ FunctorEnvelope() [5/5]

template<typename T >
Moose::FunctorEnvelope< T >::FunctorEnvelope ( FunctorEnvelope< T > &&  )
delete

◆ ~FunctorEnvelope()

template<typename T >
virtual Moose::FunctorEnvelope< T >::~FunctorEnvelope ( )
virtualdefault

Member Function Documentation

◆ assign() [1/3]

template<typename T >
void Moose::FunctorEnvelope< T >::assign ( const FunctorBase< T > &  wrapped)
inline
Parameters
wrappedThe functor to wrap. We will not not own the wrapped object. If we previously owned a functor, it will be destructed

Definition at line 1140 of file MooseFunctor.h.

1141 {
1142 _owned.reset();
1143 _wrapped = &wrapped;
1144 }

◆ assign() [2/3]

template<typename T >
void Moose::FunctorEnvelope< T >::assign ( FunctorBase< T > &&  )
delete

Prevent wrapping of a temporary object.

If we are to own a functor, the unique_ptr assign overload should be used

◆ assign() [3/3]

template<typename T >
void Moose::FunctorEnvelope< T >::assign ( std::unique_ptr< FunctorBase< T > > &&  wrapped)
inline
Parameters
wrappedA unique pointer around the functor to wrap. We will own the wrapped object. If we previously owned a functor, it will be destructed

Definition at line 1150 of file MooseFunctor.h.

1151 {
1152 _owned = std::move(wrapped);
1153 _wrapped = _owned.get();
1154 }

◆ checkFace()

template<typename T >
void Moose::FunctorBase< T >::checkFace ( const Moose::FaceArg &  face) const
inherited

Examines the incoming face argument.

If the face argument producer (residual object, postprocessor, etc.) did not indicate a sidedness to the face, e.g. if the face_side member of the FaceArg is nullptr, then we may "modify" the sidedness of the argument if we are only defined on one side of the face. If the face argument producer \emph has indicated a sidedness and we are not defined on that side, then we will error

Parameters
faceThe face argument created by the face argument producer, likely a residual object
Returns
A face with possibly changed sidedness depending on whether we aren't defined on both sides of the face

Definition at line 773 of file MooseFunctor.h.

778{
779#if DEBUG
780 const Elem * const elem = face.face_side;
781 const FaceInfo * const fi = face.fi;
782 mooseAssert(fi, "face info should be non-null");
783 bool check_elem_def = false;
784 bool check_neighbor_def = false;
785 // We check if the functor is defined on both sides of the face
786 if (!elem)
787 {
788 if (!hasFaceSide(*fi, true))
789 check_neighbor_def = true;
790 else if (!hasFaceSide(*fi, false))
791 check_elem_def = true;
792 }
793 else if (elem == fi->elemPtr())
794 check_elem_def = true;
795 else
796 {
797 mooseAssert(elem == fi->neighborPtr(), "This has to match something");
798 check_neighbor_def = true;
799 }
800
801 if (check_elem_def && !hasFaceSide(*fi, true))
802 {
803 std::string additional_message = "It is not defined on the neighbor side either.";
804 if (hasFaceSide(*fi, false))
805 additional_message = "It is however defined on the neighbor side.";
806 additional_message += " Face centroid: " + Moose::stringify(fi->faceCentroid());
808 " is not defined on the element side of the face information, but a face argument "
809 "producer "
810 "(e.g. residual object, postprocessor, etc.) has requested evaluation there.\n",
811 additional_message);
812 }
813 if (check_neighbor_def && !hasFaceSide(*fi, false))
814 {
815 std::string additional_message = "It is not defined on the element side either.";
816 if (hasFaceSide(*fi, true))
817 additional_message = "It is however defined on the element side.";
818 additional_message += " Face centroid: " + Moose::stringify(fi->faceCentroid());
821 " is not defined on the neighbor side of the face information, but a face argument "
822 "producer (e.g. residual object, postprocessor, etc.) has requested evaluation there.\n",
823 additional_message);
824 }
825#endif
826}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition FaceInfo.h:38
const Elem * neighborPtr() const
Definition FaceInfo.h:88
const Elem * elemPtr() const
Definition FaceInfo.h:86
const Point & faceCentroid() const
Returns the coordinates of the face centroid.
Definition FaceInfo.h:75
virtual bool hasFaceSide(const FaceInfo &fi, const bool fi_elem_side) const override
MooseFunctorName _functor_name
name of the functor
std::string stringify(const T &t)
conversion to string
Definition Conversion.h:65
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

◆ clearCacheData()

template<typename T >
void Moose::FunctorBase< T >::clearCacheData ( )
privateinherited

clear cache data

Definition at line 830 of file MooseFunctor.h.

831{
832 for (auto & map_pr : _qp_to_value)
833 for (auto & pr : map_pr.second)
834 pr.first = false;
835
836 for (auto & map_pr : _side_qp_to_value)
837 {
838 auto & side_vector = map_pr.second;
839 for (auto & qp_vector : side_vector)
840 for (auto & pr : qp_vector)
841 pr.first = false;
842 }
843
845 _current_qp_map_value = nullptr;
848
849 _elem_arg_to_value.clear();
850 _face_arg_to_value.clear();
851 _node_arg_to_value.clear();
852}
for(PetscInt i=0;i< nvars;++i)
dof_id_type _current_qp_map_key
Current key for qp map cache.
std::map< ElemArg, ValueType > _elem_arg_to_value
Map from element arguments to their cached evaluations.
std::unordered_map< dof_id_type, std::vector< std::pair< bool, ValueType > > > _qp_to_value
Cached element quadrature point functor property evaluations.
std::map< FaceArg, ValueType > _face_arg_to_value
Map from face arguments to their cached evaluations.
std::vector< std::vector< std::pair< bool, ValueType > > > * _current_side_qp_map_value
Current value for side-qp map cache.
std::map< NodeArg, ValueType > _node_arg_to_value
Map from nodal arguments to their cached evaluations.
std::vector< std::pair< bool, ValueType > > * _current_qp_map_value
Current value for qp map cache.
dof_id_type _current_side_qp_map_key
Current key for side-qp map cache.
std::unordered_map< dof_id_type, std::vector< std::vector< std::pair< bool, ValueType > > > > _side_qp_to_value
Cached element quadrature point functor property evaluations.
static constexpr dof_id_type invalid_id

◆ customSetup()

template<typename T >
void Moose::FunctorBase< T >::customSetup ( const ExecFlagType &  exec_type)
overridevirtualinherited

Implements Moose::FunctorAbstract.

Reimplemented in Function.

Definition at line 880 of file MooseFunctor.h.

881{
882 if (_clearance_schedule.count(exec_type))
884}
void clearCacheData()
clear cache data
std::set< ExecFlagType > _clearance_schedule
How often to clear the material property cache.

Referenced by Function::customSetup().

◆ dot() [1/7]

template<typename T >
FunctorBase< T >::DotType Moose::FunctorBase< T >::dot ( const ElemArg &  elem,
const StateArg &  state 
) const
inherited

Same as their evaluateDot overloads with the same arguments but allows for caching implementation.

These are the methods a user will call in their code

Definition at line 938 of file MooseFunctor.h.

939{
940 return evaluateDot(elem, state);
941}
virtual DotType evaluateDot(const ElemArg &, const StateArg &) const
Evaluate the functor time derivative with a given element.

Referenced by FVFunctorTimeKernel::computeQpResidual(), Moose::ADWrapperFunctor< T >::evaluateDot(), Moose::ADWrapperFunctor< T >::evaluateDot(), Moose::ADWrapperFunctor< T >::evaluateDot(), Moose::ADWrapperFunctor< T >::evaluateDot(), Moose::ADWrapperFunctor< T >::evaluateDot(), Moose::ADWrapperFunctor< T >::evaluateDot(), and Moose::ADWrapperFunctor< T >::evaluateDot().

◆ dot() [2/7]

template<typename T >
FunctorBase< T >::DotType Moose::FunctorBase< T >::dot ( const ElemPointArg &  elem_point,
const StateArg &  state 
) const
inherited

Definition at line 967 of file MooseFunctor.h.

968{
969 return evaluateDot(elem_point, state);
970}

◆ dot() [3/7]

template<typename T >
FunctorBase< T >::DotType Moose::FunctorBase< T >::dot ( const ElemQpArg &  qp,
const StateArg &  state 
) const
inherited

Definition at line 953 of file MooseFunctor.h.

954{
955 return evaluateDot(elem_qp, state);
956}

◆ dot() [4/7]

template<typename T >
FunctorBase< T >::DotType Moose::FunctorBase< T >::dot ( const ElemSideQpArg &  qp,
const StateArg &  state 
) const
inherited

Definition at line 960 of file MooseFunctor.h.

961{
962 return evaluateDot(elem_side_qp, state);
963}

◆ dot() [5/7]

template<typename T >
FunctorBase< T >::DotType Moose::FunctorBase< T >::dot ( const FaceArg &  face,
const StateArg &  state 
) const
inherited

Definition at line 945 of file MooseFunctor.h.

946{
947 checkFace(face);
948 return evaluateDot(face, state);
949}
void checkFace(const Moose::FaceArg &face) const
Examines the incoming face argument.

◆ dot() [6/7]

template<typename T >
FunctorBase< T >::DotType Moose::FunctorBase< T >::dot ( const NodeArg &  node,
const StateArg &  state 
) const
inherited

Definition at line 974 of file MooseFunctor.h.

975{
976 return evaluateDot(node, state);
977}

◆ dot() [7/7]

template<typename T >
FunctorBase< T >::DotType Moose::FunctorBase< T >::dot ( const PointArg &  point,
const StateArg &  state 
) const
inherited

Definition at line 981 of file MooseFunctor.h.

982{
983 return evaluateDot(point, state);
984}

◆ evaluate() [1/7]

template<typename T >
virtual ValueType Moose::FunctorEnvelope< T >::evaluate ( const ElemArg &  elem,
const StateArg &  state 
) const
inlineoverrideprotectedvirtual

Forward calls to wrapped object.

Implements Moose::FunctorBase< T >.

Definition at line 1211 of file MooseFunctor.h.

1212 {
1213 return _wrapped->operator()(elem, state);
1214 }

◆ evaluate() [2/7]

template<typename T >
virtual ValueType Moose::FunctorEnvelope< T >::evaluate ( const ElemPointArg &  elem_point,
const StateArg &  state 
) const
inlineoverrideprotectedvirtual

Evaluate the functor with a given element and point.

Some example implementations of this method could perform a two-term Taylor expansion using cell-centered value and gradient

Implements Moose::FunctorBase< T >.

Definition at line 1227 of file MooseFunctor.h.

1228 {
1229 return _wrapped->operator()(elem_point, state);
1230 }

◆ evaluate() [3/7]

template<typename T >
virtual ValueType Moose::FunctorEnvelope< T >::evaluate ( const ElemQpArg &  qp,
const StateArg &  state 
) const
inlineoverrideprotectedvirtual
Parameters
qpSee the ElemQpArg doxygen
stateSee the StateArg doxygen
Returns
The functor evaluated at the requested state and space

Implements Moose::FunctorBase< T >.

Definition at line 1219 of file MooseFunctor.h.

1220 {
1221 return _wrapped->operator()(qp, state);
1222 }

◆ evaluate() [4/7]

template<typename T >
virtual ValueType Moose::FunctorEnvelope< T >::evaluate ( const ElemSideQpArg &  side_qp,
const StateArg &  state 
) const
inlineoverrideprotectedvirtual
Parameters
side_qpSee the ElemSideQpArg doxygen
stateSee the StateArg doxygen
Returns
The functor evaluated at the requested state and space

Implements Moose::FunctorBase< T >.

Definition at line 1223 of file MooseFunctor.h.

1224 {
1225 return _wrapped->operator()(qp, state);
1226 }

◆ evaluate() [5/7]

template<typename T >
virtual ValueType Moose::FunctorEnvelope< T >::evaluate ( const FaceArg &  face,
const StateArg &  state 
) const
inlineoverrideprotectedvirtual
Parameters
faceSee the FaceArg doxygen
stateSee the StateArg doxygen
Returns
The functor evaluated at the requested state and space

Implements Moose::FunctorBase< T >.

Definition at line 1215 of file MooseFunctor.h.

1216 {
1217 return _wrapped->operator()(face, state);
1218 }

◆ evaluate() [6/7]

template<typename T >
virtual ValueType Moose::FunctorEnvelope< T >::evaluate ( const NodeArg &  node,
const StateArg &  state 
) const
inlineoverrideprotectedvirtual

Implements Moose::FunctorBase< T >.

Definition at line 1231 of file MooseFunctor.h.

1232 {
1233 return _wrapped->operator()(node, state);
1234 }

◆ evaluate() [7/7]

template<typename T >
virtual ValueType Moose::FunctorEnvelope< T >::evaluate ( const PointArg &  ,
const StateArg &   
) const
inlineoverrideprotectedvirtual

Evaluate the functor at a physical point without any mesh information.

Functors that need mesh information, e.g. field variables, do not support this

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1235 of file MooseFunctor.h.

1236 {
1237 return _wrapped->operator()(point, state);
1238 }

◆ evaluateDot() [1/7]

template<typename T >
virtual DotType Moose::FunctorEnvelope< T >::evaluateDot ( const ElemArg &  ,
const StateArg &   
) const
inlineoverrideprotectedvirtual

Evaluate the functor time derivative with a given element.

Some example implementations of this method could compute an element-average or evaluate at the element centroid

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1272 of file MooseFunctor.h.

1273 {
1274 return _wrapped->dot(elem, state);
1275 }

◆ evaluateDot() [2/7]

template<typename T >
virtual DotType Moose::FunctorEnvelope< T >::evaluateDot ( const ElemPointArg &  ,
const StateArg &   
) const
inlineoverrideprotectedvirtual

Evaluate the functor time derivative with a given element and point.

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1288 of file MooseFunctor.h.

1290 {
1291 return _wrapped->dot(elem_point, state);
1292 }

◆ evaluateDot() [3/7]

template<typename T >
virtual DotType Moose::FunctorEnvelope< T >::evaluateDot ( const ElemQpArg &  ,
const StateArg &   
) const
inlineoverrideprotectedvirtual
Parameters
qpSee the ElemQpArg doxygen
stateSee the StateArg doxygen
Returns
The functor time derivative evaluated at the requested state and space

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1280 of file MooseFunctor.h.

1281 {
1282 return _wrapped->dot(qp, state);
1283 }

◆ evaluateDot() [4/7]

template<typename T >
virtual DotType Moose::FunctorEnvelope< T >::evaluateDot ( const ElemSideQpArg &  ,
const StateArg &   
) const
inlineoverrideprotectedvirtual
Parameters
side_qpSee the ElemSideQpArg doxygen
stateSee the StateArg doxygen
Returns
The functor time derivative evaluated at the requested state and space

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1284 of file MooseFunctor.h.

1285 {
1286 return _wrapped->dot(qp, state);
1287 }

◆ evaluateDot() [5/7]

template<typename T >
virtual DotType Moose::FunctorEnvelope< T >::evaluateDot ( const FaceArg &  ,
const StateArg &   
) const
inlineoverrideprotectedvirtual
Parameters
faceSee the FaceArg doxygen
stateSee the StateArg doxygen
Returns
The functor time derivative evaluated at the requested state and space

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1276 of file MooseFunctor.h.

1277 {
1278 return _wrapped->dot(face, state);
1279 }

◆ evaluateDot() [6/7]

template<typename T >
virtual DotType Moose::FunctorEnvelope< T >::evaluateDot ( const NodeArg &  node,
const StateArg &  state 
) const
inlineoverrideprotectedvirtual

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1293 of file MooseFunctor.h.

1294 {
1295 return _wrapped->dot(node, state);
1296 }

◆ evaluateDot() [7/7]

template<typename T >
virtual DotType Moose::FunctorEnvelope< T >::evaluateDot ( const PointArg &  point,
const StateArg &  state 
) const
inlineoverrideprotectedvirtual

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1297 of file MooseFunctor.h.

1298 {
1299 return _wrapped->dot(point, state);
1300 }

◆ evaluateGradDot() [1/7]

template<typename T >
virtual GradientType Moose::FunctorEnvelope< T >::evaluateGradDot ( const ElemArg &  ,
const StateArg &   
) const
inlineoverrideprotectedvirtual

Evaluate the functor gradient-dot with a given element.

Some example implementations of this method could compute an element-average or evaluate at the element centroid

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1302 of file MooseFunctor.h.

1303 {
1304 return _wrapped->gradDot(elem, state);
1305 }

◆ evaluateGradDot() [2/7]

template<typename T >
virtual GradientType Moose::FunctorEnvelope< T >::evaluateGradDot ( const ElemPointArg &  ,
const StateArg &   
) const
inlineoverrideprotectedvirtual

Evaluate the functor gradient-dot with a given element and point.

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1319 of file MooseFunctor.h.

1321 {
1322 return _wrapped->gradDot(elem_point, state);
1323 }

◆ evaluateGradDot() [3/7]

template<typename T >
virtual GradientType Moose::FunctorEnvelope< T >::evaluateGradDot ( const ElemQpArg &  ,
const StateArg &   
) const
inlineoverrideprotectedvirtual
Parameters
qpSee the ElemQpArg doxygen
stateSee the StateArg doxygen
Returns
The functor gradient-dot evaluated at the requested state and space

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1310 of file MooseFunctor.h.

1311 {
1312 return _wrapped->gradDot(qp, state);
1313 }

◆ evaluateGradDot() [4/7]

template<typename T >
virtual GradientType Moose::FunctorEnvelope< T >::evaluateGradDot ( const ElemSideQpArg &  ,
const StateArg &   
) const
inlineoverrideprotectedvirtual
Parameters
side_qpSee the ElemSideQpArg doxygen
stateSee the StateArg doxygen
Returns
The functor gradient-dot evaluated at the requested state and space

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1314 of file MooseFunctor.h.

1316 {
1317 return _wrapped->gradDot(qp, state);
1318 }

◆ evaluateGradDot() [5/7]

template<typename T >
virtual GradientType Moose::FunctorEnvelope< T >::evaluateGradDot ( const FaceArg &  ,
const StateArg &   
) const
inlineoverrideprotectedvirtual
Parameters
faceSee the FaceArg doxygen
stateSee the StateArg doxygen
Returns
The functor gradient-dot evaluated at the requested state and space

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1306 of file MooseFunctor.h.

1307 {
1308 return _wrapped->gradDot(face, state);
1309 }

◆ evaluateGradDot() [6/7]

template<typename T >
virtual GradientType Moose::FunctorEnvelope< T >::evaluateGradDot ( const NodeArg &  node,
const StateArg &  state 
) const
inlineoverrideprotectedvirtual

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1324 of file MooseFunctor.h.

1325 {
1326 return _wrapped->gradDot(node, state);
1327 }

◆ evaluateGradDot() [7/7]

template<typename T >
virtual GradientType Moose::FunctorEnvelope< T >::evaluateGradDot ( const PointArg &  point,
const StateArg &  state 
) const
inlineoverrideprotectedvirtual

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1328 of file MooseFunctor.h.

1330 {
1331 return _wrapped->gradDot(point, state);
1332 }

◆ evaluateGradient() [1/7]

template<typename T >
virtual GradientType Moose::FunctorEnvelope< T >::evaluateGradient ( const ElemArg &  ,
const StateArg &   
) const
inlineoverrideprotectedvirtual

Evaluate the functor gradient with a given element.

Some example implementations of this method could compute an element-average or evaluate at the element centroid

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1240 of file MooseFunctor.h.

1241 {
1242 return _wrapped->gradient(elem, state);
1243 }

◆ evaluateGradient() [2/7]

template<typename T >
virtual GradientType Moose::FunctorEnvelope< T >::evaluateGradient ( const ElemPointArg &  ,
const StateArg &   
) const
inlineoverrideprotectedvirtual

Evaluate the functor gradient with a given element and point.

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1257 of file MooseFunctor.h.

1259 {
1260 return _wrapped->gradient(elem_point, state);
1261 }

◆ evaluateGradient() [3/7]

template<typename T >
virtual GradientType Moose::FunctorEnvelope< T >::evaluateGradient ( const ElemQpArg &  ,
const StateArg &   
) const
inlineoverrideprotectedvirtual
Parameters
qpSee the ElemQpArg doxygen
stateSee the StateArg doxygen
Returns
The functor gradient evaluated at the requested state and space

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1248 of file MooseFunctor.h.

1249 {
1250 return _wrapped->gradient(qp, state);
1251 }

◆ evaluateGradient() [4/7]

template<typename T >
virtual GradientType Moose::FunctorEnvelope< T >::evaluateGradient ( const ElemSideQpArg &  ,
const StateArg &   
) const
inlineoverrideprotectedvirtual
Parameters
side_qpSee the ElemSideQpArg doxygen
stateSee the StateArg doxygen
Returns
The functor gradient evaluated at the requested state and space

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1252 of file MooseFunctor.h.

1254 {
1255 return _wrapped->gradient(qp, state);
1256 }

◆ evaluateGradient() [5/7]

template<typename T >
virtual GradientType Moose::FunctorEnvelope< T >::evaluateGradient ( const FaceArg &  ,
const StateArg &   
) const
inlineoverrideprotectedvirtual
Parameters
faceSee the FaceArg doxygen
stateSee the StateArg doxygen
Returns
The functor gradient evaluated at the requested state and space

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1244 of file MooseFunctor.h.

1245 {
1246 return _wrapped->gradient(face, state);
1247 }

◆ evaluateGradient() [6/7]

template<typename T >
virtual GradientType Moose::FunctorEnvelope< T >::evaluateGradient ( const NodeArg &  node,
const StateArg &  state 
) const
inlineoverrideprotectedvirtual

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1262 of file MooseFunctor.h.

1263 {
1264 return _wrapped->gradient(node, state);
1265 }

◆ evaluateGradient() [7/7]

template<typename T >
virtual GradientType Moose::FunctorEnvelope< T >::evaluateGradient ( const PointArg &  point,
const StateArg &  state 
) const
inlineoverrideprotectedvirtual

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1266 of file MooseFunctor.h.

1268 {
1269 return _wrapped->gradient(point, state);
1270 }

◆ functorName()

template<typename T >
const MooseFunctorName & Moose::FunctorBase< T >::functorName ( ) const
inlineinherited

◆ genericEvaluate()

template<typename T >
template<FunctorEvaluationKind FET, typename Space , typename State >
FunctorReturnType< T, FET >::type Moose::FunctorBase< T >::genericEvaluate ( const Space &  r,
const State &  state 
) const
inherited

Perform a generic evaluation based on the supplied template argument FET and supplied spatial and temporal arguments.

Definition at line 1049 of file MooseFunctor.h.

1050{
1051 if constexpr (FET == FunctorEvaluationKind::Value)
1052 return (*this)(r, state);
1053 else if constexpr (FET == FunctorEvaluationKind::Gradient)
1054 return gradient(r, state);
1055 else if constexpr (FET == FunctorEvaluationKind::Dot)
1056 return dot(r, state);
1057 else
1058 return gradDot(r, state);
1059}
DotType dot(const ElemArg &elem, const StateArg &state) const
Same as their evaluateDot overloads with the same arguments but allows for caching implementation.
GradientType gradient(const ElemArg &elem, const StateArg &state) const
Same as their evaluateGradient overloads with the same arguments but allows for caching implementatio...
GradientType gradDot(const ElemArg &elem, const StateArg &state) const
Same as their evaluateGradDot overloads with the same arguments but allows for caching implementation...

◆ gradDot() [1/7]

template<typename T >
FunctorBase< T >::GradientType Moose::FunctorBase< T >::gradDot ( const ElemArg &  elem,
const StateArg &  state 
) const
inherited

Same as their evaluateGradDot overloads with the same arguments but allows for caching implementation.

These are the methods a user will call in their code

Definition at line 988 of file MooseFunctor.h.

989{
990 return evaluateGradDot(elem, state);
991}
virtual GradientType evaluateGradDot(const ElemArg &, const StateArg &) const
Evaluate the functor gradient-dot with a given element.

Referenced by Moose::ADWrapperFunctor< T >::evaluateGradDot(), Moose::VectorComponentFunctor< T >::evaluateGradDot(), Moose::ADWrapperFunctor< T >::evaluateGradDot(), Moose::ADWrapperFunctor< T >::evaluateGradDot(), Moose::ADWrapperFunctor< T >::evaluateGradDot(), Moose::ADWrapperFunctor< T >::evaluateGradDot(), Moose::VectorComponentFunctor< T >::evaluateGradDot(), Moose::ADWrapperFunctor< T >::evaluateGradDot(), and Moose::ADWrapperFunctor< T >::evaluateGradDot().

◆ gradDot() [2/7]

template<typename T >
FunctorBase< T >::GradientType Moose::FunctorBase< T >::gradDot ( const ElemPointArg &  elem_point,
const StateArg &  state 
) const
inherited

Definition at line 1017 of file MooseFunctor.h.

1018{
1019 return evaluateGradDot(elem_point, state);
1020}

◆ gradDot() [3/7]

template<typename T >
FunctorBase< T >::GradientType Moose::FunctorBase< T >::gradDot ( const ElemQpArg &  qp,
const StateArg &  state 
) const
inherited

Definition at line 1003 of file MooseFunctor.h.

1004{
1005 return evaluateGradDot(elem_qp, state);
1006}

◆ gradDot() [4/7]

template<typename T >
FunctorBase< T >::GradientType Moose::FunctorBase< T >::gradDot ( const ElemSideQpArg &  qp,
const StateArg &  state 
) const
inherited

Definition at line 1010 of file MooseFunctor.h.

1011{
1012 return evaluateGradDot(elem_side_qp, state);
1013}

◆ gradDot() [5/7]

template<typename T >
FunctorBase< T >::GradientType Moose::FunctorBase< T >::gradDot ( const FaceArg &  face,
const StateArg &  state 
) const
inherited

Definition at line 995 of file MooseFunctor.h.

996{
997 checkFace(face);
998 return evaluateGradDot(face, state);
999}

◆ gradDot() [6/7]

template<typename T >
FunctorBase< T >::GradientType Moose::FunctorBase< T >::gradDot ( const NodeArg &  node,
const StateArg &  state 
) const
inherited

Definition at line 1024 of file MooseFunctor.h.

1025{
1026 return evaluateGradDot(node, state);
1027}

◆ gradDot() [7/7]

template<typename T >
FunctorBase< T >::GradientType Moose::FunctorBase< T >::gradDot ( const PointArg &  point,
const StateArg &  state 
) const
inherited

Definition at line 1031 of file MooseFunctor.h.

1032{
1033 return evaluateGradDot(point, state);
1034}

◆ gradient() [1/7]

template<typename T >
FunctorBase< T >::GradientType Moose::FunctorBase< T >::gradient ( const ElemArg &  elem,
const StateArg &  state 
) const
inherited

◆ gradient() [2/7]

template<typename T >
FunctorBase< T >::GradientType Moose::FunctorBase< T >::gradient ( const ElemPointArg &  elem_point,
const StateArg &  state 
) const
inherited

Definition at line 917 of file MooseFunctor.h.

918{
919 return evaluateGradient(elem_point, state);
920}

◆ gradient() [3/7]

template<typename T >
FunctorBase< T >::GradientType Moose::FunctorBase< T >::gradient ( const ElemQpArg &  qp,
const StateArg &  state 
) const
inherited

Definition at line 903 of file MooseFunctor.h.

904{
905 return evaluateGradient(elem_qp, state);
906}

◆ gradient() [4/7]

template<typename T >
FunctorBase< T >::GradientType Moose::FunctorBase< T >::gradient ( const ElemSideQpArg &  qp,
const StateArg &  state 
) const
inherited

Definition at line 910 of file MooseFunctor.h.

911{
912 return evaluateGradient(elem_side_qp, state);
913}

◆ gradient() [5/7]

template<typename T >
FunctorBase< T >::GradientType Moose::FunctorBase< T >::gradient ( const FaceArg &  face,
const StateArg &  state 
) const
inherited

Definition at line 895 of file MooseFunctor.h.

896{
897 checkFace(face);
898 return evaluateGradient(face, state);
899}

◆ gradient() [6/7]

template<typename T >
FunctorBase< T >::GradientType Moose::FunctorBase< T >::gradient ( const NodeArg &  node,
const StateArg &  state 
) const
inherited

Definition at line 924 of file MooseFunctor.h.

925{
926 return evaluateGradient(node, state);
927}

◆ gradient() [7/7]

template<typename T >
FunctorBase< T >::GradientType Moose::FunctorBase< T >::gradient ( const PointArg &  point,
const StateArg &  state 
) const
inherited

Definition at line 931 of file MooseFunctor.h.

932{
933 return evaluateGradient(point, state);
934}

◆ hasBlocks()

template<typename T >
virtual bool Moose::FunctorEnvelope< T >::hasBlocks ( const SubdomainID  ) const
inlineoverridevirtual

Returns whether the functor is defined on this block.

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1197 of file MooseFunctor.h.

1197{ return _wrapped->hasBlocks(id); }

◆ hasFaceSide()

template<typename T >
virtual bool Moose::FunctorEnvelope< T >::hasFaceSide ( const FaceInfo &  fi,
const bool  fi_elem_side 
) const
inlineoverridevirtual

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1198 of file MooseFunctor.h.

1199 {
1200 return _wrapped->hasFaceSide(fi, fi_elem_side);
1201 }

◆ isConstant()

template<typename T >
virtual bool Moose::FunctorEnvelope< T >::isConstant ( ) const
inlineoverridevirtual

Returns true if this functor is a constant.

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1196 of file MooseFunctor.h.

1196{ return _wrapped->isConstant(); }

◆ isExtrapolatedBoundaryFace()

template<typename T >
virtual bool Moose::FunctorEnvelope< T >::isExtrapolatedBoundaryFace ( const FaceInfo &  ,
const Elem *const  ,
const StateArg &   
) const
inlineoverridevirtual

Returns whether this (sided) face is an extrapolated boundary face for this functor.

Reimplemented from Moose::FunctorBase< T >.

Definition at line 1190 of file MooseFunctor.h.

1193 {
1194 return _wrapped->isExtrapolatedBoundaryFace(fi, elem, state);
1195 }

◆ isInternalFace()

template<typename T >
bool Moose::FunctorBase< T >::isInternalFace ( const FaceInfo &  fi) const
inherited

Returns true if the face is an internal face.

Definition at line 603 of file MooseFunctor.h.

604{
605 if (!fi.neighborPtr())
606 return false;
607
608 return hasBlocks(fi.elem().subdomain_id()) && hasBlocks(fi.neighborPtr()->subdomain_id());
609}
const Elem & elem() const
Definition FaceInfo.h:85
virtual bool hasBlocks(SubdomainID) const
Returns whether the functor is defined on this block.

Referenced by FVAnisotropicDiffusion::computeQpResidual(), and FVDiffusion::computeQpResidual().

◆ jacobianSetup()

template<typename T >
void Moose::FunctorBase< T >::jacobianSetup ( )
overridevirtualinherited

◆ operator()() [1/7]

template<typename T >
FunctorBase< T >::ValueType Moose::FunctorBase< T >::operator() ( const ElemArg &  elem,
const StateArg &  state 
) const
inherited

Same as their evaluate overloads with the same arguments but allows for caching implementation.

These are the methods a user will call in their code

Definition at line 631 of file MooseFunctor.h.

632{
634 return evaluate(elem, state);
635
636 mooseAssert(state.state == 0,
637 "Cached evaluations are only currently supported for the current state.");
638
640}
bool _always_evaluate
Boolean to check if we always need evaluation.
virtual ValueType evaluate(const ElemArg &elem, const StateArg &state) const =0
Evaluate the functor with a given element.
ValueType queryFVArgCache(std::map< SpaceArg, ValueType > &cache_data, const SpaceArg &space) const
check a finite volume spatial argument cache and if invalid then evaluate

◆ operator()() [2/7]

template<typename T >
FunctorBase< T >::ValueType Moose::FunctorBase< T >::operator() ( const ElemPointArg &  elem_point,
const StateArg &  state 
) const
inherited

Definition at line 741 of file MooseFunctor.h.

742{
743 return evaluate(elem_point, state);
744}

◆ operator()() [3/7]

template<typename T >
FunctorBase< T >::ValueType Moose::FunctorBase< T >::operator() ( const ElemQpArg &  qp,
const StateArg &  state 
) const
inherited

Definition at line 690 of file MooseFunctor.h.

691{
693 return evaluate(elem_qp, state);
694
695 const auto elem_id = elem_qp.elem->id();
696 if (elem_id != _current_qp_map_key)
697 {
698 _current_qp_map_key = elem_id;
700 }
701 auto & qp_data = *_current_qp_map_value;
702 const auto qp = elem_qp.qp;
703 const auto * const qrule = elem_qp.qrule;
704 mooseAssert(qrule, "qrule must be non-null");
705
706 return queryQpCache(qp, *qrule, qp_data, elem_qp, state);
707}
ValueType queryQpCache(unsigned int qp, const libMesh::QBase &qrule, std::vector< std::pair< bool, T > > &qp_cache_data, const SpaceArg &space, const StateArg &state) const
check a qp cache and if invalid then evaluate

◆ operator()() [4/7]

template<typename T >
FunctorBase< T >::ValueType Moose::FunctorBase< T >::operator() ( const ElemSideQpArg &  qp,
const StateArg &  state 
) const
inherited

Definition at line 711 of file MooseFunctor.h.

712{
714 return evaluate(elem_side_qp, state);
715
716 const Elem * const elem = elem_side_qp.elem;
717 mooseAssert(elem, "elem must be non-null");
718 const auto elem_id = elem->id();
719 if (elem_id != _current_side_qp_map_key)
720 {
721 _current_side_qp_map_key = elem_id;
723 }
724 auto & side_qp_data = *_current_side_qp_map_value;
725 const auto side = elem_side_qp.side;
726 const auto qp = elem_side_qp.qp;
727 const auto * const qrule = elem_side_qp.qrule;
728 mooseAssert(qrule, "qrule must be non-null");
729
730 // Check and see whether we even have sized for this side
731 if (side >= side_qp_data.size())
732 side_qp_data.resize(elem->n_sides());
733
734 // Ok we were sized enough for our side
735 auto & qp_data = side_qp_data[side];
736 return queryQpCache(qp, *qrule, qp_data, elem_side_qp, state);
737}

◆ operator()() [5/7]

template<typename T >
FunctorBase< T >::ValueType Moose::FunctorBase< T >::operator() ( const FaceArg &  face,
const StateArg &  state 
) const
inherited

Definition at line 644 of file MooseFunctor.h.

645{
646 checkFace(face_in);
647
649 return evaluate(face_in, state);
650
651 mooseAssert(state.state == 0,
652 "Cached evaluations are only currently supported for the current state.");
653
654 return queryFVArgCache(_face_arg_to_value, face_in);
655}

◆ operator()() [6/7]

template<typename T >
FunctorBase< T >::ValueType Moose::FunctorBase< T >::operator() ( const NodeArg &  node,
const StateArg &  state 
) const
inherited

Definition at line 758 of file MooseFunctor.h.

759{
760 mooseAssert(node.subdomain_ids, "Subdomain IDs must be supplied to the node argument");
761 return evaluate(node, state);
762}

◆ operator()() [7/7]

template<typename T >
FunctorBase< T >::ValueType Moose::FunctorBase< T >::operator() ( const PointArg &  point,
const StateArg &  state 
) const
inherited

Definition at line 766 of file MooseFunctor.h.

767{
768 return evaluate(point, state);
769}

◆ operator=() [1/2]

template<typename T >
FunctorEnvelope & Moose::FunctorEnvelope< T >::operator= ( const FunctorEnvelope< T > &  )
delete

◆ operator=() [2/2]

template<typename T >
FunctorEnvelope & Moose::FunctorEnvelope< T >::operator= ( FunctorEnvelope< T > &&  )
delete

◆ ownsWrappedFunctor()

template<typename T >
virtual bool Moose::FunctorEnvelope< T >::ownsWrappedFunctor ( ) const
inlineoverridevirtual
Returns
Whether this envelope owns its wrapped functor. This envelope may briefly own null functors during simulation setup or it may own non-AD or AD wrappers of "true" functors, but we should never own any "true" functors, e.g. we expect memory of "true" functors to be managed by warehouses (e.g. variable, function, etc.), or by the SubProblem itself. With this expectation, we don't have to worry about performing setup calls

Implements Moose::FunctorEnvelopeBase.

Definition at line 1179 of file MooseFunctor.h.

1179{ return _owned.get(); }

◆ queryFVArgCache()

template<typename T >
template<typename SpaceArg >
FunctorBase< T >::ValueType Moose::FunctorBase< T >::queryFVArgCache ( std::map< SpaceArg, ValueType > &  cache_data,
const SpaceArg &  space 
) const
privateinherited

check a finite volume spatial argument cache and if invalid then evaluate

Definition at line 614 of file MooseFunctor.h.

616{
617 // We don't want to evaluate if the key already exists, so instead we value initialize
618 auto [it, inserted] = cache_data.try_emplace(space, ValueType());
619 auto & value = it->second;
620
621 if (inserted)
622 // value not ready to go
623 // this function is only called from functions that assert we are in the current time state
624 value = evaluate(space, currentState());
625
626 return value;
627}
StateArg currentState()
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)

◆ queryQpCache()

template<typename T >
template<typename SpaceArg , typename StateArg >
FunctorBase< T >::ValueType Moose::FunctorBase< T >::queryQpCache ( unsigned int  qp,
const libMesh::QBase &  qrule,
std::vector< std::pair< bool, T > > &  qp_cache_data,
const SpaceArg &  space,
const StateArg &  state 
) const
privateinherited

check a qp cache and if invalid then evaluate

Definition at line 660 of file MooseFunctor.h.

665{
666 // Check and see whether we even have sized for this quadrature point. If we haven't then we
667 // must evaluate
668 if (qp >= qp_cache_data.size())
669 {
670 qp_cache_data.resize(qrule.n_points(), std::make_pair(false, ValueType()));
671 auto & pr = qp_cache_data[qp];
672 pr.second = evaluate(space, state);
673 pr.first = true;
674 return pr.second;
675 }
676
677 // We've already sized for this qp, so let's see whether we have a valid cache value
678 auto & pr = qp_cache_data[qp];
679 if (pr.first)
680 return pr.second;
681
682 // No valid cache value so evaluate
683 pr.second = evaluate(space, state);
684 pr.first = true;
685 return pr.second;
686}
unsigned int n_points() const

◆ residualSetup()

template<typename T >
void Moose::FunctorBase< T >::residualSetup ( )
overridevirtualinherited

◆ returnType()

template<typename T >
virtual std::string Moose::FunctorEnvelope< T >::returnType ( ) const
inlineoverridevirtual
Returns
a string representation of the return type of this functor

Implements Moose::FunctorEnvelopeBase.

Definition at line 1177 of file MooseFunctor.h.

1177{ return libMesh::demangle(typeid(T).name()); }
std::string name(const ElemQuality q)
std::string demangle(const char *name)

◆ setCacheClearanceSchedule()

template<typename T >
void Moose::FunctorBase< T >::setCacheClearanceSchedule ( const std::set< ExecFlagType > &  clearance_schedule)
inherited

Set how often to clear the functor evaluation cache.

Definition at line 748 of file MooseFunctor.h.

749{
750 if (clearance_schedule.count(EXEC_ALWAYS))
751 _always_evaluate = true;
752
753 _clearance_schedule = clearance_schedule;
754}
const ExecFlagType EXEC_ALWAYS
Definition Moose.C:54

◆ supportsElemSideQpArg()

template<typename T >
bool Moose::FunctorEnvelope< T >::supportsElemSideQpArg ( ) const
inlinefinaloverridevirtual

Whether this functor supports evaluation with ElemSideQpArg.

Implements Moose::FunctorBase< T >.

Definition at line 1204 of file MooseFunctor.h.

1204{ return true; }

◆ supportsFaceArg()

template<typename T >
bool Moose::FunctorEnvelope< T >::supportsFaceArg ( ) const
inlinefinaloverridevirtual

Whether this functor supports evaluation with FaceArg.

Implements Moose::FunctorBase< T >.

Definition at line 1203 of file MooseFunctor.h.

1203{ return true; }

◆ timestepSetup()

template<typename T >
void Moose::FunctorBase< T >::timestepSetup ( )
overridevirtualinherited

◆ wrapsNull()

template<typename T >
virtual bool Moose::FunctorEnvelope< T >::wrapsNull ( ) const
inlineoverridevirtual
Returns
whether this object wraps a null functor

Implements Moose::FunctorEnvelopeBase.

Definition at line 1172 of file MooseFunctor.h.

1172{ return wrapsType<NullFunctor<T>>(); }

◆ wrapsType()

template<typename T >
template<typename T2 >
bool Moose::FunctorEnvelope< T >::wrapsType ( ) const
inline
Returns
whether the wrapped object is of the requested type

Definition at line 1185 of file MooseFunctor.h.

1186 {
1187 return dynamic_cast<const T2 *>(_wrapped);
1188 }

Friends And Related Symbol Documentation

◆ ::SubProblem

template<typename T >
friend class ::SubProblem
friend

Definition at line 1340 of file MooseFunctor.h.

Member Data Documentation

◆ _always_evaluate

template<typename T >
bool Moose::FunctorBase< T >::_always_evaluate
privateinherited

Boolean to check if we always need evaluation.

Definition at line 551 of file MooseFunctor.h.

◆ _clearance_schedule

template<typename T >
std::set<ExecFlagType> Moose::FunctorBase< T >::_clearance_schedule
privateinherited

How often to clear the material property cache.

Definition at line 548 of file MooseFunctor.h.

◆ _current_qp_map_key

template<typename T >
dof_id_type Moose::FunctorBase< T >::_current_qp_map_key = libMesh::DofObject::invalid_id
mutableprivateinherited

Current key for qp map cache.

Definition at line 557 of file MooseFunctor.h.

◆ _current_qp_map_value

template<typename T >
std::vector<std::pair<bool, ValueType> >* Moose::FunctorBase< T >::_current_qp_map_value = nullptr
mutableprivateinherited

Current value for qp map cache.

Definition at line 560 of file MooseFunctor.h.

◆ _current_side_qp_map_key

template<typename T >
dof_id_type Moose::FunctorBase< T >::_current_side_qp_map_key = libMesh::DofObject::invalid_id
mutableprivateinherited

Current key for side-qp map cache.

Definition at line 573 of file MooseFunctor.h.

◆ _current_side_qp_map_value

template<typename T >
std::vector<std::vector<std::pair<bool, ValueType> > >* Moose::FunctorBase< T >::_current_side_qp_map_value
mutableprivateinherited
Initial value:
=
nullptr

Current value for side-qp map cache.

Definition at line 576 of file MooseFunctor.h.

◆ _elem_arg_to_value

template<typename T >
std::map<ElemArg, ValueType> Moose::FunctorBase< T >::_elem_arg_to_value
mutableprivateinherited

Map from element arguments to their cached evaluations.

Definition at line 589 of file MooseFunctor.h.

◆ _face_arg_to_value

template<typename T >
std::map<FaceArg, ValueType> Moose::FunctorBase< T >::_face_arg_to_value
mutableprivateinherited

Map from face arguments to their cached evaluations.

Definition at line 592 of file MooseFunctor.h.

◆ _functor_name

template<typename T >
MooseFunctorName Moose::FunctorBase< T >::_functor_name
privateinherited

name of the functor

Definition at line 598 of file MooseFunctor.h.

Referenced by Moose::FunctorBase< T >::functorName().

◆ _node_arg_to_value

template<typename T >
std::map<NodeArg, ValueType> Moose::FunctorBase< T >::_node_arg_to_value
mutableprivateinherited

Map from nodal arguments to their cached evaluations.

Definition at line 595 of file MooseFunctor.h.

◆ _owned

template<typename T >
std::unique_ptr<FunctorBase<T> > Moose::FunctorEnvelope< T >::_owned
private

◆ _qp_to_value

template<typename T >
std::unordered_map<dof_id_type, std::vector<std::pair<bool, ValueType> > > Moose::FunctorBase< T >::_qp_to_value
mutableprivateinherited

Cached element quadrature point functor property evaluations.

The map key is the element id. The map values should have size corresponding to the number of quadrature points on the element. The vector elements are pairs. The first member of the pair indicates whether a cached value has been computed. The second member of the pair is the (cached) value. If the boolean is false, then the value cannot be trusted

Definition at line 567 of file MooseFunctor.h.

◆ _side_qp_to_value

template<typename T >
std::unordered_map<dof_id_type, std::vector<std::vector<std::pair<bool, ValueType> > > > Moose::FunctorBase< T >::_side_qp_to_value
mutableprivateinherited

Cached element quadrature point functor property evaluations.

The map key is the element id. The map values are a multi-dimensional vector (or vector of vectors) with the first index corresponding to the side and the second index corresponding to the quadrature point index. The elements returned after double indexing are pairs. The first member of the pair indicates whether a cached value has been computed. The second member of the pair is the (cached) value. If the boolean is false, then the value cannot be trusted

Definition at line 586 of file MooseFunctor.h.

◆ _wrapped

template<typename T >
const FunctorBase<T>* Moose::FunctorEnvelope< T >::_wrapped
private

Definition at line 1338 of file MooseFunctor.h.

Referenced by Moose::FunctorEnvelope< T >::assign(), Moose::FunctorEnvelope< T >::assign(), Moose::FunctorEnvelope< T >::evaluate(), Moose::FunctorEnvelope< T >::evaluate(), Moose::FunctorEnvelope< T >::evaluate(), Moose::FunctorEnvelope< T >::evaluate(), Moose::FunctorEnvelope< T >::evaluate(), Moose::FunctorEnvelope< T >::evaluate(), Moose::FunctorEnvelope< T >::evaluate(), Moose::FunctorEnvelope< T >::evaluateDot(), Moose::FunctorEnvelope< T >::evaluateDot(), Moose::FunctorEnvelope< T >::evaluateDot(), Moose::FunctorEnvelope< T >::evaluateDot(), Moose::FunctorEnvelope< T >::evaluateDot(), Moose::FunctorEnvelope< T >::evaluateDot(), Moose::FunctorEnvelope< T >::evaluateDot(), Moose::FunctorEnvelope< T >::evaluateGradDot(), Moose::FunctorEnvelope< T >::evaluateGradDot(), Moose::FunctorEnvelope< T >::evaluateGradDot(), Moose::FunctorEnvelope< T >::evaluateGradDot(), Moose::FunctorEnvelope< T >::evaluateGradDot(), Moose::FunctorEnvelope< T >::evaluateGradDot(), Moose::FunctorEnvelope< T >::evaluateGradDot(), Moose::FunctorEnvelope< T >::evaluateGradient(), Moose::FunctorEnvelope< T >::evaluateGradient(), Moose::FunctorEnvelope< T >::evaluateGradient(), Moose::FunctorEnvelope< T >::evaluateGradient(), Moose::FunctorEnvelope< T >::evaluateGradient(), Moose::FunctorEnvelope< T >::evaluateGradient(), Moose::FunctorEnvelope< T >::evaluateGradient(), Moose::FunctorEnvelope< T >::hasBlocks(), Moose::FunctorEnvelope< T >::hasFaceSide(), Moose::FunctorEnvelope< T >::isConstant(), Moose::FunctorEnvelope< T >::isExtrapolatedBoundaryFace(), and Moose::FunctorEnvelope< T >::wrapsType().


The documentation for this class was generated from the following file: