libMesh::ConstFunction< Output > Class Template Reference
#include <const_function.h>

Public Member Functions | |
| ConstFunction (const Output &c) | |
| virtual Output | operator() (const Point &, const Real=0) |
| virtual void | operator() (const Point &, const Real, DenseVector< Output > &output) |
| virtual AutoPtr< FunctionBase < Output > > | clone () const |
| virtual void | init () |
| virtual void | clear () |
| void | operator() (const Point &p, DenseVector< Output > &output) |
| virtual Output | component (unsigned int i, const Point &p, Real time=0.) |
| bool | initialized () const |
Protected Attributes | |
| const FunctionBase * | _master |
| bool | _initialized |
Private Attributes | |
| Output | _c |
Detailed Description
template<typename Output = Number>
class libMesh::ConstFunction< Output >
Definition at line 33 of file const_function.h.
Constructor & Destructor Documentation
| libMesh::ConstFunction< Output >::ConstFunction | ( | const Output & | c | ) | [inline, explicit] |
Definition at line 37 of file const_function.h.
References libMesh::FunctionBase< Output >::_initialized.
00037 : _c(c) { this->_initialized = true; }
Member Function Documentation
| virtual void libMesh::FunctionBase< Output >::clear | ( | ) | [inline, virtual, inherited] |
Clears the function.
Reimplemented in libMesh::AnalyticFunction< Output >, libMesh::MeshFunction, and libMesh::ParsedFunction< Output >.
Definition at line 90 of file function_base.h.
| virtual AutoPtr<FunctionBase<Output> > libMesh::ConstFunction< Output >::clone | ( | ) | const [inline, 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.
Implements libMesh::FunctionBase< Output >.
Reimplemented in libMesh::ZeroFunction< Output >.
Definition at line 52 of file const_function.h.
References libMesh::ConstFunction< Output >::_c.
00052 { 00053 return AutoPtr<FunctionBase<Output> > 00054 (new ConstFunction<Output>(_c)); 00055 }
| Output libMesh::FunctionBase< Output >::component | ( | unsigned int | i, | |
| const Point & | p, | |||
| Real | time = 0. | |||
| ) | [inline, virtual, inherited] |
- Returns:
- the vector component
iat coordinatepand timetime. 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 >, and libMesh::WrappedFunction< Output >.
Definition at line 203 of file function_base.h.
Referenced by libMesh::BoundaryProjectSolution::operator()(), libMesh::ProjectFEMSolution::operator()(), and libMesh::ProjectSolution::operator()().
| virtual void libMesh::FunctionBase< Output >::init | ( | ) | [inline, virtual, inherited] |
The actual initialization process.
Reimplemented in libMesh::AnalyticFunction< Output >, libMesh::MeshFunction, and libMesh::ParsedFunction< Output >.
Definition at line 85 of file function_base.h.
| bool libMesh::FunctionBase< Output >::initialized | ( | ) | const [inline, inherited] |
- Returns:
truewhen this object is properly initialized and ready for use,falseotherwise.
Definition at line 194 of file function_base.h.
References libMesh::FunctionBase< Output >::_initialized.
Referenced by libMesh::AnalyticFunction< Output >::operator()().
00195 { 00196 return (this->_initialized); 00197 }
| 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 216 of file function_base.h.
References libMesh::FunctionBase< Output >::operator()().
00218 { 00219 // Call the time-dependent function with t=0. 00220 this->operator()(p, 0., output); 00221 }
| virtual void libMesh::ConstFunction< Output >::operator() | ( | const Point & | p, | |
| const | time, | |||
| DenseVector< Output > & | output | |||
| ) | [inline, 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.
Implements libMesh::FunctionBase< Output >.
Definition at line 43 of file const_function.h.
References libMesh::ConstFunction< Output >::_c, and libMesh::DenseVector< T >::size().
00046 { 00047 unsigned int size = output.size(); 00048 for (unsigned int i=0; i != size; ++i) 00049 output(i) = _c; 00050 }
| virtual Output libMesh::ConstFunction< Output >::operator() | ( | const Point & | p, | |
| const | time = 0 | |||
| ) | [inline, virtual] |
- Returns:
- the scalar value at coordinate
pand timetime, which defaults to zero. Purely virtual, so you have to overload it. Note that this cannot be a const method, checkMeshFunction.
Implements libMesh::FunctionBase< Output >.
Definition at line 39 of file const_function.h.
References libMesh::ConstFunction< Output >::_c.
00041 { return _c; }
Member Data Documentation
Output libMesh::ConstFunction< Output >::_c [private] |
Definition at line 58 of file const_function.h.
Referenced by libMesh::ConstFunction< Output >::clone(), and libMesh::ConstFunction< Output >::operator()().
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 166 of file function_base.h.
Referenced by libMesh::AnalyticFunction< Output >::AnalyticFunction(), libMesh::AnalyticFunction< Output >::clear(), libMesh::ConstFunction< Output >::ConstFunction(), libMesh::AnalyticFunction< Output >::init(), libMesh::FunctionBase< Output >::initialized(), libMesh::ParsedFunction< Output >::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 160 of file function_base.h.
The documentation for this class was generated from the following file:
Site Created By: libMesh Developers
Last modified: February 05 2013 19:55:13 UTC
Hosted By: