Functions

Let

  double (*function)(double x);

be a pointer to a function. Then,

  Function1<double,double> F(function);

defines a function which can be used in an expression.

Functions with 2 or 3 parameters can be defined by

  Function2<double,double> F(function);

and 

  Function3<double,double> F(function);

Expressions with functions are not allowed to contain stencil operators!



Example:

  Variable<double> u_exact(grid);
  X_coordinate X(grid);
  Y_coordinate Y(grid);

  Function1<double,double> Cos(cos);        // definition of a function
  u_exact = Cos(X)*Cos(Y);   // exact solution
                             // of an equation

Handbook

Last modified: Tue Feb 22 11:08:52 MET 2000