Poster of Linux kernelThe best gift for a Linux geek
FunctionBase

FunctionBase

Section: C Library Functions (3) Updated: Thu Apr 7 2011
Local index Up
 

NAME

FunctionBase -  

SYNOPSIS


#include <function_base.h>

Inherited by AnalyticFunction, and MeshFunction.  

Public Member Functions


virtual ~FunctionBase ()

virtual void init ()=0

virtual void clear ()=0

virtual Number operator() (const Point &p, const Real time=0.)=0

void operator() (const Point &p, DenseVector< Number > &output)

virtual void operator() (const Point &p, const Real time, DenseVector< Number > &output)=0

bool initialized () const
 

Protected Member Functions


FunctionBase (const FunctionBase *master=NULL)
 

Protected Attributes


const FunctionBase * _master

bool _initialized
 

Detailed Description

This is the base class for functor-like classes. These entities are functions (in the mathematical sense) of time and space, $ f(mathbf{x},t) = mbox{ exttt{v}} $, 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*.

Author:

Daniel Dreyer, 2003

Definition at line 58 of file function_base.h.  

Constructor & Destructor Documentation

 

FunctionBase::FunctionBase (const FunctionBase *master = NULL) [protected]Constructor. Optionally takes a master.

Definition at line 33 of file function_base.C.

                                                      :
  _master             (master),
  _initialized        (false)
{
}
 

FunctionBase::~FunctionBase () [virtual]Destructor.

Definition at line 41 of file function_base.C.

{
}
 

Member Function Documentation

 

virtual void FunctionBase::clear () [pure virtual]Clears the function.

Implemented in MeshFunction.  

virtual void FunctionBase::init () [pure virtual]The actual initialization process.

Implemented in MeshFunction, and AnalyticFunction.  

bool FunctionBase::initialized () const [inline]Returns:

true when this object is properly initialized and ready for use, false otherwise.

Definition at line 144 of file function_base.h.

References _initialized.

Referenced by MeshFunction::disable_out_of_mesh_mode(), MeshFunction::enable_out_of_mesh_mode(), MeshFunction::get_point_locator(), MeshFunction::gradient(), MeshFunction::hessian(), MeshFunction::operator()(), and AnalyticFunction::operator()().

{
  return (this->_initialized);
}
 

void FunctionBase::operator() (const Point &p, DenseVector< Number > &output) [inline]Return function for vectors. Returns in output the values of the data at the coordinate p.

Definition at line 152 of file function_base.h.

References operator()().

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

virtual void FunctionBase::operator() (const Point &p, const Realtime, DenseVector< Number > &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.

Implemented in MeshFunction, and AnalyticFunction.  

virtual Number FunctionBase::operator() (const Point &p, const Realtime = 0.) [pure virtual]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.

Implemented in MeshFunction, and AnalyticFunction.

Referenced by operator()().  

Member Data Documentation

 

bool FunctionBase::_initialized [protected]When init() was called so that everything is ready for calls to operator() (...), then this bool is true.

Definition at line 136 of file function_base.h.

Referenced by AnalyticFunction::AnalyticFunction(), MeshFunction::clear(), MeshFunction::init(), AnalyticFunction::init(), and initialized().  

const FunctionBase* FunctionBase::_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 130 of file function_base.h.

Referenced by MeshFunction::clear(), MeshFunction::gradient(), MeshFunction::hessian(), MeshFunction::init(), MeshFunction::operator()(), and MeshFunction::~MeshFunction().

 

Author

Generated automatically by Doxygen for libMesh from the source code.


 

Index

NAME
SYNOPSIS
Public Member Functions
Protected Member Functions
Protected Attributes
Detailed Description
Constructor & Destructor Documentation
FunctionBase::FunctionBase (const FunctionBase *master = NULL) [protected]Constructor. Optionally takes a master.
FunctionBase::~FunctionBase () [virtual]Destructor.
Member Function Documentation
virtual void FunctionBase::clear () [pure virtual]Clears the function.
virtual void FunctionBase::init () [pure virtual]The actual initialization process.
bool FunctionBase::initialized () const [inline]Returns:
void FunctionBase::operator() (const Point &p, DenseVector< Number > &output) [inline]Return function for vectors. Returns in output the values of the data at the coordinate p.
virtual void FunctionBase::operator() (const Point &p, const Realtime, DenseVector< Number > &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.
virtual Number FunctionBase::operator() (const Point &p, const Realtime = 0.) [pure virtual]Returns:
Member Data Documentation
bool FunctionBase::_initialized [protected]When init() was called so that everything is ready for calls to operator() (...), then this bool is true.
const FunctionBase* FunctionBase::_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.
Author

This document was created by man2html, using the manual pages.
Time: 21:46:24 GMT, April 16, 2011