import firedrake
import viskex
Generate meshes of the unit cube by dividing each edge of the cube in 6 segments, using either a tetrahedral or hexahedral mesh.
cube_tetra = firedrake.UnitCubeMesh(6, 6, 6, hexahedral=False)
cube_hexa = firedrake.UnitCubeMesh(6, 6, 6, hexahedral=True)
Plot the meshes.
viskex.firedrake.plot_mesh(cube_tetra)
error: XDG_RUNTIME_DIR is invalid or not set in the environment. MESA: error: ZINK: failed to choose pdev glx: failed to create drisw screen
viskex.firedrake.plot_mesh(cube_hexa)
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
MESA: error: ZINK: failed to choose pdev glx: failed to create drisw screen
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=3
plots cells of the mesh (i.e., tetrahedra or hexahedra), dim=2
plots facets of the mesh (i.e., triangles or quadrilaterals), dim=1
plots the edges of the mesh, while dim=0
plots vertices of the mesh.
viskex.firedrake.plot_mesh(cube_tetra, dim=3)
error: XDG_RUNTIME_DIR is invalid or not set in the environment. MESA: error: ZINK: failed to choose pdev glx: failed to create drisw screen
viskex.firedrake.plot_mesh(cube_hexa, dim=3)
error: XDG_RUNTIME_DIR is invalid or not set in the environment. MESA: error: ZINK: failed to choose pdev glx: failed to create drisw screen
viskex.firedrake.plot_mesh(cube_tetra, dim=2)
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
MESA: error: ZINK: failed to choose pdev glx: failed to create drisw screen
viskex.firedrake.plot_mesh(cube_hexa, dim=2)
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
MESA: error: ZINK: failed to choose pdev glx: failed to create drisw screen
viskex.firedrake.plot_mesh(cube_tetra, dim=1)
error: XDG_RUNTIME_DIR is invalid or not set in the environment. MESA: error: ZINK: failed to choose pdev glx: failed to create drisw screen
viskex.firedrake.plot_mesh(cube_hexa, dim=1)
error: XDG_RUNTIME_DIR is invalid or not set in the environment. MESA: error: ZINK: failed to choose pdev glx: failed to create drisw screen
viskex.firedrake.plot_mesh(cube_tetra, dim=0)
error: XDG_RUNTIME_DIR is invalid or not set in the environment. MESA: error: ZINK: failed to choose pdev glx: failed to create drisw screen
viskex.firedrake.plot_mesh(cube_hexa, dim=0)
error: XDG_RUNTIME_DIR is invalid or not set in the environment. MESA: error: ZINK: failed to choose pdev glx: failed to create drisw screen