Where are mesh points defined?

As I’m learning FEniCSx, I’m confused as to where the points in a mesh are definted. I’ve looked through all of the attributes of a mesh object, FunctionSpace object, and Function object, but do not find the mesh points. A MWE is shown below. In a Jupyter notebook I’ve looked through all of the attributes of domain, V, and u_n, but have not found an array of mesh points. What am I missing? I’m using FEniCSx version 0.6.

from dolfinx import fem, mesh
from mpi4py import MPI
import numpy as np

# Define mesh
nx, ny = 3, 2
domain = mesh.create_rectangle(
    MPI.COMM_WORLD,
    [np.array([0, 0]), np.array([2, 1])],
    [nx, ny],
    mesh.CellType.triangle,
)

# Define FunctionSpace based on mesh
V = fem.FunctionSpace(domain, ("Lagrange", 1))

# Define function over FunctionSpace
u_n = fem.Function(V)
u_n.name = "u_n"
u_n.interpolate(lambda x: x[0] + x[1])

domain.geometry.x
Gives you the nodes of the mesh.

1 Like

Perfect–thank you! :grinning: