<span class="gI"></span>Hello,<br><br>I would like to solve nonlinear PDEs on a regular grid (DMDACreate2D, 2 dof per node) using:<br>- MatFDColoring to compute the Jacobian matrix<br>- The ASM preconditioner<br><br><br>Here is an overview of the code:<br>
<br>ierr = DMGetMatrix(da,MATAIJ,&J);<br>ierr = TSGetSNES(ts,&snes);<br>ierr = DMGetColoring(da,IS_COLORING_GLOBAL,MATAIJ,&iscoloring);<br>ierr = MatFDColoringCreate(J,iscoloring,&matfdcoloring);<br>ierr = MatFDColoringSetFromOptions(matfdcoloring);<br>
ierr = ISColoringDestroy(&iscoloring);<br>ierr = MatFDColoringSetFunction(matfdcoloring,(PetscErrorCode (*)(void))SNESTSFormFunction,ts);<br>ierr = SNESSetJacobian(snes,J,J,SNESDefaultComputeJacobianColor,matfdcoloring);<br>
ierr = KSPCreate(PETSC_COMM_WORLD,&ksp);<br>ierr = KSPSetOperators(ksp,J,J,DIFFERENT_NONZERO_PATTERN);<br>ierr = KSPGetPC(ksp,&pc);<br>ierr = PCSetType(pc,PCASM);<br>ierr = PCASMSetOverlap(pc,1);<br>ierr = KSPSetUp(ksp);<br>
ierr = SNESSetKSP(snes,ksp);<br>ierr = TSSetFromOptions(ts);<br>ierr = TSSolve(ts,u,&ftime);<br><br>And I have the following error for overlap>0.<br><br>[1]PETSC ERROR: ------------------------------------------------------------------------<br>
[1]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range<br>[1]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger<br>[1]PETSC ERROR: or see <a href="http://www.mcs.anl.gov/petsc/petsc-as/documentation/faq.html#valgrind">http://www.mcs.anl.gov/petsc/petsc-as/documentation/faq.html#valgrind</a><br>
[1]PETSC ERROR: or try <a href="http://valgrind.org">http://valgrind.org</a> on GNU/linux and Apple Mac OS X to find memory corruption errors<br>[1]PETSC ERROR: likely location of problem given in stack below<br>[1]PETSC ERROR: --------------------- Stack Frames ------------------------------------<br>
[1]PETSC ERROR: Note: The EXACT line numbers in the stack are not available,<br>[1]PETSC ERROR: INSTEAD the line number of the start of the function<br>[1]PETSC ERROR: is given.<br>[1]PETSC ERROR: [1] MatIncreaseOverlap_MPIAIJ_Receive line 427 src/mat/impls/aij/mpi/mpiov.c<br>
[1]PETSC ERROR: [1] MatIncreaseOverlap_MPIAIJ_Once line 71 src/mat/impls/aij/mpi/mpiov.c<br>[1]PETSC ERROR: [1] MatIncreaseOverlap_MPIAIJ line 22 src/mat/impls/aij/mpi/mpiov.c<br>[1]PETSC ERROR: [1] MatIncreaseOverlap line 6543 src/mat/interface/matrix.c<br>
[1]PETSC ERROR: [1] PCSetUp_ASM line 155 src/ksp/pc/impls/asm/asm.c<br>[1]PETSC ERROR: [1] PCSetUp line 797 src/ksp/pc/interface/precon.c<br>[1]PETSC ERROR: [1] KSPSetUp line 184 src/ksp/ksp/interface/itfunc.c<br>[1]PETSC ERROR: [1] KSPSolve line 331 src/ksp/ksp/interface/itfunc.c<br>
[1]PETSC ERROR: [1] SNES_KSPSolve line 3394 src/snes/interface/snes.c<br>[1]PETSC ERROR: [1] SNESSolve_LS line 142 src/snes/impls/ls/ls.c<br>[1]PETSC ERROR: [1] SNESSolve line 2647 src/snes/interface/snes.c<br>[1]PETSC ERROR: [1] TSStep_Theta line 25 src/ts/impls/implicit/theta/theta.c<br>
[1]PETSC ERROR: [1] TSStep line 1768 src/ts/interface/ts.c<br>[1]PETSC ERROR: [1] TSSolve line 1824 src/ts/interface/ts.c<br>[1]PETSC ERROR: --------------------- Error Message ------------------------------------<br>The same error happens when I run the example /snes/examples/tutorials/ex32.c with the option -'pc_type asm'.<br>
<br>How to properly set up the preconditioner in that case (dof > 1) ?<br><br>Thanks,<br><br>Laurent Berenguer<br><br>PhD student,<br>Université Lyon 1<br><br><br><br>