import firedrake
import viskex
Generate a mesh of the unit interval, divided into six cells.
interval = firedrake.UnitIntervalMesh(6, distribution_parameters={"partitioner_type": "simple"})
Plot the mesh.
viskex.firedrake.plot_mesh(interval)
2026-03-23 05:06:22.788 ( 1.095s) [ 7F0EE81E6080]vtkXOpenGLRenderWindow.:1460 WARN| bad X server connection. DISPLAY=
An optional argument dim argument controls the dimension of the entities to plotted. By default, it is equal to the topological dimension. In this example, dim=1 plots cells of the mesh (i.e., intervals), while dim=0 plots vertices of the mesh.
viskex.firedrake.plot_mesh(interval, dim=1)
viskex.firedrake.plot_mesh(interval, dim=0)