$extrastylesheet
#include <analytic_function.h>

Public Member Functions | |
| AnalyticFunction (Output fptr(const Point &p, const Real time)) | |
| AnalyticFunction (void fptr(DenseVector< Output > &output, const Point &p, const Real time)) | |
| ~AnalyticFunction () | |
| void | init () |
| void | clear () |
| virtual UniquePtr < FunctionBase< Output > > | clone () const |
| Output | operator() (const Point &p, const Real time=0.) |
| void | operator() (const Point &p, const Real time, DenseVector< Output > &output) |
| void | operator() (const Point &p, DenseVector< Output > &output) |
| virtual Output | component (unsigned int i, const Point &p, Real time=0.) |
| bool | initialized () const |
Public Attributes | |
| Output(* | _number_fptr )(const Point &p, const Real time) |
| void(* | _vector_fptr )(DenseVector< Output > &output, const Point &p, const Real time) |
Protected Attributes | |
| const FunctionBase * | _master |
| bool | _initialized |
This class provides function-like objects for which an analytical expression can be provided. The user may either provide vector-return or number-return functions.
Definition at line 50 of file analytic_function.h.
| libMesh::AnalyticFunction< Output >::AnalyticFunction | ( | Output | fptrconst Point &p,const Real time | ) |
Constructor. Takes a function pointer for scalar return values.
Definition at line 150 of file analytic_function.h.
References libMesh::FunctionBase< Output >::_initialized, and libMesh::libmesh_assert().
: FunctionBase<Output> (), _number_fptr (fptr), _vector_fptr (NULL) { libmesh_assert(fptr); this->_initialized = true; }
| libMesh::AnalyticFunction< Output >::AnalyticFunction | ( | void | fptrDenseVector< Output > &output,const Point &p,const Real time | ) | [inline] |
Constructor. Takes a function pointer for vector valued functions.
Definition at line 164 of file analytic_function.h.
References libMesh::FunctionBase< Output >::_initialized, and libMesh::libmesh_assert().
: FunctionBase<Output> (), _number_fptr (NULL), _vector_fptr (fptr) { libmesh_assert(fptr); this->_initialized = true; }
| libMesh::AnalyticFunction< Output >::~AnalyticFunction | ( | ) | [inline] |
| void libMesh::AnalyticFunction< Output >::clear | ( | ) | [inline, virtual] |
Clears the function.
Reimplemented from libMesh::FunctionBase< Output >.
Definition at line 199 of file analytic_function.h.
{
// We probably need a method to reset these later...
_number_fptr = NULL;
_vector_fptr = NULL;
// definitely not ready
this->_initialized = false;
}
| UniquePtr< FunctionBase< Output > > libMesh::AnalyticFunction< Output >::clone | ( | ) | const [inline, virtual] |
Returns a new deep copy of the function.
Implements libMesh::FunctionBase< Output >.
Definition at line 214 of file analytic_function.h.
{
return UniquePtr<FunctionBase<Output> >
( _number_fptr ?
new AnalyticFunction<Output>(_number_fptr) :
new AnalyticFunction<Output>(_vector_fptr) );
}
| Output libMesh::FunctionBase< Output >::component | ( | unsigned int | i, |
| const Point & | p, | ||
| Real | time = 0. |
||
| ) | [inline, virtual, inherited] |
i at coordinate p and time time. Subclasses aren't required to overload this, since the default implementation is based on the full vector evaluation, which is often correct. Subclasses are recommended to overload this, since the default implementation is based on a vector evaluation, which is usually unnecessarily inefficient. Reimplemented in libMesh::ParsedFunction< Output, OutputGradient >, libMesh::CompositeFunction< Output >, and libMesh::WrappedFunction< Output >.
Definition at line 207 of file function_base.h.
Referenced by libMesh::ProjectSolution::operator()(), libMesh::ProjectFEMSolution::operator()(), and libMesh::BoundaryProjectSolution::operator()().
{
DenseVector<Output> outvec(i+1);
(*this)(p, time, outvec);
return outvec(i);
}
| void libMesh::AnalyticFunction< Output >::init | ( | ) | [virtual] |
The actual initialization process.
Reimplemented from libMesh::FunctionBase< Output >.
Definition at line 186 of file analytic_function.h.
References libMesh::libmesh_assert().
{
// dumb double-test
libmesh_assert ((_number_fptr != NULL) || (_vector_fptr != NULL));
// definitely ready
this->_initialized = true;
}
| bool libMesh::FunctionBase< Output >::initialized | ( | ) | const [inline, inherited] |
true when this object is properly initialized and ready for use, false otherwise. Definition at line 198 of file function_base.h.
{
return (this->_initialized);
}
| Output libMesh::AnalyticFunction< Output >::operator() | ( | const Point & | p, |
| const Real | time = 0. |
||
| ) | [inline, virtual] |
p and time time, which defaults to zero. Implements libMesh::FunctionBase< Output >.
Definition at line 127 of file analytic_function.h.
References libMesh::initialized(), and libMesh::libmesh_assert().
{
libmesh_assert (this->initialized());
return (this->_number_fptr(p, time));
}
| void libMesh::FunctionBase< Output >::operator() | ( | const Point & | p, |
| DenseVector< Output > & | output | ||
| ) | [inline, inherited] |
Return function for vectors. Returns in output the values of the data at the coordinate p.
Definition at line 220 of file function_base.h.
{
// Call the time-dependent function with t=0.
this->operator()(p, 0., output);
}
| void libMesh::AnalyticFunction< Output >::operator() | ( | const Point & | p, |
| const Real | time, | ||
| DenseVector< Output > & | output | ||
| ) | [inline, virtual] |
Like before, but returns the values in a writable reference.
Implements libMesh::FunctionBase< Output >.
Definition at line 138 of file analytic_function.h.
References libMesh::initialized(), and libMesh::libmesh_assert().
{
libmesh_assert (this->initialized());
this->_vector_fptr(output, p, time);
return;
}
bool libMesh::FunctionBase< Output >::_initialized [protected, inherited] |
When init() was called so that everything is ready for calls to operator() (...), then this bool is true.
Definition at line 170 of file function_base.h.
Referenced by libMesh::AnalyticFunction< Output >::AnalyticFunction(), libMesh::ConstFunction< Output >::ConstFunction(), libMesh::ParsedFunction< Output, OutputGradient >::ParsedFunction(), and libMesh::WrappedFunction< Output >::WrappedFunction().
const FunctionBase* libMesh::FunctionBase< Output >::_master [protected, inherited] |
Const pointer to our master, initialized to NULL. There may be cases where multiple functions are required, but to save memory, one master handles some centralized data.
Definition at line 164 of file function_base.h.
| Output(* libMesh::AnalyticFunction< Output >::_number_fptr)(const Point &p, const Real time) |
Pointer to user-provided function that computes the boundary values when an analytical expression is available.
Definition at line 79 of file analytic_function.h.
| void(* libMesh::AnalyticFunction< Output >::_vector_fptr)(DenseVector< Output > &output, const Point &p, const Real time) |
Pointer to user-provided vector valued function.
Definition at line 85 of file analytic_function.h.