import firedrake
import pyvista
import viskex
Generate a mesh of the unit cube by dividing each edge of the cube in 6 segments.
cube = firedrake.UnitCubeMesh(
6, 6, 6, distribution_parameters={"partitioner_type": "simple"})
Create plotters for each topological dimension using the lower level viskex.FiredrakePlotter
class instead of the viskex.firedrake
functions. Pass a common pyvista.Plotter
to the viskex
plot function. Do not show each plotter yet.
plotter = pyvista.Plotter(shape=(2, 2))
for row in range(2):
for col in range(2):
plotter.subplot(row, col)
viskex.FiredrakePlotter.plot_mesh(cube, dim=3 - row * 2 - col, plotter=plotter)
Finally, link cameras together and show the plot with subplots.
plotter.link_views()
plotter.show()