libMesh::ConstFunction< Output > Class Template Reference

#include <const_function.h>

Inheritance diagram for libMesh::ConstFunction< Output >:

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

template<typename Output = Number>
libMesh::ConstFunction< Output >::ConstFunction ( const Output &  c)
inlineexplicit

Definition at line 37 of file const_function.h.

References libMesh::FunctionBase< Output >::_initialized.

37 : _c(c) { this->_initialized = true; }

Member Function Documentation

template<typename Output>
virtual void libMesh::FunctionBase< Output >::clear ( )
inlinevirtualinherited

Clears the function.

Reimplemented in libMesh::ParsedFunction< Output >, libMesh::MeshFunction, and libMesh::AnalyticFunction< Output >.

Definition at line 90 of file function_base.h.

90 {}
template<typename Output = Number>
virtual AutoPtr<FunctionBase<Output> > libMesh::ConstFunction< Output >::clone ( ) const
inlinevirtual

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.

52  {
53  return AutoPtr<FunctionBase<Output> >
54  (new ConstFunction<Output>(_c));
55  }
template<typename Output >
Output libMesh::FunctionBase< Output >::component ( unsigned int  i,
const Point p,
Real  time = 0. 
)
inlinevirtualinherited
Returns
the vector component 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 >, and libMesh::WrappedFunction< Output >.

Definition at line 203 of file function_base.h.

Referenced by libMesh::ProjectSolution::operator()(), libMesh::ProjectFEMSolution::operator()(), and libMesh::BoundaryProjectSolution::operator()().

206 {
207  DenseVector<Output> outvec(i+1);
208  (*this)(p, time, outvec);
209  return outvec(i);
210 }
template<typename Output>
virtual void libMesh::FunctionBase< Output >::init ( )
inlinevirtualinherited

The actual initialization process.

Reimplemented in libMesh::ParsedFunction< Output >, libMesh::MeshFunction, and libMesh::AnalyticFunction< Output >.

Definition at line 85 of file function_base.h.

85 {}
template<typename Output >
bool libMesh::FunctionBase< Output >::initialized ( ) const
inlineinherited
Returns
true when this object is properly initialized and ready for use, false otherwise.

Definition at line 194 of file function_base.h.

195 {
196  return (this->_initialized);
197 }
template<typename Output = Number>
virtual Output libMesh::ConstFunction< Output >::operator() ( const Point p,
const Real  time = 0 
)
inlinevirtual
Returns
the scalar value at coordinate 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.

Implements libMesh::FunctionBase< Output >.

Definition at line 39 of file const_function.h.

References libMesh::ConstFunction< Output >::_c.

41  { return _c; }
template<typename Output = Number>
virtual void libMesh::ConstFunction< Output >::operator() ( const Point p,
const Real  time,
DenseVector< Output > &  output 
)
inlinevirtual

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().

46  {
47  unsigned int size = output.size();
48  for (unsigned int i=0; i != size; ++i)
49  output(i) = _c;
50  }
template<typename Output>
void libMesh::FunctionBase< Output >::operator() ( const Point p,
DenseVector< Output > &  output 
)
inlineinherited

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.

218 {
219  // Call the time-dependent function with t=0.
220  this->operator()(p, 0., output);
221 }

Member Data Documentation

template<typename Output = Number>
Output libMesh::ConstFunction< Output >::_c
private
template<typename Output>
bool libMesh::FunctionBase< Output >::_initialized
protectedinherited

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::ConstFunction< Output >::ConstFunction(), libMesh::ParsedFunction< Output >::ParsedFunction(), and libMesh::WrappedFunction< Output >::WrappedFunction().

template<typename Output>
const FunctionBase* libMesh::FunctionBase< Output >::_master
protectedinherited

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 07 2014 16:57:59 UTC

Hosted By:
SourceForge.net Logo