Slicing in dofVector of function
When passing a NumPy array as DofVector to a function the slicing is ignored as the following example demonstrates:
from dune.grid import structuredGrid as leafGridView
from dune.fem.space import lagrange as solutionSpace
import numpy as np
N = 20
gridView = leafGridView([0, 0], [1, 1], [N, N])
space = solutionSpace(gridView)
x = np.zeros([space.size, 2])
x[:,1] = 1.0
f = space.function("f", dofVector=x[:,1])
f.plot()
g = space.function("g", dofVector=x[:,1].copy())
g.plot()
I would expect that at least a warning is triggered when a sliced NumPy array is passed to a function.
I used dune-fem version 2.8.0.dev20210402 installed with pip.