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>
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). More... | |
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. More... | |
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. More... | |
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. More... | |
virtual bool | isConstant () const override |
Returns true if this functor is a constant. More... | |
virtual bool | hasBlocks (const SubdomainID id) const override |
Returns whether the functor is defined on this block. More... | |
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. More... | |
bool | supportsElemSideQpArg () const override final |
Whether this functor supports evaluation with ElemSideQpArg. More... | |
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. More... | |
const MooseFunctorName & | functorName () const |
Return the functor name. More... | |
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. More... | |
bool | isInternalFace (const FaceInfo &) const |
Returns true if the face is an internal face. More... | |
void | checkFace (const Moose::FaceArg &face) const |
Examines the incoming face argument. More... | |
ValueType | operator() (const ElemArg &elem, const StateArg &state) const |
Same as their evaluate overloads with the same arguments but allows for caching implementation. More... | |
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 |
GradientType | gradient (const ElemArg &elem, const StateArg &state) const |
Same as their evaluateGradient overloads with the same arguments but allows for caching implementation. More... | |
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 |
DotType | dot (const ElemArg &elem, const StateArg &state) const |
Same as their evaluateDot overloads with the same arguments but allows for caching implementation. More... | |
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 |
GradientType | gradDot (const ElemArg &elem, const StateArg &state) const |
Same as their evaluateGradDot overloads with the same arguments but allows for caching implementation. More... | |
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 |
Protected Member Functions | |
virtual ValueType | evaluate (const ElemArg &elem, const StateArg &state) const override |
Forward calls to wrapped object. More... | |
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. More... | |
virtual ValueType | evaluate (const NodeArg &node, const StateArg &state) const override |
virtual GradientType | evaluateGradient (const ElemArg &elem, const StateArg &state) const override |
Evaluate the functor gradient with a given element. More... | |
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. More... | |
virtual GradientType | evaluateGradient (const NodeArg &node, 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. More... | |
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. More... | |
virtual DotType | evaluateDot (const NodeArg &node, 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. More... | |
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. More... | |
virtual GradientType | evaluateGradDot (const NodeArg &node, const StateArg &state) const override |
Private Attributes | |
std::unique_ptr< FunctorBase< T > > | _owned |
Our wrapped object. More... | |
const FunctorBase< T > * | _wrapped |
Friends | |
class | ::SubProblem |
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 1040 of file MooseFunctor.h.
|
inherited |
Definition at line 150 of file MooseFunctor.h.
|
inherited |
Definition at line 140 of file MooseFunctor.h.
|
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.
|
inherited |
Definition at line 141 of file MooseFunctor.h.
|
inline |
wrapped | The functor to wrap. We will not not own the wrapped object |
Definition at line 1050 of file MooseFunctor.h.
|
inline |
wrapped | A 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 1060 of file MooseFunctor.h.
|
delete |
Prevent wrapping of a temporary object.
If we are to own a functor, the unique_ptr constructor overload should be used
|
delete |
|
delete |
|
virtualdefault |
|
inline |
wrapped | The functor to wrap. We will not not own the wrapped object. If we previously owned a functor, it will be destructed |
Definition at line 1078 of file MooseFunctor.h.
|
inline |
wrapped | A 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 1088 of file MooseFunctor.h.
|
delete |
Prevent wrapping of a temporary object.
If we are to own a functor, the unique_ptr assign overload should be used
|
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 has indicated a sidedness and we are not defined on that side, then we will error
face | The face argument created by the face argument producer, likely a residual object |
Definition at line 732 of file MooseFunctor.h.
|
overridevirtualinherited |
Implements Moose::FunctorAbstract.
Reimplemented in Function.
Definition at line 839 of file MooseFunctor.h.
|
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 890 of file MooseFunctor.h.
Referenced by FVFunctorTimeKernel::computeQpResidual(), and Moose::ADWrapperFunctor< T >::evaluateDot().
|
inherited |
Definition at line 897 of file MooseFunctor.h.
|
inherited |
Definition at line 905 of file MooseFunctor.h.
|
inherited |
Definition at line 912 of file MooseFunctor.h.
|
inherited |
Definition at line 919 of file MooseFunctor.h.
|
inherited |
Definition at line 926 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
Forward calls to wrapped object.
Implements Moose::FunctorBase< T >.
Definition at line 1149 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
Implements Moose::FunctorBase< T >.
Definition at line 1153 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
Implements Moose::FunctorBase< T >.
Definition at line 1157 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
side_qp | See the ElemSideQpArg doxygen |
state | See the StateArg doxygen |
Implements Moose::FunctorBase< T >.
Definition at line 1161 of file MooseFunctor.h.
|
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 1165 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
|
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 1201 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
Reimplemented from Moose::FunctorBase< T >.
Definition at line 1205 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
Reimplemented from Moose::FunctorBase< T >.
Definition at line 1209 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
side_qp | See the ElemSideQpArg doxygen |
state | See the StateArg doxygen |
Reimplemented from Moose::FunctorBase< T >.
Definition at line 1213 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
Evaluate the functor time derivative with a given element and point.
Reimplemented from Moose::FunctorBase< T >.
Definition at line 1217 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
|
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 1227 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
Reimplemented from Moose::FunctorBase< T >.
Definition at line 1231 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
Reimplemented from Moose::FunctorBase< T >.
Definition at line 1235 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
side_qp | See the ElemSideQpArg doxygen |
state | See the StateArg doxygen |
Reimplemented from Moose::FunctorBase< T >.
Definition at line 1239 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
Evaluate the functor gradient-dot with a given element and point.
Reimplemented from Moose::FunctorBase< T >.
Definition at line 1244 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
|
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 1174 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
Reimplemented from Moose::FunctorBase< T >.
Definition at line 1178 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
Reimplemented from Moose::FunctorBase< T >.
Definition at line 1182 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
side_qp | See the ElemSideQpArg doxygen |
state | See the StateArg doxygen |
Reimplemented from Moose::FunctorBase< T >.
Definition at line 1186 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
Evaluate the functor gradient with a given element and point.
Reimplemented from Moose::FunctorBase< T >.
Definition at line 1191 of file MooseFunctor.h.
|
inlineoverrideprotectedvirtual |
|
inlineinherited |
Return the functor name.
Definition at line 170 of file MooseFunctor.h.
Referenced by Moose::FunctorBase< libMesh::VectorValue >::evaluateDot(), Moose::FunctorBase< libMesh::VectorValue >::evaluateGradDot(), Moose::FunctorBase< libMesh::VectorValue >::evaluateGradient(), and Moose::FunctorBase< libMesh::VectorValue >::hasBlocks().
|
inherited |
Perform a generic evaluation based on the supplied template argument FET
and supplied spatial and temporal arguments.
Definition at line 987 of file MooseFunctor.h.
|
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 933 of file MooseFunctor.h.
Referenced by Moose::VectorComponentFunctor< T >::evaluateGradDot(), and Moose::ADWrapperFunctor< T >::evaluateGradDot().
|
inherited |
Definition at line 940 of file MooseFunctor.h.
|
inherited |
Definition at line 948 of file MooseFunctor.h.
|
inherited |
Definition at line 955 of file MooseFunctor.h.
|
inherited |
Definition at line 962 of file MooseFunctor.h.
|
inherited |
Definition at line 969 of file MooseFunctor.h.
|
inherited |
Same as their evaluateGradient
overloads with the same arguments but allows for caching implementation.
These are the methods a user will call in their code
Definition at line 847 of file MooseFunctor.h.
Referenced by GradientJumpIndicator::computeQpIntegral(), Moose::FV::containerInterpolate(), Moose::VectorComponentFunctor< T >::evaluateGradient(), Moose::ADWrapperFunctor< T >::evaluateGradient(), and Moose::FV::greenGaussGradient().
|
inherited |
Definition at line 854 of file MooseFunctor.h.
|
inherited |
Definition at line 862 of file MooseFunctor.h.
|
inherited |
Definition at line 869 of file MooseFunctor.h.
|
inherited |
Definition at line 876 of file MooseFunctor.h.
|
inherited |
Definition at line 883 of file MooseFunctor.h.
|
inlineoverridevirtual |
Returns whether the functor is defined on this block.
Reimplemented from Moose::FunctorBase< T >.
Definition at line 1135 of file MooseFunctor.h.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Returns true if this functor is a constant.
Reimplemented from Moose::FunctorBase< T >.
Definition at line 1134 of file MooseFunctor.h.
|
inlineoverridevirtual |
Returns whether this (sided) face is an extrapolated boundary face for this functor.
Reimplemented from Moose::FunctorBase< T >.
Definition at line 1128 of file MooseFunctor.h.
|
inherited |
Returns true if the face is an internal face.
Definition at line 569 of file MooseFunctor.h.
Referenced by FVAnisotropicDiffusion::computeQpResidual(), and FVDiffusion::computeQpResidual().
|
overridevirtualinherited |
Implements Moose::FunctorAbstract.
Reimplemented in MooseVariableFE< OutputType >, MooseVariableFE< ComputeValueType >, MooseVariableFE< T >, MooseVariableFE< RealEigenVector >, MooseVariableFE< VectorValue< Real > >, MooseVariableFE< RealVectorValue >, MooseVariableFE< Real >, MooseVariableFV< OutputType >, MooseVariableFV< ComputeValueType >, MooseVariableFV< T >, MooseVariableFV< RealEigenVector >, MooseVariableFV< RealVectorValue >, MooseVariableFV< Real >, MooseVariableField< OutputType >, MooseVariableField< RT >, MooseVariableField< ComputeValueType >, MooseVariableField< T >, MooseVariableField< RealEigenVector >, MooseVariableField< RealVectorValue >, MooseVariableField< Real >, MooseLinearVariableFV< OutputType >, MooseLinearVariableFV< ComputeValueType >, MooseLinearVariableFV< T >, MooseLinearVariableFV< RealEigenVector >, MooseLinearVariableFV< RealVectorValue >, MooseLinearVariableFV< Real >, and Function.
Definition at line 831 of file MooseFunctor.h.
|
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 597 of file MooseFunctor.h.
|
inherited |
Definition at line 610 of file MooseFunctor.h.
|
inherited |
Definition at line 656 of file MooseFunctor.h.
|
inherited |
Definition at line 677 of file MooseFunctor.h.
|
inherited |
Definition at line 707 of file MooseFunctor.h.
|
inherited |
Definition at line 724 of file MooseFunctor.h.
|
delete |
|
delete |
|
inlineoverridevirtual |
SubProblem
itself. With this expectation, we don't have to worry about performing setup calls Implements Moose::FunctorEnvelopeBase.
Definition at line 1117 of file MooseFunctor.h.
|
overridevirtualinherited |
Implements Moose::FunctorAbstract.
Reimplemented in MooseVariableFE< OutputType >, MooseVariableFE< ComputeValueType >, MooseVariableFE< T >, MooseVariableFE< RealEigenVector >, MooseVariableFE< VectorValue< Real > >, MooseVariableFE< RealVectorValue >, MooseVariableFE< Real >, MooseVariableFV< OutputType >, MooseVariableFV< ComputeValueType >, MooseVariableFV< T >, MooseVariableFV< RealEigenVector >, MooseVariableFV< RealVectorValue >, MooseVariableFV< Real >, MooseVariableField< OutputType >, MooseVariableField< RT >, MooseVariableField< ComputeValueType >, MooseVariableField< T >, MooseVariableField< RealEigenVector >, MooseVariableField< RealVectorValue >, MooseVariableField< Real >, MooseLinearVariableFV< OutputType >, MooseLinearVariableFV< ComputeValueType >, MooseLinearVariableFV< T >, MooseLinearVariableFV< RealEigenVector >, MooseLinearVariableFV< RealVectorValue >, MooseLinearVariableFV< Real >, and Function.
Definition at line 823 of file MooseFunctor.h.
|
inlineoverridevirtual |
Implements Moose::FunctorEnvelopeBase.
Definition at line 1115 of file MooseFunctor.h.
|
inherited |
Set how often to clear the functor evaluation cache.
Definition at line 714 of file MooseFunctor.h.
|
inlinefinaloverridevirtual |
Whether this functor supports evaluation with ElemSideQpArg.
Implements Moose::FunctorBase< T >.
Definition at line 1142 of file MooseFunctor.h.
|
inlinefinaloverridevirtual |
Whether this functor supports evaluation with FaceArg.
Implements Moose::FunctorBase< T >.
Definition at line 1141 of file MooseFunctor.h.
|
overridevirtualinherited |
Implements Moose::FunctorAbstract.
Reimplemented in MooseVariableFV< OutputType >, MooseVariableFV< ComputeValueType >, MooseVariableFV< T >, MooseVariableFV< RealEigenVector >, MooseVariableFV< RealVectorValue >, MooseVariableFV< Real >, MooseVariableField< OutputType >, MooseVariableField< RT >, MooseVariableField< ComputeValueType >, MooseVariableField< T >, MooseVariableField< RealEigenVector >, MooseVariableField< RealVectorValue >, MooseVariableField< Real >, Function, NumNonlinearIterations, and MemoryUsage.
Definition at line 815 of file MooseFunctor.h.
|
inlineoverridevirtual |
Implements Moose::FunctorEnvelopeBase.
Definition at line 1110 of file MooseFunctor.h.
|
inline |
Definition at line 1123 of file MooseFunctor.h.
|
friend |
Definition at line 1260 of file MooseFunctor.h.
|
private |
Our wrapped object.
Definition at line 1257 of file MooseFunctor.h.
Referenced by Moose::FunctorEnvelope< libMesh::VectorValue >::assign(), and Moose::FunctorEnvelope< libMesh::VectorValue >::ownsWrappedFunctor().
|
private |
Definition at line 1258 of file MooseFunctor.h.
Referenced by Moose::FunctorEnvelope< libMesh::VectorValue >::assign(), Moose::FunctorEnvelope< libMesh::VectorValue >::evaluate(), Moose::FunctorEnvelope< libMesh::VectorValue >::evaluateDot(), Moose::FunctorEnvelope< libMesh::VectorValue >::evaluateGradDot(), Moose::FunctorEnvelope< libMesh::VectorValue >::evaluateGradient(), Moose::FunctorEnvelope< libMesh::VectorValue >::hasBlocks(), Moose::FunctorEnvelope< libMesh::VectorValue >::hasFaceSide(), Moose::FunctorEnvelope< libMesh::VectorValue >::isConstant(), Moose::FunctorEnvelope< libMesh::VectorValue >::isExtrapolatedBoundaryFace(), and Moose::FunctorEnvelope< libMesh::VectorValue >::wrapsType().