20 #ifndef LIBMESH_ANALYTIC_FUNCTION_H 21 #define LIBMESH_ANALYTIC_FUNCTION_H 24 #include "libmesh/function_base.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)
145 template <
typename Output>
149 _number_fptr (nullptr),
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 _number_fptr ?
190 std::make_unique<AnalyticFunction<Output>>(_number_fptr) :
198 #endif // LIBMESH_ANALYTIC_FUNCTION_H OutputFunction _number_fptr
Pointer to user-provided function that computes the boundary values when an analytical expression is ...
virtual Output operator()(const Point &p, const Real time=0.) override
bool _initialized
When init() was called so that everything is ready for calls to operator() (...), then this bool is t...
Output(* OutputFunction)(const Point &p, const Real time)
Scalar return value function pointer type.
The libMesh namespace provides an interface to certain functionality in the library.
OutputVectorFunction _vector_fptr
Pointer to user-provided vector valued function.
Wraps a function pointer into a FunctionBase object.
Number fptr(const Point &p, const Parameters &, const std::string &libmesh_dbg_var(sys_name), const std::string &unknown_name)
virtual std::unique_ptr< FunctionBase< Output > > clone() const override
virtual ~AnalyticFunction()=default
void(* OutputVectorFunction)(DenseVector< Output > &output, const Point &p, const Real time)
Vector return value function pointer type.
AnalyticFunction(OutputFunction fptr)
Constructor.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual void init() override
The actual initialization process.
virtual void clear() override
Clears the function.
bool initialized()
Checks that library initialization has been done.
Base class for functors that can be evaluated at a point and (optionally) time.
AnalyticFunction & operator=(const AnalyticFunction &)=default
A Point defines a location in LIBMESH_DIM dimensional Real space.