Hello,
How to make it possible to understand the order of mesh nodes and basis functions? Must one look at definition of basis functions in basix or can we find information in V.dofmap, mesh.geometry.dofmap, or anywhere?
For example, Degree 1 Lagrange on a quadrilateral numbering is in picture https://defelement.com/elements/examples/quadrilateral-lagrange-equispaced-1.html. But mesh nodes are
[[0. 0.]
[0. 1.]
[1. 0.]
[1. 1.]]
Simple example. Different f is constructed with mesh.geometry.x order in mind and expect max at respective mesh.geometry.x point.
import dolfinx
import ufl
import mpi4py
import numpy
mesh = dolfinx.mesh.create_unit_square(
mpi4py.MPI.COMM_WORLD, 1, 1, cell_type=dolfinx.mesh.CellType.quadrilateral
)
print(mesh.geometry.x[:, 0:2])
V = dolfinx.fem.FunctionSpace(mesh, ("Lagrange", 1))
v = ufl.TestFunction(V)
x = ufl.SpatialCoordinate(mesh)
f0 = (1 - x[0]) * (1 - x[1])
f1 = x[0] * (1 - x[1])
f2 = (1 - x[0]) * x[1]
f3 = x[0] * x[1]
for f in [f0, f1, f2, f3]:
L = dolfinx.fem.form(ufl.inner(f, v) * ufl.dx)
b = dolfinx.fem.petsc.assemble_vector(L)
print(b.array)
print("arg max", numpy.argmax(b.array))
I suspect I must never look at mesh.geometry.