[petsc-users] SNES convergence failure (line search) for Neumann boundary condition

Graf, Peter Peter.Graf at nrel.gov
Wed Aug 10 09:06:09 CDT 2011


Hi Matt,
Thanks for your reply.  Attached is the output as requested, specifically, of

 ./snes_test -snes_monitor -snes_converged_reason -ksp_converged_reason -snes_view -snes_monitor -ksp_monitor -ksp_type preonly -pc_type lu

For good measure (?), I am also attaching the case with "-info".

(R.e. terminology, I was contrasting the case here with the Dirichlet case of, e.g., u(0) =1, u(1) = 1.  Actually I think I'm still wrong, in that my BCs are mixed type,... but thanks for being clear)

Again, thank you very much for any help.
-Peter

On 8/10/11 7:13 AM, "Matthew Knepley" <knepley at gmail.com> wrote:

On Wed, Aug 10, 2011 at 12:39 PM, Graf, Peter <Peter.Graf at nrel.gov> wrote:
Dear Petsc-Users,
I am implementing a 1D solution of the (drift/diffusion) semiconductor equations.  The case of Dirichlet boundaries works fine.  The case of Neumann boundaries (i.e. current boundary conditions such as occur at semiconductor/metal contacts) does not.   In sorting this out, I have modified one of your examples to recreate the problem:

The (modified) example seeks to solve
u`` + u^{2} = f
on [0,1] with
u'(0) = U0
u(1) = 1

With U0 = 0, the SNES solver converges.  With U0=-2 (for example) it does not:

Just to be clear, both of these are Neumann conditions.

 11 SNES Function norm 5.018284941187e+00
Nonlinear solve did not converge due to DIVERGED_LS_FAILURE

When asking about convergence, please send the entire output of -snes_view -snes_monitor -ksp_monitor -snes_converged_reason

Since the Jacobian becomes more ill-conditioned, its possible the linear solver is not converging. When testing, its best to always use
-ksp_type preonly -pc_type lu so that the solves are exact to start out.

  Thanks,

      Matt

(interestingly, it still comes up with roughly good solutions, e.g. at least visually, which suggests to me my discretization is not _total_ garbage)

Along the way (with -info) I get messages of the form:
SNESLSCheckResidual_Private(): ||J^T(F-Ax)||/||F-AX|| 208.031 near zero implies inconsistent rhs

At the end, I get:
[0] SNESLSCheckLocalMin_Private(): || J^T F|| 80.3 near zero implies found a local minimum

I have used -snes_type test to verify that my Jacobian is accurate.
I have also dumped the Jacobians to a file and examined their condition numbers.  The nonconverged cases have condition numbers around 10^7, whereas the converged cases have condition numbers around 10^3.  This seems like a clue, but I'm not sure what to do about it.

All this is completely analogous to the real case of interest (in that case, my condition numbers go to 10^13 or more, and there is similar visual evidence that the solver is "trying" to do the right thing).
I would love to have help getting this to work.  Specifically, what does the message about the "inconsistent rhs" tell me I'm doing wrong?  What is the evidence of the condition number telling me?  Do I have an error somewhere, or do I have a legitimately ill-conditioned Jacobian (in which case, what should I do about that?)?

Thank you very much for any advice,

Peter Graf
NREL Scientific Computing Center
Golden, CO


-------------- next part --------------
A non-text attachment was scrubbed...
Name: verbose_output2
Type: application/octet-stream
Size: 2325 bytes
Desc: verbose_output2
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110810/a20c984e/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: verbose_output_info
Type: application/octet-stream
Size: 25428 bytes
Desc: verbose_output_info
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110810/a20c984e/attachment-0003.obj>


More information about the petsc-users mailing list