Hi,
To scale the whole mesh:
mesh = UnitSquareMesh(2, 2)
x = mesh.coordinates()
scaling_factor = 2.
x[:, :] *= scaling_factor
To scale in just one single direction:
x[:, 1] *= scaling_factor
Finally a cached search tree needs to be explicitly updated after moving/deforming a mesh and before evaluating any function (even by assembler) without cell argument.
mesh.intersection_operator().clear() # up to version 1.2.0
mesh.bounding_box_tree().build(mesh) # development version