<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
p.msipfooter6d2e06ff, li.msipfooter6d2e06ff, div.msipfooter6d2e06ff
{mso-style-name:msipfooter6d2e06ff;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Thanks, Dave.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Ernesto.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b>From:</b> Dave May [mailto:dave.mayhem23@gmail.com] <br>
<b>Sent:</b> Thursday, June 25, 2020 2:12 AM<br>
<b>To:</b> Ernesto Prudencio <EPrudencio@slb.com><br>
<b>Cc:</b> Jose E. Roman <jroman@dsic.upv.es>; petsc-users@mcs.anl.gov<br>
<b>Subject:</b> Re: [petsc-users] [Ext] Re: Question on SLEPc + computing SVD with a "matrix free" matrix<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Thu 25. Jun 2020 at 08:23, Ernesto Prudencio via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal">Thank you, Jose.<br>
<br>
However, in the case of a "matrix free" matrix, the APIs on PETSc seem to allow just the implementation of A.v, not of A' . w<br>
<br>
One could create another "matrix free" matrix B which could make the role of computing z = B . w = A' . w. But how could one force the routine MatMultTranspose(A, w, z) to call the routine for B? Here I am assuming that MatMultTranspose(A, w, z) is the routine
that SLEPc calls internally in its algorithms when the user sets for implicit transpose.<br>
<br>
I see two possibilities (for brain storming, since I don't know if such approaches would be acceptable for the PETSc team and/or the SLEPc team):<br>
1) PETSc could add an entry for a second routine that computes [ A' . w ] when calling MatMFFDSetFunction()<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">MatMFFD is designed for providing the action of the jacobian associated with a nonlinear problem F(x)=0. It uses F to provide a finite difference approx of the action J w. It does not support actions J’ w. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You will need to create a MatShell and supply the methods for MatMult and MatMultTranspose (as Jose suggested). <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Dave<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal">2) SLEPc could add an entry for the routine for computing [ A' . w ] when the matrix A is "matrix free"<br>
<br>
Thanks again,<br>
<br>
Ernesto.<br>
<br>
<br>
Schlumberger-Private<br>
<br>
-----Original Message-----<br>
From: Jose E. Roman [mailto:<a href="mailto:jroman@dsic.upv.es" target="_blank">jroman@dsic.upv.es</a>]
<br>
Sent: Thursday, June 25, 2020 1:01 AM<br>
To: Ernesto Prudencio <<a href="mailto:EPrudencio@slb.com" target="_blank">EPrudencio@slb.com</a>><br>
Cc: <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a><br>
Subject: [Ext] Re: [petsc-users] Question on SLEPc + computing SVD with a "matrix free" matrix<br>
<br>
Yes, you have to set it with SVDSetImplicitTranspose(), but then the matrix-free matrix should implement both "A.v" and "A'.v" operations.<br>
Jose<br>
<br>
<br>
> El 24 jun 2020, a las 23:25, Ernesto Prudencio via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>> escribió:<br>
> <br>
> Hi,<br>
> <br>
> Is it possible to compute a SVD for a “matrix free” matrix?<br>
> <br>
> At first, it seems it would be ok with a MatCreateMFFD() and MatMFFDSetFunction(), because one could then provide the routine that computes “A . v” for any given v, which is an operation needed by SLEPc. However, one would also need to set up the SVD object
in SLEPc with an implicit transpose. Would that be possible?<br>
> <br>
> Thanks in advance,<br>
> <br>
> Ernesto.<br>
> <br>
> Schlumberger-Private<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="msipfooter6d2e06ff" align="center" style="margin:0in;margin-bottom:.0001pt;text-align:center">
<span style="font-size:10.0pt;color:black">Schlumberger-Private</span><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</body>
</html>