Why does ufl.Mesh() only take vector elements?

I’m trying to understand some of the finer details of UFL, but the documentation doesn’t explain ufl.Mesh(). This tutorial goes over how to use ufl.Mesh() to make a symbolic representation of the domain, but doesn’t say why it needs to take a vector element.

The following code produces an error when trying to use ufl.Mesh() with a scalar element.

import ufl
import basix.ufl

el=basix.ufl.element('Lagrange', 'triangle', 1)
domain=ufl.Mesh(el)

For context, I’m running this code in a Python3 kernel in a Jupyter Notebook out of the dolfinx/lab:stable Docker container.

Also, when might one want to use ufl.Mesh() instead of the dolfinx.mesh library?

It needs a vector element to represent each of the coordinates (x,y,z).

This is explained in even more detail at
http://jsdokken.com/FEniCS-workshop/src/finite_element_method/advanced_elements.html
which also covers when to use uf.Mesh
http://jsdokken.com/FEniCS-workshop/src/unified_form_language/ufl_elements.html#the-domain-omega
http://jsdokken.com/FEniCS-workshop/src/form_compilation/compile_form.html
http://jsdokken.com/FEniCS-workshop/src/form_compilation/alternate_form.html