<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19019">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>By 50 iterations, I meant my implementation of this prescribed
boundary condition was not working,</FONT></DIV>
<DIV><FONT size=2>not converging. Yes, I put 1 on the diagonal.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV>Can I just enforce the solution x within each Newton iteration to the
prescribed values to satisfy the prescribed boundary condition, not
MatZeroRowsing Jacobian?</DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px"
dir=ltr>
<DIV style="FONT: 10pt arial"> </DIV>
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B>
<A title=jedbrown@mcs.anl.gov href="mailto:jedbrown@mcs.anl.gov">Jed Brown</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=petsc-users@mcs.anl.gov
href="mailto:petsc-users@mcs.anl.gov">PETSc users list</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, September 08, 2011 5:09
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [petsc-users] Fwd: nonzero
prescribed boundary condition</DIV>
<DIV><BR></DIV>
<DIV class=gmail_quote>On Thu, Sep 8, 2011 at 09:02, Tian(ICT) <SPAN
dir=ltr><<A
href="mailto:rongtian@ncic.ac.cn">rongtian@ncic.ac.cn</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV id=:1zg>in a nonlinear solving, I followed the above suggestion: in
FormFunction,<BR>set F_i=x_i-given_value (nonzero) and in FormJacobian,
MatZeroRows for the corresponding rows.<BR>However, the convergence is must
slowed down as the exact satisfaction of xi=givenvalue<BR>has to be
satisfied in an interative manner. Acturally convergence is not just slow
but almost<BR>not practical (normally > 50
interations).<BR></DIV></BLOCKQUOTE>
<DIV><BR></DIV>
<DIV>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.</DIV>
<DIV><BR></DIV>
<DIV>Why do you think that 50 iterations is more than the solver algorithm you
are using should need?</DIV>
<DIV><BR></DIV>
<DIV>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.</DIV></DIV></BLOCKQUOTE></BODY></HTML>