[petsc-users] reuse ksp in time marching loop

Jed Brown jed at jedbrown.org
Tue Jun 10 15:58:38 CDT 2014


Shriram Srinivasan <shriram at ualberta.ca> writes:

> Hi all,
> I am implementing a time marching loop (My problem is not amenable to 
> usage of the TS module) where the coefficient matrix A wont change with 
> time. I was wondering, in the sequence of commands
>
> /KSPCreate(PETSC_COMM_SELF, &ksp); //
> //KSPSetOperators(ksp, A,  A, SAME_PRECONDITIONER); //
> //KSPGetPC(ksp, &pc);//
> //PCSetType(pc, PCLU); //
> //PCFactorSetMatSolverPackage(pc, MATSOLVERMUMPS);//
> //KSPSetFromOptions(ksp);//
> //KSPSolve(ksp, b, x);//
> //KSPDestroy(&ksp);/
>
> would it be  efficient/possible to move some of them out of the loop.
> If so, which ones can I move out.

Everything except KSPSolve.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140610/9b783771/attachment.pgp>


More information about the petsc-users mailing list