OP2 / PyOP2

Framework for performance-portable parallel computations on unstructured meshes
https://op2.github.io/PyOP2
Other
80 stars 35 forks source link

Fix Vec's state counter for MixedDat #670

Closed nbouziani closed 2 years ago

nbouziani commented 2 years ago

MixedDat objects don’t only rely on the PETSc Vec of the underlying Dat objects, they is also a Vec living on the mixed space that is made by duplicating the layout vector of the dataset attached to the MixedDat instance.

The data version of MixedDat is obtained by summing the data version of the underlying Dat (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 the vec_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.