<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=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","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;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
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="FY" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-GB">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Thank you for your answer.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">My problem is a bit more complex. During the simulation (“real time”), I need to upgrade at each time step the matrix A and the MatassemblyBegin and MatassemblyEnd take time and so, in order to avoid these functions,
I don’t use ksp or pc. I prefer to use the functions </span><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">MatLUFactorNumeric, MatLUFactorSymbolic and MatLUFactor</span><span lang="EN-GB">. And so, I want to know if there is similar
functions for KLU. (I tried for Cholesky and, iLU and it works well).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Best regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB">Romain<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Matthew Knepley [mailto:knepley@gmail.com]
<br>
<b>Sent:</b> vrijdag 14 augustus 2015 16:41<br>
<b>To:</b> Romain Thomas<br>
<b>Cc:</b> petsc-users@mcs.anl.gov<br>
<b>Subject:</b> Re: [petsc-users] petsc KLU<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal">On Fri, Aug 14, 2015 at 9:23 AM, Romain Thomas <<a href="mailto:R.Thomas@tudelft.nl" target="_blank">R.Thomas@tudelft.nl</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">Dear PETSc users,<br>
<br>
I would like to know if I can replace the following functions<br>
<br>
MatLUFactorNumeric(Mat fact,Mat mat,const MatFactorInfo *info)<br>
MatLUFactorSymbolic(Mat fact,Mat mat,IS row,IS col,const MatFactorInfo *info)<br>
MatLUFactor(Mat mat,IS row,IS col,const MatFactorInfo *info)<br>
<br>
by<br>
<br>
MatLUFactorNumeric_KLU(Mat F,Mat A,const MatFactorInfo *info)<br>
MatLUFactorSymbolic_KLU(Mat F,Mat A,IS r,IS c,const MatFactorInfo *info)<br>
MatGetFactor_seqaij_klu(Mat A,MatFactorType ftype,Mat *F)<br>
<br>
in my code for the simulation of electrical power systems? (I installed the package SuiteSparse)<o:p></o:p></span></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Why would you do that? It already works with the former code. In fact, you should really just use<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> KSPCreate(comm, &ksp)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> KSPSetOperator(ksp, A, A);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> KSPSetFromOptions(ksp);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> KSPSolve(ksp, b, x);<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">and then give the options<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> -ksp_type preonly -pc_type lu -pc_mat_factor_package suitesparse<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">This is no advantage to using the Factor language since subsequent calls to<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">KSPSolve() will not refactor.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"> Matt<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:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black">Thank you,<br>
Best regards,<br>
Romain<o:p></o:p></span></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<p class="MsoNormal">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<o:p></o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>