[petsc-users] MatNest with Shell blocks for multipysics
Barry Smith
bsmith at petsc.dev
Thu Jul 1 16:56:39 CDT 2021
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.)
> On Jul 1, 2021, at 4:10 PM, Matteo Semplice <matteo.semplice at uninsubria.it> wrote:
>
> Thank you, Matthew and Barry!
>
> I can now see a way forward.
>
> Il 01/07/21 21:42, Barry Smith ha scritto:
>>> 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.
>> 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.
> Just to be sure:
> - I create a DMDA with n0+n1 dof per node
>
> - the jacobian will be associated to this DMDA. (It is not crucial, but can this be a shell matrix?)
>
> - 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)
>
> - 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?
>
> Best
>
> Matteo
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20210701/3a864494/attachment-0001.html>
More information about the petsc-users
mailing list