[petsc-users] Fwd: nonzero prescribed boundary condition

Jed Brown jedbrown at mcs.anl.gov
Thu Sep 8 04:09:56 CDT 2011


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/58ae994a/attachment-0001.htm>


More information about the petsc-users mailing list