<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div> Elias,<div class=""><br class=""></div><div class=""> How are you zeroing the rows and columns of the matrix, are you using MatZeroRowsColumns()? </div><div class=""><br class=""></div><div class=""> If so, are you passing in the vectors b and x (with b set and the x locations associated with the Dirichlet rows set to the correct Dirichlet value)?</div><div class=""><br class=""></div><div class=""> If so, are you calling KSPSetInitializeGuessNonzero(ksp,PETSC_TRUE) before the solve?</div><div class=""><br class=""></div><div class=""> Thanks</div><div class=""><br class=""></div><div class=""> Barry</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 7, 2022, at 3:14 AM, Karabelas, Elias (<a href="mailto:elias.karabelas@uni-graz.at" class="">elias.karabelas@uni-graz.at</a>) <<a href="mailto:elias.karabelas@uni-graz.at" class="">elias.karabelas@uni-graz.at</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
<div class="">
<div class="moz-cite-prefix">Hi Mark,</div>
<div class="moz-cite-prefix">thanks for the answer, but I'm struggling to translate your suggestion into solver options.
<br class="">
</div>
<div class="moz-cite-prefix">From scrolling through the user manual I think this points towards PCCOMPOSITE.<br class="">
</div>
<div class="moz-cite-prefix">However, the User Manual is not very precise with composite PCs, so how would I achieve this on top of my existing solver options?</div>
<div class="moz-cite-prefix">Best regards</div>
<div class="moz-cite-prefix">Elias<br class="">
</div>
<div class="moz-cite-prefix"><br class="">
</div>
<div class="moz-cite-prefix"><br class="">
</div>
<div class="moz-cite-prefix"><br class="">
</div>
<div class="moz-cite-prefix">Am 06.07.22 um 16:41 schrieb Mark Adams:<br class="">
</div>
<blockquote type="cite" cite="mid:CADOhEh6GaPynnLG4GjZ19T7qJon47G6sqM_k2YvHHmfY8T2fgA@mail.gmail.com" class="">
<div dir="ltr" class="">And one iteration of undamped Jacobi after the solve should fix this.</div>
<br class="">
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Jul 6, 2022 at 8:42 AM Karabelas, Elias (<a href="mailto:elias.karabelas@uni-graz.at" moz-do-not-send="true" class="">elias.karabelas@uni-graz.at</a>) <<a href="mailto:elias.karabelas@uni-graz.at" moz-do-not-send="true" class="">elias.karabelas@uni-graz.at</a>>
wrote:<br class="">
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="">
<div class="">Dear Matt,</div>
<div class=""><br class="">
</div>
<div class="">thanks for the fast response. That makes perfect sense to me. <br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Best regards</div>
<div class="">Elias<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Am 06.07.22 um 14:35 schrieb Matthew Knepley:<br class="">
</div>
<blockquote type="cite" class="">
<div dir="ltr" class="">
<div dir="ltr" class="">On Wed, Jul 6, 2022 at 7:46 AM Karabelas, Elias (<a href="mailto:elias.karabelas@uni-graz.at" target="_blank" moz-do-not-send="true" class="">elias.karabelas@uni-graz.at</a>) <<a href="mailto:elias.karabelas@uni-graz.at" target="_blank" moz-do-not-send="true" class="">elias.karabelas@uni-graz.at</a>>
wrote:<br class="">
</div>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px
0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div class=""><p class=""><font size="4" class=""><font face="monospace" class="">Dear all,</font></font></p><p class=""><font size="4" class=""><font face="monospace" class="">I don't know if this is a bug, but I observed that when using GMRES with AGG-PCGAMG as preconditioner Dirichlet boundary conditions don't seem to be exactly fulfilled.</font></font></p><p class=""><font size="4" class=""><font face="monospace" class="">My Matrix has zero rows and cols with 1 on the diagonal where I have dirichlet-bcs in my FE-mesh and I would expect that the eqs in this rows can be exactly fulfilled (as u_i = g_i) there.</font></font></p>
</div>
</blockquote>
<div class="">I would not expect aggregation to be exact here, but only within the iteration tolerance. If instead you eliminate those variables, you can maintain algebraic exactness.</div>
<div class="">This is what we do in examples, like SNES ex56.</div>
<div class=""><br class="">
</div>
<div class=""> Thanks,</div>
<div class=""><br class="">
</div>
<div class=""> Matt</div>
<blockquote class="gmail_quote" style="margin:0px 0px
0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div class=""><p class=""><font size="4" class=""><font face="monospace" class="">However, when I solve A*x = b with the above solver I only get u_i = g_i + error in that part of the vector. Switching from pc_gamg_type agg to pc_gamg_type classical cures this problem, but the classical is not advertised
in the user manual.</font></font></p><p class="">These are the options I'm currently using:</p><p class="">-ksp_type gmres<br class="">
-ksp_pc_side right<br class="">
-pc_type gamg<br class="">
-pc_gamg_type agg [or classical]<br class="">
-pc_gamg_sym_graph 1<br class="">
-pc_gamg_square_graph 1<br class="">
-pc_gamg_agg_nsmooths 1<br class="">
-pc_gamg_threshold 0.01<br class="">
-pc_mg_cycles v<br class="">
</p><p class="">Iteration counts are basically the same.</p><p class="">Best regards</p><p class="">Elias<br class="">
</p>
<pre cols="72" class="">--
Dr. Elias Karabelas
Research Associate
University of Graz
Institute of Mathematics and Scientific Computing
Heinrichstraße 36
A-8010 Graz
Austria
Phone: +43 316 380 8546
Email: <a href="mailto:elias.karabelas@uni-graz.at" target="_blank" moz-do-not-send="true" class="">elias.karabelas@uni-graz.at</a>
Web: <a href="https://ccl.medunigraz.at/" target="_blank" moz-do-not-send="true" class="">https://ccl.medunigraz.at/</a></pre>
</div>
</blockquote>
</div>
<br clear="all" class="">
<div class=""><br class="">
</div>
-- <br class="">
<div dir="ltr" class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">
-- Norbert Wiener</div>
<div class=""><br class="">
</div>
<div class=""><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank" moz-do-not-send="true" class="">https://www.cse.buffalo.edu/~knepley/</a><br class="">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote><p class=""><br class="">
</p>
<pre cols="72" class="">--
Dr. Elias Karabelas
Research Associate
University of Graz
Institute of Mathematics and Scientific Computing
Heinrichstraße 36
A-8010 Graz
Austria
Phone: +43 316 380 8546
Email: <a href="mailto:elias.karabelas@uni-graz.at" target="_blank" moz-do-not-send="true" class="">elias.karabelas@uni-graz.at</a>
Web: <a href="https://ccl.medunigraz.at/" target="_blank" moz-do-not-send="true" class="">https://ccl.medunigraz.at/</a></pre>
</div>
</blockquote>
</div>
</blockquote><p class=""><br class="">
</p>
<pre class="moz-signature" cols="72">--
Dr. Elias Karabelas
Research Associate
University of Graz
Institute of Mathematics and Scientific Computing
Heinrichstraße 36
A-8010 Graz
Austria
Phone: +43 316 380 8546
Email: <a class="moz-txt-link-abbreviated" href="mailto:elias.karabelas@uni-graz.at">elias.karabelas@uni-graz.at</a>
Web: <a class="moz-txt-link-freetext" href="https://ccl.medunigraz.at/">https://ccl.medunigraz.at/</a></pre>
</div>
</div></blockquote></div><br class=""></div></body></html>