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

A material property that is evaluated on-the-fly via calls to various overloads of operator() More...

#include <PiecewiseByBlockLambdaFunctor.h>

Inheritance diagram for PiecewiseByBlockLambdaFunctor< 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

template<typename PolymorphicLambda >
 PiecewiseByBlockLambdaFunctor (const std::string &name, PolymorphicLambda my_lammy, const std::set< ExecFlagType > &clearance_schedule, const MooseMesh &mesh, const std::set< SubdomainID > &block_ids)
 
template<typename PolymorphicLambda >
void setFunctor (const MooseMesh &mesh, const std::set< SubdomainID > &block_ids, PolymorphicLambda my_lammy)
 Set the functor that will be used in calls to evaluate overloads. More...
 
virtual ~PiecewiseByBlockLambdaFunctor ()=default
 
bool isExtrapolatedBoundaryFace (const FaceInfo &fi, const Elem *elem, const Moose::StateArg &time) const override
 Returns whether this (sided) face is an extrapolated boundary face for this functor. More...
 
bool hasBlocks (SubdomainID id) const override
 Returns whether the functor is defined on this block. More...
 
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...
 
virtual bool isConstant () const
 Returns true if this functor is a constant. More...
 
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. 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 Types

using ElemFn = std::function< T(const Moose::ElemArg &, const Moose::StateArg &)>
 
using FaceFn = std::function< T(const Moose::FaceArg &, const Moose::StateArg &)>
 
using ElemQpFn = std::function< T(const Moose::ElemQpArg &, const Moose::StateArg &)>
 
using ElemSideQpFn = std::function< T(const Moose::ElemSideQpArg &, const Moose::StateArg &)>
 
using ElemPointFn = std::function< T(const Moose::ElemPointArg &, const Moose::StateArg &)>
 
using NodeFn = std::function< T(const Moose::NodeArg &, const Moose::StateArg &)>
 

Protected Member Functions

ValueType evaluate (const Moose::ElemArg &elem_arg, const Moose::StateArg &time) const override
 Evaluate the functor with a given element. More...
 
ValueType evaluate (const Moose::FaceArg &face, const Moose::StateArg &time) const override
 
ValueType evaluate (const Moose::ElemQpArg &elem_qp, const Moose::StateArg &time) const override
 
ValueType evaluate (const Moose::ElemSideQpArg &elem_side_qp, const Moose::StateArg &time) const override
 
ValueType evaluate (const Moose::ElemPointArg &elem_point, const Moose::StateArg &time) const override
 Evaluate the functor with a given element and point. More...
 
ValueType evaluate (const Moose::NodeArg &node_arg, const Moose::StateArg &time) const override
 
GradientType evaluateGradient (const Moose::ElemArg &elem_arg, const Moose::StateArg &) const override
 Evaluate the functor gradient with a given element. More...
 
GradientType evaluateGradient (const Moose::FaceArg &face_arg, const Moose::StateArg &) const override
 
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 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. More...
 
virtual GradientType evaluateGradient (const NodeArg &, const StateArg &) const
 
virtual DotType evaluateDot (const ElemArg &, const StateArg &) const
 Evaluate the functor time derivative with a given element. More...
 
virtual DotType evaluateDot (const FaceArg &, 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. More...
 
virtual DotType evaluateDot (const NodeArg &, const StateArg &) const
 
virtual GradientType evaluateGradDot (const ElemArg &, const StateArg &) const
 Evaluate the functor gradient-dot with a given element. More...
 
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. More...
 
virtual GradientType evaluateGradDot (const NodeArg &, const StateArg &) const
 

Private Member Functions

template<typename C >
void subdomainErrorMessage (SubdomainID sub_id, const std::unordered_map< SubdomainID, C > &functors) const
 Provide a useful error message about lack of functor material property on the provided subdomain sub_id. More...
 

Private Attributes

std::unordered_map< SubdomainID, ElemFn_elem_functor
 Functors that return element average values (or cell centroid values or whatever the implementer wants to return for a given element argument) More...
 
std::unordered_map< SubdomainID, FaceFn_face_functor
 Functors that return the property value on the requested side of the face (e.g. More...
 
std::unordered_map< SubdomainID, ElemQpFn_elem_qp_functor
 Functors that will evaluate elements at quadrature points. More...
 
std::unordered_map< SubdomainID, ElemSideQpFn_elem_side_qp_functor
 Functors that will evaluate elements at side quadrature points. More...
 
std::unordered_map< SubdomainID, ElemPointFn_elem_point_functor
 Functors that return evaluations at an arbitrary physical point in an element. More...
 
std::unordered_map< SubdomainID, NodeFn_node_functor
 Functors that return nodal values. More...
 
const MooseMesh_mesh
 The mesh that this functor operates on. More...
 

Detailed Description

template<typename T>
class PiecewiseByBlockLambdaFunctor< T >

A material property that is evaluated on-the-fly via calls to various overloads of operator()

Definition at line 32 of file PiecewiseByBlockLambdaFunctor.h.

Member Typedef Documentation

◆ DotType

template<typename T>
using Moose::FunctorBase< T >::DotType = ValueType
inherited

Definition at line 150 of file MooseFunctor.h.

◆ ElemFn

template<typename T >
using PiecewiseByBlockLambdaFunctor< T >::ElemFn = std::function<T(const Moose::ElemArg &, const Moose::StateArg &)>
protected

Definition at line 70 of file PiecewiseByBlockLambdaFunctor.h.

◆ ElemPointFn

template<typename T >
using PiecewiseByBlockLambdaFunctor< T >::ElemPointFn = std::function<T(const Moose::ElemPointArg &, const Moose::StateArg &)>
protected

Definition at line 74 of file PiecewiseByBlockLambdaFunctor.h.

◆ ElemQpFn

template<typename T >
using PiecewiseByBlockLambdaFunctor< T >::ElemQpFn = std::function<T(const Moose::ElemQpArg &, const Moose::StateArg &)>
protected

Definition at line 72 of file PiecewiseByBlockLambdaFunctor.h.

◆ ElemSideQpFn

template<typename T >
using PiecewiseByBlockLambdaFunctor< T >::ElemSideQpFn = std::function<T(const Moose::ElemSideQpArg &, const Moose::StateArg &)>
protected

Definition at line 73 of file PiecewiseByBlockLambdaFunctor.h.

◆ FaceFn

template<typename T >
using PiecewiseByBlockLambdaFunctor< T >::FaceFn = std::function<T(const Moose::FaceArg &, const Moose::StateArg &)>
protected

Definition at line 71 of file PiecewiseByBlockLambdaFunctor.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.

◆ NodeFn

template<typename T >
using PiecewiseByBlockLambdaFunctor< T >::NodeFn = std::function<T(const Moose::NodeArg &, const Moose::StateArg &)>
protected

Definition at line 75 of file PiecewiseByBlockLambdaFunctor.h.

◆ ValueType

template<typename T>
using Moose::FunctorBase< T >::ValueType = T
inherited

Definition at line 141 of file MooseFunctor.h.

Constructor & Destructor Documentation

◆ PiecewiseByBlockLambdaFunctor()

template<typename T >
template<typename PolymorphicLambda >
PiecewiseByBlockLambdaFunctor< T >::PiecewiseByBlockLambdaFunctor ( const std::string &  name,
PolymorphicLambda  my_lammy,
const std::set< ExecFlagType > &  clearance_schedule,
const MooseMesh mesh,
const std::set< SubdomainID > &  block_ids 
)

Definition at line 129 of file PiecewiseByBlockLambdaFunctor.h.

135  : Moose::FunctorBase<T>(name, clearance_schedule), _mesh(mesh)
136 {
137  setFunctor(mesh, block_ids, my_lammy);
138 }
std::string name(const ElemQuality q)
Base class template for functor objects.
Definition: MooseFunctor.h:137
void setFunctor(const MooseMesh &mesh, const std::set< SubdomainID > &block_ids, PolymorphicLambda my_lammy)
Set the functor that will be used in calls to evaluate overloads.
const MooseMesh & _mesh
The mesh that this functor operates on.

◆ ~PiecewiseByBlockLambdaFunctor()

template<typename T >
virtual PiecewiseByBlockLambdaFunctor< T >::~PiecewiseByBlockLambdaFunctor ( )
virtualdefault

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

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

◆ customSetup()

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

Implements Moose::FunctorAbstract.

Reimplemented in Function.

Definition at line 839 of file MooseFunctor.h.

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

◆ dot() [1/6]

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

Same as their evaluateDot overloads with the same arguments but allows for caching implementation.

These are the methods a user will call in their code

Definition at line 890 of file MooseFunctor.h.

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

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

◆ dot() [2/6]

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

Definition at line 897 of file MooseFunctor.h.

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

◆ dot() [3/6]

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

Definition at line 905 of file MooseFunctor.h.

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

◆ dot() [4/6]

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

Definition at line 912 of file MooseFunctor.h.

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

◆ dot() [5/6]

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

Definition at line 919 of file MooseFunctor.h.

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

◆ dot() [6/6]

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

Definition at line 926 of file MooseFunctor.h.

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

◆ evaluate() [1/6]

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

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

Definition at line 234 of file PiecewiseByBlockLambdaFunctor.h.

236 {
237  const Elem * const elem = elem_arg.elem;
238  mooseAssert(elem && elem != libMesh::remote_elem,
239  "The element must be non-null and non-remote in functor material properties");
240  auto it = _elem_functor.find(elem->subdomain_id());
241  if (it == _elem_functor.end())
242  subdomainErrorMessage(elem->subdomain_id(), _elem_functor);
243 
244  return it->second(elem_arg, time);
245 }
std::unordered_map< SubdomainID, ElemFn > _elem_functor
Functors that return element average values (or cell centroid values or whatever the implementer want...
void subdomainErrorMessage(SubdomainID sub_id, const std::unordered_map< SubdomainID, C > &functors) const
Provide a useful error message about lack of functor material property on the provided subdomain sub_...
const libMesh::Elem * elem
const RemoteElem * remote_elem

◆ evaluate() [2/6]

template<typename T >
PiecewiseByBlockLambdaFunctor< T >::ValueType PiecewiseByBlockLambdaFunctor< T >::evaluate ( const Moose::FaceArg face,
const Moose::StateArg state 
) const
overrideprotectedvirtual
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 249 of file PiecewiseByBlockLambdaFunctor.h.

251 {
252  using namespace Moose::FV;
253 
254  if (face.face_side)
255  {
256  const auto sub_id = face.face_side->subdomain_id();
257  auto it = _face_functor.find(sub_id);
258  if (it == _face_functor.end())
260 
261  return it->second(face, time);
262  }
263 
264  mooseAssert(this->isInternalFace(*face.fi),
265  "If we did not have a face side, then we must be an internal face");
266  return interpolate(*this, face, time);
267 }
const libMesh::Elem * face_side
A member that can be used to indicate whether there is a sidedness to this face.
void subdomainErrorMessage(SubdomainID sub_id, const std::unordered_map< SubdomainID, C > &functors) const
Provide a useful error message about lack of functor material property on the provided subdomain sub_...
bool isInternalFace(const FaceInfo &) const
Returns true if the face is an internal face.
Definition: MooseFunctor.h:569
std::unordered_map< SubdomainID, FaceFn > _face_functor
Functors that return the property value on the requested side of the face (e.g.
const FaceInfo * fi
a face information object which defines our location in space
subdomain_id_type subdomain_id() const
void interpolate(InterpMethod m, T &result, const T2 &value1, const T3 &value2, const FaceInfo &fi, const bool one_is_elem)
Provides interpolation of face values for non-advection-specific purposes (although it can/will still...
Definition: MathFVUtils.h:282

◆ evaluate() [3/6]

template<typename T >
PiecewiseByBlockLambdaFunctor< T >::ValueType PiecewiseByBlockLambdaFunctor< T >::evaluate ( const Moose::ElemQpArg qp,
const Moose::StateArg state 
) const
overrideprotectedvirtual
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 271 of file PiecewiseByBlockLambdaFunctor.h.

273 {
274  const auto sub_id = elem_qp.elem->subdomain_id();
275  auto it = _elem_qp_functor.find(sub_id);
276  if (it == _elem_qp_functor.end())
278 
279  return it->second(elem_qp, time);
280 }
void subdomainErrorMessage(SubdomainID sub_id, const std::unordered_map< SubdomainID, C > &functors) const
Provide a useful error message about lack of functor material property on the provided subdomain sub_...
std::unordered_map< SubdomainID, ElemQpFn > _elem_qp_functor
Functors that will evaluate elements at quadrature points.

◆ evaluate() [4/6]

template<typename T >
PiecewiseByBlockLambdaFunctor< T >::ValueType PiecewiseByBlockLambdaFunctor< T >::evaluate ( const Moose::ElemSideQpArg side_qp,
const Moose::StateArg state 
) const
overrideprotectedvirtual
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 284 of file PiecewiseByBlockLambdaFunctor.h.

286 {
287  const auto sub_id = elem_side_qp.elem->subdomain_id();
288  auto it = _elem_side_qp_functor.find(sub_id);
289  if (it == _elem_side_qp_functor.end())
291 
292  return it->second(elem_side_qp, time);
293 }
std::unordered_map< SubdomainID, ElemSideQpFn > _elem_side_qp_functor
Functors that will evaluate elements at side quadrature points.
void subdomainErrorMessage(SubdomainID sub_id, const std::unordered_map< SubdomainID, C > &functors) const
Provide a useful error message about lack of functor material property on the provided subdomain sub_...

◆ evaluate() [5/6]

template<typename T >
PiecewiseByBlockLambdaFunctor< T >::ValueType PiecewiseByBlockLambdaFunctor< T >::evaluate ( const Moose::ElemPointArg elem_point,
const Moose::StateArg state 
) const
overrideprotectedvirtual

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 297 of file PiecewiseByBlockLambdaFunctor.h.

299 {
300  const Elem * const elem = elem_point_arg.elem;
301  mooseAssert(elem && elem != libMesh::remote_elem,
302  "The element must be non-null and non-remote in functor material properties");
303  auto it = _elem_point_functor.find(elem->subdomain_id());
304  if (it == _elem_point_functor.end())
305  subdomainErrorMessage(elem->subdomain_id(), _elem_point_functor);
306 
307  return it->second(elem_point_arg, time);
308 }
std::unordered_map< SubdomainID, ElemPointFn > _elem_point_functor
Functors that return evaluations at an arbitrary physical point in an element.
void subdomainErrorMessage(SubdomainID sub_id, const std::unordered_map< SubdomainID, C > &functors) const
Provide a useful error message about lack of functor material property on the provided subdomain sub_...
const RemoteElem * remote_elem

◆ evaluate() [6/6]

template<typename T >
PiecewiseByBlockLambdaFunctor< T >::ValueType PiecewiseByBlockLambdaFunctor< T >::evaluate ( const Moose::NodeArg node_arg,
const Moose::StateArg time 
) const
overrideprotectedvirtual

Implements Moose::FunctorBase< T >.

Definition at line 312 of file PiecewiseByBlockLambdaFunctor.h.

314 {
315  mooseAssert(node_arg.node, "The node must be non-null in functor material properties");
316  if (node_arg.subdomain_ids->size() != 1)
317  mooseError("We do not currently support multi-subdomain evaluation of nodal arguments");
318  const auto sub_id = *(node_arg.subdomain_ids->begin());
319  auto it = _node_functor.find(sub_id);
320  if (it == _node_functor.end())
322 
323  return it->second(node_arg, time);
324 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
void subdomainErrorMessage(SubdomainID sub_id, const std::unordered_map< SubdomainID, C > &functors) const
Provide a useful error message about lack of functor material property on the provided subdomain sub_...
const libMesh::Node * node
The node which defines our location in space.
const std::set< SubdomainID > * subdomain_ids
Indicates what subdomains this argument should be associated with.
std::unordered_map< SubdomainID, NodeFn > _node_functor
Functors that return nodal values.

◆ evaluateDot() [1/6]

template<typename T>
virtual DotType Moose::FunctorBase< T >::evaluateDot ( const ElemArg ,
const StateArg  
) const
inlineprotectedvirtualinherited

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 in Moose::ConstantFunctor< T >, Moose::FunctorEnvelope< T >, Moose::FunctorEnvelope< ADReal >, Moose::FunctorEnvelope< GenericReal< is_ad > >, Moose::FunctorEnvelope< GenericRealVectorValue< is_ad > >, Moose::FunctorEnvelope< VectorValue< Real > >, Moose::FunctorEnvelope< Moose::GenericType< T, is_ad > >, Moose::FunctorEnvelope< VectorValue< GenericReal< is_ad > > >, Moose::FunctorEnvelope< Moose::GenericType< Real, is_ad > >, Moose::FunctorEnvelope< Real >, Moose::FunctorEnvelope< libMesh::VectorValue >, MooseVariableFE< OutputType >, MooseVariableFE< ComputeValueType >, MooseVariableFE< T >, MooseVariableFE< RealEigenVector >, MooseVariableFE< VectorValue< Real > >, MooseVariableFE< RealVectorValue >, MooseVariableFE< Real >, MooseVariableFV< OutputType >, MooseVariableFV< ComputeValueType >, MooseVariableFV< T >, MooseVariableFV< RealEigenVector >, MooseVariableFV< RealVectorValue >, MooseVariableFV< Real >, MooseLinearVariableFV< OutputType >, MooseLinearVariableFV< ComputeValueType >, MooseLinearVariableFV< T >, MooseLinearVariableFV< RealEigenVector >, MooseLinearVariableFV< RealVectorValue >, MooseLinearVariableFV< Real >, Function, Postprocessor, Moose::ADWrapperFunctor< T >, Moose::RawValueFunctor< T >, and Moose::VectorCompositeFunctor< T >.

Definition at line 385 of file MooseFunctor.h.

386  {
387  mooseError("Element time derivative not implemented for functor " + functorName());
388  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:170

◆ evaluateDot() [2/6]

template<typename T>
virtual DotType Moose::FunctorBase< T >::evaluateDot ( const FaceArg ,
const StateArg  
) const
inlineprotectedvirtualinherited
Parameters
faceSee the FaceArg doxygen
stateSee the StateArg doxygen
Returns
The functor time derivative evaluated at the requested state and space

Reimplemented in Moose::ConstantFunctor< T >, Moose::FunctorEnvelope< T >, Moose::FunctorEnvelope< ADReal >, Moose::FunctorEnvelope< GenericReal< is_ad > >, Moose::FunctorEnvelope< GenericRealVectorValue< is_ad > >, Moose::FunctorEnvelope< VectorValue< Real > >, Moose::FunctorEnvelope< Moose::GenericType< T, is_ad > >, Moose::FunctorEnvelope< VectorValue< GenericReal< is_ad > > >, Moose::FunctorEnvelope< Moose::GenericType< Real, is_ad > >, Moose::FunctorEnvelope< Real >, Moose::FunctorEnvelope< libMesh::VectorValue >, MooseVariableFE< OutputType >, MooseVariableFE< ComputeValueType >, MooseVariableFE< T >, MooseVariableFE< RealEigenVector >, MooseVariableFE< VectorValue< Real > >, MooseVariableFE< RealVectorValue >, MooseVariableFE< Real >, MooseVariableFV< OutputType >, MooseVariableFV< ComputeValueType >, MooseVariableFV< T >, MooseVariableFV< RealEigenVector >, MooseVariableFV< RealVectorValue >, MooseVariableFV< Real >, Function, Moose::ADWrapperFunctor< T >, Postprocessor, Moose::RawValueFunctor< T >, and Moose::VectorCompositeFunctor< T >.

Definition at line 395 of file MooseFunctor.h.

396  {
397  mooseError("Face time derivative not implemented for functor " + functorName());
398  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:170

◆ evaluateDot() [3/6]

template<typename T>
virtual DotType Moose::FunctorBase< 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

Reimplemented in Moose::ConstantFunctor< T >, Moose::FunctorEnvelope< T >, Moose::FunctorEnvelope< ADReal >, Moose::FunctorEnvelope< GenericReal< is_ad > >, Moose::FunctorEnvelope< GenericRealVectorValue< is_ad > >, Moose::FunctorEnvelope< VectorValue< Real > >, Moose::FunctorEnvelope< Moose::GenericType< T, is_ad > >, Moose::FunctorEnvelope< VectorValue< GenericReal< is_ad > > >, Moose::FunctorEnvelope< Moose::GenericType< Real, is_ad > >, Moose::FunctorEnvelope< Real >, Moose::FunctorEnvelope< libMesh::VectorValue >, MooseVariableFE< OutputType >, MooseVariableFE< ComputeValueType >, MooseVariableFE< T >, MooseVariableFE< RealEigenVector >, MooseVariableFE< VectorValue< Real > >, MooseVariableFE< RealVectorValue >, MooseVariableFE< Real >, MooseVariableFV< OutputType >, MooseVariableFV< ComputeValueType >, MooseVariableFV< T >, MooseVariableFV< RealEigenVector >, MooseVariableFV< RealVectorValue >, MooseVariableFV< Real >, Function, Moose::ADWrapperFunctor< T >, Postprocessor, and Moose::RawValueFunctor< T >.

Definition at line 405 of file MooseFunctor.h.

406  {
407  mooseError("Element quadrature point time derivative not implemented for functor " +
408  functorName());
409  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:170

◆ evaluateDot() [4/6]

template<typename T>
virtual DotType Moose::FunctorBase< T >::evaluateDot ( const ElemSideQpArg ,
const StateArg  
) const
inlineprotectedvirtualinherited

◆ evaluateDot() [5/6]

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

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

Reimplemented in Moose::ConstantFunctor< T >, Moose::FunctorEnvelope< T >, Moose::FunctorEnvelope< ADReal >, Moose::FunctorEnvelope< GenericReal< is_ad > >, Moose::FunctorEnvelope< GenericRealVectorValue< is_ad > >, Moose::FunctorEnvelope< VectorValue< Real > >, Moose::FunctorEnvelope< Moose::GenericType< T, is_ad > >, Moose::FunctorEnvelope< VectorValue< GenericReal< is_ad > > >, Moose::FunctorEnvelope< Moose::GenericType< Real, is_ad > >, Moose::FunctorEnvelope< Real >, Moose::FunctorEnvelope< libMesh::VectorValue >, Function, Moose::ADWrapperFunctor< T >, Moose::RawValueFunctor< T >, and Postprocessor.

Definition at line 425 of file MooseFunctor.h.

426  {
427  mooseError("Element-point time derivative not implemented for functor " + functorName());
428  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:170

◆ evaluateDot() [6/6]

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

◆ evaluateGradDot() [1/6]

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

◆ evaluateGradDot() [2/6]

template<typename T>
virtual GradientType Moose::FunctorBase< 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

Reimplemented in Moose::ConstantFunctor< T >, Moose::FunctorEnvelope< T >, Moose::FunctorEnvelope< ADReal >, Moose::FunctorEnvelope< GenericReal< is_ad > >, Moose::FunctorEnvelope< GenericRealVectorValue< is_ad > >, Moose::FunctorEnvelope< VectorValue< Real > >, Moose::FunctorEnvelope< Moose::GenericType< T, is_ad > >, Moose::FunctorEnvelope< VectorValue< GenericReal< is_ad > > >, Moose::FunctorEnvelope< Moose::GenericType< Real, is_ad > >, Moose::FunctorEnvelope< Real >, Moose::FunctorEnvelope< libMesh::VectorValue >, Moose::ADWrapperFunctor< T >, Moose::RawValueFunctor< T >, and Moose::VectorComponentFunctor< T >.

Definition at line 449 of file MooseFunctor.h.

450  {
451  mooseError("Face gradient-dot not implemented for functor " + functorName());
452  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:170

◆ evaluateGradDot() [3/6]

template<typename T>
virtual GradientType Moose::FunctorBase< 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

Reimplemented in Moose::ConstantFunctor< T >, Moose::FunctorEnvelope< T >, Moose::FunctorEnvelope< ADReal >, Moose::FunctorEnvelope< GenericReal< is_ad > >, Moose::FunctorEnvelope< GenericRealVectorValue< is_ad > >, Moose::FunctorEnvelope< VectorValue< Real > >, Moose::FunctorEnvelope< Moose::GenericType< T, is_ad > >, Moose::FunctorEnvelope< VectorValue< GenericReal< is_ad > > >, Moose::FunctorEnvelope< Moose::GenericType< Real, is_ad > >, Moose::FunctorEnvelope< Real >, Moose::FunctorEnvelope< libMesh::VectorValue >, Moose::ADWrapperFunctor< T >, and Moose::RawValueFunctor< T >.

Definition at line 459 of file MooseFunctor.h.

460  {
461  mooseError("Element quadrature point gradient-dot not implemented for functor " +
462  functorName());
463  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:170

◆ evaluateGradDot() [4/6]

template<typename T>
virtual GradientType Moose::FunctorBase< 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

Reimplemented in Moose::ConstantFunctor< T >, Moose::FunctorEnvelope< T >, Moose::FunctorEnvelope< ADReal >, Moose::FunctorEnvelope< GenericReal< is_ad > >, Moose::FunctorEnvelope< GenericRealVectorValue< is_ad > >, Moose::FunctorEnvelope< VectorValue< Real > >, Moose::FunctorEnvelope< Moose::GenericType< T, is_ad > >, Moose::FunctorEnvelope< VectorValue< GenericReal< is_ad > > >, Moose::FunctorEnvelope< Moose::GenericType< Real, is_ad > >, Moose::FunctorEnvelope< Real >, Moose::FunctorEnvelope< libMesh::VectorValue >, Moose::ADWrapperFunctor< T >, and Moose::RawValueFunctor< T >.

Definition at line 470 of file MooseFunctor.h.

471  {
472  mooseError("Element side quadrature point gradient-dot not implemented for functor " +
473  functorName());
474  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:170

◆ evaluateGradDot() [5/6]

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

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

Reimplemented in Moose::ConstantFunctor< T >, Moose::FunctorEnvelope< T >, Moose::FunctorEnvelope< ADReal >, Moose::FunctorEnvelope< GenericReal< is_ad > >, Moose::FunctorEnvelope< GenericRealVectorValue< is_ad > >, Moose::FunctorEnvelope< VectorValue< Real > >, Moose::FunctorEnvelope< Moose::GenericType< T, is_ad > >, Moose::FunctorEnvelope< VectorValue< GenericReal< is_ad > > >, Moose::FunctorEnvelope< Moose::GenericType< Real, is_ad > >, Moose::FunctorEnvelope< Real >, Moose::FunctorEnvelope< libMesh::VectorValue >, Moose::ADWrapperFunctor< T >, and Moose::RawValueFunctor< T >.

Definition at line 479 of file MooseFunctor.h.

480  {
481  mooseError("Element-point gradient-dot not implemented for functor " + functorName());
482  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:170

◆ evaluateGradDot() [6/6]

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

◆ evaluateGradient() [1/6]

template<typename T >
PiecewiseByBlockLambdaFunctor< T >::GradientType PiecewiseByBlockLambdaFunctor< T >::evaluateGradient ( const Moose::ElemArg ,
const Moose::StateArg  
) const
overrideprotectedvirtual

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 328 of file PiecewiseByBlockLambdaFunctor.h.

330 {
331  return Moose::FV::greenGaussGradient(elem_arg, time, *this, true, _mesh);
332 }
libMesh::VectorValue< T > greenGaussGradient(const ElemArg &elem_arg, const StateArg &state_arg, const FunctorBase< T > &functor, const bool two_term_boundary_expansion, const MooseMesh &mesh, const bool force_green_gauss=false)
Compute a cell gradient using the method of Green-Gauss.
const MooseMesh & _mesh
The mesh that this functor operates on.

◆ evaluateGradient() [2/6]

template<typename T >
PiecewiseByBlockLambdaFunctor< T >::GradientType PiecewiseByBlockLambdaFunctor< T >::evaluateGradient ( const Moose::FaceArg ,
const Moose::StateArg  
) const
overrideprotectedvirtual
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 336 of file PiecewiseByBlockLambdaFunctor.h.

338 {
339  return Moose::FV::greenGaussGradient(face_arg, time, *this, true, _mesh);
340 }
libMesh::VectorValue< T > greenGaussGradient(const ElemArg &elem_arg, const StateArg &state_arg, const FunctorBase< T > &functor, const bool two_term_boundary_expansion, const MooseMesh &mesh, const bool force_green_gauss=false)
Compute a cell gradient using the method of Green-Gauss.
const MooseMesh & _mesh
The mesh that this functor operates on.

◆ evaluateGradient() [3/6]

template<typename T>
virtual GradientType Moose::FunctorBase< 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

Reimplemented in Moose::ConstantFunctor< T >, Moose::FunctorEnvelope< T >, Moose::FunctorEnvelope< ADReal >, Moose::FunctorEnvelope< GenericReal< is_ad > >, Moose::FunctorEnvelope< GenericRealVectorValue< is_ad > >, Moose::FunctorEnvelope< VectorValue< Real > >, Moose::FunctorEnvelope< Moose::GenericType< T, is_ad > >, Moose::FunctorEnvelope< VectorValue< GenericReal< is_ad > > >, Moose::FunctorEnvelope< Moose::GenericType< Real, is_ad > >, Moose::FunctorEnvelope< Real >, Moose::FunctorEnvelope< libMesh::VectorValue >, MooseVariableFE< OutputType >, MooseVariableFE< ComputeValueType >, MooseVariableFE< T >, MooseVariableFE< RealEigenVector >, MooseVariableFE< VectorValue< Real > >, MooseVariableFE< RealVectorValue >, MooseVariableFE< Real >, MooseVariableFV< OutputType >, MooseVariableFV< ComputeValueType >, MooseVariableFV< T >, MooseVariableFV< RealEigenVector >, MooseVariableFV< RealVectorValue >, MooseVariableFV< Real >, MooseLinearVariableFV< OutputType >, MooseLinearVariableFV< ComputeValueType >, MooseLinearVariableFV< T >, MooseLinearVariableFV< RealEigenVector >, MooseLinearVariableFV< RealVectorValue >, MooseLinearVariableFV< Real >, Function, Postprocessor, Moose::ADWrapperFunctor< T >, and Moose::RawValueFunctor< T >.

Definition at line 352 of file MooseFunctor.h.

353  {
354  mooseError("Element quadrature point gradient not implemented for functor " + functorName());
355  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:170

◆ evaluateGradient() [4/6]

template<typename T>
virtual GradientType Moose::FunctorBase< T >::evaluateGradient ( const ElemSideQpArg ,
const StateArg  
) const
inlineprotectedvirtualinherited

◆ evaluateGradient() [5/6]

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

Evaluate the functor gradient with a given element and point.

Reimplemented in Moose::ConstantFunctor< T >, Moose::FunctorEnvelope< T >, Moose::FunctorEnvelope< ADReal >, Moose::FunctorEnvelope< GenericReal< is_ad > >, Moose::FunctorEnvelope< GenericRealVectorValue< is_ad > >, Moose::FunctorEnvelope< VectorValue< Real > >, Moose::FunctorEnvelope< Moose::GenericType< T, is_ad > >, Moose::FunctorEnvelope< VectorValue< GenericReal< is_ad > > >, Moose::FunctorEnvelope< Moose::GenericType< Real, is_ad > >, Moose::FunctorEnvelope< Real >, Moose::FunctorEnvelope< libMesh::VectorValue >, Function, Postprocessor, Moose::ADWrapperFunctor< T >, and Moose::RawValueFunctor< T >.

Definition at line 371 of file MooseFunctor.h.

372  {
373  mooseError("Element-point gradient not implemented for functor " + functorName());
374  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:170

◆ evaluateGradient() [6/6]

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

◆ functorName()

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

◆ genericEvaluate()

template<typename T >
template<FunctorEvaluationKind FET, typename Space , typename State >
FunctorReturnType< T, FET >::type Moose::FunctorBase< T >::genericEvaluate ( const Space &  r,
const State &  state 
) const
inherited

Perform a generic evaluation based on the supplied template argument FET and supplied spatial and temporal arguments.

Definition at line 987 of file MooseFunctor.h.

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

◆ gradDot() [1/6]

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

Same as their evaluateGradDot overloads with the same arguments but allows for caching implementation.

These are the methods a user will call in their code

Definition at line 933 of file MooseFunctor.h.

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

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

◆ gradDot() [2/6]

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

Definition at line 940 of file MooseFunctor.h.

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

◆ gradDot() [3/6]

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

Definition at line 948 of file MooseFunctor.h.

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

◆ gradDot() [4/6]

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

Definition at line 955 of file MooseFunctor.h.

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

◆ gradDot() [5/6]

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

Definition at line 962 of file MooseFunctor.h.

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

◆ gradDot() [6/6]

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

Definition at line 969 of file MooseFunctor.h.

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

◆ gradient() [1/6]

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

Same as their evaluateGradient overloads with the same arguments but allows for caching implementation.

These are the methods a user will call in their code

Definition at line 847 of file MooseFunctor.h.

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

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

◆ gradient() [2/6]

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

Definition at line 854 of file MooseFunctor.h.

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

◆ gradient() [3/6]

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

Definition at line 862 of file MooseFunctor.h.

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

◆ gradient() [4/6]

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

Definition at line 869 of file MooseFunctor.h.

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

◆ gradient() [5/6]

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

Definition at line 876 of file MooseFunctor.h.

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

◆ gradient() [6/6]

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

Definition at line 883 of file MooseFunctor.h.

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

◆ hasBlocks()

template<typename T >
bool PiecewiseByBlockLambdaFunctor< T >::hasBlocks ( SubdomainID  ) const
overridevirtual

Returns whether the functor is defined on this block.

Reimplemented from Moose::FunctorBase< T >.

Definition at line 197 of file PiecewiseByBlockLambdaFunctor.h.

198 {
199  // If any of the maps has a functor for that block, it has the block
200  const bool has_blocks = _elem_functor.count(id);
201  mooseAssert(has_blocks == _face_functor.count(id),
202  "All functor sets should agree on whether we have this sub id");
203  mooseAssert(has_blocks == _elem_qp_functor.count(id),
204  "All functor sets should agree on whether we have this sub id");
205  mooseAssert(has_blocks == _elem_side_qp_functor.count(id),
206  "All functor sets should agree on whether we have this sub id");
207  return has_blocks;
208 }
std::unordered_map< SubdomainID, ElemFn > _elem_functor
Functors that return element average values (or cell centroid values or whatever the implementer want...
std::unordered_map< SubdomainID, ElemSideQpFn > _elem_side_qp_functor
Functors that will evaluate elements at side quadrature points.
std::unordered_map< SubdomainID, ElemQpFn > _elem_qp_functor
Functors that will evaluate elements at quadrature points.
std::unordered_map< SubdomainID, FaceFn > _face_functor
Functors that return the property value on the requested side of the face (e.g.

◆ hasFaceSide()

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

Implements FaceArgInterface.

Reimplemented in Moose::NullFunctor< T >, Moose::FunctorEnvelope< T >, Moose::FunctorEnvelope< ADReal >, Moose::FunctorEnvelope< GenericReal< is_ad > >, Moose::FunctorEnvelope< GenericRealVectorValue< is_ad > >, Moose::FunctorEnvelope< VectorValue< Real > >, Moose::FunctorEnvelope< Moose::GenericType< T, is_ad > >, Moose::FunctorEnvelope< VectorValue< GenericReal< is_ad > > >, Moose::FunctorEnvelope< Moose::GenericType< Real, is_ad > >, Moose::FunctorEnvelope< Real >, Moose::FunctorEnvelope< libMesh::VectorValue >, Moose::ADWrapperFunctor< T >, Moose::RawValueFunctor< T >, InternalSideIntegralVariablePostprocessor, InterfaceIntegralVariableValuePostprocessor, SideIntegralVariablePostprocessor, SideIntegralFunctorPostprocessorTempl< is_ad >, and SideIntegralFunctorPostprocessorTempl< false >.

Definition at line 976 of file MooseFunctor.h.

Referenced by SideIntegralVariablePostprocessor::hasFaceSide(), InternalSideIntegralVariablePostprocessor::hasFaceSide(), and Moose::ADWrapperFunctor< T >::hasFaceSide().

977 {
978  if (fi_elem_side)
979  return hasBlocks(fi.elem().subdomain_id());
980  else
981  return fi.neighborPtr() && hasBlocks(fi.neighbor().subdomain_id());
982 }
virtual bool hasBlocks(SubdomainID) const
Returns whether the functor is defined on this block.
Definition: MooseFunctor.h:237
const Elem & elem() const
Definition: FaceInfo.h:81
const Elem * neighborPtr() const
Definition: FaceInfo.h:84
const Elem & neighbor() const
Definition: FaceInfo.h:216

◆ isConstant()

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

◆ isExtrapolatedBoundaryFace()

template<typename T >
bool PiecewiseByBlockLambdaFunctor< T >::isExtrapolatedBoundaryFace ( const FaceInfo ,
const Elem *  ,
const Moose::StateArg  
) const
overridevirtual

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

Reimplemented from Moose::FunctorBase< T >.

Definition at line 179 of file PiecewiseByBlockLambdaFunctor.h.

182 {
183  if (!fi.neighborPtr())
184  return true;
185 
186  const bool defined_on_elem = _elem_functor.count(fi.elem().subdomain_id());
187  const bool defined_on_neighbor = _elem_functor.count(fi.neighbor().subdomain_id());
188  const bool extrapolated = (defined_on_elem + defined_on_neighbor) == 1;
189 
190  mooseAssert(defined_on_elem || defined_on_neighbor,
191  "This shouldn't be called if we aren't defined on either side.");
192  return extrapolated;
193 }
std::unordered_map< SubdomainID, ElemFn > _elem_functor
Functors that return element average values (or cell centroid values or whatever the implementer want...

◆ isInternalFace()

template<typename T >
bool Moose::FunctorBase< T >::isInternalFace ( const FaceInfo fi) const
inherited

Returns true if the face is an internal face.

Definition at line 569 of file MooseFunctor.h.

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

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

◆ jacobianSetup()

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

◆ operator()() [1/6]

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

Same as their evaluate overloads with the same arguments but allows for caching implementation.

These are the methods a user will call in their code

Definition at line 597 of file MooseFunctor.h.

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

◆ operator()() [2/6]

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

Definition at line 610 of file MooseFunctor.h.

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

◆ operator()() [3/6]

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

Definition at line 656 of file MooseFunctor.h.

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

◆ operator()() [4/6]

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

Definition at line 677 of file MooseFunctor.h.

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

◆ operator()() [5/6]

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

Definition at line 707 of file MooseFunctor.h.

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

◆ operator()() [6/6]

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

Definition at line 724 of file MooseFunctor.h.

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

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

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

◆ setFunctor()

template<typename T >
template<typename PolymorphicLambda >
void PiecewiseByBlockLambdaFunctor< T >::setFunctor ( const MooseMesh mesh,
const std::set< SubdomainID > &  block_ids,
PolymorphicLambda  my_lammy 
)

Set the functor that will be used in calls to evaluate overloads.

Parameters
meshThe mesh that the functor is defined on
block_idsThe block/subdomain IDs that the user-provided functor is valid for
my_lammyThe functor that defines how this object is evaluated

Definition at line 143 of file PiecewiseByBlockLambdaFunctor.h.

Referenced by PiecewiseByBlockLambdaFunctor< T >::PiecewiseByBlockLambdaFunctor().

146 {
147  mooseAssert(&mesh == &_mesh,
148  "We should always be setting this functor with the same mesh. We may relax this "
149  "assertion later");
150 
151  auto add_lammy = [this, my_lammy](const SubdomainID block_id)
152  {
153  auto pr = _elem_functor.emplace(block_id, my_lammy);
154  if (!pr.second)
155  mooseError("No insertion for the functor material property '",
156  this->functorName(),
157  "' for block id ",
158  block_id,
159  ". Another material must already declare this property on that block.");
160  _face_functor.emplace(block_id, my_lammy);
161  _elem_qp_functor.emplace(block_id, my_lammy);
162  _elem_side_qp_functor.emplace(block_id, my_lammy);
163  _elem_point_functor.emplace(block_id, my_lammy);
164  _node_functor.emplace(block_id, my_lammy);
165  };
166 
167  for (const auto block_id : block_ids)
168  add_lammy(block_id);
169 
170  // Handle special case of ANY_BLOCK_ID and empty block restriction that also cover
171  // INVALID_BLOCK_ID
172  if (block_ids.count(Moose::ANY_BLOCK_ID) || block_ids.empty() ||
173  block_ids == mesh.meshSubdomains())
174  add_lammy(Moose::INVALID_BLOCK_ID);
175 }
std::unordered_map< SubdomainID, ElemFn > _elem_functor
Functors that return element average values (or cell centroid values or whatever the implementer want...
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
std::unordered_map< SubdomainID, ElemPointFn > _elem_point_functor
Functors that return evaluations at an arbitrary physical point in an element.
std::unordered_map< SubdomainID, ElemSideQpFn > _elem_side_qp_functor
Functors that will evaluate elements at side quadrature points.
MeshBase & mesh
const SubdomainID INVALID_BLOCK_ID
Definition: MooseTypes.C:20
std::unordered_map< SubdomainID, ElemQpFn > _elem_qp_functor
Functors that will evaluate elements at quadrature points.
std::unordered_map< SubdomainID, NodeFn > _node_functor
Functors that return nodal values.
std::unordered_map< SubdomainID, FaceFn > _face_functor
Functors that return the property value on the requested side of the face (e.g.
const MooseMesh & _mesh
The mesh that this functor operates on.
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:170
const SubdomainID ANY_BLOCK_ID
Definition: MooseTypes.C:19

◆ subdomainErrorMessage()

template<typename T >
template<typename C >
void PiecewiseByBlockLambdaFunctor< T >::subdomainErrorMessage ( SubdomainID  sub_id,
const std::unordered_map< SubdomainID, C > &  functors 
) const
private

Provide a useful error message about lack of functor material property on the provided subdomain sub_id.

Parameters
sub_idsubdomain id on which the functor was missing
functorsmap of functors, used to show list of blocks with a definition

Definition at line 213 of file PiecewiseByBlockLambdaFunctor.h.

215 {
216  std::vector<SubdomainID> block_ids;
217  block_ids.reserve(functors.size());
218  for (const auto & [available_sub_id, functor] : functors)
219  {
220  libmesh_ignore(functor);
221  block_ids.push_back(available_sub_id);
222  }
223  mooseError("The provided subdomain ID ",
224  std::to_string(sub_id),
225  " doesn't exist in the map for lambda functor '",
226  this->functorName(),
227  "'! This is likely because you did not provide a functor material "
228  "definition on that subdomain.\nSubdomain IDs in the map: ",
229  Moose::stringify(block_ids));
230 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
void libmesh_ignore(const Args &...)
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:64
const MooseFunctorName & functorName() const
Return the functor name.
Definition: MooseFunctor.h:170

◆ supportsElemSideQpArg()

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

Whether this functor supports evaluation with ElemSideQpArg.

Implements Moose::FunctorBase< T >.

Definition at line 62 of file PiecewiseByBlockLambdaFunctor.h.

62 { return true; }

◆ supportsFaceArg()

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

Whether this functor supports evaluation with FaceArg.

Implements Moose::FunctorBase< T >.

Definition at line 61 of file PiecewiseByBlockLambdaFunctor.h.

61 { return true; }

◆ timestepSetup()

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

Member Data Documentation

◆ _elem_functor

template<typename T >
std::unordered_map<SubdomainID, ElemFn> PiecewiseByBlockLambdaFunctor< T >::_elem_functor
private

Functors that return element average values (or cell centroid values or whatever the implementer wants to return for a given element argument)

Definition at line 105 of file PiecewiseByBlockLambdaFunctor.h.

◆ _elem_point_functor

template<typename T >
std::unordered_map<SubdomainID, ElemPointFn> PiecewiseByBlockLambdaFunctor< T >::_elem_point_functor
private

Functors that return evaluations at an arbitrary physical point in an element.

Definition at line 118 of file PiecewiseByBlockLambdaFunctor.h.

◆ _elem_qp_functor

template<typename T >
std::unordered_map<SubdomainID, ElemQpFn> PiecewiseByBlockLambdaFunctor< T >::_elem_qp_functor
private

Functors that will evaluate elements at quadrature points.

Definition at line 112 of file PiecewiseByBlockLambdaFunctor.h.

◆ _elem_side_qp_functor

template<typename T >
std::unordered_map<SubdomainID, ElemSideQpFn> PiecewiseByBlockLambdaFunctor< T >::_elem_side_qp_functor
private

Functors that will evaluate elements at side quadrature points.

Definition at line 115 of file PiecewiseByBlockLambdaFunctor.h.

◆ _face_functor

template<typename T >
std::unordered_map<SubdomainID, FaceFn> PiecewiseByBlockLambdaFunctor< T >::_face_functor
private

Functors that return the property value on the requested side of the face (e.g.

the infinitesimal + or - side of the face)

Definition at line 109 of file PiecewiseByBlockLambdaFunctor.h.

◆ _mesh

template<typename T >
const MooseMesh& PiecewiseByBlockLambdaFunctor< T >::_mesh
private

The mesh that this functor operates on.

Definition at line 124 of file PiecewiseByBlockLambdaFunctor.h.

◆ _node_functor

template<typename T >
std::unordered_map<SubdomainID, NodeFn> PiecewiseByBlockLambdaFunctor< T >::_node_functor
private

Functors that return nodal values.

Definition at line 121 of file PiecewiseByBlockLambdaFunctor.h.


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