[petsc-users] solving stokes-like equation in 3D staggered grid in irregular domain with petscsection

Bishesh Khanal bisheshkh at gmail.com
Tue Dec 3 10:07:02 CST 2013


On Tue, Dec 3, 2013 at 3:49 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

> Bishesh Khanal <bisheshkh at gmail.com> writes:
> > I tried to modify my existing code to incorporate c(x) instead of 0 as
> you
> > suggested. When c(x) is zero everywhere, the solver converges and gives
> me
> > the result I expect, as before. However, when c(x) is non-zero in domain
> B,
> > the solver does not seem to converge. The ouput for both cases are given
> > below. When c(x) was zero everywhere, I had set the constant pressure
> null
> > space to the system matrix and the schur complement matrix since I am
> > solving the system with pctype fieldsplit and schur.  However, when c(x)
> is
> > non-zero in domain B (I put c(x) = 1 in B for test), we do not have the
> > constant null space for pressure anymore; so for this case I do not set
> the
> > constant null space. Can you comment on what could be possibly going
> wrong
> > ?
> > 1. Output for the test case: c(x) = 0 in A, c(x) = 1 in B; mu = 1
> > everywhere.
> > options given:
> > -pc_type fieldsplit -pc_fieldsplit_type schur -pc_fieldsplit_dm_splits 0
> > -pc_fieldsplit_0_fields 0,1,2 -pc_fieldsplit_1_fields 3
> > -fieldsplit_0_pc_type lu -fieldsplit_0_pc_factor_mat_solver_package
> > superlu_dist -fieldsplit_0_ksp_monitor -fieldsplit_0_ksp_converged_reason
> > -fieldsplit_0_ksp_max_it 100 -fieldsplit_1_ksp_monitor
> > -fieldsplit_1_ksp_converged_reason -ksp_converged_reason
> >
> > output:
> >
> >     Residual norms for fieldsplit_0_ solve.
> >     0 KSP Residual norm 2.321914527334e+01
> >     1 KSP Residual norm 5.204444045635e-14
> >   Linear solve converged due to CONVERGED_RTOL iterations 1
> >     Residual norms for fieldsplit_1_ solve.
> >     0 KSP Residual norm 2.890735677419e+14
> >     Residual norms for fieldsplit_0_ solve.
>
> -fieldsplit_1_ksp_converged_reason to see why that subsolve does not
>  converge.  Also check ksp_monitor_true_residual to get some indication
>  of whether the preconditioner is singular.
>

With options ksp_converged_reason and ksp_monitor_true_residual set only
for the fieldsplit_1 , I get the result as below. -ksp_view reports that
the preconditioner for the schur complement is built from A11.
preconditioned resid norm below looks to be the same and in the order of
10e+14 for every iteration. Does this imply the precondtioner is singular?
Does it mean that the problem is possibly in assembling the A11 block? It
is the diagonal of this block corresponding to the domain B cells that
changes when I set c(x) = 1.
  Residual norms for fieldsplit_1_ solve.
    0 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.265820125363e+01 ||r(i)||/||b|| 1.000000000000e+00
    1 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.117075725063e+01 ||r(i)||/||b|| 8.824916768826e-01
    2 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.109990265188e+01 ||r(i)||/||b|| 8.768941518210e-01
    3 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.109895437193e+01 ||r(i)||/||b|| 8.768192375476e-01
    4 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.109892185160e+01 ||r(i)||/||b|| 8.768166684358e-01
    5 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.109889770615e+01 ||r(i)||/||b|| 8.768147609417e-01
    6 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.109886495655e+01 ||r(i)||/||b|| 8.768121737173e-01
    7 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.109886096749e+01 ||r(i)||/||b|| 8.768118585813e-01
    8 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.109885236160e+01 ||r(i)||/||b|| 8.768111787141e-01
    9 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.109882829958e+01 ||r(i)||/||b|| 8.768092778106e-01
   10 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.109882703198e+01 ||r(i)||/||b|| 8.768091776699e-01
   11 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.109882171007e+01 ||r(i)||/||b|| 8.768087572386e-01
   12 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.109882129003e+01 ||r(i)||/||b|| 8.768087240548e-01
   13 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.109880708177e+01 ||r(i)||/||b|| 8.768076016004e-01
   14 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.109884240385e+01 ||r(i)||/||b|| 8.768103920501e-01
   15 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.110342530238e+01 ||r(i)||/||b|| 8.771724417953e-01
   16 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.668559859400e+01 ||r(i)||/||b|| 1.318165058342e+00
   17 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
2.379573238198e+02 ||r(i)||/||b|| 1.879866807707e+01
   18 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
7.475251038198e+02 ||r(i)||/||b|| 5.905460727331e+01
   19 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
7.610489296073e+02 ||r(i)||/||b|| 6.012299175517e+01
   20 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.162871674016e+03 ||r(i)||/||b|| 9.186705525659e+01
   21 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
2.438552126509e+03 ||r(i)||/||b|| 1.926460227364e+02
   22 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
2.112154724517e+03 ||r(i)||/||b|| 1.668605738047e+02
   23 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
1.867895524623e+03 ||r(i)||/||b|| 1.475640564719e+02
   24 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
2.760528221023e+03 ||r(i)||/||b|| 2.180821876435e+02
   25 KSP preconditioned resid norm 2.890735677419e+14 true resid norm
2.585072583244e+03 ||r(i)||/||b|| 2.042211631374e+02
and it continues.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131203/e7cba0ef/attachment.html>


More information about the petsc-users mailing list