firedrakeproject / asQ

A library for implementing ParaDIAG timestepping algorithms using Firedrake

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update `HybridisationSCPC` to use `ufl.replace` with `firedrake.formmanipulation.ExtractSubBlock`

JHopeCollins opened this issue · comments

In the hybridisation preconditioner we have an original form on V = HDiv x DG. We need to construct a hybridisable form on Vtr = Broken(HDiv) x DG x Tr where the (0-1,0-1) blocks are the original form on V.
Ideally we would do this using ufl.replace. This works fine for replacing instances in each subspace V[0] -> Vtr[0] and V[1] -> Vtr[1]. However we run into issues when we need to replace instances of u \in V, because we can't construct an equivalent u from the subspaces of Vtr.

Our current "solution" in HybridisationSCPC is to restrict ourselves to constructing the hybridisable form from the form_mass and form_function callbacks. This is fine for all current uses in asQ but does limit the PC and adds extra code.

Pablo has suggested that we might be able to get around this by manually splitting the form into blocks using firedrake.formmanipulation.ExtractSubBlock. For terms with instances from HDiv or DG this won't make a difference, but it should split any term with instances from V into multiple terms for each component of V. We should then be able to use ufl.replace on each term.