[petsc-users] Using GAMG to speed up solving of Poisson eqn

TAY wee-beng zonexo at gmail.com
Thu Jul 25 07:57:25 CDT 2013


Hi,

Part of my code is :

*/do ...

call MatSetValues(A_mat,1,II,1,JJ,big_A(ijk,kk),ADD_VALUES,ierr)/**/
/**//**/
/**/end do/**//**/
/**/
/**/    call MatAssemblyBegin(A_mat,MAT_FINAL_ASSEMBLY,ierr)/**/
/**/
/**/    call MatAssemblyEnd(A_mat,MAT_FINAL_ASSEMBLY,ierr)/**/
/**//**/
/**/    call 
MatSetOption(A_mat,MAT_STRUCTURALLY_SYMMETRIC,PETSC_TRUE,ierr)/**/
/**/
/**/    call 
MatSetOption(A_mat,MAT_NEW_NONZERO_LOCATIONS,PETSC_FALSE,ierr)/**/
/**//**/
/**/    call KSPSetOperators(ksp,A_mat,A_mat,SAME_NONZERO_PATTERN,ierr)/**/
/**/
/**/    call KSPGetPC(ksp,pc,ierr) /**/
/**//**/
/**/    call KSPSetOptionsPrefix(ksp,"poisson_",ierr)/**/
/**/
/**/    ksptype=KSPBCGS/**/
/**/
/**/    call KSPSetType(ksp,ksptype,ierr)/**/
/**/
/**/    !call PCSetType(pc,PCGAMG,ierr)/**/
/**/
/**/
/**/    call KSPSetFromOptions(ksp,ierr)/**/
/**/
/**/    tol=1.e-5/**/
/**/
/**/    call 
KSPSetTolerances(ksp,tol,PETSC_DEFAULT_DOUBLE_PRECISION,PETSC_DEFAULT_DOUBLE_PRECISION,PETSC_DEFAULT_INTEGER,ierr)/**/
/**/
do ...

/**/call VecSetValue(b_rhs,II,q_p(ijk),INSERT_VALUES,ierr)/**/

end do
/**/
/*/*c*/*/all VecAssemblyBegin(b_rhs,ierr)/**/
/**/
/**/call VecAssemblyEnd(b_rhs,ierr)/**/
/**/
/**/call VecAssemblyBegin(xx,ierr)/**/
/**/
/**/call VecAssemblyEnd(xx,ierr)/**/
/**/
/**/call KSPSolve(ksp,b_rhs,xx,ierr)/**/- hang
/**/
/**/call KSPGetConvergedReason(ksp,reason,ierr)/*

It hangs at */KSPSolve/*, when used with the option :

-poisson_pc_gamg_agg_nsmooths 1 -poisson_pc_type gamg

Yours sincerely,

TAY wee-beng

On 20/7/2013 8:36 PM, Jed Brown wrote:
> -poisson_pc_gamg_agg_nsmooths 1 -poisson_pc_type gamg

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130725/2612212b/attachment.html>


More information about the petsc-users mailing list