20 #ifndef LIBMESH_WRAPPED_FUNCTOR_H 21 #define LIBMESH_WRAPPED_FUNCTOR_H 24 #include "libmesh/fem_function_base.h" 25 #include "libmesh/function_base.h" 26 #include "libmesh/point.h" 44 template <
typename Output=Number>
71 virtual std::unique_ptr<FEMFunctionBase<Output>>
clone ()
const override 73 return std::make_unique<WrappedFunctor<Output>>(*_func);
78 const Real time = 0.)
override 79 {
return _func->operator()(p, time); }
85 {
_func->operator() (p, time, output); }
90 Real time=0.)
override 91 {
return _func->component(i, p, time); }
95 std::unique_ptr<FunctionBase<Output>>
_func;
102 #endif // LIBMESH_WRAPPED_FUNCTOR_H WrappedFunctor & operator=(const WrappedFunctor &)=delete
virtual Output component(const FEMContext &, unsigned int i, const Point &p, Real time=0.) override
The libMesh namespace provides an interface to certain functionality in the library.
virtual std::unique_ptr< FEMFunctionBase< Output > > clone() const override
This class provides a wrapper with which to evaluate a (libMesh-style) function pointer in a Function...
virtual Output operator()(const FEMContext &, const Point &p, const Real time=0.) override
std::unique_ptr< FunctionBase< Output > > _func
This class provides all data required for a physics package (e.g.
virtual ~WrappedFunctor()=default
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
WrappedFunctor(const FunctionBase< Output > &func)
Constructor to wrap FunctionBase functors in a FEMFunctionBase compatible shim.
Base class for functors that can be evaluated at a point and (optionally) time.
FEMFunctionBase is a base class from which users can derive in order to define "function-like" object...
A Point defines a location in LIBMESH_DIM dimensional Real space.