Resolving with different RHS

53 views
Skip to first unread message

Andreas Kyritsakis

unread,
Jun 2, 2020, 6:04:38 AM6/2/20
to deal.II User Group
Dear all,

I have a problem where a Poisson-like equation has to be solved again and again in many time steps. At each timestep the LHS remains the same while the RHS changes (slightly). My current implementation is to use the standard SolverCG, passing the old solution as initial, which already reduces the number of CG steps required. Yet, I wonder whether my approach is naive and there is a faster way to implement this, taking better advantage of the fact that the LHS stays always the same. I initially thought about calculating the inverse matrix once and just doing matrix multiplication, but since the mass matrix is a huge sparse matrix, only storing the inverse (which in general is not sparse) would require huge memory. I also thought about the LinearOperator concepts, but if I understood correctly, they just implement a nice wrapper to call a solver each time. Am I missing something?

Cheers,
Andreas

Simon Sticko

unread,
Jun 2, 2020, 6:21:37 AM6/2/20
to deal.II User Group
Hi,
a better option than computing the inverse is to factorize the matrix. This can be done using the SparseDirectUMFPACK solver:

https://www.dealii.org/current/doxygen/deal.II/classSparseDirectUMFPACK.html

You might want to take a look at step 22, which uses this solver:

https://www.dealii.org/current/doxygen/deal.II/step_22.html

Best,
Simon

Andreas Kyritsakis

unread,
Jun 2, 2020, 6:53:08 AM6/2/20
to deal.II User Group
Thanks a lot!!

Jean-Paul Pelteret

unread,
Jun 2, 2020, 3:12:43 PM6/2/20
to dea...@googlegroups.com
Hi Andreas,

I concur with Simon. Additionally, if you’re using the Trilinos linear algebra classes, then the TrilinosWrappers::SolverDirect solver will do the same
Its hard to tell (from the documentation) what PETScWrappers::SparseDirectMUMPS does, but if it doesn’t retain the factorisation then I’m sure some light refactoring of the class could address that issue.

Best,
Jean-Paul

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/072b1775-eaae-486e-a874-2fba0ca4e36d%40googlegroups.com.

Andreas Kyritsakis

unread,
Jun 3, 2020, 2:39:20 AM6/3/20
to deal.II User Group
Thank you both!
To unsubscribe from this group and stop receiving emails from it, send an email to dea...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages