22#include "libmesh/remote_elem.h"
23#include "libmesh/tensor_tools.h"
25#include "metaphysicl/ct_types.h"
27#include <unordered_map>
48template <
typename, FunctorEvaluationKind>
69 typedef typename MetaPhysicL::ReplaceAlgebraicType<
72 typename MetaPhysicL::ValueType<T>::type>::type>::type
type;
97template <FunctorEvaluationKind>
154 const std::set<ExecFlagType> & clearance_schedule = {
EXEC_ALWAYS})
160#ifdef MOOSE_KOKKOS_ENABLED
171 template <FunctorEvaluationKind FET,
typename Space,
typename State>
173 const State & state)
const;
383 mooseError(
"Element side quadrature point gradient not implemented for functor " +
431 mooseError(
"Element quadrature point time derivative not implemented for functor " +
442 mooseError(
"Element side quadrature point time derivative not implemented for functor " +
490 mooseError(
"Element quadrature point gradient-dot not implemented for functor " +
501 mooseError(
"Element side quadrature point gradient-dot not implemented for functor " +
533 template <
typename SpaceArg,
typename StateArg>
536 std::vector<std::pair<bool, T>> & qp_cache_data,
537 const SpaceArg & space,
543 template <
typename SpaceArg>
545 const SpaceArg & space)
const;
567 mutable std::unordered_map<dof_id_type, std::vector<std::pair<bool, ValueType>>>
_qp_to_value;
585 mutable std::unordered_map<dof_id_type, std::vector<std::vector<std::pair<bool, ValueType>>>>
608 return hasBlocks(fi.
elem().subdomain_id()) && hasBlocks(fi.
neighborPtr()->subdomain_id());
612template <
typename SpaceArg>
615 const SpaceArg & space)
const
618 auto [it, inserted] = cache_data.try_emplace(space,
ValueType());
619 auto & value = it->second;
633 if (_always_evaluate)
636 mooseAssert(state.
state == 0,
637 "Cached evaluations are only currently supported for the current state.");
639 return queryFVArgCache(_elem_arg_to_value, elem);
648 if (_always_evaluate)
651 mooseAssert(state.
state == 0,
652 "Cached evaluations are only currently supported for the current state.");
654 return queryFVArgCache(_face_arg_to_value, face_in);
658template <
typename SpaceArg,
typename StateArg>
662 std::vector<std::pair<bool, ValueType>> & qp_cache_data,
663 const SpaceArg & space,
668 if (qp >= qp_cache_data.size())
671 auto & pr = qp_cache_data[qp];
678 auto & pr = qp_cache_data[qp];
692 if (_always_evaluate)
695 const auto elem_id = elem_qp.
elem->
id();
696 if (elem_id != _current_qp_map_key)
698 _current_qp_map_key = elem_id;
699 _current_qp_map_value = &_qp_to_value[elem_id];
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");
706 return queryQpCache(qp, *qrule, qp_data, elem_qp, state);
713 if (_always_evaluate)
714 return evaluate(elem_side_qp, state);
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)
721 _current_side_qp_map_key = elem_id;
722 _current_side_qp_map_value = &_side_qp_to_value[elem_id];
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");
731 if (side >= side_qp_data.size())
732 side_qp_data.resize(elem->n_sides());
735 auto & qp_data = side_qp_data[side];
736 return queryQpCache(qp, *qrule, qp_data, elem_side_qp, state);
751 _always_evaluate =
true;
753 _clearance_schedule = clearance_schedule;
760 mooseAssert(node.
subdomain_ids,
"Subdomain IDs must be supplied to the node argument");
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;
788 if (!hasFaceSide(*fi,
true))
789 check_neighbor_def =
true;
790 else if (!hasFaceSide(*fi,
false))
791 check_elem_def =
true;
793 else if (elem == fi->
elemPtr())
794 check_elem_def =
true;
797 mooseAssert(elem == fi->
neighborPtr(),
"This has to match something");
798 check_neighbor_def =
true;
801 if (check_elem_def && !hasFaceSide(*fi,
true))
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.";
808 " is not defined on the element side of the face information, but a face argument "
810 "(e.g. residual object, postprocessor, etc.) has requested evaluation there.\n",
813 if (check_neighbor_def && !hasFaceSide(*fi,
false))
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.";
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",
832 for (
auto & map_pr : _qp_to_value)
833 for (
auto & pr : map_pr.second)
836 for (
auto & map_pr : _side_qp_to_value)
838 auto & side_vector = map_pr.second;
839 for (
auto & qp_vector : side_vector)
840 for (
auto & pr : qp_vector)
845 _current_qp_map_value =
nullptr;
847 _current_side_qp_map_value =
nullptr;
849 _elem_arg_to_value.clear();
850 _face_arg_to_value.clear();
851 _node_arg_to_value.clear();
882 if (_clearance_schedule.count(exec_type))
890 return evaluateGradient(elem, state);
898 return evaluateGradient(face, state);
905 return evaluateGradient(elem_qp, state);
912 return evaluateGradient(elem_side_qp, state);
919 return evaluateGradient(elem_point, state);
926 return evaluateGradient(node, state);
933 return evaluateGradient(point, state);
940 return evaluateDot(elem, state);
948 return evaluateDot(face, state);
955 return evaluateDot(elem_qp, state);
962 return evaluateDot(elem_side_qp, state);
969 return evaluateDot(elem_point, state);
976 return evaluateDot(node, state);
983 return evaluateDot(point, state);
990 return evaluateGradDot(elem, state);
998 return evaluateGradDot(face, state);
1001template <
typename T>
1005 return evaluateGradDot(elem_qp, state);
1008template <
typename T>
1012 return evaluateGradDot(elem_side_qp, state);
1015template <
typename T>
1019 return evaluateGradDot(elem_point, state);
1022template <
typename T>
1026 return evaluateGradDot(node, state);
1029template <
typename T>
1033 return evaluateGradDot(point, state);
1036template <
typename T>
1041 return hasBlocks(fi.
elem().subdomain_id());
1046template <
typename T>
1047template <FunctorEvaluationKind FET,
typename Space,
typename State>
1052 return (*
this)(r, state);
1054 return gradient(r, state);
1056 return dot(r, state);
1058 return gradDot(r, state);
1101template <
typename T>
1152 _owned = std::move(wrapped);
1172 virtual bool wrapsNull()
const override {
return wrapsType<NullFunctor<T>>(); }
1184 template <
typename T2>
1187 return dynamic_cast<const T2 *
>(
_wrapped);
1191 const Elem *
const elem,
1192 const StateArg & state)
const override
1194 return _wrapped->isExtrapolatedBoundaryFace(fi, elem, state);
1200 return _wrapped->hasFaceSide(fi, fi_elem_side);
1213 return _wrapped->operator()(elem, state);
1217 return _wrapped->operator()(face, state);
1221 return _wrapped->operator()(qp, state);
1225 return _wrapped->operator()(qp, state);
1229 return _wrapped->operator()(elem_point, state);
1233 return _wrapped->operator()(node, state);
1237 return _wrapped->operator()(point, state);
1242 return _wrapped->gradient(elem, state);
1246 return _wrapped->gradient(face, state);
1250 return _wrapped->gradient(qp, state);
1253 const StateArg & state)
const override
1255 return _wrapped->gradient(qp, state);
1258 const StateArg & state)
const override
1260 return _wrapped->gradient(elem_point, state);
1264 return _wrapped->gradient(node, state);
1267 const StateArg & state)
const override
1269 return _wrapped->gradient(point, state);
1289 const StateArg & state)
const override
1291 return _wrapped->dot(elem_point, state);
1299 return _wrapped->dot(point, state);
1304 return _wrapped->gradDot(elem, state);
1308 return _wrapped->gradDot(face, state);
1312 return _wrapped->gradDot(qp, state);
1315 const StateArg & state)
const override
1317 return _wrapped->gradDot(qp, state);
1320 const StateArg & state)
const override
1322 return _wrapped->gradDot(elem_point, state);
1326 return _wrapped->gradDot(node, state);
1329 const StateArg & state)
const override
1331 return _wrapped->gradDot(point, state);
1340 friend class ::SubProblem;
1346template <
typename T>
1415template <
typename T>
1435 mooseError(
"We should never get here. If you have, contact a MOOSE developer and tell them "
1436 "they've written broken code");
1440 mooseError(
"We should never get here. If you have, contact a MOOSE developer and tell them "
1441 "they've written broken code");
1445 mooseError(
"We should never get here. If you have, contact a MOOSE developer and tell them "
1446 "they've written broken code");
1450 mooseError(
"We should never get here. If you have, contact a MOOSE developer and tell them "
1451 "they've written broken code");
1455 mooseError(
"We should never get here. If you have, contact a MOOSE developer and tell them "
1456 "they've written broken code");
1460 mooseError(
"We should never get here. If you have, contact a MOOSE developer and tell them "
1461 "they've written broken code");
1465 mooseError(
"We should never get here. If you have, contact a MOOSE developer and tell them "
1466 "they've written broken code");
1470template <
typename T>
subdomain_id_type SubdomainID
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
T evaluate(Real, const Point &)
The general evaluation method is not defined.
const ExecFlagType EXEC_TIMESTEP_BEGIN
const ExecFlagType EXEC_ALWAYS
const ExecFlagType EXEC_LINEAR
const ExecFlagType EXEC_NONLINEAR
A base class interface for both producers and consumers of functor face arguments,...
This data structure is used to store geometric and variable related metadata about each cell face in ...
const Elem & elem() const
const Elem * neighborPtr() const
const Elem * elemPtr() const
const Point & faceCentroid() const
Returns the coordinates of the face centroid.
const Elem & neighbor() const
Class for containing MooseEnum item information.
Class template for creating constant functors.
ValueType evaluate(const NodeArg &, const StateArg &) const override
GradientType evaluateGradDot(const ElemSideQpArg &, const StateArg &) const override
DotType evaluateDot(const PointArg &, const StateArg &) const override
ConstantFunctor(ValueType &&value)
ConstantFunctor(const ValueType &value)
virtual bool isConstant() const override
Returns true if this functor is a constant.
bool supportsElemSideQpArg() const override final
Whether this functor supports evaluation with ElemSideQpArg.
GradientType evaluateGradient(const ElemPointArg &, const StateArg &) const override
Evaluate the functor gradient with a given element and point.
ValueType evaluate(const ElemQpArg &, const StateArg &) const override
DotType evaluateDot(const NodeArg &, const StateArg &) const override
GradientType evaluateGradient(const NodeArg &, const StateArg &) const override
GradientType evaluateGradDot(const NodeArg &, const StateArg &) const override
ValueType evaluate(const ElemArg &, const StateArg &) const override
Evaluate the functor with a given element.
GradientType evaluateGradient(const ElemSideQpArg &, const StateArg &) const override
GradientType evaluateGradient(const ElemQpArg &, const StateArg &) const override
DotType evaluateDot(const ElemPointArg &, const StateArg &) const override
Evaluate the functor time derivative with a given element and point.
DotType evaluateDot(const ElemQpArg &, const StateArg &) const override
DotType evaluateDot(const FaceArg &, const StateArg &) const override
DotType evaluateDot(const ElemArg &, const StateArg &) const override
Evaluate the functor time derivative with a given element.
GradientType evaluateGradDot(const ElemQpArg &, const StateArg &) const override
ValueType evaluate(const ElemPointArg &, const StateArg &) const override
Evaluate the functor with a given element and point.
GradientType evaluateGradDot(const ElemPointArg &, const StateArg &) const override
Evaluate the functor gradient-dot with a given element and point.
GradientType evaluateGradDot(const ElemArg &, const StateArg &) const override
Evaluate the functor gradient-dot with a given element.
ValueType evaluate(const PointArg &, const StateArg &) const override
Evaluate the functor at a physical point without any mesh information.
bool supportsFaceArg() const override final
Whether this functor supports evaluation with FaceArg.
DotType evaluateDot(const ElemSideQpArg &, const StateArg &) const override
GradientType evaluateGradDot(const FaceArg &, const StateArg &) const override
GradientType evaluateGradient(const FaceArg &, const StateArg &) const override
GradientType evaluateGradDot(const PointArg &, const StateArg &) const override
GradientType evaluateGradient(const ElemArg &, const StateArg &) const override
Evaluate the functor gradient with a given element.
bool hasBlocks(SubdomainID) const override
Returns whether the functor is defined on this block.
ValueType evaluate(const ElemSideQpArg &, const StateArg &) const override
ValueType evaluate(const FaceArg &, const StateArg &) const override
GradientType evaluateGradient(const PointArg &, const StateArg &) const override
Abstract base class that can be used to hold collections of functors.
virtual void residualSetup()=0
virtual void timestepSetup()=0
virtual void jacobianSetup()=0
virtual void customSetup(const ExecFlagType &exec_type)=0
Base class template for functor objects.
virtual DotType evaluateDot(const FaceArg &, const StateArg &) const
virtual GradientType evaluateGradDot(const PointArg &, const StateArg &) const
DotType dot(const ElemQpArg &qp, 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.
GradientType gradient(const NodeArg &node, const StateArg &state) const
GradientType gradient(const FaceArg &face, const StateArg &state) const
DotType dot(const NodeArg &node, const StateArg &state) const
virtual GradientType evaluateGradDot(const NodeArg &, const StateArg &) const
GradientType gradDot(const NodeArg &node, const StateArg &state) const
virtual bool isExtrapolatedBoundaryFace(const FaceInfo &, const Elem *, const StateArg &) const
Returns whether this (sided) face is an extrapolated boundary face for this functor.
GradientType gradient(const ElemSideQpArg &qp, const StateArg &state) const
virtual GradientType evaluateGradDot(const ElemQpArg &, const StateArg &) const
ValueType operator()(const ElemArg &elem, const StateArg &state) const
Same as their evaluate overloads with the same arguments but allows for caching implementation.
virtual GradientType evaluateGradient(const ElemPointArg &, const StateArg &) const
Evaluate the functor gradient with a given element and point.
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 tem...
void setCacheClearanceSchedule(const std::set< ExecFlagType > &clearance_schedule)
Set how often to clear the functor evaluation cache.
virtual GradientType evaluateGradDot(const ElemSideQpArg &, const StateArg &) const
virtual GradientType evaluateGradDot(const ElemArg &, const StateArg &) const
Evaluate the functor gradient-dot with a given element.
bool _always_evaluate
Boolean to check if we always need evaluation.
ValueType operator()(const NodeArg &node, const StateArg &state) const
void clearCacheData()
clear cache data
GradientType gradient(const ElemPointArg &elem_point, const StateArg &state) const
void checkFace(const Moose::FaceArg &face) const
Examines the incoming face argument.
typename FunctorReturnType< T, FunctorEvaluationKind::Gradient >::type GradientType
This rigmarole makes it so that a user can create functors that return containers (std::vector,...
dof_id_type _current_qp_map_key
Current key for qp map cache.
GradientType gradient(const PointArg &point, const StateArg &state) const
virtual bool supportsFaceArg() const =0
Whether this functor supports evaluation with FaceArg.
virtual DotType evaluateDot(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 ValueType evaluate(const ElemArg &elem, const StateArg &state) const =0
Evaluate the functor with a given element.
ValueType operator()(const ElemSideQpArg &qp, const StateArg &state) const
const MooseFunctorName & functorName() const
Return the functor name.
virtual GradientType evaluateGradient(const ElemQpArg &, const StateArg &) const
virtual bool hasBlocks(SubdomainID) const
Returns whether the functor is defined on this block.
GradientType gradDot(const FaceArg &face, const StateArg &state) const
DotType dot(const FaceArg &face, const StateArg &state) const
std::map< ElemArg, ValueType > _elem_arg_to_value
Map from element arguments to their cached evaluations.
ValueType operator()(const PointArg &point, const StateArg &state) const
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
virtual void residualSetup() override
virtual bool supportsElemSideQpArg() const =0
Whether this functor supports evaluation with ElemSideQpArg.
virtual DotType evaluateDot(const ElemArg &, const StateArg &) const
Evaluate the functor time derivative with a given element.
virtual ValueType evaluate(const NodeArg &node, const StateArg &state) const =0
DotType dot(const PointArg &point, const StateArg &state) const
std::unordered_map< dof_id_type, std::vector< std::pair< bool, ValueType > > > _qp_to_value
Cached element quadrature point functor property evaluations.
GradientType gradDot(const ElemSideQpArg &qp, const StateArg &state) const
virtual GradientType evaluateGradient(const NodeArg &, const StateArg &) const
bool isInternalFace(const FaceInfo &) const
Returns true if the face is an internal face.
virtual DotType evaluateDot(const ElemPointArg &, const StateArg &) const
Evaluate the functor time derivative with a given element and point.
virtual GradientType evaluateGradient(const ElemSideQpArg &, const StateArg &) const
GradientType gradDot(const ElemQpArg &qp, const StateArg &state) const
virtual ValueType evaluate(const PointArg &, const StateArg &) const
Evaluate the functor at a physical point without any mesh information.
ValueType operator()(const ElemQpArg &qp, 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 implementatio...
std::map< FaceArg, ValueType > _face_arg_to_value
Map from face arguments to their cached evaluations.
ValueType queryFVArgCache(std::map< SpaceArg, ValueType > &cache_data, const SpaceArg &space) const
check a finite volume spatial argument cache and if invalid then evaluate
virtual ValueType evaluate(const FaceArg &face, const StateArg &state) const =0
DotType dot(const ElemPointArg &elem_point, const StateArg &state) const
virtual void timestepSetup() override
virtual DotType evaluateDot(const NodeArg &, const StateArg &) const
ValueType operator()(const FaceArg &face, const StateArg &state) const
virtual GradientType evaluateGradDot(const FaceArg &, const StateArg &) const
virtual DotType evaluateDot(const ElemQpArg &, const StateArg &) const
FunctorBase(const FunctorBase< T > &, const Moose::Kokkos::FunctorCopy &)
Special constructor used for Kokkos functor copy during parallel dispatch.
GradientType gradient(const ElemQpArg &qp, const StateArg &state) const
virtual ValueType evaluate(const ElemQpArg &qp, const StateArg &state) const =0
virtual GradientType evaluateGradient(const PointArg &, const StateArg &) const
std::vector< std::vector< std::pair< bool, ValueType > > > * _current_side_qp_map_value
Current value for side-qp map cache.
GradientType gradDot(const ElemArg &elem, const StateArg &state) const
Same as their evaluateGradDot overloads with the same arguments but allows for caching implementation...
std::map< NodeArg, ValueType > _node_arg_to_value
Map from nodal arguments to their cached evaluations.
virtual DotType evaluateDot(const PointArg &, const StateArg &) const
virtual bool hasFaceSide(const FaceInfo &fi, const bool fi_elem_side) const override
std::vector< std::pair< bool, ValueType > > * _current_qp_map_value
Current value for qp map cache.
virtual void customSetup(const ExecFlagType &exec_type) override
DotType dot(const ElemSideQpArg &qp, const StateArg &state) const
std::set< ExecFlagType > _clearance_schedule
How often to clear the material property cache.
FunctorBase(const MooseFunctorName &name, const std::set< ExecFlagType > &clearance_schedule={EXEC_ALWAYS})
MooseFunctorName _functor_name
name of the functor
virtual ValueType evaluate(const ElemPointArg &elem_point, const StateArg &state) const =0
Evaluate the functor with a given element and point.
dof_id_type _current_side_qp_map_key
Current key for side-qp map cache.
virtual ~FunctorBase()=default
ValueType operator()(const ElemPointArg &elem_point, const StateArg &state) const
virtual void jacobianSetup() override
GradientType gradDot(const ElemPointArg &elem_point, const StateArg &state) const
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.
virtual ValueType evaluate(const ElemSideQpArg &side_qp, const StateArg &state) const =0
GradientType gradDot(const PointArg &point, const StateArg &state) const
virtual GradientType evaluateGradient(const FaceArg &, const StateArg &) const
virtual bool isConstant() const
Returns true if this functor is a constant.
virtual GradientType evaluateGradient(const ElemArg &, const StateArg &) const
Evaluate the functor gradient with a given element.
A non-templated base class for functors that allow an owner object to hold different class template i...
virtual bool ownsWrappedFunctor() const =0
virtual ~FunctorEnvelopeBase()=default
virtual bool wrapsNull() const =0
virtual std::string returnType() const =0
FunctorEnvelopeBase()=default
virtual bool isConstant() const =0
This is a wrapper that forwards calls to the implementation, which can be switched out at any time wi...
virtual DotType evaluateDot(const FaceArg &face, const StateArg &state) const override
virtual ValueType evaluate(const FaceArg &face, const StateArg &state) const override
virtual bool wrapsNull() const override
virtual GradientType evaluateGradDot(const ElemSideQpArg &qp, const StateArg &state) const override
virtual bool isExtrapolatedBoundaryFace(const FaceInfo &fi, const Elem *const elem, const StateArg &state) const override
Returns whether this (sided) face is an extrapolated boundary face for this functor.
bool supportsElemSideQpArg() const override final
Whether this functor supports evaluation with ElemSideQpArg.
virtual ValueType evaluate(const ElemQpArg &qp, const StateArg &state) const override
virtual ValueType evaluate(const ElemPointArg &elem_point, const StateArg &state) const override
Evaluate the functor with a given element and point.
virtual GradientType evaluateGradDot(const ElemArg &elem, const StateArg &state) const override
Evaluate the functor gradient-dot with a given element.
virtual DotType evaluateDot(const ElemQpArg &qp, const StateArg &state) const override
virtual GradientType evaluateGradDot(const NodeArg &node, const StateArg &state) const override
virtual ~FunctorEnvelope()=default
virtual GradientType evaluateGradient(const ElemSideQpArg &qp, const StateArg &state) const override
void assign(const FunctorBase< T > &wrapped)
virtual GradientType evaluateGradient(const PointArg &point, const StateArg &state) const override
virtual bool isConstant() const override
Returns true if this functor is a constant.
FunctorEnvelope(FunctorEnvelope &&)=delete
virtual DotType evaluateDot(const ElemPointArg &elem_point, const StateArg &state) const override
Evaluate the functor time derivative with a given element and point.
virtual ValueType evaluate(const ElemSideQpArg &qp, const StateArg &state) const override
virtual GradientType evaluateGradDot(const ElemQpArg &qp, const StateArg &state) const override
const FunctorBase< T > * _wrapped
virtual GradientType evaluateGradDot(const PointArg &point, const StateArg &state) const override
virtual bool ownsWrappedFunctor() const override
void assign(std::unique_ptr< FunctorBase< T > > &&wrapped)
virtual GradientType evaluateGradient(const NodeArg &node, const StateArg &state) const override
void assign(FunctorBase< T > &&)=delete
Prevent wrapping of a temporary object.
virtual GradientType evaluateGradDot(const ElemPointArg &elem_point, const StateArg &state) const override
Evaluate the functor gradient-dot with a given element and point.
virtual DotType evaluateDot(const NodeArg &node, const StateArg &state) const override
virtual ValueType evaluate(const NodeArg &node, const StateArg &state) const override
virtual bool hasBlocks(const SubdomainID id) const override
Returns whether the functor is defined on this block.
virtual GradientType evaluateGradient(const ElemQpArg &qp, const StateArg &state) const override
FunctorEnvelope(const FunctorEnvelope &)=delete
virtual DotType evaluateDot(const ElemArg &elem, const StateArg &state) const override
Evaluate the functor time derivative with a given element.
virtual ValueType evaluate(const PointArg &point, const StateArg &state) const override
Evaluate the functor at a physical point without any mesh information.
std::unique_ptr< FunctorBase< T > > _owned
Our wrapped object.
virtual GradientType evaluateGradDot(const FaceArg &face, const StateArg &state) const override
virtual GradientType evaluateGradient(const ElemArg &elem, const StateArg &state) const override
Evaluate the functor gradient with a given element.
FunctorEnvelope & operator=(FunctorEnvelope &&)=delete
FunctorEnvelope(FunctorBase< T > &&)=delete
Prevent wrapping of a temporary object.
virtual std::string returnType() const override
virtual DotType evaluateDot(const PointArg &point, const StateArg &state) const override
FunctorEnvelope(const FunctorBase< T > &wrapped)
FunctorEnvelope(std::unique_ptr< FunctorBase< T > > &&wrapped)
virtual bool hasFaceSide(const FaceInfo &fi, const bool fi_elem_side) const override
virtual ValueType evaluate(const ElemArg &elem, const StateArg &state) const override
Forward calls to wrapped object.
FunctorEnvelope & operator=(const FunctorEnvelope &)=delete
virtual GradientType evaluateGradient(const FaceArg &face, const StateArg &state) const override
bool supportsFaceArg() const override final
Whether this functor supports evaluation with FaceArg.
virtual DotType evaluateDot(const ElemSideQpArg &qp, const StateArg &state) const override
virtual GradientType evaluateGradient(const ElemPointArg &elem_point, const StateArg &state) const override
Evaluate the functor gradient with a given element and point.
A functor that serves as a placeholder during the simulation setup phase if a functor consumer reques...
ValueType evaluate(const FaceArg &, const StateArg &) const override
bool supportsElemSideQpArg() const override final
Whether this functor supports evaluation with ElemSideQpArg.
ValueType evaluate(const ElemQpArg &, const StateArg &) const override
ValueType evaluate(const PointArg &, const StateArg &) const override
Evaluate the functor at a physical point without any mesh information.
bool supportsFaceArg() const override final
Whether this functor supports evaluation with FaceArg.
ValueType evaluate(const ElemSideQpArg &, const StateArg &) const override
ValueType evaluate(const ElemPointArg &, const StateArg &) const override
Evaluate the functor with a given element and point.
ValueType evaluate(const NodeArg &, const StateArg &) const override
bool hasFaceSide(const FaceInfo &fi, bool) const override
ValueType evaluate(const ElemArg &, const StateArg &) const override
Evaluate the functor with a given element.
static constexpr dof_id_type invalid_id
unsigned int n_points() const
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
std::string stringify(const T &t)
conversion to string
FunctorEvaluationKind
An enumeration of possible functor evaluation kinds.
std::string demangle(const char *name)
A structure that is used to evaluate Moose functors logically at an element/cell center.
A structure that is used to evaluate Moose functors at an arbitrary physical point contained within a...
Argument for requesting functor evaluation at a quadrature point location in an element.
const libMesh::Elem * elem
The element.
const libMesh::QBase * qrule
The quadrature rule.
unsigned int qp
The quadrature point index.
Argument for requesting functor evaluation at quadrature point locations on an element side.
const libMesh::Elem * elem
The element.
unsigned int qp
The quadrature point index.
unsigned int side
The local side index.
const libMesh::QBase * qrule
The quadrature rule.
A structure defining a "face" evaluation calling argument for Moose functors.
This structure takes an evaluation kind as a template argument and defines a constant expression indi...
FunctorReturnType< T, FunctorEvaluationKind::Gradient >::type type
MetaPhysicL::ReplaceAlgebraicType< T, typenamelibMesh::TensorTools::IncrementRank< typenameMetaPhysicL::ValueType< T >::type >::type >::type type
A structure that defines the return type of a functor based on the type of the functor and the reques...
const std::set< SubdomainID > * subdomain_ids
Indicates what subdomains this argument should be associated with.
A structure that is used to evaluate Moose functors at an arbitrary physical point,...
State argument for evaluating functors.
unsigned int state
The state.