<div dir="ltr">Hi,<div><br></div><div style>I am using the <span class="GRcorrect">cray</span>-<span class="GRcorrect">petsc</span> implementation on the NERSC system. Specifically, I have implemented a <span class="GRcorrect">runge</span> <span class="GRcorrect">kutta</span> solver, and I need to solve a linear system Ax = <span class="GRcorrect">b</span> several times per time step. I am using PETSC to interface with the MUMPS solver for direct factorization.</div>
<div style><br></div><div style>The matrix A is constant over a whole time step, but changes at each time step. What I do now is that at the beginning of each time step, I compute the matrix A, use the MUMPS solver to compute <span class="GRcorrect">a</span> LU factorization of A, and then use KSPSolve to solve each linear system during the same time step. Here is an example of the succession of calls (inspired from example ex52<span class="GRcorrect">.</span>c):</div>
<div style><br></div><div style>Once per time step:</div><div style><div>call KSPSetOperators(KSP_A, A, A, DIFFERENT_NONZERO_PATTERN, ierr)</div><div>call KSPSetType(KSP_A, KSPPREONLY, ierr);</div><div>call KSPGetPC(KSP_A, PC_A, ierr)</div>
<div>call KSPSetTolerances(KSP_A, 1.d-20, PETSC_DEFAULT_DOUBLE_PRECISION, PETSC_DEFAULT_DOUBLE_PRECISION, PETSC_DEFAULT_INTEGER, ierr)</div><div>call PCSetType(PC_A, PCLU, ierr)</div><div>call PCFactorSetMatSolverPackage(PC_A, MATSOLVERMUMPS, ierr)</div>
<div>call PCFactorSetUpMatSolverPackage(PC_A, ierr)</div><div>call PCFactorGetMatrix(PC_A, PC_A, ierr)</div><div>call MatMumpsSetIcntl(PC_A, 7, 5, ierr)</div><div>call <span class=""><span class="GRcorrect">PCSetup</span></span>(PC_A, ierr)</div>
<div>call KSPSetUp(KSP_A, ierr)</div><div><br></div><div style>Then several times per time step:</div><div style>call KSPSolve( KSP_A, b, x, ierr)<br></div><div style><br></div><div style>This works fine. </div><div style>
However, I am able to precompute the maximal sparsity pattern of A before the time iterations. Therefore, I would like to use this information by precomputing the symbolic factorization before the time iterations start, and only compute the numerical factorization at each time step. Is there a way to use MUMPS in PETSC to do this ? I would appreciate any help/reference on this topic.</div>
<div style><br></div><div style>Thank you,</div><div style><br></div><div style>Tibo</div></div></div>