Poster of Linux kernelThe best gift for a Linux geek
AnalyticFunction

AnalyticFunction

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

NAME

AnalyticFunction -  

SYNOPSIS


#include <analytic_function.h>

Inherits FunctionBase.  

Public Member Functions


AnalyticFunction (Number fptr(const Point &p, const Real time))

AnalyticFunction (void fptr(DenseVector< Number > &output, const Point &p, const Real time))

~AnalyticFunction ()

void init ()

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

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

virtual void clear ()=0

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

bool initialized () const
 

Public Attributes


Number(* _number_fptr )(const Point &p, const Real time)

void(* _vector_fptr )(DenseVector< Number > &output, const Point &p, const Real time)
 

Protected Attributes


const FunctionBase * _master

bool _initialized
 

Detailed Description

This class provides function-like objects for which an analytical expression can be provided. The user may either provide vector-return or number-return functions.

Author:

Daniel Dreyer, 2003

Definition at line 48 of file analytic_function.h.  

Constructor & Destructor Documentation

 

AnalyticFunction::AnalyticFunction (Number fptrconst Point &p,const Real time)Constructor. Takes a function pointer for scalar return values.

Definition at line 32 of file analytic_function.C.

References FunctionBase::_initialized.

                                                                  :
  FunctionBase (),
  _number_fptr (fptr)
{
  libmesh_assert (fptr != NULL);
  this->_initialized = true;
}
 

AnalyticFunction::AnalyticFunction (void fptrDenseVector< Number > &output,const Point &p,const Real time)Constructor. Takes a function pointer for vector valued functions.

Definition at line 44 of file analytic_function.C.

References FunctionBase::_initialized.

                                                                :
  FunctionBase (),
  _vector_fptr (fptr)
{
  libmesh_assert (fptr != NULL);
  this->_initialized = true;
}
 

AnalyticFunction::~AnalyticFunction ()Destructor.

Definition at line 57 of file analytic_function.C.

{
}
 

Member Function Documentation

 

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

Implemented in MeshFunction.  

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

Implements FunctionBase.

Definition at line 65 of file analytic_function.C.

References FunctionBase::_initialized, _number_fptr, and _vector_fptr.

{
  // dumb double-test
  libmesh_assert ((_number_fptr != NULL) || (_vector_fptr != NULL));

  // definitely ready
  this->_initialized = true;
}
 

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

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

Definition at line 144 of file function_base.h.

References FunctionBase::_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 operator()().

{
  return (this->_initialized);
}
 

Number AnalyticFunction::operator() (const Point &p, const Realtime = 0.) [inline, virtual]Returns:

the value at point p and time time, which defaults to zero.

Implements FunctionBase.

Definition at line 114 of file analytic_function.h.

References _number_fptr, and FunctionBase::initialized().

{
  libmesh_assert (this->initialized());
  return (this->_number_fptr(p, time));
}
 

void FunctionBase::operator() (const Point &p, DenseVector< Number > &output) [inline, inherited]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 FunctionBase::operator()().

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

void AnalyticFunction::operator() (const Point &p, const Realtime, DenseVector< Number > &output) [inline, virtual]Like before, but returns the values in a writable reference.

Implements FunctionBase.

Definition at line 124 of file analytic_function.h.

References _vector_fptr, and FunctionBase::initialized().

{
  libmesh_assert (this->initialized());
  this->_vector_fptr(output, p, time);
  return;
}
 

Member Data Documentation

 

bool FunctionBase::_initialized [protected, inherited]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(), MeshFunction::clear(), MeshFunction::init(), init(), and FunctionBase::initialized().  

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

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

Number(* AnalyticFunction::_number_fptr)(const Point &p, const Real time)Pointer to user-provided function that computes the boundary values when an analytical expression is available.

Definition at line 77 of file analytic_function.h.

Referenced by init(), and operator()().  

void(* AnalyticFunction::_vector_fptr)(DenseVector< Number > &output, const Point &p, const Real time)Pointer to user-provided vector valued function.

Definition at line 83 of file analytic_function.h.

Referenced by init(), and operator()().

 

Author

Generated automatically by Doxygen for libMesh from the source code.


 

Index

NAME
SYNOPSIS
Public Member Functions
Public Attributes
Protected Attributes
Detailed Description
Constructor & Destructor Documentation
AnalyticFunction::AnalyticFunction (Number fptrconst Point &p,const Real time)Constructor. Takes a function pointer for scalar return values.
AnalyticFunction::AnalyticFunction (void fptrDenseVector< Number > &output,const Point &p,const Real time)Constructor. Takes a function pointer for vector valued functions.
AnalyticFunction::~AnalyticFunction ()Destructor.
Member Function Documentation
virtual void FunctionBase::clear () [pure virtual, inherited]Clears the function.
void AnalyticFunction::init () [virtual]The actual initialization process.
bool FunctionBase::initialized () const [inline, inherited]Returns:
Number AnalyticFunction::operator() (const Point &p, const Realtime = 0.) [inline, virtual]Returns:
void FunctionBase::operator() (const Point &p, DenseVector< Number > &output) [inline, inherited]Return function for vectors. Returns in output the values of the data at the coordinate p.
void AnalyticFunction::operator() (const Point &p, const Realtime, DenseVector< Number > &output) [inline, virtual]Like before, but returns the values in a writable reference.
Member Data Documentation
bool FunctionBase::_initialized [protected, inherited]When init() was called so that everything is ready for calls to operator() (...), then this bool is true.
const FunctionBase* FunctionBase::_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.
Number(* AnalyticFunction::_number_fptr)(const Point &p, const Real time)Pointer to user-provided function that computes the boundary values when an analytical expression is available.
void(* AnalyticFunction::_vector_fptr)(DenseVector< Number > &output, const Point &p, const Real time)Pointer to user-provided vector valued function.
Author

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