<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div> Sounds good. Yes the outer most Jacobian can be shell (or even nest but then I think you need to "build" it yourself, I don't think the DMDA will give back an appropriate nest matrix.)<div class=""><br class=""><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 1, 2021, at 4:10 PM, Matteo Semplice <<a href="mailto:matteo.semplice@uninsubria.it" class="">matteo.semplice@uninsubria.it</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
<div class=""><p class="">Thank you, Matthew and Barry!</p><p class="">I can now see a way forward.</p>
Il 01/07/21 21:42, Barry Smith ha scritto:<br class="">
<blockquote type="cite" cite="mid:68848A0B-21F2-4129-8D7E-3847387E5916@petsc.dev" class="">
<blockquote type="cite" style="color: #007cff;" class="">
<pre class="moz-quote-pre" wrap="">I do not understand how creating a DMDA with n0+n1 dofs will let me easily reuse my shell preconditioner code on the top-left block.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap=""> PCFIELDSPLIT (and friends) do not order the dof by block, rather they "pull out" the required pieces of the vector (using IS's) when needed. Your shell preconditioner will just operate on the "pulled out" vectors. If you use DMDAVecGetArray etc in your shell preconditioner you can create an auxiliary DMDA of that smaller dof to still be able to use the DMDAVecGetArray constructs.
</pre>
</blockquote>
Just to be sure:
<p class="">- I create a DMDA with n0+n1 dof per node</p><p class="">- the jacobian will be associated to this DMDA. (It is not
crucial, but can this be a shell matrix?)<br class="">
</p><p class="">- I create a multiplicative PCfieldsplit, assign the correct n0
and n1 fields to each split (and get the IS for the splits via
PCFieldSplitGetIS, shuld I need them)</p><p class="">- the routine A00PCApply for the shell preconditioner of the A00
block, will see a Vec which is really a subvector with n0 dofs per
node. In order to use DMDA semantics on this one, I create a DMDA
with n0 dofs using DMDACreateCompatibleDMDA and then
VecGetArrayDOFS using the smaller DMDA?<br class="">
</p><p class="">Best</p><p class=""> Matteo<br class="">
</p><p class=""><br class="">
</p>
</div>
</div></blockquote></div><br class=""></div></div></body></html>