Go to the documentation of this file.
20 #ifndef LIBMESH_FUNCTION_BASE_H
21 #define LIBMESH_FUNCTION_BASE_H
24 #include "libmesh/libmesh_common.h"
25 #include "libmesh/dense_vector.h"
61 template <
typename Output=Number>
100 virtual std::unique_ptr<FunctionBase<Output>>
clone ()
const = 0;
109 const Real time = 0.) = 0;
192 template<
typename Output>
196 _initialized (false),
197 _is_time_dependent (true)
203 template <
typename Output>
207 return (this->_initialized);
210 template <
typename Output>
214 this->_is_time_dependent = is_time_dependent;
217 template <
typename Output>
221 return (this->_is_time_dependent);
225 template <
typename Output>
232 (*this)(p, time, outvec);
238 template <
typename Output>
244 this->operator()(p, 0., output);
249 #endif // LIBMESH_FUNCTION_BASE_H
Base class for functors that can be evaluated at a point and (optionally) time.
bool is_time_dependent() const
virtual std::unique_ptr< FunctionBase< Output > > clone() const =0
virtual void init()
The actual initialization process.
The libMesh namespace provides an interface to certain functionality in the library.
bool _is_time_dependent
Cache whether or not this function is actually time-dependent.
FunctionBase & operator=(const FunctionBase &)=default
void set_is_time_dependent(bool is_time_dependent)
Function to set whether this is a time-dependent function or not.
virtual Output component(unsigned int i, const Point &p, Real time=0.)
FunctionBase(const FunctionBase *master=nullptr)
Constructor.
bool _initialized
When init() was called so that everything is ready for calls to operator() (...), then this bool is t...
A Point defines a location in LIBMESH_DIM dimensional Real space.
const FunctionBase * _master
Const pointer to our master, initialized to nullptr.
bool initialized()
Checks that library initialization has been done.
virtual Output operator()(const Point &p, const Real time=0.)=0
virtual void clear()
Clears the function.
virtual ~FunctionBase()=default
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real