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

A functor that returns a vector composed of its component functor evaluations. More...

#include <VectorCompositeFunctor.h>

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

Public Types

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

Public Member Functions

 VectorCompositeFunctor (const MooseFunctorName &name, const FunctorBase< T > &x_comp, const FunctorBase< T > &y_comp, const FunctorBase< T > &z_comp)
 From xyz component constructor.
 
 VectorCompositeFunctor (const MooseFunctorName &name, const FunctorBase< T > &x_comp, const FunctorBase< T > &y_comp)
 From xy component constructor.
 
 VectorCompositeFunctor (const MooseFunctorName &name, const FunctorBase< T > &x_comp)
 From x component constructor.
 
virtual bool hasBlocks (SubdomainID sub_id) const override
 Returns whether the functor is defined on this block.
 
bool supportsFaceArg () const override
 Whether this functor supports evaluation with FaceArg.
 
bool supportsElemSideQpArg () const override
 Whether this functor supports evaluation with ElemSideQpArg.
 
FunctorReturnType< VectorValue< T >, FET >::type genericEvaluate (const Space &r, const State &state) const
 Perform a generic evaluation based on the supplied template argument FET and supplied spatial and temporal arguments.
 
const MooseFunctorName & functorName () const
 Return the functor name.
 
virtual void residualSetup () override
 
virtual void jacobianSetup () override
 
virtual void timestepSetup () override
 
virtual void customSetup (const ExecFlagType &exec_type) override
 
void setCacheClearanceSchedule (const std::set< ExecFlagType > &clearance_schedule)
 Set how often to clear the functor evaluation cache.
 
virtual bool isExtrapolatedBoundaryFace (const FaceInfo &, const Elem *, const StateArg &) const
 Returns whether this (sided) face is an extrapolated boundary face for this functor.
 
bool isInternalFace (const FaceInfo &) const
 Returns true if the face is an internal face.
 
virtual bool isConstant () const
 Returns true if this functor is a constant.
 
virtual bool hasFaceSide (const FaceInfo &fi, const bool fi_elem_side) const override
 
void checkFace (const Moose::FaceArg &face) const
 Examines the incoming face argument.
 
ValueType operator() (const ElemArg &elem, const StateArg &state) const
 Same as their evaluate overloads with the same arguments but allows for caching implementation.
 
ValueType operator() (const FaceArg &face, const StateArg &state) const
 
ValueType operator() (const ElemQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemSideQpArg &qp, const StateArg &state) const
 
ValueType operator() (const ElemPointArg &elem_point, const StateArg &state) const
 
ValueType operator() (const NodeArg &node, const StateArg &state) const
 
ValueType operator() (const PointArg &point, const StateArg &state) const
 
GradientType gradient (const ElemArg &elem, const StateArg &state) const
 Same as their evaluateGradient overloads with the same arguments but allows for caching implementation.
 
GradientType gradient (const FaceArg &face, const StateArg &state) const
 
GradientType gradient (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradient (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradient (const NodeArg &node, const StateArg &state) const
 
GradientType gradient (const PointArg &point, const StateArg &state) const
 
DotType dot (const ElemArg &elem, const StateArg &state) const
 Same as their evaluateDot overloads with the same arguments but allows for caching implementation.
 
DotType dot (const FaceArg &face, const StateArg &state) const
 
DotType dot (const ElemQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemSideQpArg &qp, const StateArg &state) const
 
DotType dot (const ElemPointArg &elem_point, const StateArg &state) const
 
DotType dot (const NodeArg &node, const StateArg &state) const
 
DotType dot (const PointArg &point, const StateArg &state) const
 
GradientType gradDot (const ElemArg &elem, const StateArg &state) const
 Same as their evaluateGradDot overloads with the same arguments but allows for caching implementation.
 
GradientType gradDot (const FaceArg &face, const StateArg &state) const
 
GradientType gradDot (const ElemQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemSideQpArg &qp, const StateArg &state) const
 
GradientType gradDot (const ElemPointArg &elem_point, const StateArg &state) const
 
GradientType gradDot (const NodeArg &node, const StateArg &state) const
 
GradientType gradDot (const PointArg &point, const StateArg &state) const
 

Protected Member Functions

Functor evaluation routines

These methods are all for evaluating functors with different kinds of spatial arguments.

Each of these methods also takes a state argument. For a description of the state argument, please see the StateArg doxygen

virtual GradientType evaluateGradient (const FaceArg &, const StateArg &) const
 
virtual GradientType evaluateGradient (const ElemQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradient (const ElemSideQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradient (const ElemPointArg &, const StateArg &) const
 Evaluate the functor gradient with a given element and point.
 
virtual GradientType evaluateGradient (const NodeArg &, const StateArg &) const
 
virtual GradientType evaluateGradient (const PointArg &, const StateArg &) const
 
virtual DotType evaluateDot (const ElemQpArg &, const StateArg &) const
 
virtual DotType evaluateDot (const ElemSideQpArg &, const StateArg &) const
 
virtual DotType evaluateDot (const ElemPointArg &, const StateArg &) const
 Evaluate the functor time derivative with a given element and point.
 
virtual DotType evaluateDot (const NodeArg &, const StateArg &) const
 
virtual DotType evaluateDot (const PointArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemArg &, const StateArg &) const
 Evaluate the functor gradient-dot with a given element.
 
virtual GradientType evaluateGradDot (const FaceArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemSideQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemPointArg &, const StateArg &) const
 Evaluate the functor gradient-dot with a given element and point.
 
virtual GradientType evaluateGradDot (const NodeArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const PointArg &, const StateArg &) const
 

Private Member Functions

ValueType evaluate (const ElemArg &elem_arg, const StateArg &state) const override
 Evaluate the functor with a given element.
 
ValueType evaluate (const FaceArg &face, const StateArg &state) const override
 
ValueType evaluate (const ElemQpArg &elem_qp, const StateArg &state) const override
 
ValueType evaluate (const ElemSideQpArg &elem_side_qp, const StateArg &state) const override
 
ValueType evaluate (const ElemPointArg &elem_point_arg, const StateArg &state) const override
 Evaluate the functor with a given element and point.
 
ValueType evaluate (const NodeArg &node_arg, const StateArg &state) const override
 
ValueType evaluate (const PointArg &point_arg, const StateArg &state) const override
 Evaluate the functor at a physical point without any mesh information.
 
GradientType evaluateGradient (const ElemArg &elem_arg, const StateArg &state) const override
 Evaluate the functor gradient with a given element.
 
DotType evaluateDot (const FaceArg &face_arg, const StateArg &state) const override
 
DotType evaluateDot (const ElemArg &elem_arg, const StateArg &state) const override
 Evaluate the functor time derivative with a given element.
 
void clearCacheData ()
 clear cache data
 
ValueType queryQpCache (unsigned int qp, const libMesh::QBase &qrule, std::vector< std::pair< bool, VectorValue< T > > > &qp_cache_data, const SpaceArg &space, const StateArg &state) const
 check a qp cache and if invalid then evaluate
 
ValueType queryFVArgCache (std::map< SpaceArg, ValueType > &cache_data, const SpaceArg &space) const
 check a finite volume spatial argument cache and if invalid then evaluate
 

Private Attributes

std::unique_ptr< ConstantFunctor< T > > _y_constant
 Possible holder of constant-0 y-component functor.
 
std::unique_ptr< ConstantFunctor< T > > _z_constant
 Possible holder of constant-0 z-component functor.
 
const FunctorBase< T > & _x_comp
 The x-component functor.
 
const FunctorBase< T > & _y_comp
 The y-component functor.
 
const FunctorBase< T > & _z_comp
 The z-component functor.
 
const bool _has_y
 Whether the user supplied a y-functor.
 
const bool _has_z
 Whether the user supplied a z-functor.
 
std::set< ExecFlagType > _clearance_schedule
 How often to clear the material property cache.
 
bool _always_evaluate
 Boolean to check if we always need evaluation.
 
dof_id_type _current_qp_map_key
 Current key for qp map cache.
 
std::vector< std::pair< bool, ValueType > > * _current_qp_map_value
 Current value for qp map cache.
 
std::unordered_map< dof_id_type, std::vector< std::pair< bool, ValueType > > > _qp_to_value
 Cached element quadrature point functor property evaluations.
 
dof_id_type _current_side_qp_map_key
 Current key for side-qp map cache.
 
std::vector< std::vector< std::pair< bool, ValueType > > > * _current_side_qp_map_value
 Current value for side-qp map cache.
 
std::unordered_map< dof_id_type, std::vector< std::vector< std::pair< bool, ValueType > > > > _side_qp_to_value
 Cached element quadrature point functor property evaluations.
 
std::map< ElemArg, ValueType > _elem_arg_to_value
 Map from element arguments to their cached evaluations.
 
std::map< FaceArg, ValueType > _face_arg_to_value
 Map from face arguments to their cached evaluations.
 
std::map< NodeArg, ValueType > _node_arg_to_value
 Map from nodal arguments to their cached evaluations.
 
MooseFunctorName _functor_name
 name of the functor
 

Detailed Description

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

A functor that returns a vector composed of its component functor evaluations.

Definition at line 21 of file VectorCompositeFunctor.h.

Member Typedef Documentation

◆ DotType

using Moose::FunctorBase< VectorValue< T > >::DotType = ValueType
inherited

Definition at line 150 of file MooseFunctor.h.

◆ FunctorBase

template<typename T >
template<typename U >
using Moose::VectorCompositeFunctor< T >::FunctorBase = FunctorBase<U>

Definition at line 25 of file VectorCompositeFunctor.h.

◆ FunctorType

using Moose::FunctorBase< VectorValue< T > >::FunctorType = FunctorBase<VectorValue< T > >
inherited

Definition at line 140 of file MooseFunctor.h.

◆ GradientType

using Moose::FunctorBase< VectorValue< T > >::GradientType = typename FunctorReturnType<VectorValue< 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

using Moose::FunctorBase< VectorValue< T > >::ValueType = VectorValue< T >
inherited

Definition at line 141 of file MooseFunctor.h.

Constructor & Destructor Documentation

◆ VectorCompositeFunctor() [1/3]

template<typename T >
Moose::VectorCompositeFunctor< T >::VectorCompositeFunctor ( const MooseFunctorName &  name,
const FunctorBase< T > &  x_comp,
const FunctorBase< T > &  y_comp,
const FunctorBase< T > &  z_comp 
)

From xyz component constructor.

Definition at line 103 of file VectorCompositeFunctor.h.

107 : FunctorBase<VectorValue<T>>(name),
108 _x_comp(x_comp),
109 _y_comp(y_comp),
110 _z_comp(z_comp),
111 _has_y(true),
112 _has_z(true)
113{
114}
const FunctorBase< T > & _y_comp
The y-component functor.
const FunctorBase< T > & _x_comp
The x-component functor.
const bool _has_y
Whether the user supplied a y-functor.
const FunctorBase< T > & _z_comp
The z-component functor.
const bool _has_z
Whether the user supplied a z-functor.
std::string name(const ElemQuality q)

◆ VectorCompositeFunctor() [2/3]

template<typename T >
Moose::VectorCompositeFunctor< T >::VectorCompositeFunctor ( const MooseFunctorName &  name,
const FunctorBase< T > &  x_comp,
const FunctorBase< T > &  y_comp 
)

From xy component constructor.

Definition at line 117 of file VectorCompositeFunctor.h.

120 : FunctorBase<VectorValue<T>>(name),
121 _z_constant(std::make_unique<ConstantFunctor>(T(0))),
122 _x_comp(x_comp),
123 _y_comp(y_comp),
125 _has_y(true),
126 _has_z(false)
127{
128}
std::unique_ptr< ConstantFunctor< T > > _z_constant
Possible holder of constant-0 z-component functor.

◆ VectorCompositeFunctor() [3/3]

template<typename T >
Moose::VectorCompositeFunctor< T >::VectorCompositeFunctor ( const MooseFunctorName &  name,
const FunctorBase< T > &  x_comp 
)

From x component constructor.

Definition at line 131 of file VectorCompositeFunctor.h.

133 : FunctorBase<VectorValue<T>>(name),
134 _y_constant(std::make_unique<ConstantFunctor>(T(0))),
135 _z_constant(std::make_unique<ConstantFunctor>(T(0))),
136 _x_comp(x_comp),
139 _has_y(false),
140 _has_z(false)
141{
142}
std::unique_ptr< ConstantFunctor< T > > _y_constant
Possible holder of constant-0 y-component functor.

Member Function Documentation

◆ checkFace()

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

Examines the incoming face argument.

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

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

Definition at line 284 of file MooseFunctor.h.

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

◆ clearCacheData()

void Moose::FunctorBase< VectorValue< T > >::clearCacheData ( )
privateinherited

clear cache data

Definition at line 528 of file MooseFunctor.h.

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

◆ customSetup()

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

Implements Moose::FunctorAbstract.

Definition at line 237 of file MooseFunctor.h.

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

◆ dot() [1/7]

FunctorBase< VectorValue< T > >::DotType Moose::FunctorBase< VectorValue< 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 211 of file MooseFunctor.h.

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

◆ dot() [2/7]

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

Definition at line 215 of file MooseFunctor.h.

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

◆ dot() [3/7]

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

Definition at line 213 of file MooseFunctor.h.

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

◆ dot() [4/7]

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

Definition at line 214 of file MooseFunctor.h.

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

◆ dot() [5/7]

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

Definition at line 212 of file MooseFunctor.h.

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

◆ dot() [6/7]

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

Definition at line 216 of file MooseFunctor.h.

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

◆ dot() [7/7]

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

Definition at line 217 of file MooseFunctor.h.

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

◆ evaluate() [1/7]

template<typename T >
VectorCompositeFunctor< T >::ValueType Moose::VectorCompositeFunctor< T >::evaluate ( const ElemArg &  elem,
const StateArg &  state 
) const
overrideprivatevirtual

Evaluate the functor with a given element.

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

Implements Moose::FunctorBase< VectorValue< T > >.

Definition at line 172 of file VectorCompositeFunctor.h.

173{
174 return {_x_comp(elem_arg, state), _y_comp(elem_arg, state), _z_comp(elem_arg, state)};
175}

◆ evaluate() [2/7]

template<typename T >
VectorCompositeFunctor< T >::ValueType Moose::VectorCompositeFunctor< T >::evaluate ( const ElemPointArg &  elem_point,
const StateArg &  state 
) const
overrideprivatevirtual

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< VectorValue< T > >.

Definition at line 201 of file VectorCompositeFunctor.h.

203{
204 return {_x_comp(elem_point_arg, state),
205 _y_comp(elem_point_arg, state),
206 _z_comp(elem_point_arg, state)};
207}

◆ evaluate() [3/7]

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

Implements Moose::FunctorBase< VectorValue< T > >.

Definition at line 186 of file VectorCompositeFunctor.h.

187{
188 return {_x_comp(elem_qp, state), _y_comp(elem_qp, state), _z_comp(elem_qp, state)};
189}

◆ evaluate() [4/7]

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

Implements Moose::FunctorBase< VectorValue< T > >.

Definition at line 193 of file VectorCompositeFunctor.h.

195{
196 return {_x_comp(elem_side_qp, state), _y_comp(elem_side_qp, state), _z_comp(elem_side_qp, state)};
197}

◆ evaluate() [5/7]

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

Implements Moose::FunctorBase< VectorValue< T > >.

Definition at line 179 of file VectorCompositeFunctor.h.

180{
181 return {_x_comp(face, state), _y_comp(face, state), _z_comp(face, state)};
182}

◆ evaluate() [6/7]

template<typename T >
VectorCompositeFunctor< T >::ValueType Moose::VectorCompositeFunctor< T >::evaluate ( const NodeArg &  node_arg,
const StateArg &  state 
) const
overrideprivatevirtual

Implements Moose::FunctorBase< VectorValue< T > >.

Definition at line 211 of file VectorCompositeFunctor.h.

212{
213 return {_x_comp(node_arg, state), _y_comp(node_arg, state), _z_comp(node_arg, state)};
214}

◆ evaluate() [7/7]

template<typename T >
VectorCompositeFunctor< T >::ValueType Moose::VectorCompositeFunctor< T >::evaluate ( const PointArg &  ,
const StateArg &   
) const
overrideprivatevirtual

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

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

Reimplemented from Moose::FunctorBase< VectorValue< T > >.

Definition at line 218 of file VectorCompositeFunctor.h.

219{
220 return {_x_comp(point_arg, state), _y_comp(point_arg, state), _z_comp(point_arg, state)};
221}

◆ evaluateDot() [1/7]

template<typename T >
VectorCompositeFunctor< T >::DotType Moose::VectorCompositeFunctor< T >::evaluateDot ( const ElemArg &  ,
const StateArg &   
) const
overrideprivatevirtual

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< VectorValue< T > >.

Definition at line 241 of file VectorCompositeFunctor.h.

242{
243 return {_x_comp.dot(elem_arg, state), _y_comp.dot(elem_arg, state), _z_comp.dot(elem_arg, state)};
244}

◆ evaluateDot() [2/7]

virtual DotType Moose::FunctorBase< VectorValue< T > >::evaluateDot ( const ElemPointArg &  ,
const StateArg &   
) const
inlineprotectedvirtualinherited

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

Definition at line 449 of file MooseFunctor.h.

450 {
451 mooseError("Element-point time derivative not implemented for functor " + functorName());
452 }
const MooseFunctorName & functorName() const
Return the functor name.

◆ evaluateDot() [3/7]

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

Definition at line 429 of file MooseFunctor.h.

430 {
431 mooseError("Element quadrature point time derivative not implemented for functor " +
432 functorName());
433 }

◆ evaluateDot() [4/7]

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

Definition at line 440 of file MooseFunctor.h.

441 {
442 mooseError("Element side quadrature point time derivative not implemented for functor " +
443 functorName());
444 }

◆ evaluateDot() [5/7]

template<typename T >
VectorCompositeFunctor< T >::DotType Moose::VectorCompositeFunctor< T >::evaluateDot ( const FaceArg &  ,
const StateArg &   
) const
overrideprivatevirtual
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< VectorValue< T > >.

Definition at line 234 of file VectorCompositeFunctor.h.

235{
236 return {_x_comp.dot(face_arg, state), _y_comp.dot(face_arg, state), _z_comp.dot(face_arg, state)};
237}

◆ evaluateDot() [6/7]

virtual DotType Moose::FunctorBase< VectorValue< T > >::evaluateDot ( const NodeArg &  ,
const StateArg &   
) const
inlineprotectedvirtualinherited

Definition at line 454 of file MooseFunctor.h.

455 {
456 mooseError("Time derivative at node not implemented for functor " + functorName());
457 }

◆ evaluateDot() [7/7]

virtual DotType Moose::FunctorBase< VectorValue< T > >::evaluateDot ( const PointArg &  ,
const StateArg &   
) const
inlineprotectedvirtualinherited

Definition at line 459 of file MooseFunctor.h.

460 {
461 mooseError("Time derivative at point not implemented for functor " + functorName());
462 }

◆ evaluateGradDot() [1/7]

virtual GradientType Moose::FunctorBase< VectorValue< T > >::evaluateGradDot ( const ElemArg &  ,
const StateArg &   
) const
inlineprotectedvirtualinherited

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

Definition at line 468 of file MooseFunctor.h.

469 {
470 mooseError("Element gradient-dot not implemented for functor " + functorName());
471 }

◆ evaluateGradDot() [2/7]

virtual GradientType Moose::FunctorBase< VectorValue< T > >::evaluateGradDot ( const ElemPointArg &  ,
const StateArg &   
) const
inlineprotectedvirtualinherited

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

Definition at line 508 of file MooseFunctor.h.

509 {
510 mooseError("Element-point gradient-dot not implemented for functor " + functorName());
511 }

◆ evaluateGradDot() [3/7]

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

Definition at line 488 of file MooseFunctor.h.

489 {
490 mooseError("Element quadrature point gradient-dot not implemented for functor " +
491 functorName());
492 }

◆ evaluateGradDot() [4/7]

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

Definition at line 499 of file MooseFunctor.h.

500 {
501 mooseError("Element side quadrature point gradient-dot not implemented for functor " +
502 functorName());
503 }

◆ evaluateGradDot() [5/7]

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

Definition at line 478 of file MooseFunctor.h.

479 {
480 mooseError("Face gradient-dot not implemented for functor " + functorName());
481 }

◆ evaluateGradDot() [6/7]

virtual GradientType Moose::FunctorBase< VectorValue< T > >::evaluateGradDot ( const NodeArg &  ,
const StateArg &   
) const
inlineprotectedvirtualinherited

Definition at line 513 of file MooseFunctor.h.

514 {
515 mooseError("Gradient-dot at node not implemented for functor " + functorName());
516 }

◆ evaluateGradDot() [7/7]

virtual GradientType Moose::FunctorBase< VectorValue< T > >::evaluateGradDot ( const PointArg &  ,
const StateArg &   
) const
inlineprotectedvirtualinherited

Definition at line 518 of file MooseFunctor.h.

519 {
520 mooseError("Gradient-dot at point not implemented for functor " + functorName());
521 }

◆ evaluateGradient() [1/7]

template<typename T >
VectorCompositeFunctor< T >::GradientType Moose::VectorCompositeFunctor< T >::evaluateGradient ( const ElemArg &  ,
const StateArg &   
) const
overrideprivatevirtual

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< VectorValue< T > >.

Definition at line 225 of file VectorCompositeFunctor.h.

226{
227 return {_x_comp.gradient(elem_arg, state),
228 _y_comp.gradient(elem_arg, state),
229 _z_comp.gradient(elem_arg, state)};
230}

◆ evaluateGradient() [2/7]

virtual GradientType Moose::FunctorBase< VectorValue< T > >::evaluateGradient ( const ElemPointArg &  ,
const StateArg &   
) const
inlineprotectedvirtualinherited

Evaluate the functor gradient with a given element and point.

Definition at line 390 of file MooseFunctor.h.

391 {
392 mooseError("Element-point gradient not implemented for functor " + functorName());
393 }

◆ evaluateGradient() [3/7]

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

Definition at line 371 of file MooseFunctor.h.

372 {
373 mooseError("Element quadrature point gradient not implemented for functor " + functorName());
374 }

◆ evaluateGradient() [4/7]

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

Definition at line 381 of file MooseFunctor.h.

382 {
383 mooseError("Element side quadrature point gradient not implemented for functor " +
384 functorName());
385 }

◆ evaluateGradient() [5/7]

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

Definition at line 361 of file MooseFunctor.h.

362 {
363 mooseError("Face gradient not implemented for functor " + functorName());
364 }

◆ evaluateGradient() [6/7]

virtual GradientType Moose::FunctorBase< VectorValue< T > >::evaluateGradient ( const NodeArg &  ,
const StateArg &   
) const
inlineprotectedvirtualinherited

Definition at line 395 of file MooseFunctor.h.

396 {
397 mooseError("Gradient at node not implemented for functor " + functorName());
398 }

◆ evaluateGradient() [7/7]

virtual GradientType Moose::FunctorBase< VectorValue< T > >::evaluateGradient ( const PointArg &  ,
const StateArg &   
) const
inlineprotectedvirtualinherited

Definition at line 400 of file MooseFunctor.h.

401 {
402 mooseError("Gradient at point not implemented for functor " + functorName());
403 }

◆ functorName()

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

Return the functor name.

Definition at line 176 of file MooseFunctor.h.

176{ return _functor_name; }
MooseFunctorName _functor_name
name of the functor

◆ genericEvaluate()

FunctorReturnType< VectorValue< T > , FET >::type Moose::FunctorBase< VectorValue< 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 172 of file MooseFunctor.h.

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

◆ gradDot() [1/7]

FunctorBase< VectorValue< T > >::GradientType Moose::FunctorBase< VectorValue< 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 225 of file MooseFunctor.h.

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

◆ gradDot() [2/7]

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

Definition at line 229 of file MooseFunctor.h.

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

◆ gradDot() [3/7]

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

Definition at line 227 of file MooseFunctor.h.

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

◆ gradDot() [4/7]

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

Definition at line 228 of file MooseFunctor.h.

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

◆ gradDot() [5/7]

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

Definition at line 226 of file MooseFunctor.h.

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

◆ gradDot() [6/7]

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

Definition at line 230 of file MooseFunctor.h.

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

◆ gradDot() [7/7]

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

Definition at line 231 of file MooseFunctor.h.

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

◆ gradient() [1/7]

FunctorBase< VectorValue< T > >::GradientType Moose::FunctorBase< VectorValue< 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 197 of file MooseFunctor.h.

889{
890 return evaluateGradient(elem, state);
891}
virtual GradientType evaluateGradient(const ElemArg &, const StateArg &) const
Evaluate the functor gradient with a given element.

◆ gradient() [2/7]

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

Definition at line 201 of file MooseFunctor.h.

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

◆ gradient() [3/7]

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

Definition at line 199 of file MooseFunctor.h.

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

◆ gradient() [4/7]

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

Definition at line 200 of file MooseFunctor.h.

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

◆ gradient() [5/7]

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

Definition at line 198 of file MooseFunctor.h.

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

◆ gradient() [6/7]

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

Definition at line 202 of file MooseFunctor.h.

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

◆ gradient() [7/7]

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

Definition at line 203 of file MooseFunctor.h.

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

◆ hasBlocks()

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

Returns whether the functor is defined on this block.

Reimplemented from Moose::FunctorBase< VectorValue< T > >.

Definition at line 51 of file VectorCompositeFunctor.h.

52 {
53 const bool ret = _x_comp.hasBlocks(sub_id);
54 if (_has_y)
55 mooseAssert(ret == _y_comp.hasBlocks(sub_id), "x and y block restriction don't agree");
56 if (_has_z)
57 mooseAssert(ret == _z_comp.hasBlocks(sub_id), "x and z block restriction don't agree");
58 return ret;
59 }

◆ hasFaceSide()

bool Moose::FunctorBase< VectorValue< T > >::hasFaceSide ( const FaceInfo &  fi,
const bool  fi_elem_side 
) const
overridevirtualinherited

Implements FaceArgInterface.

Definition at line 272 of file MooseFunctor.h.

1039{
1040 if (fi_elem_side)
1041 return hasBlocks(fi.elem().subdomain_id());
1042 else
1043 return fi.neighborPtr() && hasBlocks(fi.neighbor().subdomain_id());
1044}
const Elem & elem() const
Definition FaceInfo.h:85
const Elem & neighbor() const
Definition FaceInfo.h:220
virtual bool hasBlocks(SubdomainID) const
Returns whether the functor is defined on this block.

◆ isConstant()

virtual bool Moose::FunctorBase< VectorValue< T > >::isConstant ( ) const
inlinevirtualinherited

Returns true if this functor is a constant.

Definition at line 270 of file MooseFunctor.h.

270{ return false; }

◆ isExtrapolatedBoundaryFace()

virtual bool Moose::FunctorBase< VectorValue< T > >::isExtrapolatedBoundaryFace ( const FaceInfo &  ,
const Elem *  ,
const StateArg &   
) const
inlinevirtualinherited

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

Definition at line 257 of file MooseFunctor.h.

258 {
259 mooseError("not implemented");
260 }

◆ isInternalFace()

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

Returns true if the face is an internal face.

Definition at line 265 of file MooseFunctor.h.

604{
605 if (!fi.neighborPtr())
606 return false;
607
608 return hasBlocks(fi.elem().subdomain_id()) && hasBlocks(fi.neighborPtr()->subdomain_id());
609}

◆ jacobianSetup()

void Moose::FunctorBase< VectorValue< T > >::jacobianSetup ( )
overridevirtualinherited

Implements Moose::FunctorAbstract.

Definition at line 235 of file MooseFunctor.h.

873{
876}
const ExecFlagType EXEC_NONLINEAR
Definition Moose.C:34

◆ operator()() [1/7]

FunctorBase< VectorValue< T > >::ValueType Moose::FunctorBase< VectorValue< 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 183 of file MooseFunctor.h.

632{
633 if (_always_evaluate)
634 return evaluate(elem, state);
635
636 mooseAssert(state.state == 0,
637 "Cached evaluations are only currently supported for the current state.");
638
639 return queryFVArgCache(_elem_arg_to_value, elem);
640}
T evaluate(Real, const Point &)
The general evaluation method is not defined.
ValueType queryFVArgCache(std::map< SpaceArg, ValueType > &cache_data, const SpaceArg &space) const
check a finite volume spatial argument cache and if invalid then evaluate

◆ operator()() [2/7]

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

Definition at line 187 of file MooseFunctor.h.

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

◆ operator()() [3/7]

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

Definition at line 185 of file MooseFunctor.h.

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

◆ operator()() [4/7]

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

Definition at line 186 of file MooseFunctor.h.

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

◆ operator()() [5/7]

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

Definition at line 184 of file MooseFunctor.h.

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

◆ operator()() [6/7]

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

Definition at line 188 of file MooseFunctor.h.

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

◆ operator()() [7/7]

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

Definition at line 189 of file MooseFunctor.h.

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

◆ queryFVArgCache()

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

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

Definition at line 544 of file MooseFunctor.h.

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

◆ queryQpCache()

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

check a qp cache and if invalid then evaluate

Definition at line 534 of file MooseFunctor.h.

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

◆ residualSetup()

void Moose::FunctorBase< VectorValue< T > >::residualSetup ( )
overridevirtualinherited

Implements Moose::FunctorAbstract.

Definition at line 234 of file MooseFunctor.h.

865{
868}
const ExecFlagType EXEC_LINEAR
Definition Moose.C:32

◆ setCacheClearanceSchedule()

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

Set how often to clear the functor evaluation cache.

Definition at line 242 of file MooseFunctor.h.

749{
750 if (clearance_schedule.count(EXEC_ALWAYS))
751 _always_evaluate = true;
752
753 _clearance_schedule = clearance_schedule;
754}
const ExecFlagType EXEC_ALWAYS
Definition Moose.C:54
bool _always_evaluate
Boolean to check if we always need evaluation.

◆ supportsElemSideQpArg()

template<typename T >
bool Moose::VectorCompositeFunctor< T >::supportsElemSideQpArg ( ) const
overridevirtual

Whether this functor supports evaluation with ElemSideQpArg.

Implements Moose::FunctorBase< VectorValue< T > >.

Definition at line 159 of file VectorCompositeFunctor.h.

160{
161 if (!_x_comp.supportsElemSideQpArg())
162 return false;
163 if (_has_y && !_y_comp.supportsElemSideQpArg())
164 return false;
165 if (_has_z && !_z_comp.supportsElemSideQpArg())
166 return false;
167 return true;
168}

◆ supportsFaceArg()

template<typename T >
bool Moose::VectorCompositeFunctor< T >::supportsFaceArg ( ) const
overridevirtual

Whether this functor supports evaluation with FaceArg.

Implements Moose::FunctorBase< VectorValue< T > >.

Definition at line 146 of file VectorCompositeFunctor.h.

147{
148 if (!_x_comp.supportsFaceArg())
149 return false;
150 if (_has_y && !_y_comp.supportsFaceArg())
151 return false;
152 if (_has_z && !_z_comp.supportsFaceArg())
153 return false;
154 return true;
155}

◆ timestepSetup()

void Moose::FunctorBase< VectorValue< T > >::timestepSetup ( )
overridevirtualinherited

Implements Moose::FunctorAbstract.

Definition at line 236 of file MooseFunctor.h.

857{
860}
const ExecFlagType EXEC_TIMESTEP_BEGIN
Definition Moose.C:38

Member Data Documentation

◆ _always_evaluate

bool Moose::FunctorBase< VectorValue< T > >::_always_evaluate
privateinherited

Boolean to check if we always need evaluation.

Definition at line 551 of file MooseFunctor.h.

◆ _clearance_schedule

std::set<ExecFlagType> Moose::FunctorBase< VectorValue< T > >::_clearance_schedule
privateinherited

How often to clear the material property cache.

Definition at line 548 of file MooseFunctor.h.

◆ _current_qp_map_key

dof_id_type Moose::FunctorBase< VectorValue< T > >::_current_qp_map_key
mutableprivateinherited

Current key for qp map cache.

Definition at line 557 of file MooseFunctor.h.

◆ _current_qp_map_value

std::vector<std::pair<bool, ValueType> >* Moose::FunctorBase< VectorValue< T > >::_current_qp_map_value
mutableprivateinherited

Current value for qp map cache.

Definition at line 560 of file MooseFunctor.h.

◆ _current_side_qp_map_key

dof_id_type Moose::FunctorBase< VectorValue< T > >::_current_side_qp_map_key
mutableprivateinherited

Current key for side-qp map cache.

Definition at line 573 of file MooseFunctor.h.

◆ _current_side_qp_map_value

std::vector<std::vector<std::pair<bool, ValueType> > >* Moose::FunctorBase< VectorValue< T > >::_current_side_qp_map_value
mutableprivateinherited

Current value for side-qp map cache.

Definition at line 576 of file MooseFunctor.h.

◆ _elem_arg_to_value

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

Map from element arguments to their cached evaluations.

Definition at line 589 of file MooseFunctor.h.

◆ _face_arg_to_value

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

Map from face arguments to their cached evaluations.

Definition at line 592 of file MooseFunctor.h.

◆ _functor_name

MooseFunctorName Moose::FunctorBase< VectorValue< T > >::_functor_name
privateinherited

name of the functor

Definition at line 598 of file MooseFunctor.h.

◆ _has_y

template<typename T >
const bool Moose::VectorCompositeFunctor< T >::_has_y
private

Whether the user supplied a y-functor.

Definition at line 96 of file VectorCompositeFunctor.h.

Referenced by Moose::VectorCompositeFunctor< T >::hasBlocks().

◆ _has_z

template<typename T >
const bool Moose::VectorCompositeFunctor< T >::_has_z
private

Whether the user supplied a z-functor.

Definition at line 99 of file VectorCompositeFunctor.h.

Referenced by Moose::VectorCompositeFunctor< T >::hasBlocks().

◆ _node_arg_to_value

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

Map from nodal arguments to their cached evaluations.

Definition at line 595 of file MooseFunctor.h.

◆ _qp_to_value

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

Cached element quadrature point functor property evaluations.

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

Definition at line 567 of file MooseFunctor.h.

◆ _side_qp_to_value

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

Cached element quadrature point functor property evaluations.

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

Definition at line 586 of file MooseFunctor.h.

◆ _x_comp

template<typename T >
const FunctorBase<T>& Moose::VectorCompositeFunctor< T >::_x_comp
private

The x-component functor.

Definition at line 89 of file VectorCompositeFunctor.h.

Referenced by Moose::VectorCompositeFunctor< T >::hasBlocks().

◆ _y_comp

template<typename T >
const FunctorBase<T>& Moose::VectorCompositeFunctor< T >::_y_comp
private

The y-component functor.

Definition at line 91 of file VectorCompositeFunctor.h.

Referenced by Moose::VectorCompositeFunctor< T >::hasBlocks().

◆ _y_constant

template<typename T >
std::unique_ptr<ConstantFunctor<T> > Moose::VectorCompositeFunctor< T >::_y_constant
private

Possible holder of constant-0 y-component functor.

This will be allocated if the user only supplies one component functor during construction

Definition at line 82 of file VectorCompositeFunctor.h.

◆ _z_comp

template<typename T >
const FunctorBase<T>& Moose::VectorCompositeFunctor< T >::_z_comp
private

The z-component functor.

Definition at line 93 of file VectorCompositeFunctor.h.

Referenced by Moose::VectorCompositeFunctor< T >::hasBlocks().

◆ _z_constant

template<typename T >
std::unique_ptr<ConstantFunctor<T> > Moose::VectorCompositeFunctor< T >::_z_constant
private

Possible holder of constant-0 z-component functor.

This will be allocated if the user only supplies two component functors during construction

Definition at line 86 of file VectorCompositeFunctor.h.


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