[petsc-users] interpolation function in multigrid

coco at dmi.unict.it coco at dmi.unict.it
Tue Sep 11 17:11:27 CDT 2012


Dear all,

I am using the multigrid as preconditioner, and I got in a trouble  
with the interpolation function. In practice, I defined a user  
interpolation function:

PetscErrorCode UserMultAddInterpolation(Mat mat,Vec x,Vec v2, Vec y);

and I noticed that the vectors v2 and y are zero in input, while I am  
expected that they are the solution computed in the smooth down  
process at the same level. In detail, given the following source code  
of the petsc file mg.c :

ierr =  
KSPSolve(mglevels->smoothd,mglevels->b,mglevels->x);CHKERRQ(ierr);  /*  
pre-smooth */
[...]
     while (cycles--) {
       ierr = PCMGMCycle_Private(pc,mglevelsin-1,reason);CHKERRQ(ierr);
     }
[...]
     ierr =  
MatInterpolateAdd(mglevels->interpolate,mgc->x,mglevels->x,mglevels->x);CHKERRQ(ierr);

I observed that mglevels->x is a vector which contains the correct  
values after the KSPSolve calling for the pre-smooth step, but it is a  
zero vector when given in input to the MatInterpolateAdd routine.
I would like to debug the mg.c code, for instance accessing the single  
values of the vector mglevels->x and figuring out where they are  
zeroed out between the KSPSolve and MatInterpolateAdd callings. Would  
you have some suggestion for this debugging?

Thank you for the collaboration.
Best regards,
Armando



More information about the petsc-users mailing list