[petsc-users] snes failures
Matthew Knepley
knepley at gmail.com
Wed May 18 13:48:52 CDT 2016
On Wed, May 18, 2016 at 1:38 PM, Juha Jaykka <juhaj at iki.fi> wrote:
> Dear list,
>
> I'm designing a short training course on HPC, and decided to use PETSc as
> an
> example of a good way of getting things done quick, easy, and with good
> performance, and without needing to write one's own code for things like
> linear or non-linear solvers etc.
>
> However, my SNES example turned out to be problematic: I chose the (static)
> sine-Gordon equation for my example, mostly because its exact solution is
> known so it is easy to compare with numerics and also because it is, after
> all, a dead simple equation. Yet my code refuses to converge most of the
> time!
>
> Using -snes_type ngs always succeeds, but is also very slow. Any other type
> will fail once I increase the domain size from ~100 points (the actual
> number
> depends on the type). I always keep the lattice spacing at 0.1. The
> failure is
> also always the same: DIVERGED_LINE_SEARCH. Some types manage to take one
> step
> and get stuck, some types manage to decrease the norm once and then
> continue
> forever without decreasing the norm but not complaining about divergence
> either (unless they hit one of the max_it-type limits), and ncg is the
> worst
> of all: it always (with any lattice size!) fails at the very first step.
>
> I've checked the Jacobian, and I suspect it is ok as ngs converges and the
> other types except ncg also converge nicely unless the domain is too big.
>
Nope, ngs does not use the Jacobian, and small problems can converge with
wrong Jacobians.
Any ideas of where this could go wrong?
1) Just run with -snes_fd_color -snes_fd_color_use_mat -mat_coloring_type
greedy and
see if it converges.
2) Check out
http://scicomp.stackexchange.com/questions/30/why-is-newtons-method-not-converging
Matt
> Cheers,
> Juha
>
> P.S. I can share the whole code, if that is needed, but it is presently
> quite
> messy thanks to all my efforts at trying to sort this out.
>
>
--
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160518/afce518e/attachment.html>
More information about the petsc-users
mailing list