[petsc-users] nonzero prescribed boundary condition

Jed Brown jed at 59A2.org
Thu May 12 06:15:45 CDT 2011


On Thu, May 12, 2011 at 13:01, Tian(ICT) <rongtian at ncic.ac.cn> wrote:

> C:\cygwin\home\rabbit\pGFEM-test>pgfem -snes_view -options_tableclear
>
> atol=1e-050, rtol=1e-008, stol=1e-008, maxit=50, maxf=10000
> SNES Object:
>   type: ls
>     line search variant: SNESLineSearchCubic
>     alpha=0.0001, maxstep=1e+008, steptol=1e-012
>   maximum iterations=50, maximum function evaluations=10000
>   tolerances: relative=1e-008, absolute=1e-050, solution=1e-008
>   total number of linear solver iterations=3
>   total number of function evaluations=4
>   KSP Object:
>     type: gmres
>       GMRES: restart=30, using Classical (unmodified) Gram-Schmidt
> Orthogonaliza
> tion with no iterative refinement
>       GMRES: happy breakdown tolerance 1e-030
>     maximum iterations=10000, initial guess is zero
>     tolerances:  relative=1e-005, absolute=1e-050, divergence=10000
>     left preconditioning
>   PC Object:
>     type: ilu
>       ILU: 0 levels of fill
>       ILU: factor fill ratio allocated 1
>       ILU: tolerance for zero pivot 1e-012
>            out-of-place factorization
>            matrix ordering: natural
>       ILU: factor fill ratio needed 1
>            Factored matrix follows
>           Matrix Object:
>             type=seqaij, rows=24, cols=24
>             total: nonzeros=392, allocated nonzeros=840
>               using I-node routines: found 15 nodes, limit used is 5
>     linear system matrix = precond matrix:
>     Matrix Object:
>       type=seqaij, rows=24, cols=24
>       total: nonzeros=392, allocated nonzeros=1320
>         using I-node routines: found 15 nodes, limit used is 5


This looks pretty clear that the matrix was assembled and the linear system
converged in one iteration. Now to see how the matrix was assembled. Are you
sure that your FormJacobian was not called?

The option -snes_fd (maybe in an environment variable or a .petscrc file)
could assemble a matrix, but it would log the number of function evaluations
used to do that. I don't see any evidence that you are building a Jacobian
using coloring. You can use a debugger to set a breakpoint in
SNESComputeJacobian, then check the value of the pointer
snes->ops->computejacobian. It should point at your FormJacobian.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110512/a93a6cfd/attachment.htm>


More information about the petsc-users mailing list