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