[petsc-users] Mixed matrices MatMatMult
Matthew Knepley
knepley at gmail.com
Fri Mar 27 09:43:46 CDT 2015
On Thu, Mar 26, 2015 at 6:08 PM, Luc Berger-Vergiat <lb2653 at columbia.edu>
wrote:
> The difference between IS(1), IS(2) and IS(1)',IS(2)' is that they
> operate on two different matrices. The former operate on A whereas the
> operates on S and these matrices have different sizes so it's not obvious
> to me that they IS would be identical? I guess it depends on the initial
> ordering of the blocks of A, if A00 is actually the bottom right block then
> I can see how the two are the same.
>
> But just to get a confirmation here is a simple example: let's assume I
> solve a 2D problem with momentum and energy conservation.
> In that case I get three equations per nodes:
>
> C1*d^2 u_x/dx^2 + C2*d^2 u_y/dxdy + a*dT/dt= fx ---> IS(0)
> C3*d^2 u_x/dxdy + C4*d^2 u_y/dy^2 + a*dT/dt = fy ---> IS(1)
> dT/dt + kappa*(d^2 T/dx^2 + d^2 T/dy^2) = fT ---> IS(2)
>
> This leads to a block matrix with 3x3 block per nodes. If I extract the
> temperature problem, invert it and compute the schur complement I will end
> up with S with the same size as the elasticity part of the problem but will
> the IS(0) and IS(1) be the same for the jacobian and the Schur complement?
> If that's the case that's awesome that you programmed it to keep track of
> these things!
>
Nope, I was misunderstanding. However, if you have a DM, you can get the
new ISes the same
way. The Schur complement was formed using DMCreateSubDM(), and you can
call the same
thing for those fields to get the subDM and those ISes. Does this makes
sense?
If you do not have a DM, then its a translation process.
Thanks,
Matt
> Best,
> Luc
>
> On 03/26/2015 06:05 PM, Matthew Knepley wrote:
>
> On Thu, Mar 26, 2015 at 4:06 PM, Luc Berger-Vergiat <lb2653 at columbia.edu>
> wrote:
>
>> Ok,
>> this work is still part of my Schur complement approach using the full
>> schur but with a block diagonal A00^-1.
>> I implemented the computation of A00^-1 by extracting each diagonal block
>> and inverting them individually.
>> This works quite well and does not cost some much, especially since I can
>> still use threads to accelerate this process (I might send a question about
>> this in the future...).
>>
>> At the moment the most expensive part of the procedure is inverting S
>> (I'm using LU at the moment to make sure that everything is implemented
>> correctly) and the second most expensive procedure is MatMatMult. I'm doing
>> two of these: A10 * A00^-1 and then a right multiplication by A01.
>> Decreasing that cost would be nice (I attached the output of -log_summary
>> for reference).
>> I think I need to look for the objects that are not Destroyed too.
>>
>
> We will look, but this is a notoriously hard thing to speed up. You
> might try the RAP code instead.
>
> Finally I now would like to split the Schur complement into two
>> submatrices. I have an IS that tracks location of these sub-matrices in the
>> global system:
>>
>> [ A00 A01 A02 ] --> IS(0)
>> A = [ A10 A11 A12 ] --> IS(1)
>> [ A20 A21 A22 ] --> IS(2)
>>
>> How can I use IS(1) and IS(2) to track:
>>
>> S = [ A11 A12 ] _ [ A10] * [A00]^-1 * [ A01 A02 ] = [ S11 S12 ]
>> --> IS(1)'
>> [ A21 A22 ] [ A20]
>> = [ S21 S22 ] --> IS(2)'
>>
>> or is there a simple way to compute IS(1)' and IS(2)' based on IS(1) and
>> IS(2)?
>>
>
> Aren't they identical?
>
> Thanks,
>
> Matt
>
>
>> Thanks!
>>
>> Best,
>> Luc
>>
>> On 03/26/2015 04:12 PM, Matthew Knepley wrote:
>>
>> On Thu, Mar 26, 2015 at 3:07 PM, Luc Berger-Vergiat <lb2653 at columbia.edu
>> > wrote:
>>
>>> Hi all,
>>> I want to multiply two matrices together, one is MATAIJ and the second
>>> is MATBAIJ, is there a way to leverage the properties of the blocked matrix
>>> in the BAIJ format or should I just assemble the BAIJ matrix as AIJ?
>>
>>
>> I am afraid you are currently stuck with the latter.
>>
>> Thanks,
>>
>> Matt
>>
>>
>>>
>>> --
>>> Best,
>>> Luc
>>>
>>>
>>>
>>
>>
>> --
>> 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
>>
>>
>>
>
>
> --
> 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
>
>
>
--
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150327/88373af0/attachment.html>
More information about the petsc-users
mailing list