https://mooseframework.inl.gov
Public Types | Public Member Functions | Private Attributes | List of all members
Moose::ADWrapperFunctor< T > Class Template Reference

Wraps non-AD functors such that they can be used in objects that have requested the functor as AD. More...

#include <ADWrapperFunctor.h>

Inheritance diagram for Moose::ADWrapperFunctor< 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

 ADWrapperFunctor (const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > &non_ad_functor)
 
virtual bool isExtrapolatedBoundaryFace (const FaceInfo &fi, const Elem *const elem, const Moose::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

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

Private Attributes

const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
 Our wrapped AD object. More...
 

Detailed Description

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

Wraps non-AD functors such that they can be used in objects that have requested the functor as AD.

Definition at line 20 of file ADWrapperFunctor.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

◆ ADWrapperFunctor()

template<typename T >
Moose::ADWrapperFunctor< T >::ADWrapperFunctor ( const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > &  non_ad_functor)
inline

Definition at line 27 of file ADWrapperFunctor.h.

28  : FunctorBase<T>(non_ad_functor.functorName() + "_ad_ified", {EXEC_ALWAYS}),
29  _non_ad_functor(non_ad_functor)
30  {
31  }
const ExecFlagType EXEC_ALWAYS
Definition: Moose.C:51
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:176

Member Function Documentation

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

743 {
744 #if DEBUG
745  const Elem * const elem = face.face_side;
746  const FaceInfo * const fi = face.fi;
747  mooseAssert(fi, "face info should be non-null");
748  bool check_elem_def = false;
749  bool check_neighbor_def = false;
750  // We check if the functor is defined on both sides of the face
751  if (!elem)
752  {
753  if (!hasFaceSide(*fi, true))
754  check_neighbor_def = true;
755  else if (!hasFaceSide(*fi, false))
756  check_elem_def = true;
757  }
758  else if (elem == fi->elemPtr())
759  check_elem_def = true;
760  else
761  {
762  mooseAssert(elem == fi->neighborPtr(), "This has to match something");
763  check_neighbor_def = true;
764  }
765 
766  if (check_elem_def && !hasFaceSide(*fi, true))
767  {
768  std::string additional_message = "It is not defined on the neighbor side either.";
769  if (hasFaceSide(*fi, false))
770  additional_message = "It is however defined on the neighbor side.";
771  additional_message += " Face centroid: " + Moose::stringify(fi->faceCentroid());
773  " is not defined on the element side of the face information, but a face argument "
774  "producer "
775  "(e.g. residual object, postprocessor, etc.) has requested evaluation there.\n",
776  additional_message);
777  }
778  if (check_neighbor_def && !hasFaceSide(*fi, false))
779  {
780  std::string additional_message = "It is not defined on the element side either.";
781  if (hasFaceSide(*fi, true))
782  additional_message = "It is however defined on the element side.";
783  additional_message += " Face centroid: " + Moose::stringify(fi->faceCentroid());
784  mooseError(
786  " is not defined on the neighbor side of the face information, but a face argument "
787  "producer (e.g. residual object, postprocessor, etc.) has requested evaluation there.\n",
788  additional_message);
789  }
790 #endif
791 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:311
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:75
This data structure is used to store geometric and variable related metadata about each cell face in ...
Definition: FaceInfo.h:37
const Elem * neighborPtr() const
Definition: FaceInfo.h:88
MooseFunctorName _functor_name
name of the functor
Definition: MooseFunctor.h:570
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:86
virtual bool hasFaceSide(const FaceInfo &fi, const bool fi_elem_side) const override
Definition: MooseFunctor.h:982

◆ customSetup()

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

Implements Moose::FunctorAbstract.

Reimplemented in Function.

Definition at line 845 of file MooseFunctor.h.

846 {
847  if (_clearance_schedule.count(exec_type))
848  clearCacheData();
849 }
void clearCacheData()
clear cache data
Definition: MooseFunctor.h:795
std::set< ExecFlagType > _clearance_schedule
How often to clear the material property cache.
Definition: MooseFunctor.h:520

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

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

897 {
898  return evaluateDot(elem, state);
899 }
virtual DotType evaluateDot(const ElemArg &, const StateArg &) const
Evaluate the functor time derivative with a given element.
Definition: MooseFunctor.h:391

◆ dot() [2/6]

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

Definition at line 903 of file MooseFunctor.h.

904 {
905  checkFace(face);
906  return evaluateDot(face, state);
907 }
virtual DotType evaluateDot(const ElemArg &, const StateArg &) const
Evaluate the functor time derivative with a given element.
Definition: MooseFunctor.h:391
void checkFace(const Moose::FaceArg &face) const
Examines the incoming face argument.
Definition: MooseFunctor.h:738

◆ dot() [3/6]

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

Definition at line 911 of file MooseFunctor.h.

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

◆ dot() [4/6]

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

Definition at line 918 of file MooseFunctor.h.

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

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

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

◆ dot() [6/6]

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

Definition at line 932 of file MooseFunctor.h.

933 {
934  return evaluateDot(node, state);
935 }
virtual DotType evaluateDot(const ElemArg &, const StateArg &) const
Evaluate the functor time derivative with a given element.
Definition: MooseFunctor.h:391

◆ evaluate() [1/6]

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

Forward calls to wrapped object.

Implements Moose::FunctorBase< T >.

Definition at line 60 of file ADWrapperFunctor.h.

61  {
62  return _non_ad_functor(elem, state);
63  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.

◆ evaluate() [2/6]

template<typename T >
ValueType Moose::ADWrapperFunctor< 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 64 of file ADWrapperFunctor.h.

65  {
66  return _non_ad_functor(face, state);
67  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.

◆ evaluate() [3/6]

template<typename T >
ValueType Moose::ADWrapperFunctor< 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 68 of file ADWrapperFunctor.h.

69  {
70  return _non_ad_functor(qp, state);
71  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.

◆ evaluate() [4/6]

template<typename T >
ValueType Moose::ADWrapperFunctor< 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 72 of file ADWrapperFunctor.h.

73  {
74  return _non_ad_functor(qp, state);
75  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.

◆ evaluate() [5/6]

template<typename T >
ValueType Moose::ADWrapperFunctor< 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 76 of file ADWrapperFunctor.h.

77  {
78  return _non_ad_functor(elem_point, state);
79  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.

◆ evaluate() [6/6]

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

Implements Moose::FunctorBase< T >.

Definition at line 80 of file ADWrapperFunctor.h.

81  {
82  return _non_ad_functor(node, state);
83  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.

◆ evaluateDot() [1/6]

template<typename T >
DotType Moose::ADWrapperFunctor< 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 111 of file ADWrapperFunctor.h.

112  {
113  return _non_ad_functor.dot(elem, state);
114  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:896

◆ evaluateDot() [2/6]

template<typename T >
DotType Moose::ADWrapperFunctor< 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 115 of file ADWrapperFunctor.h.

116  {
117  return _non_ad_functor.dot(face, state);
118  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:896

◆ evaluateDot() [3/6]

template<typename T >
DotType Moose::ADWrapperFunctor< 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 119 of file ADWrapperFunctor.h.

120  {
121  return _non_ad_functor.dot(qp, state);
122  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:896

◆ evaluateDot() [4/6]

template<typename T >
DotType Moose::ADWrapperFunctor< 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 123 of file ADWrapperFunctor.h.

124  {
125  return _non_ad_functor.dot(qp, state);
126  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:896

◆ evaluateDot() [5/6]

template<typename T >
DotType Moose::ADWrapperFunctor< 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 127 of file ADWrapperFunctor.h.

128  {
129  return _non_ad_functor.dot(elem_point, state);
130  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:896

◆ evaluateDot() [6/6]

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

Reimplemented from Moose::FunctorBase< T >.

Definition at line 131 of file ADWrapperFunctor.h.

132  {
133  return _non_ad_functor.dot(node, state);
134  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:896

◆ evaluateGradDot() [1/6]

template<typename T >
GradientType Moose::ADWrapperFunctor< 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 136 of file ADWrapperFunctor.h.

137  {
138  return _non_ad_functor.gradDot(elem, state);
139  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:939

◆ evaluateGradDot() [2/6]

template<typename T >
GradientType Moose::ADWrapperFunctor< 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 140 of file ADWrapperFunctor.h.

141  {
142  return _non_ad_functor.gradDot(face, state);
143  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:939

◆ evaluateGradDot() [3/6]

template<typename T >
GradientType Moose::ADWrapperFunctor< 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 144 of file ADWrapperFunctor.h.

145  {
146  return _non_ad_functor.gradDot(qp, state);
147  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:939

◆ evaluateGradDot() [4/6]

template<typename T >
GradientType Moose::ADWrapperFunctor< 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 148 of file ADWrapperFunctor.h.

149  {
150  return _non_ad_functor.gradDot(qp, state);
151  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:939

◆ evaluateGradDot() [5/6]

template<typename T >
GradientType Moose::ADWrapperFunctor< 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 152 of file ADWrapperFunctor.h.

154  {
155  return _non_ad_functor.gradDot(elem_point, state);
156  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:939

◆ evaluateGradDot() [6/6]

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

Reimplemented from Moose::FunctorBase< T >.

Definition at line 157 of file ADWrapperFunctor.h.

158  {
159  return _non_ad_functor.gradDot(node, state);
160  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:939

◆ evaluateGradient() [1/6]

template<typename T >
GradientType Moose::ADWrapperFunctor< 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 85 of file ADWrapperFunctor.h.

86  {
87  return _non_ad_functor.gradient(elem, state);
88  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:853

◆ evaluateGradient() [2/6]

template<typename T >
GradientType Moose::ADWrapperFunctor< 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 89 of file ADWrapperFunctor.h.

90  {
91  return _non_ad_functor.gradient(face, state);
92  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:853

◆ evaluateGradient() [3/6]

template<typename T >
GradientType Moose::ADWrapperFunctor< 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 93 of file ADWrapperFunctor.h.

94  {
95  return _non_ad_functor.gradient(qp, state);
96  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:853

◆ evaluateGradient() [4/6]

template<typename T >
GradientType Moose::ADWrapperFunctor< 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 97 of file ADWrapperFunctor.h.

98  {
99  return _non_ad_functor.gradient(qp, state);
100  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:853

◆ evaluateGradient() [5/6]

template<typename T >
GradientType Moose::ADWrapperFunctor< 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 101 of file ADWrapperFunctor.h.

103  {
104  return _non_ad_functor.gradient(elem_point, state);
105  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:853

◆ evaluateGradient() [6/6]

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

Reimplemented from Moose::FunctorBase< T >.

Definition at line 106 of file ADWrapperFunctor.h.

107  {
108  return _non_ad_functor.gradient(node, state);
109  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
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:853

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

994 {
995  if constexpr (FET == FunctorEvaluationKind::Value)
996  return (*this)(r, state);
997  else if constexpr (FET == FunctorEvaluationKind::Gradient)
998  return gradient(r, state);
999  else if constexpr (FET == FunctorEvaluationKind::Dot)
1000  return dot(r, state);
1001  else
1002  return gradDot(r, state);
1003 }
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:939
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:896
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:853

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

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

940 {
941  return evaluateGradDot(elem, state);
942 }
virtual GradientType evaluateGradDot(const ElemArg &, const StateArg &) const
Evaluate the functor gradient-dot with a given element.
Definition: MooseFunctor.h:445

◆ gradDot() [2/6]

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

Definition at line 946 of file MooseFunctor.h.

947 {
948  checkFace(face);
949  return evaluateGradDot(face, state);
950 }
void checkFace(const Moose::FaceArg &face) const
Examines the incoming face argument.
Definition: MooseFunctor.h:738
virtual GradientType evaluateGradDot(const ElemArg &, const StateArg &) const
Evaluate the functor gradient-dot with a given element.
Definition: MooseFunctor.h:445

◆ gradDot() [3/6]

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

Definition at line 954 of file MooseFunctor.h.

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

◆ gradDot() [4/6]

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

Definition at line 961 of file MooseFunctor.h.

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

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

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

◆ gradDot() [6/6]

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

Definition at line 975 of file MooseFunctor.h.

976 {
977  return evaluateGradDot(node, state);
978 }
virtual GradientType evaluateGradDot(const ElemArg &, const StateArg &) const
Evaluate the functor gradient-dot with a given element.
Definition: MooseFunctor.h:445

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

Referenced by FVAdvectedInterpolationMethod::advectedInterpolate(), FVAdvectedInterpolationMethod::advectedInterpolateValue(), GradientJumpIndicator::computeQpIntegral(), Moose::FV::containerInterpolate(), Moose::VectorComponentFunctor< T >::evaluateGradient(), Moose::ADWrapperFunctor< T >::evaluateGradient(), and Moose::FV::greenGaussGradient().

854 {
855  return evaluateGradient(elem, state);
856 }
virtual GradientType evaluateGradient(const ElemArg &, const StateArg &) const
Evaluate the functor gradient with a given element.
Definition: MooseFunctor.h:338

◆ gradient() [2/6]

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

Definition at line 860 of file MooseFunctor.h.

861 {
862  checkFace(face);
863  return evaluateGradient(face, state);
864 }
void checkFace(const Moose::FaceArg &face) const
Examines the incoming face argument.
Definition: MooseFunctor.h:738
virtual GradientType evaluateGradient(const ElemArg &, const StateArg &) const
Evaluate the functor gradient with a given element.
Definition: MooseFunctor.h:338

◆ gradient() [3/6]

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

Definition at line 868 of file MooseFunctor.h.

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

◆ gradient() [4/6]

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

Definition at line 875 of file MooseFunctor.h.

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

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

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

◆ gradient() [6/6]

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

Definition at line 889 of file MooseFunctor.h.

890 {
891  return evaluateGradient(node, state);
892 }
virtual GradientType evaluateGradient(const ElemArg &, const StateArg &) const
Evaluate the functor gradient with a given element.
Definition: MooseFunctor.h:338

◆ hasBlocks()

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

Returns whether the functor is defined on this block.

Reimplemented from Moose::FunctorBase< T >.

Definition at line 40 of file ADWrapperFunctor.h.

41  {
42  return _non_ad_functor.hasBlocks(id);
43  }
virtual bool hasBlocks(SubdomainID) const
Returns whether the functor is defined on this block.
Definition: MooseFunctor.h:243
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.

◆ hasFaceSide()

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

Reimplemented from Moose::FunctorBase< T >.

Definition at line 44 of file ADWrapperFunctor.h.

45  {
46  return _non_ad_functor.hasFaceSide(fi, fi_elem_side);
47  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
virtual bool hasFaceSide(const FaceInfo &fi, const bool fi_elem_side) const override
Definition: MooseFunctor.h:982

◆ isConstant()

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

Returns true if this functor is a constant.

Reimplemented from Moose::FunctorBase< T >.

Definition at line 39 of file ADWrapperFunctor.h.

39 { return _non_ad_functor.isConstant(); }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
virtual bool isConstant() const
Returns true if this functor is a constant.
Definition: MooseFunctor.h:266

◆ isExtrapolatedBoundaryFace()

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

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

Reimplemented from Moose::FunctorBase< T >.

Definition at line 33 of file ADWrapperFunctor.h.

36  {
37  return _non_ad_functor.isExtrapolatedBoundaryFace(fi, elem, state);
38  }
virtual bool isExtrapolatedBoundaryFace(const FaceInfo &, const Elem *, const StateArg &) const
Returns whether this (sided) face is an extrapolated boundary face for this functor.
Definition: MooseFunctor.h:253
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.

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

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

576 {
577  if (!fi.neighborPtr())
578  return false;
579 
580  return hasBlocks(fi.elem().subdomain_id()) && hasBlocks(fi.neighborPtr()->subdomain_id());
581 }
virtual bool hasBlocks(SubdomainID) const
Returns whether the functor is defined on this block.
Definition: MooseFunctor.h:243
const Elem & elem() const
Definition: FaceInfo.h:85
const Elem * neighborPtr() const
Definition: FaceInfo.h:88

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

604 {
605  if (_always_evaluate)
606  return evaluate(elem, state);
607 
608  mooseAssert(state.state == 0,
609  "Cached evaluations are only currently supported for the current state.");
610 
611  return queryFVArgCache(_elem_arg_to_value, elem);
612 }
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:586
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:561
bool _always_evaluate
Boolean to check if we always need evaluation.
Definition: MooseFunctor.h:523

◆ operator()() [2/6]

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

Definition at line 616 of file MooseFunctor.h.

617 {
618  checkFace(face_in);
619 
620  if (_always_evaluate)
621  return evaluate(face_in, state);
622 
623  mooseAssert(state.state == 0,
624  "Cached evaluations are only currently supported for the current state.");
625 
626  return queryFVArgCache(_face_arg_to_value, face_in);
627 }
std::map< FaceArg, ValueType > _face_arg_to_value
Map from face arguments to their cached evaluations.
Definition: MooseFunctor.h:564
void checkFace(const Moose::FaceArg &face) const
Examines the incoming face argument.
Definition: MooseFunctor.h:738
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:586
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:523

◆ operator()() [3/6]

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

Definition at line 662 of file MooseFunctor.h.

663 {
664  if (_always_evaluate)
665  return evaluate(elem_qp, state);
666 
667  const auto elem_id = elem_qp.elem->id();
668  if (elem_id != _current_qp_map_key)
669  {
670  _current_qp_map_key = elem_id;
672  }
673  auto & qp_data = *_current_qp_map_value;
674  const auto qp = elem_qp.qp;
675  const auto * const qrule = elem_qp.qrule;
676  mooseAssert(qrule, "qrule must be non-null");
677 
678  return queryQpCache(qp, *qrule, qp_data, elem_qp, state);
679 }
dof_id_type _current_qp_map_key
Current key for qp map cache.
Definition: MooseFunctor.h:529
std::vector< std::pair< bool, ValueType > > * _current_qp_map_value
Current value for qp map cache.
Definition: MooseFunctor.h:532
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:632
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:523
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:539

◆ operator()() [4/6]

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

Definition at line 683 of file MooseFunctor.h.

684 {
685  if (_always_evaluate)
686  return evaluate(elem_side_qp, state);
687 
688  const Elem * const elem = elem_side_qp.elem;
689  mooseAssert(elem, "elem must be non-null");
690  const auto elem_id = elem->id();
691  if (elem_id != _current_side_qp_map_key)
692  {
693  _current_side_qp_map_key = elem_id;
695  }
696  auto & side_qp_data = *_current_side_qp_map_value;
697  const auto side = elem_side_qp.side;
698  const auto qp = elem_side_qp.qp;
699  const auto * const qrule = elem_side_qp.qrule;
700  mooseAssert(qrule, "qrule must be non-null");
701 
702  // Check and see whether we even have sized for this side
703  if (side >= side_qp_data.size())
704  side_qp_data.resize(elem->n_sides());
705 
706  // Ok we were sized enough for our side
707  auto & qp_data = side_qp_data[side];
708  return queryQpCache(qp, *qrule, qp_data, elem_side_qp, state);
709 }
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:558
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:632
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:545
std::vector< std::vector< std::pair< bool, ValueType > > > * _current_side_qp_map_value
Current value for side-qp map cache.
Definition: MooseFunctor.h:548
bool _always_evaluate
Boolean to check if we always need evaluation.
Definition: MooseFunctor.h:523

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

714 {
715  return evaluate(elem_point, state);
716 }
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 730 of file MooseFunctor.h.

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

◆ residualSetup()

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

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

721 {
722  if (clearance_schedule.count(EXEC_ALWAYS))
723  _always_evaluate = true;
724 
725  _clearance_schedule = clearance_schedule;
726 }
const ExecFlagType EXEC_ALWAYS
Definition: Moose.C:51
bool _always_evaluate
Boolean to check if we always need evaluation.
Definition: MooseFunctor.h:523
std::set< ExecFlagType > _clearance_schedule
How often to clear the material property cache.
Definition: MooseFunctor.h:520

◆ supportsElemSideQpArg()

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

Whether this functor supports evaluation with ElemSideQpArg.

Implements Moose::FunctorBase< T >.

Definition at line 50 of file ADWrapperFunctor.h.

51  {
53  }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
virtual bool supportsElemSideQpArg() const =0
Whether this functor supports evaluation with ElemSideQpArg.

◆ supportsFaceArg()

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

Whether this functor supports evaluation with FaceArg.

Implements Moose::FunctorBase< T >.

Definition at line 49 of file ADWrapperFunctor.h.

49 { return _non_ad_functor.supportsFaceArg(); }
const FunctorBase< typename MetaPhysicL::RawType< T >::value_type > & _non_ad_functor
Our wrapped AD object.
virtual bool supportsFaceArg() const =0
Whether this functor supports evaluation with FaceArg.

◆ timestepSetup()

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

Member Data Documentation

◆ _non_ad_functor

template<typename T >
const FunctorBase<typename MetaPhysicL::RawType<T>::value_type>& Moose::ADWrapperFunctor< T >::_non_ad_functor
private

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