FluidityEquation.getFieldFromCoeff returns the first field that it finds in the state with a given coefficient. This isn't always safe, since the state can contain fields that we haven't copied to the GPU (and therefore isn't suitable as a field which we can copy to make a temporary field).
For example, it will sometime return the AbsoluteDifference field, which is a diagnostic field and isn't actually used in a UFL equation.
FluidityEquation.getFieldFromCoeff
returns the first field that it finds in the state with a given coefficient. This isn't always safe, since the state can contain fields that we haven't copied to the GPU (and therefore isn't suitable as a field which we can copy to make a temporary field).For example, it will sometime return the AbsoluteDifference field, which is a diagnostic field and isn't actually used in a UFL equation.