import dolfinx.mesh
import mpi4py.MPI
import viskex
Generate a mesh of the unit square by dividing each edge of the square in 6 segments.
square = dolfinx.mesh.create_unit_square(mpi4py.MPI.COMM_WORLD, 6, 6)
Each plotting function accepts optional keyword arguments, that are passed directly to the add_mesh
method of the underlying pyvista plotter. For instance, the following two notebook cells plot the mesh using pyvista
default color (red) first, and then using a custom color provided as a keyword argument (blue).
viskex.dolfinx.plot_mesh(square)
viskex.dolfinx.plot_mesh(square, color="blue")