# [petsc-users] Dirichlet boundary condition for a nonlinear system

Sanjay Govindjee s_g at berkeley.edu
Tue Feb 18 22:31:58 CST 2014

```One alternate to this is that on the first step the initial value of X_B
is not
taken as the know value but rather some prior known value.  Then for the
first
iteration Y_B turns out to be the known increment; in subsequent
iterations it
is take as 0.  This can sometimes be helpful with convergence in tough
problems.

-sg

On 2/18/14 5:56 PM, Barry Smith wrote:
> On Feb 18, 2014, at 5:39 PM, Fande Kong <fd.kong at siat.ac.cn> wrote:
>
>> Hi all,
>>
>> I am just trying to solve a nonlinear system resulted from discretizating a hyperelasticity problem by finite element method. When I solve a linear PDE, I never put boundary solution either in a solution vector or a matrix, but instead, I put boundary condition to the right hand size (load).
>      You adjust the right hand side to have zero as the boundary conditions. This can be written as
>
>        (A_II   A_IB ) ( X_I )       (F_I)
>        (A_BI  A_BB)(X_B)   =   (F_B)
>
>      Which is equivalent to
>
>        (A_I  A_B) (X_I)         (F_I) - (A_B)*(X_B)
>                          (0)       =
>
>        A_I X_I  = F_I - A_B*X_B
>
>      In the nonlinear case you have
>
>        F_I(X_I,X_B)    = ( 0 )
>        F_B(X_I,X_B)      ( 0)
>
>       where you know X_B  with Jacobian
>
>         (J_II  J_IB)
>         (J_BI J_BB)
>
>      Newtons’ method on all variables gives
>
>        (X_I)^{n+1}     =  (X_I)^{n}     +  (Y_I)
>        (X_B)                  (X_B)              (Y_B)
>
>      where   JY = F which written out in terms of I and B is
>
>          (J_II  J_IB)   (Y_I)      =   F_I( X_I,X_B)
>         (J_BI J_BB)   (Y_B)         F_B(X_I,X_B)
>
>      Now since X_B is the solution on the boundary the updates on the boundary at zero so Y_B is zero so this system reduces to
>
>          J_II   Y_I     = F_I(X_I,X_B) so Newton reduces to just the interior with
>
>      (X_I)^{n+1}     =  (X_I)^{n}     +  J_II^{-1} F_I(X_I,X_B)
>
>      Another way to look at it is you are simply solving F_I(X_I,X_B) = 0 with given X_B so Newton’s method only uses the Jacobian of F_I with respect to X_I
>
>     Barry
>
>
>
>
>
>
>
>
>
>> How can I do a similar thing when solving a nonlinear system using a newton method?
>>
>> Thanks,
>>
>> Fande,

```

More information about the petsc-users mailing list