import firedrake
/home/firedrake/firedrake/lib/python3.10/site-packages/pytools/__init__.py:2489: UserWarning: unable to find git revision warn("unable to find git revision")
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)
viskex.firedrake.plot_mesh(square_quad)
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)
viskex.firedrake.plot_mesh(square_quad, dim=2)
viskex.firedrake.plot_mesh(square_tria, dim=1)
viskex.firedrake.plot_mesh(square_quad, dim=1)
viskex.firedrake.plot_mesh(square_tria, dim=0)
viskex.firedrake.plot_mesh(square_quad, dim=0)