<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<p>But it seems that MatMatTransposeMult does not work for MPIAIJ
matrices:</p>
<p><br>
</p>
<p><tt><span style="color:#000000">[0]PETSC ERROR:
MatMatTransposeMult not supported for A of type mpiaij</span></tt></p>
<p><br>
</p>
<div class="moz-cite-prefix">On 23/09/2020 20:23, Zhang, Hong wrote:<br>
</div>
<blockquote type="cite"
cite="mid:BLAPR09MB70742856EB1882DC6CA0A02E88380@BLAPR09MB7074.namprd09.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
You can use MatMatTransposeMult().</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
Hong</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
face="Calibri, sans-serif" color="#000000"><b>From:</b>
petsc-users <a class="moz-txt-link-rfc2396E" href="mailto:petsc-users-bounces@mcs.anl.gov"><petsc-users-bounces@mcs.anl.gov></a> on behalf
of Olivier Jamond <a class="moz-txt-link-rfc2396E" href="mailto:olivier.jamond@cea.fr"><olivier.jamond@cea.fr></a><br>
<b>Sent:</b> Wednesday, September 23, 2020 11:56 AM<br>
<b>To:</b> PETSc <a class="moz-txt-link-rfc2396E" href="mailto:petsc-users@mcs.anl.gov"><petsc-users@mcs.anl.gov></a><br>
<b>Subject:</b> [petsc-users] Compute C*Ct using
MatCreateTranspose for Ct</font>
<div> </div>
</div>
<div>
<p><tt>Hi all,</tt><tt><br>
</tt></p>
<p><tt>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.</tt></p>
<p><tt>If I just create a 'shell' Ct:</tt><tt><br>
</tt></p>
<p><tt>Mat Ct;</tt><tt><br>
</tt><tt>MatCreateTranspose(C, &Ct);</tt><tt><br>
</tt><tt>MatMatMult(C, Ct, MAT_INITIAL_MATRIX, PETSC_DEFAULT,
&CCt);</tt><tt><br>
</tt></p>
<p><tt>Then it does not work. I get: </tt><tt><br>
</tt></p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; text-indent:0px">
<tt><span style="color:#000000">[0]PETSC ERROR: No support for
this operation for this object type</span></tt></p>
<p style="margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; text-indent:0px">
<tt><span style="color:#000000">[0]PETSC ERROR:
MatMatTransposeMult not supported for A of type mpiaij</span></tt></p>
<p>
<style type="text/css">
<!--
-->
</style><tt>But if instead of C it was Ct that I have explicitly, then
it would work:</tt></p>
<p><tt>Mat Ct, CC;</tt><tt><br>
</tt><tt>MatTranspose(C, MAT_INITIAL_MATRIX, &Ct);</tt><tt><br>
</tt><tt>MatCreateTranspose(Ct, &CC); // create a 'shell'
C from explicit Ct to test</tt><tt><br>
</tt><tt>MatMatMult(CC, Ct, MAT_INITIAL_MATRIX, PETSC_DEFAULT,
&CCt);</tt><tt> // this is OK</tt></p>
<p><tt>Is there a way to avoid the explicit transposition of the
matrix?</tt></p>
<p><tt>Many thanks,</tt><tt><br>
</tt><tt>Olivier Jamond</tt><br>
</p>
<p><br>
</p>
</div>
</blockquote>
</body>
</html>