lululxvi / deepxde

A library for scientific machine learning and physics-informed learning
https://deepxde.readthedocs.io
GNU Lesser General Public License v2.1
2.47k stars 712 forks source link

Export data for plot #1721

Open HumbertHumbert7 opened 2 months ago

HumbertHumbert7 commented 2 months ago

Once I get the solution, is it possible to export the results and plot them using ParaView? Thank you

praksharma commented 2 months ago
dde.saveplot(losshistory, train_state, issave=True, isplot=False)

This will save the loss history in loss.dat, the predicted solution with the best model in test.dat. For plotting you can use matplotlib.

HumbertHumbert7 commented 2 months ago

Thank you very much, I know how to plot in matplotlib but I would like to know if there is a way to export the data and obtain a better plot in Praview.

praksharma commented 2 months ago

Once you have the dat file, you can do whatever you want. Paraview has so many filter to plot CSV file, but that is out of scope of this discussion. I personally use plt.imshow() from a meshgrid and interpolation the values at those grids.

HumbertHumbert7 commented 2 months ago

Thank you very much. I’ll try it