firedrakeproject / asQ

A library for implementing ParaDIAG timestepping algorithms using Firedrake
MIT License
4 stars 1 forks source link

Option for time-average of block spatial jacobian in the DiagFFTPC #31

Closed JHopeCollins closed 2 years ago

JHopeCollins commented 2 years ago

This adds an extra option to the paradiag solver parameters that gets passed through to the preconditioner. This option determines whether the block spatial jacobian is calculated from a global (window) time-average of the solution or a local (slice) time-average

JHopeCollins commented 2 years ago

I'm getting the jac_average flag from the petsc options in the setUp method, because that's where the context (the global paradiag object) is grabbed from the petsc options.

It looks like the setUp(pc) method is called every time the preconditioner is reused though - so every non-linear iteration. Are the context and the averaging option ever going to change mid-solve? If not, should they be moved to the initialize(pc) method instead, which only gets called once, the first time setUp(pc) is called?