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