libMesh::ZeroFunction< Output > Class Template Reference

ConstFunction that simply returns 0. More...

#include <zero_function.h>

Inheritance diagram for libMesh::ZeroFunction< Output >:

Public Member Functions

 ZeroFunction ()
 
virtual UniquePtr< FunctionBase< Output > > clone () const libmesh_override
 
virtual Output operator() (const Point &, const Real=0) libmesh_override
 
virtual void operator() (const Point &, const Real, DenseVector< Output > &output) libmesh_override
 
void operator() (const Point &p, DenseVector< Output > &output)
 
virtual void init ()
 
virtual void clear ()
 
virtual Output component (unsigned int i, const Point &p, Real time=0.)
 
bool initialized () const
 
void set_is_time_dependent (bool is_time_dependent)
 
bool is_time_dependent () const
 

Protected Attributes

const FunctionBase_master
 
bool _initialized
 
bool _is_time_dependent
 

Detailed Description

template<typename Output = Number>
class libMesh::ZeroFunction< Output >

ConstFunction that simply returns 0.

ConstFunction that simply returns 0.

Author
Roy Stogner
Date
2012

Definition at line 35 of file zero_function.h.

Constructor & Destructor Documentation

template<typename Output = Number>
libMesh::ZeroFunction< Output >::ZeroFunction ( )
inline

Definition at line 38 of file zero_function.h.

38 : ConstFunction<Output>(0) {}

Member Function Documentation

template<typename Output = Number>
virtual void libMesh::FunctionBase< Output >::clear ( )
inlinevirtualinherited
template<typename Output = Number>
virtual UniquePtr<FunctionBase<Output> > libMesh::ZeroFunction< 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.

Reimplemented from libMesh::ConstFunction< Output >.

Definition at line 40 of file zero_function.h.

41  {
42  return UniquePtr<FunctionBase<Output> >(new ZeroFunction<Output>());
43  }
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.
Note
Subclasses aren't required to override this, since the default implementation is based on the full vector evaluation, which is often correct.
Subclasses are recommended to override this, since the default implementation is based on a vector evaluation, which is usually unnecessarily inefficient.

Reimplemented in libMesh::CompositeFunction< Output >, libMesh::ParsedFunction< Output, OutputGradient >, libMesh::ParsedFunction< T >, and libMesh::WrappedFunction< Output >.

Definition at line 230 of file function_base.h.

Referenced by libMesh::FunctionBase< Real >::clear().

233 {
234  DenseVector<Output> outvec(i+1);
235  (*this)(p, time, outvec);
236  return outvec(i);
237 }
template<typename Output = Number>
virtual void libMesh::FunctionBase< Output >::init ( )
inlinevirtualinherited
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 208 of file function_base.h.

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

Referenced by libMesh::FunctionBase< Real >::clear(), and libMesh::AnalyticFunction< Output >::operator()().

209 {
210  return (this->_initialized);
211 }
template<typename Output >
bool libMesh::FunctionBase< Output >::is_time_dependent ( ) const
inlineinherited
template<typename Output = Number>
virtual Output libMesh::ConstFunction< Output >::operator() ( const Point p,
const Real  time = 0 
)
inlinevirtualinherited
Returns
The scalar function value at coordinate p and time time, which defaults to zero.

Pure virtual, so you have to override it.

Implements libMesh::FunctionBase< Output >.

Definition at line 52 of file const_function.h.

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

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

Evaluation function for time-dependent vector-valued functions. Sets output values in the passed-in output DenseVector.

Pure virtual, so you have to override it.

Implements libMesh::FunctionBase< Output >.

Definition at line 56 of file const_function.h.

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

59  {
60  unsigned int size = output.size();
61  for (unsigned int i=0; i != size; ++i)
62  output(i) = _c;
63  }
template<typename Output>
void libMesh::FunctionBase< Output >::operator() ( const Point p,
DenseVector< Output > &  output 
)
inlineinherited

Evaluation function for time-independent vector-valued functions. Sets output values in the passed-in output DenseVector.

Definition at line 243 of file function_base.h.

References libMesh::FunctionBase< Output >::operator()().

245 {
246  // Call the time-dependent function with t=0.
247  this->operator()(p, 0., output);
248 }
virtual Output operator()(const Point &p, const Real time=0.)=0
template<typename Output >
void libMesh::FunctionBase< Output >::set_is_time_dependent ( bool  is_time_dependent)
inlineinherited

Function to set whether this is a time-dependent function or not. This is intended to be only used by subclasses who cannot natively determine time-dependence. In such a case, this function should be used immediately following construction.

Definition at line 215 of file function_base.h.

References libMesh::FunctionBase< Output >::_is_time_dependent, and libMesh::FunctionBase< Output >::is_time_dependent().

Referenced by libMesh::FunctionBase< Real >::clear().

216 {
218 }
bool is_time_dependent() const

Member Data Documentation

template<typename Output = Number>
bool libMesh::FunctionBase< Output >::_is_time_dependent
protectedinherited
template<typename Output = Number>
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 168 of file function_base.h.


The documentation for this class was generated from the following file: