Closed schnellerhase closed 3 weeks ago
For the multigrid setting we need to transfer variational forms, i.e. UFL forms, from different FEM-spaces to another.
For the use case of linear problems it should be enough to transfer bilinear forms.
So given two spaces $V_0$ and $V_1$ and a bilinear form $a:V_0 \times V_0 \to \mathbb{K}$ in ufl form, for example
$$ a0(u,v) = \int\Omega \nabla u \cdot \nabla v \ dx $$
which becomes in UFL notation
u, v = ufl.TrialFunction(V_0), ufl.TestFunction(V_0) a_0 = inner(grad(u), grad(v)) * dx
we want to get a copied version of $a_0$ that now operates on $V_1$, something like
a_1 = replace_spaces(a_0, V_1)
$a_1$ should then be the same as the construction by hand, i.e.
u, v = ufl.TrialFunction(V_1), ufl.TestFunction(V_1) a_1 = inner(grad(u), grad(v)) * dx
Handled by https://github.com/FEniCS/dolfinx/pull/3263
For the multigrid setting we need to transfer variational forms, i.e. UFL forms, from different FEM-spaces to another.
For the use case of linear problems it should be enough to transfer bilinear forms.
So given two spaces $V_0$ and $V_1$ and a bilinear form $a:V_0 \times V_0 \to \mathbb{K}$ in ufl form, for example
$$ a0(u,v) = \int\Omega \nabla u \cdot \nabla v \ dx $$
which becomes in UFL notation
we want to get a copied version of $a_0$ that now operates on $V_1$, something like
$a_1$ should then be the same as the construction by hand, i.e.