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. 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::CompositeFunction< Output >, libMesh::WrappedFunction< Output >, libMesh::ParsedFunction< Output, OutputGradient >, and libMesh::ParsedFunction< T >.

Definition at line 234 of file function_base.h.

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

237 {
238  DenseVector<Output> outvec(i+1);
239  (*this)(p, time, outvec);
240  return outvec(i);
241 }
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 212 of file function_base.h.

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

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

213 {
214  return (this->_initialized);
215 }
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 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 51 of file const_function.h.

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

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

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.

Implements libMesh::FunctionBase< Output >.

Definition at line 55 of file const_function.h.

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

58  {
59  unsigned int size = output.size();
60  for (unsigned int i=0; i != size; ++i)
61  output(i) = _c;
62  }
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 247 of file function_base.h.

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

249 {
250  // Call the time-dependent function with t=0.
251  this->operator()(p, 0., output);
252 }
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 219 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().

220 {
222 }
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 172 of file function_base.h.


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