<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 02/02/2012 15:23, Jed Brown wrote:
<blockquote
cite="mid:CAM9tzSnUa6JUnJJvhP4y41-n9HZhvGLD15Q+BpcYsz343EbZGA@mail.gmail.com"
type="cite">
<meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
<div>On Thu, Feb 2, 2012 at 13:03, 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>
<div>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>
</div>
</blockquote>
<div><br>
src/ksp/ksp/examples/tutorials/ex43.c (2D) and ex42.c (3D) use
these elements for variable-viscosity Stokes.<br>
</div>
</div>
</blockquote>
No. In those examples, you have the same grid for the velocity and
the pressure. If I use 4Q1_Q1 elements, I have not the same grid. I
have one for the velocity and an other for the pressure in the
DMComposite. And for me, it is the difficulty because as you say
after, I have to do my own preallocation step to have the good
off-diagonal blocks.<br>
<br>
This is why I asked what is the best way to construct my matrix. I
hoped that now it is not necessary to do this preallocation. This is
also a difficulty to use a multigrid only on the velocity.<br>
<br>
Thanks,<br>
Loic <br>
<br>
<blockquote
cite="mid:CAM9tzSnUa6JUnJJvhP4y41-n9HZhvGLD15Q+BpcYsz343EbZGA@mail.gmail.com"
type="cite">
<div>
<blockquote>
<div> <br>
- Construct the matrices for each DM in the DMComposite<br>
- Construct the global matrix and the global preconditioner
<br>
- Use MatNest<br>
</div>
</blockquote>
<div><br>
DMComposite can allocate for AIJ or Nest. Just set the matrix
type, e.g. -dm_mat_type nest, ex28.c does this (see
runex28_3).<br>
<br>
But preallocation for off-diagonal blocks (of MatNest or AIJ)
is still messy and I haven't figured out a good API other than
to write an efficient dynamic preallocation to make it
unnecessary. A lot of users like Jacobian-free Newton-Krylov
with the true Jacobian applied by finite differencing
(-snes_mf_operator) in which case the current code is fine
because we only assemble diagonal blocks.<br>
</div>
<blockquote>
<div> <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.</div>
</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>