Diffpack Documentation


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

FieldConst Class Reference

constant scalar field. More...

#include <FieldConst.h>

Inheritance diagram for FieldConst::

Field HandleId List of all members.

Public Methods

 FieldConst (const char *name=NULL)
 FieldConst (NUMT value, const char *name=NULL)
 ~FieldConst ()
virtual bool ok () const
virtual void minmax (NUMT &min, NUMT &max, GridWithPts *grid=NULL) const
NUMT& value ()
NUMT value () const
virtual NUMT valuePt (const Ptv(real) &x, real t=DUMMY)
virtual NUMT valueFEM (const FiniteElement &fe, real t=DUMMY)
virtual NUMT valueNode (int node, real t=DUMMY) const
virtual NUMT divergencePt (const Ptv(real) &x, real t=DUMMY)
virtual NUMT divergenceFEM (const FiniteElement &fe, real t=DUMMY)
virtual NUMT divergenceNode (int node, real t=DUMMY)
virtual Ptv(NUMT) derivativePt (const Ptv(real) &x, real t)
virtual void derivativeFEM (Ptv(NUMT) &d, const FiniteElement &fe, real t=DUMMY)
virtual void derivativeNode (Ptv(NUMT) &, int node, real t=DUMMY)
virtual void hessianPt (Ptv(NUMT) &, const Ptv(real) &x, real=DUMMY)
virtual void hessianFEM (Ptv(NUMT) &, const FiniteElement &fe, real=DUMMY)
virtual void hessianNode (Ptv(NUMT) &, int node, real=DUMMY)
virtual void fill (NUMT value)
virtual void add (NUMT value)
virtual void mult (NUMT value)
virtual void apply (Func(NUMT) f)
virtual void add (Field &field, int power, NUMT front_factor)
virtual void print (Os os) const
virtual Fieldscale ()
virtual Fieldunscale ()

Detailed Description

constant scalar field.

NAME: FieldConst - constant scalar field

DESCRIPTION:

The class implements a scalar field that is simply a constant. It may seem as an overkill to have a special field class with lots of virtual functions to represent a constant value. However, the purpose is to offer a complete scalar field hierarchy such that the programmer can work with a general "Field" without knowing whether the field is actually a complicated finite element, an explicit function or a constant. The "FieldConst" ensures that constant fields has the same interface as all other fields. At the same time, the "FieldConst" gives (nearly) optimal efficiency when the field is constant.

With the class "Field" documentation, the functions and the data should be self-explanatory.


Constructor & Destructor Documentation

FieldConst::FieldConst ( const char * name = NULL )
 

FieldConst::FieldConst ( NUMT value,
const char * name = NULL )
 

FieldConst::~FieldConst ( ) [inline]
 


Member Function Documentation

void FieldConst::add ( Field & field,
int power,
NUMT front_factor ) [virtual]
 

See documentation of one of the overloaded functions.

Reimplemented from Field.

void FieldConst::add ( NUMT value ) [virtual]
 

adds a constant field to the field. An overloaded version takes a "Field" "f", an integer power "i" and a factor "c" as arguments. The formula "c*f^i" is added to the object field.

Reimplemented from Field.

void FieldConst::apply ( Func(NUMT) f ) [virtual]
 

applies a function, like "sin(x)", to the field.

Reimplemented from Field.

void FieldConst::derivativeFEM ( Ptv(NUMT) & d,
const FiniteElement & fe,
real t = DUMMY ) [virtual]
 

Reimplemented from Field.

void FieldConst::derivativeNode ( Ptv(NUMT) & d,
int node,
real t = DUMMY ) [virtual]
 

Reimplemented from Field.

Ptv(NUMT) FieldConst::derivativePt ( const Ptv(real) & x,
real t ) [virtual]
 

evaluates the derivative of the field at a point in space and time.

Reimplemented from Field.

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

Reimplemented from Field.

NUMT FieldConst::divergenceNode ( int node,
real t = DUMMY ) [virtual]
 

Reimplemented from Field.

NUMT FieldConst::divergencePt ( const Ptv(real) & x,
real t = DUMMY ) [virtual]
 

evaluates the divergence of the field "f" at a point in space and time, i.e. "df/dx + df/dy + df/dz"

Reimplemented from Field.

void FieldConst::fill ( NUMT value ) [virtual]
 

fills the field with a numerical value (that is, the field becomes constant).

Reimplemented from Field.

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

Reimplemented from Field.

void FieldConst::hessianNode ( Ptv(NUMT) &,
int node,
real = DUMMY ) [virtual]
 

Reimplemented from Field.

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

evaluates the hessian (2nd derivatives) of the field at a point in space and time, i.e. f,xx for nsd=1, {f,xx f,yy f,xy} for nsd=2 and {f,xx f,yy f,zz f,xy f,xz f,yz} for nsd=3.

Reimplemented from Field.

void FieldConst::minmax ( NUMT & min,
NUMT & max,
GridWithPts * grid = NULL ) const [virtual]
 

finds the minimum and maximum values of the field. Most of the subclass fields have an internal grid and will find the extreme values over this grid. The "minmax" function has an optional argument "grid" that can be supplied. This grid is not used if the field has an internal grid. However, some fields, like "FieldFunc", do not have internal grids and in that case the "grid" argument is required in order to compute the extreme values.

Reimplemented from Field.

void FieldConst::mult ( NUMT value ) [virtual]
 

multiplies the field values by a number.

Reimplemented from Field.

bool FieldConst::ok ( ) const [virtual]
 

returns true if the object is initialized, for the base class "Field" it just writes an error messages such that if a derived class fails to define an "ok" function, an error message will be written.

Reimplemented from Field.

void FieldConst::print ( Os os ) const [virtual]
 

prints the field. Most subclass implementations involve printing the field values and the grid.

Reimplemented from Field.

Field & FieldConst::scale ( ) [virtual]
 

scale the field values and the space(-time) domain. That is, the original values of the field are overwritten by the new, scaled values. To retrieve the original values, call "unscale". Both "scale" and "unscale" tests a variable first to determine if the field is already scaled or unscaled (calling e.g. "scale" twice then results in no action of the second call).

Reimplemented from Field.

Field & FieldConst::unscale ( ) [virtual]
 

the inverse action of "scale".

Reimplemented from Field.

NUMT FieldConst::value ( ) const [inline]
 

NUMT & FieldConst::value ( ) [inline]
 

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

evaluates the field at a point in space and time, but the argument is a "FiniteElement" object which means that the evaluation process in a finite element context will be very efficient (since "FiniteElement" knows the element number and the local coordinates of the spatial point). The function is virtual and offers a unified interface to the evaluation of all types of fields in a finite element based simulator.

Reimplemented from Field.

NUMT FieldConst::valueNode ( int node,
real t = DUMMY ) const [virtual]
 

evaluates the field at a nodal point in space and time.

Reimplemented from Field.

NUMT FieldConst::valuePt ( const Ptv(real) & x,
real t = DUMMY ) [virtual]
 

evaluates the field at a point in space and time. The time argument can be omitted, the default value is then "DUMMY". Generally, we suggest to use "DUMMY" to check if fields are stationary.

Reimplemented from Field.


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