<div class="gmail_quote">On Wed, Feb 1, 2012 at 04:47, gouarin <span dir="ltr">&lt;<a href="mailto:loic.gouarin@math.u-psud.fr">loic.gouarin@math.u-psud.fr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I sent some email on Stokes solver using DMComposite grid (one for the velocity and an other one for the pressure).<br>
<br>
Now, I try to use PCMG to precondition the velocity part with fieldsplit and PETSc command line options only.<br>
<br>
This is an example of my options:<br>
<br>
./test -stokes_ksp_type fgmres<br>
         -stokes_pc_type fieldsplit<br>
         -stokes_fieldsplit_0_ksp_type preonly<br>
         -stokes_fieldsplit_0_pc_type mg<br>
         -stokes_fieldsplit_0_pc_mg_<u></u>levels 2<br>
         -stokes_fieldsplit_0_pc_mg_<u></u>galerkin<br>
        ...<br>
         -stokes_fieldsplit_1_ksp_type preonly<br>
         -stokes_fieldsplit_1_pc_type jacobi<br>
<br>
It doesn&#39;t work because we need to call PCFieldSplitGetSubKSP to get the subpc[0] to create the interpolation matrices.  So, we have to call KSPSetUp before PCFieldSplitGetSubKSP. But, if we call KSPSetUp, we have an error because the interpolation matrices are not created !<br>
</blockquote><div><br></div><div>The interpolation matrices for PCMG? Those should be constructed by the DM. It looks from your code like you have a DMComposite, in which case you shouldn&#39;t have to do anything special.</div>
<div><br></div><div>Try &quot;make runex28_4&quot;. (It&#39;s broken with a change that went into petsc-dev a few days ago. I&#39;ll be able to push the fix whenever I find a wireless network in this airport that doesn&#39;t block ssh.)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
But If I do:<br>
<br>
------<br>
PCSetDM(pc, dom-&gt;get_pack());<br>
PCSetType(pc, PCFIELDSPLIT);<br>
KSPSetUp(solver);<br>
PCFieldSplitGetSubKSP(pc, &amp;nsplits, &amp;subksp);<br>
PetscMalloc(sizeof(PC)*<u></u>nsplits, &amp;subpc);<br>
<br>
KSPSetType(subksp[0], KSPPREONLY);<br>
KSPGetPC(subksp[0], &amp;subpc[0]);<br>
PCSetType(subpc[0], PCMG);<br>
<br>
create the interpolation matrices<br>
<br>
KSPSetFromOptions(solver);<br>
------<br>
<br>
It works but we can&#39;t set the mg_levels with the command line options anymore. Moreover, I have some warning of this type:<br>
<br>
Option left: name:-stokes_fieldsplit_0_pc_<u></u>mg_multiplicative_cycles value: 3<br>
<br>
Is there a way to do that only with the command line option ?<br>
<br>
Thanks,<br>
Loic<br><font color="#888888">
<br>
-- <br>
Loic Gouarin<br>
Laboratoire de Mathématiques<br>
Université Paris-Sud<br>
Bâtiment 425<br>
91405 Orsay Cedex<br>
France<br>
Tel: <a href="tel:%28%2B33%29%201%2069%2015%2060%2014" value="+33169156014" target="_blank">(+33) 1 69 15 60 14</a><br>
Fax: <a href="tel:%28%2B33%29%201%2069%2015%2067%2018" value="+33169156718" target="_blank">(+33) 1 69 15 67 18</a><br>
<br>
</font></blockquote></div><br>