PlasmaControl / DESC

Stellarator Equilibrium and Optimization Suite
MIT License
98 stars 26 forks source link

Exporting coils, surfaces #1299

Open mohawk811 opened 1 month ago

mohawk811 commented 1 month ago

Previously I had used paraview to better visualize coils and the plasma boundary. Is there an equivalent software that is recommended for .h5 files? Or is there a way to save coils/surfaces to vtk format?

mohawk811 commented 1 month ago

Also is there a way to look at the resultant mod B plot from coil sets?

f0uriest commented 1 month ago

For plotting B on the surface you can use

# visualize the optimized coilset and the normal field error
fig = plot_3d(eq, "B*n", field=optimized_coilset2, field_grid=coil_grid, grid=plot_grid)
fig = plot_coils(optimized_coilset2, fig=fig)
fig.show()

(from the coil optimization tutorial)

We don't currently have any way to export to vtk but it's something I've been interested in, I just haven't gotten around to learning paraview.

dpanici commented 1 month ago

^ note on the above snippet that if you don't want the Bplasma contribution to be calculated (for example, if your equilibrium is vacuum) you can pass eq.surface instead of eq to the plot_3d call, this is shown earlier in that same tutorial

dpanici commented 1 month ago

https://github.com/pyvista/pyvista