Introduction


A program that uses the library "ugblock.h" consists of five parts (example see here ):

  1. The first part is the heading. One has to include:

    #include "source/ugblock.h"
    using namespace ::_COLSAMM_;
  2. In the second part one has to define the unstructured grid, on which the PDE is defined. This is an object of class Unstructured_grid. There exist several derived classes, which describe an Hexahedron or an Cylinder .

  3. In the third part one has to construct the discretization grid of class Blockgrid. There exist different constructors of an object of class Blockgrid. One simple construction is show in the following example:

    Example:

       int m;
       double R,r,l;
       R = 2.0;                         // radius of cylinder
       r = 1.0;                         // radius of inner grid of blockgrid
       l = 4.0;                         // length of cylinder 
       m = 200;                         // number of grid points in each direction
       Cylinder cylinder(R,r,l);
       Blockgrid grid(&cylinder,m);
  4. Variables are vectors on a discretization grid (object of class blockgrid ). For example, variables can be defined in the following way:

      Variable u<double> (grid);
      Variable w<double> (grid);
  5. This is the main part, which contains the mathematical algorithm. For example, after

      X_coordinate X(grid);
    
      u = X;
      w = 2.2;
      u = u + w;

    the vector represented by u contains the value x+2.2 at every grid point, where x is the x-coordinate of each grid point.


Handbook

Last modified: Wed Jun 6 10:15:36 PDT 2001