ksp tutorial ex22

Barry Smith bsmith at mcs.anl.gov
Thu Dec 10 14:12:24 CST 2009


On Dec 10, 2009, at 2:09 PM, Ryan Yan wrote:

> Hi all,
> I was looking at the ex22 of ksp.
>
> If I call:
> ...
> ierr = DMMGCreate(PETSC_COMM_WORLD,3,PETSC_NULL,&dmmg);CHKERRQ(ierr);
> ierr =  
> DACreate3d 
> (PETSC_COMM_WORLD 
> ,DA_NONPERIODIC 
> ,DA_STENCIL_STAR,-3,-3,-3,PETSC_DECIDE,PETSC_DECIDE,PETSC_DECIDE, 
> 1,1,0,0,0,&da);CHKERRQ(ierr);
>   ...
>
> How many grid pts should I have on the finest level? Is it 27,  
> considering I am set 3 as the global dimension in each direction of  
> the array?
>
> When I run ex22 with -ksp_view, I saw that  on the finest level  
> there are 9 pts on each direction.
>
> Is that because I have 3 level?

    Yes. The DA you create initially is for the coarsest grid, finer  
ones are automatically created by the DMMG.

    Barry

>
> Yan
>



More information about the petsc-users mailing list