Given a FunctionSpace, is there a way to retrieve the mesh it was built on? FunctionSpace has a member function ufl_domain that returns a Mesh, but this seems to be just a stub that can't actually be used for anything. for instance, I do the following in a jupyter notebook (python 3):
import fenics as fe
import ufl
import matplotlib.pyplot as plt
%matplotlib inline
mesh = fe.UnitIntervalMesh(8)
fe.plot(mesh)
This produces, as expected, a plot of the mesh. Now:
S = fe.FunctionSpace(mesh, 'DG', 2)
mesh_out = S.ufl_domain()
print(str(mesh_out))
fe.plot(mesh_out)
This prints <Mesh #0>, and the attempt to plot throws an exception 'Mesh' object has no attribute 'ufl_domain'. Furthermore, if I poke around inside mesh_out, I find that it contains almost no actual information. This puzzles me, since the FunctionSpace obviously has to know things about the mesh it was built on.
Thanks for any hints.