<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
See case '"-num_rhs" in petsc/src/ksp/ksp/tests/ex30.c</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hong</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> petsc-users <petsc-users-bounces@mcs.anl.gov> on behalf of Matthew Knepley <knepley@gmail.com><br>
<b>Sent:</b> Tuesday, August 4, 2020 7:29 PM<br>
<b>To:</b> Anthony Paul Haas <aph@email.arizona.edu><br>
<b>Cc:</b> petsc-users <petsc-users@mcs.anl.gov><br>
<b>Subject:</b> Re: [petsc-users] reuse Mumps factorization for multiple RHS</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">On Tue, Aug 4, 2020 at 7:57 PM Anthony Paul Haas <<a href="mailto:aph@email.arizona.edu">aph@email.arizona.edu</a>> wrote:<br>
</div>
<div class="x_gmail_quote">
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">Hello,
<div><br>
</div>
<div>When using Mumps to solve a linear system of equations (see below), can I reuse the factorization to solve for multiple RHS, ie, can I use <span style="color:rgb(74,0,255); font-family:Menlo; font-size:11px">KSPSolve</span> multiple times while only building
 a different RHS in between the calls to <span style="color:rgb(74,0,255); font-family:Menlo; font-size:11px">KSPSolve</span>?</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>Yes. It should detect that you have not changed the operator for the KSP and thus not refactor the matrix.</div>
<div><br>
</div>
<div>  Thanks,</div>
<div><br>
</div>
<div>     Matt</div>
<div> </div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>Thanks,</div>
<div><br>
</div>
<div>Anthony</div>
<div><br>
</div>
<div><span style="font-family:Menlo; font-size:11px; font-variant-ligatures:no-common-ligatures; color:rgb(194,0,255)">call</span><span style="color:rgb(0,0,0); font-family:Menlo; font-size:11px; font-variant-ligatures:no-common-ligatures">
</span><span style="font-family:Menlo; font-size:11px; font-variant-ligatures:no-common-ligatures; color:rgb(74,0,255)">KSPSetType</span><span style="color:rgb(0,0,0); font-family:Menlo; font-size:11px; font-variant-ligatures:no-common-ligatures">(self%ksp,KSPPREONLY,self%ierr_ps)</span><br>
</div>
<div>
<p style="margin:0px; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures; color:rgb(194,0,255)">call</span><span style="font-variant-ligatures:no-common-ligatures">
</span><span style="font-variant-ligatures:no-common-ligatures; color:rgb(74,0,255)">KSPGetPC</span><span style="font-variant-ligatures:no-common-ligatures">(self%ksp,pc,self%ierr_ps)</span></p>
<p style="margin:0px; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(203,36,24)">
                                                                                                                                                                                     <br>
</p>
<p style="margin:0px; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures; color:rgb(194,0,255)">call</span><span style="font-variant-ligatures:no-common-ligatures">
</span><span style="font-variant-ligatures:no-common-ligatures; color:rgb(74,0,255)">PCSetType</span><span style="font-variant-ligatures:no-common-ligatures">(pc,PCLU,self%ierr_ps)</span></p>
<p style="margin:0px; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(203,36,24)">
                                                                                                                                                                                               <br>
</p>
<p style="margin:0px; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(0,0,0)">
<span style="font-variant-ligatures:no-common-ligatures; color:rgb(194,0,255)">call</span><span style="font-variant-ligatures:no-common-ligatures">
</span><span style="font-variant-ligatures:no-common-ligatures; color:rgb(74,0,255)">PCFactorSetMatSolverPackage</span><span style="font-variant-ligatures:no-common-ligatures">(pc,MATSOLVERMUMPS,self%ierr_ps)</span></p>
<p style="margin:0px; font-stretch:normal; font-size:11px; line-height:normal; font-family:Menlo; color:rgb(74,0,255)">
<span style="font-variant-ligatures:no-common-ligatures; color:rgb(194,0,255)">call</span><span style="font-variant-ligatures:no-common-ligatures; color:rgb(0,0,0)">
</span><span style="font-variant-ligatures:no-common-ligatures">PCFactorSetUpMatSolverPackage</span><span style="font-variant-ligatures:no-common-ligatures; color:rgb(0,0,0)">(pc,self%ierr_ps)</span></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="x_gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener</div>
<div><br>
</div>
<div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>