Note that to visualize DG functions, you need to use XDMFFile.write_checkpoint, see: Loading xdmf data back in
XDMFFile.write_checkpoint