<div dir="ltr">* Do we understand:<div><p class="MsoNormal"><span lang="EN-GB"> type: chebyshev<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-GB"> eigenvalue estimates used: <b>min = 0., max = 0.</b><u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-GB"> eigenvalues estimate via gmres <b>min 0., max 0.</b></span></p><p class="MsoNormal"><span lang="EN-GB"><br></span></p><p class="MsoNormal"><span lang="EN-GB">* Is this Poisson solver unsymmetric?</span></p><p class="MsoNormal"><br></p><p class="MsoNormal">* Does this problem start off converging and then evolve and then start stagnating? The eigen estimates may need to be recalculated.</p><p class="MsoNormal">Also Chebyshev is problematic for unsymmetric matrices. Hypre does better with unsymmetric matrices.</p><p class="MsoNormal"><br></p><p class="MsoNormal">Mark</p></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 30, 2021 at 4:16 AM Marco Cisternino <<a href="mailto:marco.cisternino@optimad.it">marco.cisternino@optimad.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="IT" style="overflow-wrap: break-word;">
<div class="gmail-m_5266234165121487508WordSection1">
<p class="MsoNormal"><span>Hello Barry.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">This is the output of ksp_view using fgmres and gamg. It has to be said that the solution of the linear system should be a zero values field. As you can see both unpreconditioned residual
and r/b converge at this iteration of the CFD solver. During the time integration of the CFD, I can observe pressure linear solver residuals behaving in a different way: unpreconditioned residual stil converges but r/b stalls. After the output of ksp_view
I add the output of ksp_monitor_true_residual for one of these iteration where r/b stalls.<br>
Thanks,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">KSP Object: 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: fgmres<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> happy breakdown tolerance 1e-30<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> maximum iterations=100, nonzero initial guess<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> tolerances: relative=1e-05, absolute=1e-50, divergence=10000.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> right preconditioning<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> using UNPRECONDITIONED norm type for convergence test<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">PC Object: 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: gamg<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type is MULTIPLICATIVE, levels=4 cycles=v<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Cycles per PCApply=1<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Using externally compute Galerkin coarse grid matrices<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> GAMG specific options<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Threshold for dropping small values in graph on each level = 0.02 0.02
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Threshold scaling factor for each level not specified = 1.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> AGG specific options<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Symmetric graph true<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Number of levels to square graph 1<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Number smoothing steps 0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Coarse grid solver -- level -------------------------------<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> KSP Object: (mg_coarse_) 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: preonly<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> maximum iterations=10000, initial guess is zero<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> tolerances: relative=1e-05, absolute=1e-50, divergence=10000.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> left preconditioning<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> using NONE norm type for convergence test<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> PC Object: (mg_coarse_) 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: bjacobi<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> number of blocks = 1<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Local solve is same for all blocks, in the following KSP and PC objects:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> KSP Object: (mg_coarse_sub_) 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: preonly<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> maximum iterations=1, initial guess is zero<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> tolerances: relative=1e-05, absolute=1e-50, divergence=10000.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> left preconditioning<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> using DEFAULT norm type for convergence test<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> PC Object: (mg_coarse_sub_) 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: lu<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> PC has not been set up so information may be incomplete<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> out-of-place factorization<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> tolerance for zero pivot 2.22045e-14<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> using diagonal shift on blocks to prevent zero pivot [INBLOCKS]<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> matrix ordering: nd<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> linear system matrix = precond matrix:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">
</span><span lang="FR">Mat Object: 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="FR"> type: seqaij<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="FR">
</span><span lang="EN-GB">rows=18, cols=18<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> total: nonzeros=104, allocated nonzeros=104<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> total number of mallocs used during MatSetValues calls =0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> not using I-node routines<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> linear system matrix = precond matrix:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span>
<span lang="FR">Mat Object: 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="FR"> type: seqaij<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="FR"> </span>
<span lang="EN-GB">rows=18, cols=18<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> total: nonzeros=104, allocated nonzeros=104<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> total number of mallocs used during MatSetValues calls =0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> not using I-node routines<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Down solver (pre-smoother) on level 1 -------------------------------<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> KSP Object: (mg_levels_1_) 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: chebyshev<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> eigenvalue estimates used: min = 0., max = 0.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> eigenvalues estimate via gmres min 0., max 0.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> eigenvalues estimated using gmres with translations [0. 0.1; 0. 1.1]<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> KSP Object: (mg_levels_1_esteig_) 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: gmres<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> happy breakdown tolerance 1e-30<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> maximum iterations=10, initial guess is zero<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> tolerances: relative=1e-12, absolute=1e-50, divergence=10000.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> left preconditioning<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> using DEFAULT norm type for convergence test<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> estimating eigenvalues using noisy right hand side<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> maximum iterations=2, nonzero initial guess<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> tolerances: relative=1e-05, absolute=1e-50, divergence=10000.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> left preconditioning<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> using NONE norm type for convergence test<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> PC Object: (mg_levels_1_) 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: sor<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type = local_symmetric, iterations = 1, local iterations = 1, omega = 1.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> linear system matrix = precond matrix:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Mat Object: 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: seqaij<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> rows=67, cols=67<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> total: nonzeros=675, allocated nonzeros=675<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> total number of mallocs used during MatSetValues calls =0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> not using I-node routines<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Up solver (post-smoother) same as down solver (pre-smoother)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Down solver (pre-smoother) on level 2 -------------------------------<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> KSP Object: (mg_levels_2_) 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: chebyshev<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> eigenvalue estimates used: min = 0., max = 0.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> eigenvalues estimate via gmres min 0., max 0.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> eigenvalues estimated using gmres with translations [0. 0.1; 0. 1.1]<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> KSP Object: (mg_levels_2_esteig_) 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: gmres<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> happy breakdown tolerance 1e-30<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> maximum iterations=10, initial guess is zero<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> tolerances: relative=1e-12, absolute=1e-50, divergence=10000.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> left preconditioning<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> using DEFAULT norm type for convergence test<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> estimating eigenvalues using noisy right hand side<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> maximum iterations=2, nonzero initial guess<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> tolerances: relative=1e-05, absolute=1e-50, divergence=10000.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> left preconditioning<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> using NONE norm type for convergence test<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> PC Object: (mg_levels_2_) 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: sor<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type = local_symmetric, iterations = 1, local iterations = 1, omega = 1.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> linear system matrix = precond matrix:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Mat Object: 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: seqaij<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> rows=348, cols=348<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> total: nonzeros=3928, allocated nonzeros=3928<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> total number of mallocs used during MatSetValues calls =0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> not using I-node routines<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Up solver (post-smoother) same as down solver (pre-smoother)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Down solver (pre-smoother) on level 3 -------------------------------<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> KSP Object: (mg_levels_3_) 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: chebyshev<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> eigenvalue estimates used: min = 0., max = 0.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> eigenvalues estimate via gmres min 0., max 0.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> eigenvalues estimated using gmres with translations [0. 0.1; 0. 1.1]<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> KSP Object: (mg_levels_3_esteig_) 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: gmres<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> happy breakdown tolerance 1e-30<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> maximum iterations=10, initial guess is zero<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> tolerances: relative=1e-12, absolute=1e-50, divergence=10000.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> left preconditioning<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> using DEFAULT norm type for convergence test<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> estimating eigenvalues using noisy right hand side<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> maximum iterations=2, nonzero initial guess<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> tolerances: relative=1e-05, absolute=1e-50, divergence=10000.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> left preconditioning<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> using NONE norm type for convergence test<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> PC Object: (mg_levels_3_) 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: sor<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type = local_symmetric, iterations = 1, local iterations = 1, omega = 1.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> linear system matrix = precond matrix:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Mat Object: 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: seqaij<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> rows=3584, cols=3584<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> total: nonzeros=23616, allocated nonzeros=23616<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> total number of mallocs used during MatSetValues calls =0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> has attached null space<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> not using I-node routines<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Up solver (post-smoother) same as down solver (pre-smoother)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> linear system matrix = precond matrix:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Mat Object: 1 MPI processes<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> type: seqaij<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> rows=3584, cols=3584<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> total: nonzeros=23616, allocated nonzeros=23616<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> total number of mallocs used during MatSetValues calls =0<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> has attached null space<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> not using I-node routines<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> Pressure system has reached convergence in 0 iterations with reason 3.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> 0 KSP unpreconditioned resid norm 4.798763170703e-16 true resid norm 4.798763170703e-16 ||r(i)||/||b|| 1.000000000000e+00<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> 0 KSP Residual norm 4.798763170703e-16 % max 1.000000000000e+00 min 1.000000000000e+00 max/min 1.000000000000e+00<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> 1 KSP unpreconditioned resid norm 1.648749109132e-17 true resid norm 1.648749109132e-17 ||r(i)||/||b|| 3.435779284125e-02<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> 1 KSP Residual norm 1.648749109132e-17 % max 9.561792537103e-01 min 9.561792537103e-01 max/min 1.000000000000e+00<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> 2 KSP unpreconditioned resid norm 4.737880600040e-19 true resid norm 4.737880600040e-19 ||r(i)||/||b|| 9.873128619820e-04<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> 2 KSP Residual norm 4.737880600040e-19 % max 9.828636644296e-01 min 9.293131521763e-01 max/min 1.057623753767e+00<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> 3 KSP unpreconditioned resid norm 2.542212716830e-20 true resid norm 2.542212716830e-20 ||r(i)||/||b|| 5.297641551371e-05<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> 3 KSP Residual norm 2.542212716830e-20 % max 9.933572357920e-01 min 9.158303248850e-01 max/min 1.084652046127e+00<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> 4 KSP unpreconditioned resid norm 6.614510286263e-21 true resid norm 6.614510286269e-21 ||r(i)||/||b|| 1.378378146822e-05<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> 4 KSP Residual norm 6.614510286263e-21 % max 9.950912550705e-01 min 6.296575800237e-01 max/min 1.580368896747e+00<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> 5 KSP unpreconditioned resid norm 1.981505525281e-22 true resid norm 1.981505525272e-22 ||r(i)||/||b|| 4.129200493513e-07<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> 5 KSP Residual norm 1.981505525281e-22 % max 9.984097962703e-01 min 5.316259535293e-01 max/min 1.878030577029e+00<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Linear solve converged due to CONVERGED_RTOL iterations 5<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Ksp_monitor_true_residual output for stalling r/b CFD iteration<br>
0 KSP unpreconditioned resid norm 9.010260489109e-14 true resid norm 9.010260489109e-14 ||r(i)||/||b|| 2.021559024868e+00<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"> </span>
<span>0 KSP Residual norm 9.010260489109e-14 % max 1.000000000000e+00 min 1.000000000000e+00 max/min 1.000000000000e+00<u></u><u></u></span></p>
<p class="MsoNormal"><span> 1 KSP unpreconditioned resid norm 4.918108339808e-15 true resid norm 4.918171792537e-15 ||r(i)||/||b|| 1.103450292594e-01<u></u><u></u></span></p>
<p class="MsoNormal"><span> 1 KSP Residual norm 4.918108339808e-15 % max 9.566256813737e-01 min 9.566256813737e-01 max/min 1.000000000000e+00<u></u><u></u></span></p>
<p class="MsoNormal"><span> 2 KSP unpreconditioned resid norm 1.443599554690e-15 true resid norm 1.444867143493e-15 ||r(i)||/||b|| 3.241731154382e-02<u></u><u></u></span></p>
<p class="MsoNormal"><span> 2 KSP Residual norm 1.443599554690e-15 % max 9.614019380614e-01 min 7.360950481750e-01 max/min 1.306083963538e+00<u></u><u></u></span></p>
<p class="MsoNormal"><span> 3 KSP unpreconditioned resid norm 6.623206616803e-16 true resid norm 6.654132553541e-16 ||r(i)||/||b|| 1.492933720678e-02<u></u><u></u></span></p>
<p class="MsoNormal"><span> 3 KSP Residual norm 6.623206616803e-16 % max 9.764112945239e-01 min 4.911485418014e-01 max/min 1.988016274960e+00<u></u><u></u></span></p>
<p class="MsoNormal"><span> 4 KSP unpreconditioned resid norm 6.551896936698e-16 true resid norm 6.646157296305e-16 ||r(i)||/||b|| 1.491144376933e-02<u></u><u></u></span></p>
<p class="MsoNormal"><span> 4 KSP Residual norm 6.551896936698e-16 % max 9.883425885532e-01 min 1.461270778833e-01 max/min 6.763582786091e+00<u></u><u></u></span></p>
<p class="MsoNormal"><span> 5 KSP unpreconditioned resid norm 6.222297644887e-16 true resid norm 1.720560536914e-15 ||r(i)||/||b|| 3.860282047823e-02<u></u><u></u></span></p>
<p class="MsoNormal"><span> 5 KSP Residual norm 6.222297644887e-16 % max 1.000409371755e+00 min 4.989767363560e-03 max/min 2.004921870829e+02<u></u><u></u></span></p>
<p class="MsoNormal"><span> 6 KSP unpreconditioned resid norm 6.496945794974e-17 true resid norm 2.031914800253e-14 ||r(i)||/||b|| 4.558842341106e-01<u></u><u></u></span></p>
<p class="MsoNormal"><span> 6 KSP Residual norm 6.496945794974e-17 % max 1.004914985753e+00 min 1.459258738706e-03 max/min 6.886475709192e+02<u></u><u></u></span></p>
<p class="MsoNormal"><span> 7 KSP unpreconditioned resid norm 1.965237342540e-17 true resid norm 1.684522207337e-14 ||r(i)||/||b|| 3.779425772373e-01<u></u><u></u></span></p>
<p class="MsoNormal"><span> 7 KSP Residual norm 1.965237342540e-17 % max 1.005737762541e+00 min 1.452603803766e-03 max/min 6.923689446035e+02<u></u><u></u></span></p>
<p class="MsoNormal"><span> 8 KSP unpreconditioned resid norm 1.627718951285e-17 true resid norm 1.958642967520e-14 ||r(i)||/||b|| 4.394448276241e-01<u></u><u></u></span></p>
<p class="MsoNormal"><span> 8 KSP Residual norm 1.627718951285e-17 % max 1.006364278765e+00 min 1.452081813014e-03 max/min 6.930492963590e+02<u></u><u></u></span></p>
<p class="MsoNormal"><span> 9 KSP unpreconditioned resid norm 1.616577677764e-17 true resid norm 2.019110946644e-14 ||r(i)||/||b|| 4.530115373837e-01<u></u><u></u></span></p>
<p class="MsoNormal"><span> 9 KSP Residual norm 1.616577677764e-17 % max 1.006648747131e+00 min 1.452031376577e-03 max/min 6.932692801059e+02<u></u><u></u></span></p>
<p class="MsoNormal"><span>10 KSP unpreconditioned resid norm 1.285788988203e-17 true resid norm 2.065082694477e-14 ||r(i)||/||b|| 4.633258453698e-01<u></u><u></u></span></p>
<p class="MsoNormal"><span>10 KSP Residual norm 1.285788988203e-17 % max 1.007469033514e+00 min 1.433291867068e-03 max/min 7.029057072477e+02<u></u><u></u></span></p>
<p class="MsoNormal"><span>11 KSP unpreconditioned resid norm 5.490854431580e-19 true resid norm 1.798071628891e-14 ||r(i)||/||b|| 4.034187394623e-01<u></u><u></u></span></p>
<p class="MsoNormal"><span>11 KSP Residual norm 5.490854431580e-19 % max 1.008058905554e+00 min 1.369401685301e-03 max/min 7.361309076612e+02<u></u><u></u></span></p>
<p class="MsoNormal"><span>12 KSP unpreconditioned resid norm 1.371754802104e-20 true resid norm 1.965688920064e-14 ||r(i)||/||b|| 4.410256708163e-01<u></u><u></u></span></p>
<p class="MsoNormal"><span>12 KSP Residual norm 1.371754802104e-20 % max 1.008409402214e+00 min 1.369243011779e-03 max/min 7.364721919624e+02<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">Linear solve converged due to CONVERGED_RTOL iterations 12<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal">Marco Cisternino <u></u><u></u></p>
</div>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>>
<br>
<b>Sent:</b> mercoledì 29 settembre 2021 18:34<br>
<b>To:</b> Marco Cisternino <<a href="mailto:marco.cisternino@optimad.it" target="_blank">marco.cisternino@optimad.it</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a><br>
<b>Subject:</b> Re: [petsc-users] Disconnected domains and Poisson equation<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal"><br>
<br>
<u></u><u></u></p>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<p class="MsoNormal">On Sep 29, 2021, at 11:59 AM, Marco Cisternino <<a href="mailto:marco.cisternino@optimad.it" target="_blank">marco.cisternino@optimad.it</a>> wrote:<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-GB">For sake of completeness, explicitly building the null space using a vector per sub-domain make s the CFD runs using BCGS and GMRES more stable, but still slower than FGMRES.</span><u></u><u></u></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal"> Something is strange. Please run with -ksp_view and send the output on the solver details.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><br>
<br>
<u></u><u></u></p>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<div>
<p class="MsoNormal"><span lang="EN-GB">I had divergence using BCGS and GMRES setting the null space with only one constant.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">Thanks</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
<div>
<p class="MsoNormal">Marco Cisternino <u></u><u></u></p>
</div>
<p class="MsoNormal"><span> </span><u></u><u></u></p>
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Marco Cisternino
<br>
<b>Sent:</b> mercoledì 29 settembre 2021 17:54<br>
<b>To:</b> Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a><br>
<b>Subject:</b> RE: [petsc-users] Disconnected domains and Poisson equation</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">Thank you Barry for the quick reply.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">About the null space: I already tried what you suggest, building 2 Vec (constants) with 0 and 1 chosen by sub-domain, normalizing them and setting the null space like this</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">MatNullSpaceCreate(PETSC_COMM_WORLD,PETSC_FALSE,nconstants,constants,&nullspace);</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">The solution is slightly different in values but it is still different in the two sub-domains.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">About the solver: I tried BCGS, GMRES and FGMRES. The linear system is a pressure system in a navier-stokes solver and only solving with FGMRES makes the CFD stable, with BCGS and GMRES
the CFD solution diverges. Moreover, in the same case but with a single domain, CFD solution is stable using all the solvers, but FGMRES converges in much less iterations than the others.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
<div>
<p class="MsoNormal"><span lang="EN-GB">Marco Cisternino </span><u></u><u></u></p>
</div>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>>
<br>
<b>Sent:</b> mercoledì 29 settembre 2021 15:59<br>
<b>To:</b> Marco Cisternino <<a href="mailto:marco.cisternino@optimad.it" target="_blank">marco.cisternino@optimad.it</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a><br>
<b>Subject:</b> Re: [petsc-users] Disconnected domains and Poisson equation</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<p class="MsoNormal"> The problem actually has a two dimensional null space; constant on each domain but possibly different constants. I think you need to build the MatNullSpace by explicitly constructing two vectors, one with 0 on one domain and constant
value on the other and one with 0 on the other domain and constant on the first. <u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> Separate note: why use FGMRES instead of just GMRES? If the problem is linear and the preconditioner is linear (no GMRES inside the smoother) then you can just use GMRES and it will save a little space/work and be conceptually clearer.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> Barry<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-bottom:12pt"> <u></u><u></u></p>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<p class="MsoNormal">On Sep 29, 2021, at 8:46 AM, Marco Cisternino <<a href="mailto:marco.cisternino@optimad.it" target="_blank">marco.cisternino@optimad.it</a>> wrote:<u></u><u></u></p>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-GB">Good morning,</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB">I want to solve the Poisson equation on a 3D domain with 2 non-connected sub-domains.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB">I am using FGMRES+GAMG and I have no problem if the two sub-domains see a Dirichlet boundary condition each.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB">On the same domain I would like to solve the Poisson equation imposing periodic boundary condition in one direction and homogenous Neumann boundary conditions in the other two directions. The two sub-domains are symmetric
with respect to the separation between them and the operator discretization and the right hand side are symmetric as well. It would be nice to have the same solution in both the sub-domains.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB">Setting the null space to the constant, the solver converges to a solution having the same gradients in both sub-domains but different values.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB">Am I doing some wrong with the null space? I’m not setting a block matrix (one block for each sub-domain), should I?</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB">I tested the null space against the matrix using MatNullSpaceTest and the answer is true. Can I do something more to have a symmetric solution as outcome of the solver?</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB">Thank you in advance for any comments and hints.</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB">Best regards,</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span lang="EN-GB">Marco Cisternino</span><u></u><u></u></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</blockquote></div>