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 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)
viskex.firedrake.plot_mesh(cube_hexa)
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)
viskex.firedrake.plot_mesh(cube_hexa, dim=3)
viskex.firedrake.plot_mesh(cube_tetra, dim=2)
viskex.firedrake.plot_mesh(cube_hexa, dim=2)
viskex.firedrake.plot_mesh(cube_tetra, dim=1)
viskex.firedrake.plot_mesh(cube_hexa, dim=1)
viskex.firedrake.plot_mesh(cube_tetra, dim=0)
viskex.firedrake.plot_mesh(cube_hexa, dim=0)