<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Thank you, Matthew and Barry!</p>
<p>I can now see a way forward.</p>
Il 01/07/21 21:42, Barry Smith ha scritto:<br>
<blockquote type="cite" cite="mid:68848A0B-21F2-4129-8D7E-3847387E5916@petsc.dev">
<blockquote type="cite" style="color: #007cff;">
<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>- I create a DMDA with n0+n1 dof per node</p>
<p>- the jacobian will be associated to this DMDA. (It is not
crucial, but can this be a shell matrix?)<br>
</p>
<p>- 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>- 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>
</p>
<p>Best</p>
<p> Matteo<br>
</p>
<p><br>
</p>
</body>
</html>