$extrastylesheet
#include <function_base.h>

Public Member Functions | |
| virtual | ~FunctionBase () |
| virtual void | init () |
| virtual void | clear () |
| virtual UniquePtr < FunctionBase< Output > > | clone () const =0 |
| virtual Output | operator() (const Point &p, const Real time=0.)=0 |
| void | operator() (const Point &p, DenseVector< Output > &output) |
| virtual void | operator() (const Point &p, const Real time, DenseVector< Output > &output)=0 |
| virtual Output | component (unsigned int i, const Point &p, Real time=0.) |
| bool | initialized () const |
Protected Member Functions | |
| FunctionBase (const FunctionBase *master=NULL) | |
Protected Attributes | |
| const FunctionBase * | _master |
| bool | _initialized |
This is the base class for functor-like classes. These entities are functions (in the mathematical sense) of time and space,
, where v may be either a Number or a DenseVector<Number>. Children of this base class implement different styles of data retrieval for these functions. Use the constructors of the derived classes for creating new objects. The required input of each derived class thwarts the effective use of the commonly used build() member. But afterwards the virtual members allow the convenient and libMesh-common usage through a FunctionBase*. Note that for functor objects for vector-valued variables, it is assumed each component is indexed contiguously; i.e. if u_var is index 3, then libMesh expects the x-component of u_var is index 3, the y-component is index 4, and the z-component is index 5. Note that for 2-D elements in 3 spatial dimensions, libMesh is expecting 2 components (i.e. mesh_dimension() number of components).
Definition at line 65 of file function_base.h.
| libMesh::FunctionBase< Output >::FunctionBase | ( | const FunctionBase< Output > * | master = NULL | ) | [inline, explicit, protected] |
Constructor. Optionally takes a master.
Definition at line 180 of file function_base.h.
: _master (master), _initialized (false) { }
| libMesh::FunctionBase< Output >::~FunctionBase | ( | ) | [inline, virtual] |
| virtual void libMesh::FunctionBase< Output >::clear | ( | ) | [inline, virtual] |
Clears the function.
Reimplemented in libMesh::ParsedFunction< Output, OutputGradient >, libMesh::MeshFunction, and libMesh::AnalyticFunction< Output >.
Definition at line 90 of file function_base.h.
{}
| virtual UniquePtr<FunctionBase<Output> > libMesh::FunctionBase< Output >::clone | ( | ) | const [pure virtual] |
Returns a new copy of the function. The new copy should be as ``deep'' as necessary to allow independent destruction and simultaneous evaluations of the copies in different threads.
Implemented in libMesh::ParsedFunction< Output, OutputGradient >, libMesh::ParsedFunction< Output, OutputGradient >, libMesh::CompositeFunction< Output >, libMesh::MeshFunction, libMesh::AnalyticFunction< Output >, libMesh::WrappedFunction< Output >, libMesh::ConstFunction< Output >, and libMesh::ZeroFunction< Output >.
Referenced by libMesh::ExactErrorEstimator::attach_exact_deriv(), libMesh::ExactSolution::attach_exact_deriv(), libMesh::ExactErrorEstimator::attach_exact_hessian(), libMesh::ExactSolution::attach_exact_hessian(), libMesh::ExactErrorEstimator::attach_exact_value(), libMesh::ExactSolution::attach_exact_value(), libMesh::CompositeFunction< Output >::attach_subfunction(), and libMesh::MeshTools::Modification::redistribute().
| Output libMesh::FunctionBase< Output >::component | ( | unsigned int | i, |
| const Point & | p, | ||
| Real | time = 0. |
||
| ) | [inline, virtual] |
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);
}
| virtual void libMesh::FunctionBase< Output >::init | ( | ) | [inline, virtual] |
The actual initialization process.
Reimplemented in libMesh::ParsedFunction< Output, OutputGradient >, libMesh::MeshFunction, and libMesh::AnalyticFunction< Output >.
Definition at line 85 of file function_base.h.
{}
| bool libMesh::FunctionBase< Output >::initialized | ( | ) | const [inline] |
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);
}
| virtual Output libMesh::FunctionBase< Output >::operator() | ( | const Point & | p, |
| const Real | time = 0. |
||
| ) | [pure virtual] |
p and time time, which defaults to zero. Purely virtual, so you have to overload it. Note that this cannot be a const method, check MeshFunction. Implemented in libMesh::ParsedFunction< Output, OutputGradient >, libMesh::ParsedFunction< Output, OutputGradient >, libMesh::MeshFunction, libMesh::AnalyticFunction< Output >, libMesh::CompositeFunction< Output >, libMesh::WrappedFunction< Output >, and libMesh::ConstFunction< Output >.
| void libMesh::FunctionBase< Output >::operator() | ( | const Point & | p, |
| DenseVector< Output > & | output | ||
| ) | [inline] |
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);
}
| virtual void libMesh::FunctionBase< Output >::operator() | ( | const Point & | p, |
| const Real | time, | ||
| DenseVector< Output > & | output | ||
| ) | [pure virtual] |
Return function for vectors. Returns in output the values of the data at the coordinate p and for time time. Purely virtual, so you have to overload it. Note that this cannot be a const method, check MeshFunction. Can optionally provide subdomain_ids which will restrict the function to operate on elements with subdomain id contained in the set. This is useful in cases where there are multiple dimensioned elements, for example.
Implemented in libMesh::ParsedFunction< Output, OutputGradient >, libMesh::ParsedFunction< Output, OutputGradient >, libMesh::MeshFunction, libMesh::AnalyticFunction< Output >, libMesh::CompositeFunction< Output >, libMesh::WrappedFunction< Output >, and libMesh::ConstFunction< Output >.
bool libMesh::FunctionBase< Output >::_initialized [protected] |
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] |
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.