This PR fixes two separate issues for multigrid with Functions in R.
The restriction operator for the R space is square. For these cases PETSc complains if we do not pass a vector to rescale the restriction operator to construct the "cheap" injection, even though it is not necessary, as we already pass the proper injection operator. To fix this we just pass a vector of the appropriate size.
The parentdm of an R space function sometimes might have a null __setup_hooks__, which makes it impossible to call add_hook on it. As a workaround, we just skip that call.
Description
This PR fixes two separate issues for multigrid with
Functions
in R.The restriction operator for the R space is square. For these cases PETSc complains if we do not pass a vector to rescale the restriction operator to construct the "cheap" injection, even though it is not necessary, as we already pass the proper injection operator. To fix this we just pass a vector of the appropriate size.
The
parentdm
of an R space function sometimes might have a null__setup_hooks__
, which makes it impossible to calladd_hook
on it. As a workaround, we just skip that call.