https://mooseframework.inl.gov
Public Types | Public 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). 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
 
FunctorEnvelopeoperator= (const FunctorEnvelope &)=delete
 
FunctorEnvelopeoperator= (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
 

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 1040 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 1050 of file MooseFunctor.h.

1051  : FunctorBase<T>("wraps_" + wrapped.functorName()), FunctorEnvelopeBase(), _wrapped(&wrapped)
1052  {
1053  }
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 1060 of file MooseFunctor.h.

1061  : FunctorBase<T>("wraps_" + wrapped->functorName()),
1063  _owned(std::move(wrapped)),
1064  _wrapped(_owned.get())
1065  {
1066  }
std::unique_ptr< FunctorBase< T > > _owned
Our wrapped object.
const FunctorBase< T > * _wrapped

◆ 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 1078 of file MooseFunctor.h.

1079  {
1080  _owned.reset();
1081  _wrapped = &wrapped;
1082  }
std::unique_ptr< FunctorBase< T > > _owned
Our wrapped object.
const FunctorBase< T > * _wrapped

◆ assign() [2/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 1088 of file MooseFunctor.h.

1089  {
1090  _owned = std::move(wrapped);
1091  _wrapped = _owned.get();
1092  }
std::unique_ptr< FunctorBase< T > > _owned
Our wrapped object.
const FunctorBase< T > * _wrapped

◆ assign() [3/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

◆ 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 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 732 of file MooseFunctor.h.

737 {
738 #if DEBUG
739  const Elem * const elem = face.face_side;
740  const FaceInfo * const fi = face.fi;
741  mooseAssert(fi, "face info should be non-null");
742  bool check_elem_def = false;
743  bool check_neighbor_def = false;
744  // We check if the functor is defined on both sides of the face
745  if (!elem)
746  {
747  if (!hasFaceSide(*fi, true))
748  check_neighbor_def = true;
749  else if (!hasFaceSide(*fi, false))
750  check_elem_def = true;
751  }
752  else if (elem == fi->elemPtr())
753  check_elem_def = true;
754  else
755  {
756  mooseAssert(elem == fi->neighborPtr(), "This has to match something");
757  check_neighbor_def = true;
758  }
759 
760  if (check_elem_def && !hasFaceSide(*fi, true))
761  {
762  std::string additional_message = "It is not defined on the neighbor side either.";
763  if (hasFaceSide(*fi, false))
764  additional_message = "It is however defined on the neighbor side.";
765  additional_message += " Face centroid: " + Moose::stringify(fi->faceCentroid());
767  " is not defined on the element side of the face information, but a face argument "
768  "producer "
769  "(e.g. residual object, postprocessor, etc.) has requested evaluation there.\n",
770  additional_message);
771  }
772  if (check_neighbor_def && !hasFaceSide(*fi, false))
773  {
774  std::string additional_message = "It is not defined on the element side either.";
775  if (hasFaceSide(*fi, true))
776  additional_message = "It is however defined on the element side.";
777  additional_message += " Face centroid: " + Moose::stringify(fi->faceCentroid());
778  mooseError(
780  " is not defined on the neighbor side of the face information, but a face argument "
781  "producer (e.g. residual object, postprocessor, etc.) has requested evaluation there.\n",
782  additional_message);
783  }
784 #endif
785 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
const libMesh::Elem * face_side
A member that can be used to indicate whether there is a sidedness to this face.
const Point & faceCentroid() const
Returns the coordinates of the face centroid.
Definition: FaceInfo.h:71
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition: FaceInfo.h:36
const Elem * neighborPtr() const
Definition: FaceInfo.h:84
MooseFunctorName _functor_name
name of the functor
Definition: MooseFunctor.h:564
const FaceInfo * fi
a face information object which defines our location in space
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:64
const Elem * elemPtr() const
Definition: FaceInfo.h:82
virtual bool hasFaceSide(const FaceInfo &fi, const bool fi_elem_side) const override
Definition: MooseFunctor.h:976

◆ customSetup()

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

Implements Moose::FunctorAbstract.

Reimplemented in Function.

Definition at line 839 of file MooseFunctor.h.

840 {
841  if (_clearance_schedule.count(exec_type))
842  clearCacheData();
843 }
void clearCacheData()
clear cache data
Definition: MooseFunctor.h:789
std::set< ExecFlagType > _clearance_schedule
How often to clear the material property cache.
Definition: MooseFunctor.h:514

◆ dot() [1/6]

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 890 of file MooseFunctor.h.

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

891 {
892  return evaluateDot(elem, state);
893 }
virtual DotType evaluateDot(const ElemArg &, const StateArg &) const
Evaluate the functor time derivative with a given element.
Definition: MooseFunctor.h:385

◆ dot() [2/6]

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

Definition at line 897 of file MooseFunctor.h.

898 {
899  checkFace(face);
900  return evaluateDot(face, state);
901 }
virtual DotType evaluateDot(const ElemArg &, const StateArg &) const
Evaluate the functor time derivative with a given element.
Definition: MooseFunctor.h:385
void checkFace(const Moose::FaceArg &face) const
Examines the incoming face argument.
Definition: MooseFunctor.h:732

◆ dot() [3/6]

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

Definition at line 905 of file MooseFunctor.h.

906 {
907  return evaluateDot(elem_qp, state);
908 }
virtual DotType evaluateDot(const ElemArg &, const StateArg &) const
Evaluate the functor time derivative with a given element.
Definition: MooseFunctor.h:385

◆ dot() [4/6]

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

Definition at line 912 of file MooseFunctor.h.

913 {
914  return evaluateDot(elem_side_qp, state);
915 }
virtual DotType evaluateDot(const ElemArg &, const StateArg &) const
Evaluate the functor time derivative with a given element.
Definition: MooseFunctor.h:385

◆ dot() [5/6]

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

Definition at line 919 of file MooseFunctor.h.

920 {
921  return evaluateDot(elem_point, state);
922 }
virtual DotType evaluateDot(const ElemArg &, const StateArg &) const
Evaluate the functor time derivative with a given element.
Definition: MooseFunctor.h:385

◆ dot() [6/6]

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

Definition at line 926 of file MooseFunctor.h.

927 {
928  return evaluateDot(node, state);
929 }
virtual DotType evaluateDot(const ElemArg &, const StateArg &) const
Evaluate the functor time derivative with a given element.
Definition: MooseFunctor.h:385

◆ evaluate() [1/6]

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 1149 of file MooseFunctor.h.

1150  {
1151  return _wrapped->operator()(elem, state);
1152  }
const FunctorBase< T > * _wrapped

◆ evaluate() [2/6]

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 1153 of file MooseFunctor.h.

1154  {
1155  return _wrapped->operator()(face, state);
1156  }
const FunctorBase< T > * _wrapped

◆ evaluate() [3/6]

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 1157 of file MooseFunctor.h.

1158  {
1159  return _wrapped->operator()(qp, state);
1160  }
const FunctorBase< T > * _wrapped

◆ evaluate() [4/6]

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 1161 of file MooseFunctor.h.

1162  {
1163  return _wrapped->operator()(qp, state);
1164  }
const FunctorBase< T > * _wrapped

◆ evaluate() [5/6]

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 1165 of file MooseFunctor.h.

1166  {
1167  return _wrapped->operator()(elem_point, state);
1168  }
const FunctorBase< T > * _wrapped

◆ evaluate() [6/6]

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

Implements Moose::FunctorBase< T >.

Definition at line 1169 of file MooseFunctor.h.

1170  {
1171  return _wrapped->operator()(node, state);
1172  }
const FunctorBase< T > * _wrapped

◆ evaluateDot() [1/6]

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 1201 of file MooseFunctor.h.

1202  {
1203  return _wrapped->dot(elem, state);
1204  }
const FunctorBase< T > * _wrapped

◆ evaluateDot() [2/6]

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 1205 of file MooseFunctor.h.

1206  {
1207  return _wrapped->dot(face, state);
1208  }
const FunctorBase< T > * _wrapped

◆ evaluateDot() [3/6]

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 1209 of file MooseFunctor.h.

1210  {
1211  return _wrapped->dot(qp, state);
1212  }
const FunctorBase< T > * _wrapped

◆ evaluateDot() [4/6]

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 1213 of file MooseFunctor.h.

1214  {
1215  return _wrapped->dot(qp, state);
1216  }
const FunctorBase< T > * _wrapped

◆ evaluateDot() [5/6]

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 1217 of file MooseFunctor.h.

1219  {
1220  return _wrapped->dot(elem_point, state);
1221  }
const FunctorBase< T > * _wrapped

◆ evaluateDot() [6/6]

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 1222 of file MooseFunctor.h.

1223  {
1224  return _wrapped->dot(node, state);
1225  }
const FunctorBase< T > * _wrapped

◆ evaluateGradDot() [1/6]

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 1227 of file MooseFunctor.h.

1228  {
1229  return _wrapped->gradDot(elem, state);
1230  }
const FunctorBase< T > * _wrapped

◆ evaluateGradDot() [2/6]

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 1231 of file MooseFunctor.h.

1232  {
1233  return _wrapped->gradDot(face, state);
1234  }
const FunctorBase< T > * _wrapped

◆ evaluateGradDot() [3/6]

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 1235 of file MooseFunctor.h.

1236  {
1237  return _wrapped->gradDot(qp, state);
1238  }
const FunctorBase< T > * _wrapped

◆ evaluateGradDot() [4/6]

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 1239 of file MooseFunctor.h.

1241  {
1242  return _wrapped->gradDot(qp, state);
1243  }
const FunctorBase< T > * _wrapped

◆ evaluateGradDot() [5/6]

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 1244 of file MooseFunctor.h.

1246  {
1247  return _wrapped->gradDot(elem_point, state);
1248  }
const FunctorBase< T > * _wrapped

◆ evaluateGradDot() [6/6]

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 1249 of file MooseFunctor.h.

1250  {
1251  return _wrapped->gradDot(node, state);
1252  }
const FunctorBase< T > * _wrapped

◆ evaluateGradient() [1/6]

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 1174 of file MooseFunctor.h.

1175  {
1176  return _wrapped->gradient(elem, state);
1177  }
const FunctorBase< T > * _wrapped

◆ evaluateGradient() [2/6]

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 1178 of file MooseFunctor.h.

1179  {
1180  return _wrapped->gradient(face, state);
1181  }
const FunctorBase< T > * _wrapped

◆ evaluateGradient() [3/6]

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 1182 of file MooseFunctor.h.

1183  {
1184  return _wrapped->gradient(qp, state);
1185  }
const FunctorBase< T > * _wrapped

◆ evaluateGradient() [4/6]

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 1186 of file MooseFunctor.h.

1188  {
1189  return _wrapped->gradient(qp, state);
1190  }
const FunctorBase< T > * _wrapped

◆ evaluateGradient() [5/6]

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 1191 of file MooseFunctor.h.

1193  {
1194  return _wrapped->gradient(elem_point, state);
1195  }
const FunctorBase< T > * _wrapped

◆ evaluateGradient() [6/6]

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 1196 of file MooseFunctor.h.

1197  {
1198  return _wrapped->gradient(node, state);
1199  }
const FunctorBase< T > * _wrapped

◆ 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 987 of file MooseFunctor.h.

988 {
989  if constexpr (FET == FunctorEvaluationKind::Value)
990  return (*this)(r, state);
991  else if constexpr (FET == FunctorEvaluationKind::Gradient)
992  return gradient(r, state);
993  else if constexpr (FET == FunctorEvaluationKind::Dot)
994  return dot(r, state);
995  else
996  return gradDot(r, state);
997 }
GradientType gradDot(const ElemArg &elem, const StateArg &state) const
Same as their evaluateGradDot overloads with the same arguments but allows for caching implementation...
Definition: MooseFunctor.h:933
DotType dot(const ElemArg &elem, const StateArg &state) const
Same as their evaluateDot overloads with the same arguments but allows for caching implementation...
Definition: MooseFunctor.h:890
GradientType gradient(const ElemArg &elem, const StateArg &state) const
Same as their evaluateGradient overloads with the same arguments but allows for caching implementatio...
Definition: MooseFunctor.h:847

◆ gradDot() [1/6]

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 933 of file MooseFunctor.h.

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

934 {
935  return evaluateGradDot(elem, state);
936 }
virtual GradientType evaluateGradDot(const ElemArg &, const StateArg &) const
Evaluate the functor gradient-dot with a given element.
Definition: MooseFunctor.h:439

◆ gradDot() [2/6]

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

Definition at line 940 of file MooseFunctor.h.

941 {
942  checkFace(face);
943  return evaluateGradDot(face, state);
944 }
void checkFace(const Moose::FaceArg &face) const
Examines the incoming face argument.
Definition: MooseFunctor.h:732
virtual GradientType evaluateGradDot(const ElemArg &, const StateArg &) const
Evaluate the functor gradient-dot with a given element.
Definition: MooseFunctor.h:439

◆ gradDot() [3/6]

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

Definition at line 948 of file MooseFunctor.h.

949 {
950  return evaluateGradDot(elem_qp, state);
951 }
virtual GradientType evaluateGradDot(const ElemArg &, const StateArg &) const
Evaluate the functor gradient-dot with a given element.
Definition: MooseFunctor.h:439

◆ gradDot() [4/6]

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

Definition at line 955 of file MooseFunctor.h.

956 {
957  return evaluateGradDot(elem_side_qp, state);
958 }
virtual GradientType evaluateGradDot(const ElemArg &, const StateArg &) const
Evaluate the functor gradient-dot with a given element.
Definition: MooseFunctor.h:439

◆ gradDot() [5/6]

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

Definition at line 962 of file MooseFunctor.h.

963 {
964  return evaluateGradDot(elem_point, state);
965 }
virtual GradientType evaluateGradDot(const ElemArg &, const StateArg &) const
Evaluate the functor gradient-dot with a given element.
Definition: MooseFunctor.h:439

◆ gradDot() [6/6]

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

Definition at line 969 of file MooseFunctor.h.

970 {
971  return evaluateGradDot(node, state);
972 }
virtual GradientType evaluateGradDot(const ElemArg &, const StateArg &) const
Evaluate the functor gradient-dot with a given element.
Definition: MooseFunctor.h:439

◆ gradient() [1/6]

template<typename T >
FunctorBase< T >::GradientType Moose::FunctorBase< T >::gradient ( const ElemArg elem,
const StateArg state 
) const
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().

848 {
849  return evaluateGradient(elem, state);
850 }
virtual GradientType evaluateGradient(const ElemArg &, const StateArg &) const
Evaluate the functor gradient with a given element.
Definition: MooseFunctor.h:332

◆ gradient() [2/6]

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

Definition at line 854 of file MooseFunctor.h.

855 {
856  checkFace(face);
857  return evaluateGradient(face, state);
858 }
void checkFace(const Moose::FaceArg &face) const
Examines the incoming face argument.
Definition: MooseFunctor.h:732
virtual GradientType evaluateGradient(const ElemArg &, const StateArg &) const
Evaluate the functor gradient with a given element.
Definition: MooseFunctor.h:332

◆ gradient() [3/6]

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

Definition at line 862 of file MooseFunctor.h.

863 {
864  return evaluateGradient(elem_qp, state);
865 }
virtual GradientType evaluateGradient(const ElemArg &, const StateArg &) const
Evaluate the functor gradient with a given element.
Definition: MooseFunctor.h:332

◆ gradient() [4/6]

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

Definition at line 869 of file MooseFunctor.h.

870 {
871  return evaluateGradient(elem_side_qp, state);
872 }
virtual GradientType evaluateGradient(const ElemArg &, const StateArg &) const
Evaluate the functor gradient with a given element.
Definition: MooseFunctor.h:332

◆ gradient() [5/6]

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

Definition at line 876 of file MooseFunctor.h.

877 {
878  return evaluateGradient(elem_point, state);
879 }
virtual GradientType evaluateGradient(const ElemArg &, const StateArg &) const
Evaluate the functor gradient with a given element.
Definition: MooseFunctor.h:332

◆ gradient() [6/6]

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

Definition at line 883 of file MooseFunctor.h.

884 {
885  return evaluateGradient(node, state);
886 }
virtual GradientType evaluateGradient(const ElemArg &, const StateArg &) const
Evaluate the functor gradient with a given element.
Definition: MooseFunctor.h:332

◆ 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 1135 of file MooseFunctor.h.

1135 { return _wrapped->hasBlocks(id); }
const FunctorBase< T > * _wrapped

◆ 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 1136 of file MooseFunctor.h.

1137  {
1138  return _wrapped->hasFaceSide(fi, fi_elem_side);
1139  }
const FunctorBase< T > * _wrapped

◆ 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 1134 of file MooseFunctor.h.

1134 { return _wrapped->isConstant(); }
const FunctorBase< T > * _wrapped

◆ 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 1128 of file MooseFunctor.h.

1131  {
1132  return _wrapped->isExtrapolatedBoundaryFace(fi, elem, state);
1133  }
const FunctorBase< T > * _wrapped

◆ 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 569 of file MooseFunctor.h.

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

570 {
571  if (!fi.neighborPtr())
572  return false;
573 
574  return hasBlocks(fi.elem().subdomain_id()) && hasBlocks(fi.neighborPtr()->subdomain_id());
575 }
virtual bool hasBlocks(SubdomainID) const
Returns whether the functor is defined on this block.
Definition: MooseFunctor.h:237
const Elem & elem() const
Definition: FaceInfo.h:81
const Elem * neighborPtr() const
Definition: FaceInfo.h:84

◆ jacobianSetup()

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

◆ operator()() [1/6]

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 597 of file MooseFunctor.h.

598 {
599  if (_always_evaluate)
600  return evaluate(elem, state);
601 
602  mooseAssert(state.state == 0,
603  "Cached evaluations are only currently supported for the current state.");
604 
605  return queryFVArgCache(_elem_arg_to_value, elem);
606 }
ValueType queryFVArgCache(std::map< SpaceArg, ValueType > &cache_data, const SpaceArg &space) const
check a finite volume spatial argument cache and if invalid then evaluate
Definition: MooseFunctor.h:580
virtual ValueType evaluate(const ElemArg &elem, const StateArg &state) const =0
Evaluate the functor with a given element.
std::map< ElemArg, ValueType > _elem_arg_to_value
Map from element arguments to their cached evaluations.
Definition: MooseFunctor.h:555
bool _always_evaluate
Boolean to check if we always need evaluation.
Definition: MooseFunctor.h:517

◆ operator()() [2/6]

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

Definition at line 610 of file MooseFunctor.h.

611 {
612  checkFace(face_in);
613 
614  if (_always_evaluate)
615  return evaluate(face_in, state);
616 
617  mooseAssert(state.state == 0,
618  "Cached evaluations are only currently supported for the current state.");
619 
620  return queryFVArgCache(_face_arg_to_value, face_in);
621 }
std::map< FaceArg, ValueType > _face_arg_to_value
Map from face arguments to their cached evaluations.
Definition: MooseFunctor.h:558
void checkFace(const Moose::FaceArg &face) const
Examines the incoming face argument.
Definition: MooseFunctor.h:732
ValueType queryFVArgCache(std::map< SpaceArg, ValueType > &cache_data, const SpaceArg &space) const
check a finite volume spatial argument cache and if invalid then evaluate
Definition: MooseFunctor.h:580
virtual ValueType evaluate(const ElemArg &elem, const StateArg &state) const =0
Evaluate the functor with a given element.
bool _always_evaluate
Boolean to check if we always need evaluation.
Definition: MooseFunctor.h:517

◆ operator()() [3/6]

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

Definition at line 656 of file MooseFunctor.h.

657 {
658  if (_always_evaluate)
659  return evaluate(elem_qp, state);
660 
661  const auto elem_id = elem_qp.elem->id();
662  if (elem_id != _current_qp_map_key)
663  {
664  _current_qp_map_key = elem_id;
666  }
667  auto & qp_data = *_current_qp_map_value;
668  const auto qp = elem_qp.qp;
669  const auto * const qrule = elem_qp.qrule;
670  mooseAssert(qrule, "qrule must be non-null");
671 
672  return queryQpCache(qp, *qrule, qp_data, elem_qp, state);
673 }
dof_id_type _current_qp_map_key
Current key for qp map cache.
Definition: MooseFunctor.h:523
std::vector< std::pair< bool, ValueType > > * _current_qp_map_value
Current value for qp map cache.
Definition: MooseFunctor.h:526
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
Definition: MooseFunctor.h:626
virtual ValueType evaluate(const ElemArg &elem, const StateArg &state) const =0
Evaluate the functor with a given element.
bool _always_evaluate
Boolean to check if we always need evaluation.
Definition: MooseFunctor.h:517
std::unordered_map< dof_id_type, std::vector< std::pair< bool, ValueType > > > _qp_to_value
Cached element quadrature point functor property evaluations.
Definition: MooseFunctor.h:533

◆ operator()() [4/6]

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

Definition at line 677 of file MooseFunctor.h.

678 {
679  if (_always_evaluate)
680  return evaluate(elem_side_qp, state);
681 
682  const Elem * const elem = elem_side_qp.elem;
683  mooseAssert(elem, "elem must be non-null");
684  const auto elem_id = elem->id();
685  if (elem_id != _current_side_qp_map_key)
686  {
687  _current_side_qp_map_key = elem_id;
689  }
690  auto & side_qp_data = *_current_side_qp_map_value;
691  const auto side = elem_side_qp.side;
692  const auto qp = elem_side_qp.qp;
693  const auto * const qrule = elem_side_qp.qrule;
694  mooseAssert(qrule, "qrule must be non-null");
695 
696  // Check and see whether we even have sized for this side
697  if (side >= side_qp_data.size())
698  side_qp_data.resize(elem->n_sides());
699 
700  // Ok we were sized enough for our side
701  auto & qp_data = side_qp_data[side];
702  return queryQpCache(qp, *qrule, qp_data, elem_side_qp, state);
703 }
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.
Definition: MooseFunctor.h:552
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
Definition: MooseFunctor.h:626
virtual ValueType evaluate(const ElemArg &elem, const StateArg &state) const =0
Evaluate the functor with a given element.
dof_id_type _current_side_qp_map_key
Current key for side-qp map cache.
Definition: MooseFunctor.h:539
std::vector< std::vector< std::pair< bool, ValueType > > > * _current_side_qp_map_value
Current value for side-qp map cache.
Definition: MooseFunctor.h:542
bool _always_evaluate
Boolean to check if we always need evaluation.
Definition: MooseFunctor.h:517

◆ operator()() [5/6]

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

Definition at line 707 of file MooseFunctor.h.

708 {
709  return evaluate(elem_point, state);
710 }
virtual ValueType evaluate(const ElemArg &elem, const StateArg &state) const =0
Evaluate the functor with a given element.

◆ operator()() [6/6]

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

Definition at line 724 of file MooseFunctor.h.

725 {
726  mooseAssert(node.subdomain_ids, "Subdomain IDs must be supplied to the node argument");
727  return evaluate(node, state);
728 }
virtual ValueType evaluate(const ElemArg &elem, const StateArg &state) const =0
Evaluate the functor with a given element.

◆ 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 1117 of file MooseFunctor.h.

1117 { return _owned.get(); }
std::unique_ptr< FunctorBase< T > > _owned
Our wrapped object.

◆ 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 1115 of file MooseFunctor.h.

1115 { 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 714 of file MooseFunctor.h.

715 {
716  if (clearance_schedule.count(EXEC_ALWAYS))
717  _always_evaluate = true;
718 
719  _clearance_schedule = clearance_schedule;
720 }
const ExecFlagType EXEC_ALWAYS
Definition: Moose.C:47
bool _always_evaluate
Boolean to check if we always need evaluation.
Definition: MooseFunctor.h:517
std::set< ExecFlagType > _clearance_schedule
How often to clear the material property cache.
Definition: MooseFunctor.h:514

◆ 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 1142 of file MooseFunctor.h.

1142 { 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 1141 of file MooseFunctor.h.

1141 { 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 1110 of file MooseFunctor.h.

1110 { 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 1123 of file MooseFunctor.h.

1124  {
1125  return dynamic_cast<const T2 *>(_wrapped);
1126  }
const FunctorBase< T > * _wrapped

Friends And Related Function Documentation

◆ ::SubProblem

template<typename T>
friend class ::SubProblem
friend

Definition at line 1260 of file MooseFunctor.h.

Member Data Documentation

◆ _owned

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

◆ _wrapped

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

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