Search code examples
outputfipy

How to output a .pvd or xdmf file from FiPy


From the example documentation, there is the following section:

FiPy doesn’t plot or output anything unless you tell it to:

 if __name__ == "__main__":
     viewer = Viewer(vars=(phi,), datamin=0., datamax=1.)

I understand that the current configuration would result in an opening of a viewer using the matplotlib or Mayavi viewers. However, I would like to be able to export a .pvd or .xdmf file for consolidating the simulation.

Thanks for your help!


Solution

  • FiPy presently has no such capability, although I've experimented a bit with XDMF and multi-timestep Gmsh MSH files, but need to find time to get back to it. You can save individual data snapshots with the VTKViewer classes, but not time series.

    vw = fp.VTKCellViewer(vars=(phi, psi))
    vw.plot(filename="myFile.vtk")
    

    If there are particular thinks you'd like to see, please update issue #132.