I am using PARDISO to solve a system Ax=b in a simulation where A is a sparse unsymmetric matrix and constant, but b changes over time. How can I call PARDISO so that I only factorize A once but can then call the solve phase in a loop.
I am currently calling the solver in a function in which the four phases are performed, from initialising the solver to deleting memory, in each iteration which is very inefficient and would like to have the factorization in one initialize function which also factorises other matrices which are symmetric (and I use other MKL routines to solve them) and then call the PARDISO solver which just calls the solve phase.
- Set up all the desired values in the ipar() and pt() arrays and fixed options such as msglvl. Populate the CSR arrays for the matrix, and call Pardiso with phase = 12.
- Populate the r.h.s.vector b(t), call Pardiso with phase = 33.
- Postprocess/output results as needed. Go back to 2. as many times as needed.