By 50 iterations, I meant my implementation of this prescribed boundary
condition was not working,
not converging. Yes, I put 1 on the diagonal.
Can I just enforce the solution x within each Newton iteration to the
prescribed values to satisfy the prescribed boundary condition, not
MatZeroRowsing Jacobian?
----- Original Message -----
From: Jed Brown
To: PETSc users list
Sent: Thursday, September 08, 2011 5:09 PM
Subject: [petsc-users] Fwd: nonzero prescribed boundary condition
On Thu, Sep 8, 2011 at 09:02, Tian(ICT) <rongtian at ncic.ac.cn> wrote:
in a nonlinear solving, I followed the above suggestion: in FormFunction,
set F_i=x_i-given_value (nonzero) and in FormJacobian, MatZeroRows for the
corresponding rows.
However, the convergence is must slowed down as the exact satisfaction of
xi=givenvalue
has to be satisfied in an interative manner. Acturally convergence is not
just slow but almost
not practical (normally > 50 interations).
What are you using for the "diag" argument to MatZeroRows? If you place 1 on
the diagonal, those equations should be satisfied after one application of the
preconditioner.
Why do you think that 50 iterations is more than the solver algorithm you are
using should need?
Note that for some problems, it is desirable to preserve symmetry. The
implementation of boundary conditions described here does not preserve
symmetry. To preserve symmetry, the column should also be zeroed. In residual
evaluation, this is implemented by using the correct Dirichlet value instead of
the current approximation. It is much better to zero the column by modifying
the arguments to MatSetValues instead of "applying" boundary conditions after
assembly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110908/58def20f/attachment.htm>