Inject everything when assembling a MG hierarchy #3114
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
name: "MG: Inject coefficients"
description: ''
title: ''
labels: ''
assignees: ''
Description
Things were breaking when a solver is reused for a bilinear form with a coefficient that is not a
Constant
, e.g. functions in R or DG0, after updating that coefficient.Turns out that we also need to manually inject everything in
problem.F.coefficients()
.But wait, there's also another issue. The manual injection has to ensure that the level above the current one is up-to-date with respect to the finest level, an assumption that only holds in the two-level case. PCMG will traverse the levels in the order [1, 2, 3, ..., finest, 0 = coarsest]. So we should inject all coefficients across the hierarchy the first time we are reassembling the problem.
Fixes Issues:
Checklist for author:
make lint
in thefiredrake
source directory).make linkcheck; make html; make latexpdf
infiredrake/docs
directory)pytest tests
in thefiredrake
source directory) (useful, but not essential if you don't have suitable hardware).Checklist for reviewer:
Feel free to add reviewers if you know there is someone who is already aware of this work.
Please open this PR initially as a draft and mark as ready for review once CI tests are passing.