Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

FieldsFunc Class Reference

vector field defined as a C/C++ function or functor. More...

#include <FieldsFunc.h>

Inheritance diagram for FieldsFunc::

Fields HandleId FieldVecIdentity TransfMap List of all members.

Public Methods

 FieldsFunc (const char *name=NULL)
 ~FieldsFunc ()
 FieldsFunc (const FieldsFunc &)
virtual bool ok () const
virtual void valuePt (Ptv(NUMT) &vec, const Ptv(real) &x, real t=DUMMY)
virtual Ptv(NUMT) operator() (const Ptv(real) &x, real t) const
virtual void gradientPt (Ptm(NUMT) &, const Ptv(real) &x, real=DUMMY)
virtual void hessianPt (Ptm(NUMT) &, const Ptv(real) &x, real=DUMMY)
virtual void valueFEM (Ptv(NUMT) &vec, const FiniteElement &fe, real t=DUMMY)
virtual void gradientFEM (Ptm(NUMT) &g, const FiniteElement &fe, real t=DUMMY)
virtual void hessianFEM (Ptm(NUMT) &, const FiniteElement &fe, real=DUMMY)
virtual NUMT divergenceFEM (const FiniteElement &fe, real=DUMMY)

Detailed Description

vector field defined as a C/C++ function or functor.

NAME: FieldsFunc - vector field defined as a C/C++ function or functor

DESCRIPTION:

The class implements a vector field defined in terms of an explicit function. The function takes a spatial point and a time value as arguments and returns a "Ptv" value. The time value can be omitted since the default value is "DUMMY" (hence it is easy to recognize situations where the time value has not been supplied, just test if it is equal to "DUMMY)."

Here is a description of how to implement an explicit vector fields using this class. Derive a new class from "FieldsFunc". In the derived class one implements the virtual functions "operator()" and "valuePt." Both these functions perform the same task, the only difference is that "operator()" is a const-functions and allows a prettier syntax. This type of "FieldsFunc" is actually a so called functor. In the user''s class one may have references to other problem dependent classes such that data can be accessed.

One of the purposes of "FieldsFunc" is to support an interface to user defined functions such that all vector fields, whether they are explicit functions or complicated finite element functions, have a common interface. In other words, the programmer can work with "Fields" without knowing the details of the representation of the field. Another purpose is to offer a base class for problem dependent functors reflecting `{\em` vector fields`}`. (Observe that tensor fields can easily be representd by class "FieldsFunc" - just let the number of components equal the number of distinct components in the tensor).

This class contains a pointer to the function and maybe a pointer to the derivate of the function. If the latter is missing, derivates can be calculated by numerical differentiation. If both pointers are missing, this object cannot be used on its own, and it is required that the user derives a class and uses "FieldsFunc" as a base class for a functor.


Constructor & Destructor Documentation

FieldsFunc::FieldsFunc ( const char * name = NULL ) [inline]
 

FieldsFunc::~FieldsFunc ( )
 

FieldsFunc::FieldsFunc ( const FieldsFunc & )
 

See documentation of one of the overloaded constructor.


Member Function Documentation

NUMT FieldsFunc::divergenceFEM ( const FiniteElement & fe,
real t = DUMMY ) [virtual]
 

Reimplemented from Fields.

void FieldsFunc::gradientFEM ( Ptm(NUMT) & g,
const FiniteElement & fe,
real t = DUMMY ) [virtual]
 

Reimplemented from Fields.

void FieldsFunc::gradientPt ( Ptm(NUMT) & g,
const Ptv(real) & x,
real t = DUMMY ) [virtual]
 

evaluates the gradient of the vector field "f" at a point in space and time, i.e. in 2D "[[df(1)/dx,df(1)/dy],[df(2)/dx,df(2)/dy]]". Thus, row 1 contains the derivatives of the first field component, row 2 contains the derivatives of the second field components, etc.

Reimplemented from Fields.

void FieldsFunc::hessianFEM ( Ptm(NUMT) &,
const FiniteElement & fe,
real = DUMMY ) [virtual]
 

Reimplemented from Fields.

void FieldsFunc::hessianPt ( Ptm(NUMT) &,
const Ptv(real) & x,
real = DUMMY ) [virtual]
 

Reimplemented from Fields.

bool FieldsFunc::ok ( ) const [inline, virtual]
 

Reimplemented from Fields.

Ptv(NUMT) FieldsFunc::operator() ( const Ptv(real) & x,
real t ) const [virtual]
 

Reimplemented in FieldVecIdentity.

void FieldsFunc::valueFEM ( Ptv(NUMT) & vec,
const FiniteElement & fe,
real t = DUMMY ) [virtual]
 

Reimplemented from Fields.

void FieldsFunc::valuePt ( Ptv(NUMT) & deformed,
const Ptv(real) & refbox,
real time = DUMMY ) [virtual]
 

evaluates the function. This is a non-const function and it is also virtual in the "Field" base class.

Reimplemented from Fields.

Reimplemented in FieldVecIdentity, and TransfMap.


The documentation for this class was generated from the following file:
Copyright © 2003 inuTech GmbH. All rights reserved.