A multilevel algorithm is based on a sequence of fine and coarse grids and restriction and prolongation operators. This library does not provide such a sequence of coarse grids or a sequence of restriction and prolongation operators (instead see general array construction. ). But it contains the class class Multigrid_operator which enables the restriction and prolongation of variables between two grids and the restriction of local stiffness matrices. The main member function of this class are
Multigrid_operator::Multigrid_operator(Blockgrid& coarse_grid_,Blockgrid& fine_grid_); ... Multigrid_operator::Restrict (const Variable<DTyp>& v); ... Multigrid_operator::Prolongate (const Variable<DTyp>& v); ... Multigrid_operator::Restrict(const Local_stiffness_matrix<TYPE2>& lm);
Depending on the coarse and fine grid an object of class Multigrid_operator can perform a restriction in x,y, and z and any possible semi-coaresing constructions which are needed. To this end, the coarse and fine grid have to be block grids of the same unstructured_grid . Furthermore, the number of grid points has to increase by a factor 1 or 2 for each direction from coarse to fine grid.
Then, one can apply restriction and prolongation operator as follows to varaibles:
Multigrid_operator MGop(coarsegrid,finegrid); Variable<double> f(coarsegrid), e(coarsegrid); Variable<double> r(finegrid), uf(finegrid); f = Mgop.Restrict(r); uf = Mgop.Prolongate(e);
Furthermore, local stiffness matrices can be coarsened as follows:
Multigrid_operator Mgop(coarsegrid,finegrid); Local_stiffness_matrix<double> laplace_f(finegrid); Local_stiffness_matrix<double> laplace_c(coarsegrid); laplace_c = Mgop[i].Restrict(laplace_f);
For the construction of multilevel grids or multilevel variables or multilevel stiffness matrices one can apply the general array construction.
Last modified: Thu Feb 10 16:28:05 MET 2000