Unfortunately, I cannot reproduce this behaviour.
You are using the wrong form.
You should use dolfinx.fem.form
, not ufl.form
.
Remove form
from
You have a function space V
that is a vector function space.
The input to interpolate is a set of coordinates, x
, of shape (3, number_of_points)
, where x[0]
is the list of all x-coordinates, x[1]
all y coordinates etc.
The input is designed this way so that you can used vectorized functions in numpy.
As your space is a vector space of dim=3
, the output should be (3, number_of_points), not just number_of_points
.
Not sure why you would want such a constraint, what is the physical interpretation of this.
This is a topic covered in many other posts on discourse, see for instance: Periodic BC in dolfinx - #2 by nate