Wrong bahavior when multiple grid functions present.
The following code produces wrong results when showBug = True
:
import numpy as np
from dune.grid import cartesianDomain, gridFunction, structuredGrid
from dune.alugrid import aluConformGrid
domain = cartesianDomain([0, 0], [1, 1], [3, 2])
view = aluConformGrid(domain)
showBug = True
if showBug:
@gridFunction(view, order = 0, name = "x")
def f(xglobal):
x,y = xglobal
return np.sin(20*x*y)*xglobal.two_norm
F = [[f(corner) for corner in elt.geometry.corners] for elt in view.elements]
@gridFunction(view, order = 0, name = "x")
def h(xglobal):
x,y = xglobal
return xglobal[0]
L = [[h(corner) for corner in elt.geometry.corners] for elt in view.elements]
assert abs(L[0][0] - 1./3.) < 1e-8