<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Jed,<br>
<br>
thanks for your reply.<br>
<br>
On 01/02/2012 16:32, Jed Brown wrote:
<blockquote
cite="mid:CAM9tzSn7HssjcQA0+HAtEuQvSkLoRZGGO7Z0_sFU1JL89J1XDA@mail.gmail.com"
type="cite">
<meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
<div>On Wed, Feb 1, 2012 at 04:47, gouarin <span><<a
moz-do-not-send="true"
href="mailto:loic.gouarin@math.u-psud.fr">loic.gouarin@math.u-psud.fr</a>></span>
wrote:<br>
<blockquote>
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_ levels 2<br>
-stokes_fieldsplit_0_pc_mg_ galerkin<br>
...<br>
-stokes_fieldsplit_1_ksp_type preonly<br>
-stokes_fieldsplit_1_pc_type jacobi<br>
<br>
It doesn'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't have to do anything
special.</div>
<div><br>
</div>
<div>Try "make runex28_4". (It's broken with a change that went
into petsc-dev a few days ago. I'll be able to push the fix
whenever I find a wireless network in this airport that
doesn't block ssh.)</div>
<div> </div>
</div>
</blockquote>
It seems that I have forgotten to initialize DMSetInitialGuess,
DMSetFunction, DMSetJacobian. <br>
<br>
I don't understand what is the best way to use 4Q1-Q1 elements for
the Stokes problem:<br>
<br>
- Construct the matrices for each DM in the DMComposite<br>
- Construct the global matrix and the global preconditioner <br>
- Use MatNest<br>
<br>
There are a lot of possibilities with PETSc with new add-ons and it
is difficult to find our way with only the documentation.<br>
<br>
Best regards,<br>
Loic<br>
<br>
<blockquote
cite="mid:CAM9tzSn7HssjcQA0+HAtEuQvSkLoRZGGO7Z0_sFU1JL89J1XDA@mail.gmail.com"
type="cite">
<div>
<blockquote>
<br>
But If I do:<br>
<br>
------<br>
PCSetDM(pc, dom->get_pack());<br>
PCSetType(pc, PCFIELDSPLIT);<br>
KSPSetUp(solver);<br>
PCFieldSplitGetSubKSP(pc, &nsplits, &subksp);<br>
PetscMalloc(sizeof(PC)* nsplits, &subpc);<br>
<br>
KSPSetType(subksp[0], KSPPREONLY);<br>
KSPGetPC(subksp[0], &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'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_
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>
<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 moz-do-not-send="true"
href="tel:%28%2B33%29%201%2069%2015%2060%2014">(+33) 1 69 15
60 14</a><br>
Fax: <a moz-do-not-send="true"
href="tel:%28%2B33%29%201%2069%2015%2067%2018">(+33) 1 69 15
67 18</a><br>
<br>
</blockquote>
</div>
<br>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Loic Gouarin
Laboratoire de Mathématiques
Université Paris-Sud
Bâtiment 425
91405 Orsay Cedex
France
Tel: (+33) 1 69 15 60 14
Fax: (+33) 1 69 15 67 18</pre>
</body>
</html>