https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
NearestPointBase< UserObjectType, BaseType > Class Template Reference

This UserObject computes averages of a variable storing partial sums for the specified number of intervals in a direction (x,y,z). More...

#include <NearestPointBase.h>

Inheritance diagram for NearestPointBase< UserObjectType, BaseType >:
[legend]

Public Types

using FunctorType = FunctorBase< Real >
 
using ValueType = Real
 
using GradientType = typename FunctorReturnType< Real, 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

 NearestPointBase (const InputParameters &parameters)
 
 ~NearestPointBase ()
 
virtual void initialize () override
 
virtual void execute () override
 
virtual void finalize () override
 
virtual void threadJoin (const UserObject &y) override
 
virtual Real spatialValue (const Point &p) const override
 Given a Point return the integral value associated with the layer that point falls in for the layered average closest to that point. More...
 
virtual const std::vector< Point > & getPoints () const
 Get the points at which the nearest operation is performed. More...
 
virtual const std::vector< Point > spatialPoints () const override
 
virtual bool hasBlocks (SubdomainID sub) const override
 Returns whether the functor is defined on this block. More...
 
Real evaluateTemplate (const SpatialArg &position, const Moose::StateArg &libmesh_dbg_var(state)) const
 
FunctorReturnType< Real, 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...
 
virtual bool isExtrapolatedBoundaryFace (const FaceInfo &, const Elem *, const StateArg &) const
 Returns whether this (sided) face is an extrapolated boundary face for this functor. 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
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Types

using ElemArg = Moose::ElemArg
 
using ElemQpArg = Moose::ElemQpArg
 
using ElemSideQpArg = Moose::ElemSideQpArg
 
using FaceArg = Moose::FaceArg
 
using ElemPointArg = Moose::ElemPointArg
 
using NodeArg = Moose::NodeArg
 

Protected Member Functions

void fillPoints ()
 Fills in the _points variable from either 'points' or 'points_file' parameter. More...
 
UserObjectType & nearestUserObject (const Point &p) const
 Get the UserObject that is closest to the point. More...
 
virtual const std::string & name () const
 Get the name of the class. More...
 
virtual Real evaluate (const ElemArg &elem, const Moose::StateArg &state) const override
 Evaluate the functor with a given element. More...
 
virtual Real evaluate (const FaceArg &face, const Moose::StateArg &state) const override final
 
virtual Real evaluate (const ElemQpArg &qp, const Moose::StateArg &state) const override
 
virtual Real evaluate (const ElemSideQpArg &elem_side_qp, const Moose::StateArg &state) const override final
 
virtual Real evaluate (const ElemPointArg &elem_point, const Moose::StateArg &state) const override final
 Evaluate the functor with a given element and point. More...
 
virtual Real evaluate (const NodeArg &node, const Moose::StateArg &state) const override final
 
virtual bool supportsFaceArg () const override final
 Whether this functor supports evaluation with FaceArg. More...
 
virtual bool supportsElemSideQpArg () const override final
 Whether this functor supports evaluation with ElemSideQpArg. More...
 
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 ElemArg &, const StateArg &) const
 Evaluate the functor gradient with a given element. More...
 
virtual GradientType evaluateGradient (const FaceArg &, const StateArg &) const
 
virtual GradientType evaluateGradient (const ElemQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradient (const ElemSideQpArg &, const StateArg &) const
 
virtual GradientType evaluateGradient (const ElemPointArg &, const StateArg &) const
 Evaluate the functor gradient with a given element and point. 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
 

Protected Attributes

std::vector< Point > _points
 
std::vector< std::unique_ptr< UserObjectType > > _user_objects
 
const unsigned int _dist_norm
 
const unsigned int _axis
 

Detailed Description

template<typename UserObjectType, typename BaseType>
class NearestPointBase< UserObjectType, BaseType >

This UserObject computes averages of a variable storing partial sums for the specified number of intervals in a direction (x,y,z).

Given a list of points this object computes the layered average closest to each one of those points.

Definition at line 31 of file NearestPointBase.h.

Member Typedef Documentation

◆ DotType

using Moose::FunctorBase< Real >::DotType = ValueType
inherited

Definition at line 150 of file MooseFunctor.h.

◆ ElemArg

using SpatialUserObjectFunctor< BaseType >::ElemArg = Moose::ElemArg
protectedinherited

Definition at line 29 of file SpatialUserObjectFunctor.h.

◆ ElemPointArg

using SpatialUserObjectFunctor< BaseType >::ElemPointArg = Moose::ElemPointArg
protectedinherited

Definition at line 33 of file SpatialUserObjectFunctor.h.

◆ ElemQpArg

using SpatialUserObjectFunctor< BaseType >::ElemQpArg = Moose::ElemQpArg
protectedinherited

Definition at line 30 of file SpatialUserObjectFunctor.h.

◆ ElemSideQpArg

using SpatialUserObjectFunctor< BaseType >::ElemSideQpArg = Moose::ElemSideQpArg
protectedinherited

Definition at line 31 of file SpatialUserObjectFunctor.h.

◆ FaceArg

using SpatialUserObjectFunctor< BaseType >::FaceArg = Moose::FaceArg
protectedinherited

Definition at line 32 of file SpatialUserObjectFunctor.h.

◆ FunctorType

Definition at line 140 of file MooseFunctor.h.

◆ GradientType

using Moose::FunctorBase< Real >::GradientType = typename FunctorReturnType<Real , 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.

◆ NodeArg

using SpatialUserObjectFunctor< BaseType >::NodeArg = Moose::NodeArg
protectedinherited

Definition at line 34 of file SpatialUserObjectFunctor.h.

◆ ValueType

using Moose::FunctorBase< Real >::ValueType = Real
inherited

Definition at line 141 of file MooseFunctor.h.

Constructor & Destructor Documentation

◆ NearestPointBase()

template<typename UserObjectType , typename BaseType >
NearestPointBase< UserObjectType, BaseType >::NearestPointBase ( const InputParameters parameters)

Definition at line 125 of file NearestPointBase.h.

127  _dist_norm(this->template getParam<MooseEnum>("dist_norm")),
128  _axis(this->template getParam<MooseEnum>("axis"))
129 {
130  if (this->template getParam<MooseEnum>("dist_norm") != "radius" &&
131  parameters.isParamSetByUser("axis"))
132  this->paramError("axis", "'axis' should only be set if 'dist_norm' is set to 'radius'");
133 
134  fillPoints();
135 
136  _user_objects.resize(_points.size());
137 
138  // Build each of the UserObject objects that we will manage manually
139  // If you're looking at this in the future and want to replace this behavior,
140  // _please_ don't do it. MOOSE should manage these objects.
141  for (MooseIndex(_points) i = 0; i < _points.size(); ++i)
142  {
143  const auto uo_type = MooseUtils::prettyCppType<UserObjectType>();
144  auto sub_params = this->_app.getFactory().getValidParams(uo_type);
145  sub_params.applyParameters(parameters, {}, true);
146 
147  const auto sub_name = name() + "_sub" + std::to_string(i);
148  auto uo = this->_app.getFactory().template createUnique<UserObjectType>(
149  uo_type, sub_name, sub_params, this->_tid);
150  _user_objects[i] = std::move(uo);
151  }
152 }
std::vector< std::unique_ptr< UserObjectType > > _user_objects
void fillPoints()
Fills in the _points variable from either &#39;points&#39; or &#39;points_file&#39; parameter.
const unsigned int _axis
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was set by the user.
const unsigned int _dist_norm
std::vector< Point > _points

◆ ~NearestPointBase()

template<typename UserObjectType , typename BaseType >
NearestPointBase< UserObjectType, BaseType >::~NearestPointBase ( )

Definition at line 155 of file NearestPointBase.h.

156 {
157 }

Member Function Documentation

◆ checkFace()

void Moose::FunctorBase< Real >::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()

void Moose::FunctorBase< Real >::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]

FunctorBase< Real >::DotType Moose::FunctorBase< Real >::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.

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]

FunctorBase< Real >::DotType Moose::FunctorBase< Real >::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]

FunctorBase< Real >::DotType Moose::FunctorBase< Real >::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]

FunctorBase< Real >::DotType Moose::FunctorBase< Real >::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]

FunctorBase< Real >::DotType Moose::FunctorBase< Real >::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]

FunctorBase< Real >::DotType Moose::FunctorBase< Real >::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]

Real SpatialUserObjectFunctor< BaseType >::evaluate ( const ElemArg elem,
const Moose::StateArg state 
) const
overrideprotectedvirtualinherited

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

Definition at line 85 of file SpatialUserObjectFunctor.h.

87 {
88  return evaluateTemplate(elem, state);
89 }
Real evaluateTemplate(const SpatialArg &position, const Moose::StateArg &state) const

◆ evaluate() [2/6]

Real SpatialUserObjectFunctor< BaseType >::evaluate ( const FaceArg face,
const Moose::StateArg state 
) const
finaloverrideprotectedvirtualinherited
Parameters
faceSee the FaceArg doxygen
stateSee the StateArg doxygen
Returns
The functor evaluated at the requested state and space

Implements Moose::FunctorBase< Real >.

Definition at line 93 of file SpatialUserObjectFunctor.h.

95 {
96  return evaluateTemplate(face, state);
97 }
Real evaluateTemplate(const SpatialArg &position, const Moose::StateArg &state) const

◆ evaluate() [3/6]

Real SpatialUserObjectFunctor< BaseType >::evaluate ( const ElemQpArg qp,
const Moose::StateArg state 
) const
overrideprotectedvirtualinherited
Parameters
qpSee the ElemQpArg doxygen
stateSee the StateArg doxygen
Returns
The functor evaluated at the requested state and space

Implements Moose::FunctorBase< Real >.

Definition at line 101 of file SpatialUserObjectFunctor.h.

103 {
104  return evaluateTemplate(qp, state);
105 }
Real evaluateTemplate(const SpatialArg &position, const Moose::StateArg &state) const

◆ evaluate() [4/6]

Real SpatialUserObjectFunctor< BaseType >::evaluate ( const ElemSideQpArg elem_side_qp,
const Moose::StateArg state 
) const
finaloverrideprotectedvirtualinherited
Parameters
side_qpSee the ElemSideQpArg doxygen
stateSee the StateArg doxygen
Returns
The functor evaluated at the requested state and space

Implements Moose::FunctorBase< Real >.

Definition at line 109 of file SpatialUserObjectFunctor.h.

111 {
112  return evaluateTemplate(elem_side_qp, state);
113 }
Real evaluateTemplate(const SpatialArg &position, const Moose::StateArg &state) const

◆ evaluate() [5/6]

Real SpatialUserObjectFunctor< BaseType >::evaluate ( const ElemPointArg elem_point,
const Moose::StateArg state 
) const
finaloverrideprotectedvirtualinherited

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

Definition at line 117 of file SpatialUserObjectFunctor.h.

119 {
120  return evaluateTemplate(elem_point, state);
121 }
Real evaluateTemplate(const SpatialArg &position, const Moose::StateArg &state) const

◆ evaluate() [6/6]

Real SpatialUserObjectFunctor< BaseType >::evaluate ( const NodeArg node,
const Moose::StateArg state 
) const
finaloverrideprotectedvirtualinherited

Implements Moose::FunctorBase< Real >.

Definition at line 125 of file SpatialUserObjectFunctor.h.

127 {
128  return evaluateTemplate(node, state);
129 }
Real evaluateTemplate(const SpatialArg &position, const Moose::StateArg &state) const

◆ evaluateDot() [1/6]

virtual DotType Moose::FunctorBase< Real >::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::FunctorEnvelope< Real >, Function, and Postprocessor.

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]

virtual DotType Moose::FunctorBase< Real >::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::FunctorEnvelope< Real >, Function, and Postprocessor.

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]

virtual DotType Moose::FunctorBase< Real >::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::FunctorEnvelope< Real >, Function, and Postprocessor.

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]

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

Reimplemented in Moose::FunctorEnvelope< Real >, Function, and Postprocessor.

Definition at line 416 of file MooseFunctor.h.

417  {
418  mooseError("Element side quadrature point time derivative not implemented for functor " +
419  functorName());
420  }
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() [5/6]

virtual DotType Moose::FunctorBase< Real >::evaluateDot ( const ElemPointArg ,
const StateArg  
) const
inlineprotectedvirtualinherited

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

Reimplemented in Moose::FunctorEnvelope< Real >, Function, 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]

virtual DotType Moose::FunctorBase< Real >::evaluateDot ( const NodeArg ,
const StateArg  
) const
inlineprotectedvirtualinherited

Reimplemented in Moose::FunctorEnvelope< Real >, Function, and Postprocessor.

Definition at line 430 of file MooseFunctor.h.

431  {
432  mooseError("Time derivative at node not implemented for functor " + functorName());
433  }
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() [1/6]

virtual GradientType Moose::FunctorBase< Real >::evaluateGradDot ( const ElemArg ,
const StateArg  
) const
inlineprotectedvirtualinherited

Evaluate the functor gradient-dot with a given element.

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

Reimplemented in Moose::FunctorEnvelope< Real >.

Definition at line 439 of file MooseFunctor.h.

440  {
441  mooseError("Element gradient-dot not implemented for functor " + functorName());
442  }
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() [2/6]

virtual GradientType Moose::FunctorBase< Real >::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::FunctorEnvelope< Real >.

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]

virtual GradientType Moose::FunctorBase< Real >::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::FunctorEnvelope< Real >.

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]

virtual GradientType Moose::FunctorBase< Real >::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::FunctorEnvelope< Real >.

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]

virtual GradientType Moose::FunctorBase< Real >::evaluateGradDot ( const ElemPointArg ,
const StateArg  
) const
inlineprotectedvirtualinherited

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

Reimplemented in Moose::FunctorEnvelope< Real >.

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]

virtual GradientType Moose::FunctorBase< Real >::evaluateGradDot ( const NodeArg ,
const StateArg  
) const
inlineprotectedvirtualinherited

Reimplemented in Moose::FunctorEnvelope< Real >.

Definition at line 484 of file MooseFunctor.h.

485  {
486  mooseError("Gradient-dot at node not implemented for functor " + functorName());
487  }
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() [1/6]

virtual GradientType Moose::FunctorBase< Real >::evaluateGradient ( const ElemArg ,
const StateArg  
) const
inlineprotectedvirtualinherited

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 in Moose::FunctorEnvelope< Real >, Function, and Postprocessor.

Definition at line 332 of file MooseFunctor.h.

333  {
334  mooseError("Element gradient not implemented for functor " + functorName());
335  }
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() [2/6]

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

Reimplemented in Moose::FunctorEnvelope< Real >, Function, and Postprocessor.

Definition at line 342 of file MooseFunctor.h.

343  {
344  mooseError("Face gradient not implemented for functor " + functorName());
345  }
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() [3/6]

virtual GradientType Moose::FunctorBase< Real >::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::FunctorEnvelope< Real >, Function, and Postprocessor.

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]

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

Reimplemented in Moose::FunctorEnvelope< Real >, Function, and Postprocessor.

Definition at line 362 of file MooseFunctor.h.

363  {
364  mooseError("Element side quadrature point gradient not implemented for functor " +
365  functorName());
366  }
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() [5/6]

virtual GradientType Moose::FunctorBase< Real >::evaluateGradient ( const ElemPointArg ,
const StateArg  
) const
inlineprotectedvirtualinherited

Evaluate the functor gradient with a given element and point.

Reimplemented in Moose::FunctorEnvelope< Real >, Function, and Postprocessor.

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]

virtual GradientType Moose::FunctorBase< Real >::evaluateGradient ( const NodeArg ,
const StateArg  
) const
inlineprotectedvirtualinherited

Reimplemented in Moose::FunctorEnvelope< Real >, Function, and Postprocessor.

Definition at line 376 of file MooseFunctor.h.

377  {
378  mooseError("Gradient at node not implemented for functor " + functorName());
379  }
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

◆ evaluateTemplate()

Real SpatialUserObjectFunctor< BaseType >::evaluateTemplate ( const SpatialArg &  position,
const Moose::StateArg libmesh_dbg_varstate 
) const
inherited

Definition at line 76 of file SpatialUserObjectFunctor.h.

78 {
79  mooseAssert(state.state == 0, "We do not currently support evaluating at old states");
80  return this->spatialValue(position.getPoint());
81 }

◆ execute()

template<typename UserObjectType , typename BaseType >
void NearestPointBase< UserObjectType, BaseType >::execute ( )
overridevirtual

Definition at line 205 of file NearestPointBase.h.

206 {
207  nearestUserObject(_current_elem->vertex_average()).execute();
208 }
UserObjectType & nearestUserObject(const Point &p) const
Get the UserObject that is closest to the point.
virtual void execute() override

◆ fillPoints()

template<typename UserObjectType , typename BaseType >
void NearestPointBase< UserObjectType, BaseType >::fillPoints ( )
protected

Fills in the _points variable from either 'points' or 'points_file' parameter.

Also performs error checking.

Definition at line 161 of file NearestPointBase.h.

Referenced by NearestPointBase< LayeredSideDiffusiveFluxAverage, SideIntegralVariableUserObject >::NearestPointBase().

162 {
163  if (isParamValid("points"))
164  {
165  _points = this->template getParam<std::vector<Point>>("points");
166  if (isParamValid("points_file"))
167  this->paramError("points_file", "Cannot be specified together with 'points'");
168  if (isParamValid("positions_object"))
169  this->paramError("positions_object", "Cannot be specified together with 'points'");
170  }
171  else if (isParamValid("points_file"))
172  {
173  const FileName & points_file = this->template getParam<FileName>("points_file");
174 
175  MooseUtils::DelimitedFileReader file(points_file, &_communicator);
177  file.read();
178  _points = file.getDataAsPoints();
179 
180  if (isParamValid("positions_object"))
181  this->paramError("positions_object", "Cannot be specified together with 'points_file'");
182  }
183  else if (isParamValid("positions_object"))
184  {
185  const auto & positions_name = this->template getParam<PositionsName>("positions_object");
186  const auto problem = this->template getCheckedPointerParam<FEProblemBase *>("_fe_problem_base");
187  _points = problem->getPositionsObject(positions_name).getPositions(/*initial_positions*/ true);
188  }
189  else
190  mooseError(
191  name(),
192  ": You need to supply either 'points', 'points_file' or 'positions_object' parameter.");
193 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:57
Utility class for reading delimited data (e.g., CSV data).
std::vector< Point > _points

◆ finalize()

template<typename UserObjectType , typename BaseType >
void NearestPointBase< UserObjectType, BaseType >::finalize ( )
overridevirtual

Reimplemented in NearestPointAverage, and NearestPointIntegralVariablePostprocessor.

Definition at line 212 of file NearestPointBase.h.

213 {
214  for (auto & user_object : _user_objects)
215  user_object->finalize();
216 }
std::vector< std::unique_ptr< UserObjectType > > _user_objects

◆ functorName()

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

Return the functor name.

Definition at line 170 of file MooseFunctor.h.

170 { return _functor_name; }
MooseFunctorName _functor_name
name of the functor
Definition: MooseFunctor.h:564

◆ genericEvaluate()

FunctorReturnType< Real , FET >::type Moose::FunctorBase< Real >::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

◆ getPoints()

template<typename UserObjectType, typename BaseType>
virtual const std::vector<Point>& NearestPointBase< UserObjectType, BaseType >::getPoints ( ) const
inlinevirtual

Get the points at which the nearest operation is performed.

Returns
points

Definition at line 57 of file NearestPointBase.h.

57 { return _points; }
std::vector< Point > _points

◆ gradDot() [1/6]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::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.

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]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::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]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::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]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::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]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::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]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::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]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::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.

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]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::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]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::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]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::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]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::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]

FunctorBase< Real >::GradientType Moose::FunctorBase< Real >::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()

bool SpatialUserObjectFunctor< BaseType >::hasBlocks ( SubdomainID  sub) const
overridevirtualinherited

Returns whether the functor is defined on this block.

Reimplemented from Moose::FunctorBase< Real >.

Definition at line 133 of file SpatialUserObjectFunctor.h.

134 {
135  if constexpr (std::is_base_of<BlockRestrictable, UserObjectType>::value)
136  return UserObjectType::hasBlocks(sub_id);
137  else
139 }
virtual bool hasBlocks(SubdomainID) const
Returns whether the functor is defined on this block.
Definition: MooseFunctor.h:237

◆ hasFaceSide()

bool Moose::FunctorBase< Real >::hasFaceSide ( const FaceInfo fi,
const bool  fi_elem_side 
) const
overridevirtualinherited

Implements FaceArgInterface.

Reimplemented in Moose::FunctorEnvelope< Real >, InternalSideIntegralVariablePostprocessor, InterfaceIntegralVariableValuePostprocessor, SideIntegralVariablePostprocessor, SideIntegralFunctorPostprocessorTempl< is_ad >, and SideIntegralFunctorPostprocessorTempl< false >.

Definition at line 976 of file MooseFunctor.h.

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

◆ initialize()

template<typename UserObjectType , typename BaseType >
void NearestPointBase< UserObjectType, BaseType >::initialize ( )
overridevirtual

Definition at line 197 of file NearestPointBase.h.

198 {
199  for (auto & user_object : _user_objects)
200  user_object->initialize();
201 }
std::vector< std::unique_ptr< UserObjectType > > _user_objects

◆ isConstant()

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

Returns true if this functor is a constant.

Reimplemented in Moose::FunctorEnvelope< Real >.

Definition at line 260 of file MooseFunctor.h.

260 { return false; }

◆ isExtrapolatedBoundaryFace()

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

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

Reimplemented in Moose::FunctorEnvelope< Real >.

Definition at line 247 of file MooseFunctor.h.

248  {
249  mooseError("not implemented");
250  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ isInternalFace()

bool Moose::FunctorBase< Real >::isInternalFace ( const FaceInfo fi) const
inherited

Returns true if the face is an internal face.

Definition at line 569 of file MooseFunctor.h.

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()

void Moose::FunctorBase< Real >::jacobianSetup ( )
overridevirtualinherited

Implements Moose::FunctorAbstract.

Reimplemented in Function.

Definition at line 831 of file MooseFunctor.h.

832 {
834  clearCacheData();
835 }
const ExecFlagType EXEC_NONLINEAR
Definition: Moose.C:31
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

◆ name()

template<typename UserObjectType, typename BaseType>
virtual const std::string& MooseBase::name
inlineprotected

Get the name of the class.

Returns
The name of the class

Definition at line 57 of file MooseBase.h.

57 { return _name; }

◆ nearestUserObject()

template<typename UserObjectType , typename BaseType >
UserObjectType & NearestPointBase< UserObjectType, BaseType >::nearestUserObject ( const Point &  p) const
protected

Get the UserObject that is closest to the point.

Parameters
pThe point.
Returns
The UserObject closest to p.

Definition at line 237 of file NearestPointBase.h.

238 {
239  unsigned int closest = 0;
240  Real closest_distance = std::numeric_limits<Real>::max();
241 
242  for (auto it : Moose::enumerate(_points))
243  {
244  const auto & current_point = it.value();
245 
246  Real current_distance;
247  if (_dist_norm == 0)
248  // the distance is computed using standard norm
249  current_distance = (p - current_point).norm();
250  else
251  {
252  // the distance is to be computed based on radii
253  // in that case, we need to determine the 2 coordinate indices
254  // that define the radius
255  unsigned int i = 0;
256  unsigned int j = 1;
257 
258  if (_axis == 0)
259  i = 2;
260  else if (_axis == 1)
261  j = 2;
262 
263  current_distance = std::abs(
264  std::sqrt(p(i) * p(i) + p(j) * p(j)) -
265  std::sqrt(current_point(i) * current_point(i) + current_point(j) * current_point(j)));
266  }
267 
268  if (current_distance < closest_distance)
269  {
270  closest_distance = current_distance;
271  closest = it.index();
272  }
273  }
274 
275  return *_user_objects[closest];
276 }
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)
Definition: EigenADReal.h:42
_enumerate_range< Iterator > enumerate(Iterator first, Iterator last, typename std::iterator_traits< Iterator >::difference_type initial)
Enumerate function for iterating over a range and obtaining both a reference to the underlying type a...
Definition: Enumerate.h:52
std::vector< std::unique_ptr< UserObjectType > > _user_objects
auto max(const L &left, const R &right)
const unsigned int _axis
auto norm(const T &a) -> decltype(std::abs(a))
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh
const unsigned int _dist_norm
std::vector< Point > _points

◆ operator()() [1/6]

FunctorBase< Real >::ValueType Moose::FunctorBase< Real >::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]

FunctorBase< Real >::ValueType Moose::FunctorBase< Real >::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]

FunctorBase< Real >::ValueType Moose::FunctorBase< Real >::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, Real >> &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]

FunctorBase< Real >::ValueType Moose::FunctorBase< Real >::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, Real >> &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]

FunctorBase< Real >::ValueType Moose::FunctorBase< Real >::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]

FunctorBase< Real >::ValueType Moose::FunctorBase< Real >::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()

void Moose::FunctorBase< Real >::residualSetup ( )
overridevirtualinherited

Implements Moose::FunctorAbstract.

Reimplemented in Function.

Definition at line 823 of file MooseFunctor.h.

824 {
825  if (_clearance_schedule.count(EXEC_LINEAR))
826  clearCacheData();
827 }
const ExecFlagType EXEC_LINEAR
Definition: Moose.C:29
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

◆ setCacheClearanceSchedule()

void Moose::FunctorBase< Real >::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:49
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

◆ spatialPoints()

template<typename UserObjectType , typename BaseType >
const std::vector< Point > NearestPointBase< UserObjectType, BaseType >::spatialPoints ( ) const
overridevirtual

Reimplemented in NearestPointIntegralVariablePostprocessor.

Definition at line 280 of file NearestPointBase.h.

281 {
282  std::vector<Point> points;
283 
284  for (MooseIndex(_points) i = 0; i < _points.size(); ++i)
285  {
286  auto layered_base = dynamic_cast<LayeredBase *>(_user_objects[i].get());
287  if (layered_base)
288  {
289  const auto & layers = layered_base->getLayerCenters();
290  auto direction = layered_base->direction();
291 
292  for (const auto & l : layers)
293  {
294  Point pt = _points[i];
295  pt(direction) = l;
296  points.push_back(pt);
297  }
298  }
299  }
300 
301  return points;
302 }
std::vector< std::unique_ptr< UserObjectType > > _user_objects
const std::vector< Real > & getLayerCenters() const
Get the center coordinates for the layers (along given direction)
Definition: LayeredBase.h:67
This base class computes volume integrals of a variable storing partial sums for the specified number...
Definition: LayeredBase.h:36
std::vector< Point > _points

◆ spatialValue()

template<typename UserObjectType , typename BaseType >
Real NearestPointBase< UserObjectType, BaseType >::spatialValue ( const Point &  p) const
overridevirtual

Given a Point return the integral value associated with the layer that point falls in for the layered average closest to that point.

Parameters
pThe point to look for in the layers.

Reimplemented in NearestPointAverage, and NearestPointIntegralVariablePostprocessor.

Definition at line 230 of file NearestPointBase.h.

231 {
232  return nearestUserObject(p).spatialValue(p);
233 }
UserObjectType & nearestUserObject(const Point &p) const
Get the UserObject that is closest to the point.

◆ supportsElemSideQpArg()

virtual bool SpatialUserObjectFunctor< BaseType >::supportsElemSideQpArg ( ) const
inlinefinaloverrideprotectedvirtualinherited

Whether this functor supports evaluation with ElemSideQpArg.

Implements Moose::FunctorBase< Real >.

Definition at line 46 of file SpatialUserObjectFunctor.h.

46 { return true; }

◆ supportsFaceArg()

virtual bool SpatialUserObjectFunctor< BaseType >::supportsFaceArg ( ) const
inlinefinaloverrideprotectedvirtualinherited

Whether this functor supports evaluation with FaceArg.

Implements Moose::FunctorBase< Real >.

Definition at line 45 of file SpatialUserObjectFunctor.h.

45 { return true; }

◆ threadJoin()

template<typename UserObjectType , typename BaseType >
void NearestPointBase< UserObjectType, BaseType >::threadJoin ( const UserObject y)
overridevirtual

Definition at line 220 of file NearestPointBase.h.

221 {
222  auto & npla = static_cast<const NearestPointBase &>(y);
223 
224  for (MooseIndex(_user_objects) i = 0; i < _user_objects.size(); ++i)
225  _user_objects[i]->threadJoin(*npla._user_objects[i]);
226 }
This UserObject computes averages of a variable storing partial sums for the specified number of inte...
std::vector< std::unique_ptr< UserObjectType > > _user_objects
virtual void threadJoin(const UserObject &y) override

◆ timestepSetup()

void Moose::FunctorBase< Real >::timestepSetup ( )
overridevirtualinherited

Implements Moose::FunctorAbstract.

Reimplemented in Function, NumNonlinearIterations, and MemoryUsage.

Definition at line 815 of file MooseFunctor.h.

816 {
818  clearCacheData();
819 }
const ExecFlagType EXEC_TIMESTEP_BEGIN
Definition: Moose.C:35
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

◆ validParams()

template<typename UserObjectType , typename BaseType >
InputParameters NearestPointBase< UserObjectType, BaseType >::validParams ( )
static

Definition at line 93 of file NearestPointBase.h.

Referenced by NearestPointLayeredSideAverageFunctor::validParams(), NearestPointLayeredSideIntegralFunctor::validParams(), NearestPointAverage::validParams(), NearestPointLayeredSideIntegral::validParams(), NearestPointLayeredAverage::validParams(), NearestPointLayeredSideAverage::validParams(), NearestPointLayeredIntegral::validParams(), and NearestRadiusLayeredAverage::validParams().

94 {
96 
97  params.addParam<std::vector<Point>>("points",
98  "Computations will be lumped into values at these points.");
99  params.addParam<FileName>("points_file",
100  "A filename that should be looked in for points. Each "
101  "set of 3 values in that file will represent a Point. "
102  "This and 'points' cannot be both supplied.");
103  params.addParam<PositionsName>(
104  "positions_object",
105  "The name of a Positions object that will contain "
106  "the locations. This, 'points' and 'points(_file)' cannot be both supplied. "
107  "Note that only the vector of initial Positions are used at this time. "
108  "Updates to the 'positions' vector are not supported.");
109 
110  MooseEnum distnorm("point=0 radius=1", "point");
111  params.addParam<MooseEnum>(
112  "dist_norm", distnorm, "To specify whether the distance is defined based on point or radius");
113  MooseEnum axis("x=0 y=1 z=2", "z");
114  params.addParam<MooseEnum>("axis", axis, "The axis around which the radius is determined");
115 
116  params.addParamNamesToGroup("points points_file dist_norm axis", "Points and distance to points");
117 
118  // Add in the valid parameters
119  params += UserObjectType::validParams();
120 
121  return params;
122 }
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters validParams()
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
This method takes a space delimited list of parameter names and adds them to the specified group name...

Member Data Documentation

◆ _axis

template<typename UserObjectType, typename BaseType>
const unsigned int NearestPointBase< UserObjectType, BaseType >::_axis
protected

Definition at line 82 of file NearestPointBase.h.

◆ _dist_norm

template<typename UserObjectType, typename BaseType>
const unsigned int NearestPointBase< UserObjectType, BaseType >::_dist_norm
protected

Definition at line 80 of file NearestPointBase.h.

◆ _points

template<typename UserObjectType, typename BaseType>
std::vector<Point> NearestPointBase< UserObjectType, BaseType >::_points
protected

◆ _user_objects

template<typename UserObjectType, typename BaseType>
std::vector<std::unique_ptr<UserObjectType> > NearestPointBase< UserObjectType, BaseType >::_user_objects
protected

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