import firedrake
/home/firedrake/firedrake/lib/python3.12/site-packages/pytools/persistent_dict.py:52: RecommendedHashNotFoundWarning: Unable to import recommended hash 'siphash24.siphash13', falling back to 'hashlib.sha256'. Run 'python3 -m pip install siphash24' to install the recommended hash. warn("Unable to import recommended hash 'siphash24.siphash13', "
import viskex
Generate meshes of the unit square by dividing each edge of the square in 6 segments, using either a triangular or quadrangular mesh.
square_tria = firedrake.UnitSquareMesh(6, 6, quadrilateral=False, diagonal="right")
square_quad = firedrake.UnitSquareMesh(6, 6, quadrilateral=True, diagonal="right")
Plot the meshes.
viskex.firedrake.plot_mesh(square_tria)
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(square_quad)
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=2
plots cells of the mesh (i.e., triangles or quadrilaterals), dim=1
plots facets of the mesh (i.e., segments), while dim=0
plots vertices of the mesh.
viskex.firedrake.plot_mesh(square_tria, 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(square_quad, 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(square_tria, 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(square_quad, 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(square_tria, 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(square_quad, 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