20 #ifndef LIBMESH_ANALYTIC_FUNCTION_H 21 #define LIBMESH_ANALYTIC_FUNCTION_H 47 template <
typename Output=Number>
91 virtual void init ()
override;
93 virtual void clear ()
override;
95 virtual std::unique_ptr<FunctionBase<Output>>
clone ()
const override;
98 const Real time=0.)
override;
109 template <
typename Output>
115 return (this->_number_fptr(p, time));
120 template <
typename Output>
127 this->_vector_fptr(output, p, time);
133 template <
typename Output>
137 _vector_fptr (nullptr)
139 libmesh_assert(fptr);
145 template <
typename Output>
149 _number_fptr (nullptr),
152 libmesh_assert(fptr);
158 template <
typename Output>
162 libmesh_assert ((_number_fptr !=
nullptr) || (_vector_fptr !=
nullptr));
165 this->_initialized =
true;
170 template <
typename Output>
175 _number_fptr =
nullptr;
176 _vector_fptr =
nullptr;
179 this->_initialized =
false;
184 template <
typename Output>
186 std::unique_ptr<FunctionBase<Output>>
189 return std::unique_ptr<FunctionBase<Output>>
199 #endif // LIBMESH_ANALYTIC_FUNCTION_H OutputFunction _number_fptr
virtual Output operator()(const Point &p, const Real time=0.) override
Output(* OutputFunction)(const Point &p, const Real time)
OutputVectorFunction _vector_fptr
Wraps a function pointer into a FunctionBase object.
virtual std::unique_ptr< FunctionBase< Output > > clone() const override
virtual ~AnalyticFunction()=default
void(* OutputVectorFunction)(DenseVector< Output > &output, const Point &p, const Real time)
AnalyticFunction(OutputFunction fptr)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void init() override
virtual void clear() override
Base class for functors that can be evaluated at a point and (optionally) time.
AnalyticFunction & operator=(const AnalyticFunction &)=default
A geometric point in (x,y,z) space.