[petsc-users] Diagnosing Poisson Solver Behavior

Barry Smith bsmith at mcs.anl.gov
Tue Oct 13 17:03:25 CDT 2015


> On Oct 13, 2015, at 4:57 PM, Matthew Knepley <knepley at gmail.com> wrote:
> 
> On Tue, Oct 13, 2015 at 4:53 PM, K. N. Ramachandran <knram06 at gmail.com> wrote:
> Hello Matt,
> 
> Ah ok. I had tried specifying -pc_mg_levels earlier, but it asks for interpolation to be setup. I am currently working on using DMDA from examples 32 and 34, which sets up the interpolation, using DMDASetInterpolationType. So this is the recommended way to go forward right?
> 
> Since I supply the sparse matrix format and the rhs values to PETSc, does it make sense to do a DMDACreate1d instead of 3d? I did a sample implementation using DMDA 1d and when I call KSPSolve and fetch the solution, it comes out all zeros, with the solver having converged. I am trying to understand what I am doing wrong there.
> 
> My understanding was that you are just solving 3D Poisson with a star stencil on a regular grid. SNES ex5 solves 2D Poisson with
> a star stencil on a regular grid (set lambda = 0.0). Just use that until you understand the performance, and then change it for 3D
> which is only about 10 lines of code.

   See src/ksp/ksp/examples/tutorials/ex45.c which does exactly the 3d problem.

> 
> For this problem, there is no need for the more complicated stuff.
> 
>   Thanks,
> 
>      Matt
>  
> On Mon, Oct 12, 2015 at 10:17 PM, Matthew Knepley <knepley at gmail.com> wrote:
> On Mon, Oct 12, 2015 at 9:11 PM, K. N. Ramachandran <knram06 at gmail.com> wrote:
> Hello Matt,
> 
> Actually I felt the boundary conditions were having a role to play and set all the boundary conditions to Dirichlet. In this case, convergence was almost immediate with the Hypre preconditioner, taking 17 seconds with 3 iterations. The MG method took about the same time though.
> 
> So I reverted to the Dirichlet, Neumann mix of BCs and Hypre starts to diverge. Please find attached the output for the Hypre run using Dirichlet and Neumann for a 21^3 grid (rows), with a max of 7 nonzeros per row. Details of the options used before running are in the file. The solver used in all cases is bcgs.
> 
> Also attached is the MG output for 101^3 grid
> 1) Dirichlet and Neumann
> 2) Dirichlet only
> 
> where it seems to take about the same time.
> 
> Notice that you have no levels of MG here. You need to use -pc_mg_levels <n>
> 
>    Matt
>  
> 
> 
> 
> Thanking You,
> Ramachandran K.N.
> Ph: 814-441-4279
> 
> 
> 
> -- 
> What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
> -- Norbert Wiener



More information about the petsc-users mailing list