Scaling Laplacian from 2D to 3D

File("mesh.pvd") << domain

If you are new to fenics i would strongly suggest using DOLFINx

Described in

with demos at
https://docs.fenicsproject.org/dolfinx/v0.7.3/python/demos.html
and The FEniCSx tutorial — FEniCSx tutorial