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
import common_firedrake as common # isort: skip
Generate a mesh of the unit interval, divided into six cells.
interval = firedrake.UnitIntervalMesh(6)
Interpolate the scalar field $x^3$, and store it either in a firedrake function or a UFL expression.
interval_scalar_field, interval_scalar_field_ufl = common.prepare_scalar_field_cases(
interval, lambda x: x[0]**3)
/home/firedrake/firedrake/src/loopy/loopy/schedule/__init__.py:2255: LoopyWarning: in kernel expression_kernel: Falling back to a slow scheduler implementation due to: cannot schedule kernels with priority dependencies between sibling loop nests (add 'v1_scheduler_fallback' to silenced_warnings kernel attribute to disable) warn_with_kernel(
Plot the scalar field on the mesh.
viskex.firedrake.plot_scalar_field(interval_scalar_field, "scalar")
/home/firedrake/firedrake/src/loopy/loopy/schedule/__init__.py:2255: LoopyWarning: in kernel expression_kernel: Falling back to a slow scheduler implementation due to: cannot schedule kernels with priority dependencies between sibling loop nests (add 'v1_scheduler_fallback' to silenced_warnings kernel attribute to disable) warn_with_kernel(
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_scalar_field(interval_scalar_field_ufl, "scalar")
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
Warp mesh according to scalar field.
viskex.firedrake.plot_scalar_field(interval_scalar_field, "scalar", warp_factor=0.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