Fix Vec's state counter for MixedDat #670
Merged
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.
MixedDat
objects don’t only rely on the PETSc Vec of the underlyingDat
objects, they is also a Vec living on the mixed space that is made by duplicating the layout vector of the dataset attached to theMixedDat
instance.The data version of
MixedDat
is obtained by summing the data version of the underlyingDat
(not unique but enough to detect that the data value changed), but we also need to update the data version of the vector in the mixed space in thevec_context
where it is populated.This causes a test to fail in firedrake as PETSc Vecs cache some operations (e.g. norm computations) based on the Vec's state counter which can lead to wrong numerical values.