[petsc-users] Compute C*Ct using MatCreateTranspose for Ct
Olivier Jamond
olivier.jamond at cea.fr
Thu Sep 24 03:34:04 CDT 2020
But it seems that MatMatTransposeMult does not work for MPIAIJ matrices:
[0]PETSC ERROR: MatMatTransposeMult not supported for A of type mpiaij
On 23/09/2020 20:23, Zhang, Hong wrote:
> You can use MatMatTransposeMult().
> Hong
> ------------------------------------------------------------------------
> *From:* petsc-users <petsc-users-bounces at mcs.anl.gov> on behalf of
> Olivier Jamond <olivier.jamond at cea.fr>
> *Sent:* Wednesday, September 23, 2020 11:56 AM
> *To:* PETSc <petsc-users at mcs.anl.gov>
> *Subject:* [petsc-users] Compute C*Ct using MatCreateTranspose for Ct
>
> Hi all,
>
> I have a rectangle MPIAIJ matrix C. I would like to compute C*Ct
> explicitly to solve some ksp(C*Ct) problems using direct solvers or
> with petsc preconditioners.
>
> If I just create a 'shell' Ct:
>
> Mat Ct;
> MatCreateTranspose(C, &Ct);
> MatMatMult(C, Ct, MAT_INITIAL_MATRIX, PETSC_DEFAULT, &CCt);
>
> Then it does not work. I get:
>
> [0]PETSC ERROR: No support for this operation for this object type
>
> [0]PETSC ERROR: MatMatTransposeMult not supported for A of type mpiaij
>
> But if instead of C it was Ct that I have explicitly, then it would work:
>
> Mat Ct, CC;
> MatTranspose(C, MAT_INITIAL_MATRIX, &Ct);
> MatCreateTranspose(Ct, &CC); // create a 'shell' C from explicit Ct to
> test
> MatMatMult(CC, Ct, MAT_INITIAL_MATRIX, PETSC_DEFAULT, &CCt);// this is OK
>
> Is there a way to avoid the explicit transposition of the matrix?
>
> Many thanks,
> Olivier Jamond
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200924/9db0bb64/attachment-0001.html>
More information about the petsc-users
mailing list