This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Options for exporting discontinuous solution?

+2 votes

Is there a way (or hack) to write discontinuous solutions to a file in FEniCS? I realize the built-in visualizer may not be able to do this, but is there a workaround to view discontinuous solutions in Paraview?

Thanks!

asked Mar 1, 2014 by jlchan FEniCS Novice (390 points)

1 Answer

+3 votes
 
Best answer
  • HDF5 (preferred) and XML are lossless outputs. Suitable for reading back into DOLFIN.
  • XDMF (preferred) and VTK are visualization formats. Both of them handle piece-wise constants and fallback to continuous P1 interpolation for anything else.
  • ParaView can visualize piece-wise constants.

Hence you can project/interpolate your discontinuous function to piece-wise constants, output to XDMF and plot in ParaView.

answered Mar 1, 2014 by Jan Blechta FEniCS Expert (51,420 points)
selected Mar 1, 2014 by jlchan

Thank you, Jan!

...