[petsc-dev] Question on extracting submatrixes from global projection when using FS + external DMShell + MG
Boris Boutkov
borisbou at buffalo.edu
Thu Oct 11 14:32:40 CDT 2018
Thank you for the reply. I think Ive made a little progress but still have
lingering issues regarding this situation.
My misunderstanding earlier came from the fact that when I was using
DMCreateFieldIS inside of my DMCreateInterpolation in order to extract the
sub-projection-matrix, the returned fields from DMCreateFieldIS
corresponded to individual fields which I was not unioning at the time.
Adding a call to ISSum on the returned fields alleviated this issue and so
I was able to extract a submatrix of proper row size. The issue that
remains is that the coarse DM coming to me inside DMCreateInterpolation has
3 fields while the fine has the expected 2 [in the context of the 2D
(u,v,p) Stokes vars with a split to do GMG on the velocity block]. This
issue is similar if I do GMG with 3 MG levels, the fine DM has 2 fields,
while the other two coarser levels have 3 fields. It seems like coarser DMs
are not properly fieldsplit by the time I have access to them in
DMCreateInterpolation and this leads to incompatible sizes in the Galerkin
product. So I guess my question becomes: am I expected to do the field
decompositions for coarser DMs at this stage inside of my
DMCreateInterpolation, or is this something that should be occurring during
an earlier setup phase.
Thanks again for the help,
- Boris
On Wed, Oct 10, 2018 at 8:21 PM Matthew Knepley <knepley at gmail.com> wrote:
> On Wed, Oct 10, 2018 at 12:23 PM Boris Boutkov <borisbou at buffalo.edu>
> wrote:
>
>> Hello again all,
>>
>> I've been trying to get GMG+FS to work with an external DMShell provided
>> by libMesh, see for reference
>> https://www.mail-archive.com/petsc-dev@mcs.anl.gov/msg23497.html .
>>
>> The situation is that while I've managed to successfully attach some
>> extra hooks to CreateSubDM_Shell to set appropriate interpolation,
>> restriction, and a few other operators that I call, I now encounter matrix
>> multiplication size mismatches when computing the Galerkin triple product
>> to produce the coarser operators during the MG setup. As it stands, libMesh
>> is computing a global projection matrix and I was hoping to be able to
>> extract sub matrices out of it corresponding to the various fields but am
>> not sure about the right way to go about this.
>>
>> Since we are using DMShell and provide Section information I was hoping
>> to use something along the lines of MatCreateSubmatrix and extract from the
>> global projection Mat, only projections corresponding to the fields in
>> question. Doing this seems to entail the need to provide the row and column
>> ISs.
>>
>
> Yes, that is right. You just need the ISes.
>
>
>> While I can extract Index Set lists from the incoming DMs during
>> DMCreateInterpolation via DMCreateFieldIS, I'm not sure what the right way
>> to extract the row and column information from these IS would be. Is there
>> a natural way to achieve such a thing from PETSc's side or am I going about
>> this in the completely wrong way and need to construct field based
>> projections from my end?
>>
>
> I am not sure what is being asked. Your hooks are transfered during
> DMCreateSubDM(). It creates the IS for the subfield, so at that point you
> know it. Either store that or use it right there to extract your
> interpolation.
>
> Thanks,
>
> Matt
>
>
>> Thanks as always for any information you can provide,
>> - Boris
>>
>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
> https://www.cse.buffalo.edu/~knepley/
> <http://www.cse.buffalo.edu/~knepley/>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20181011/2b491d6c/attachment.html>
More information about the petsc-dev
mailing list