import dolfinx.mesh
import mpi4py.MPI
import viskex
Generate a mesh of the unit interval, divided into six cells.
interval = dolfinx.mesh.create_unit_interval(mpi4py.MPI.COMM_WORLD, 6)
Plot the mesh.
viskex.dolfinx.plot_mesh(interval)
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
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.dolfinx.plot_mesh(interval, dim=1)
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
viskex.dolfinx.plot_mesh(interval, dim=0)
error: XDG_RUNTIME_DIR is invalid or not set in the environment.