ubermag / discretisedfield

Python package for the analysis and visualisation of finite-difference fields.
http://ubermag.github.io
BSD 3-Clause "New" or "Revised" License
17 stars 13 forks source link

Mumax view #156

Closed MathieuMoalic closed 2 years ago

MathieuMoalic commented 2 years ago

Hi there, Have you considered integrating mumax-view as a tool to visualize 3D fields ? Compared to k3d, it is faster as it is compiled to wasm and has better shaders out of the box. I'm not sure if it's possible to embed it as a notebook widget in a similar way to k3d. Also it would require a few changes to be called through python. I doubt this would be an easy task but k3d can be insanely slow even on top-end workstations ( single-threaded js can only go so far ). I also think mumax-view is a beautifully written software that deserves more attention and it might shine as part of the Ubermag framework.

lang-m commented 2 years ago

@MathieuMoalic How big (e.g. how much cells) are your magnetisation fields?

MathieuMoalic commented 2 years ago

well, it really depends. It can go from 512 x 512 x 1 to 4096 x 256 x 5. I also visualize time resolved data so you can multiply that by another factor. Of course I step the cells and don't plot all millions of arrows ...

lang-m commented 2 years ago

To find potential performance bottlenecks we would need to know an approximate number of arrows that you are plotting.

MathieuMoalic commented 2 years ago

I appreciate that you are trying to help me in this particular case but k3d's issue tracker would be more appropriate for performance improvements. I'm wondering more about Ubermag and mumax-view's potential integration.

fangohr commented 2 years ago

Thank you for the suggestion. A quick first brain storm suggests that we will not be able to push a mumax-view integration at this point. There are multiple aspects coming together, including the mumax-view code not appearing to be actively maintained, it being targeted quite closely to mumax-based micromagnetism (many features of the relevant discretisedfield module are not limited to micromagnetics and can thus serve a wider community), and also the lacking (as far as I can see) integration with Jupyter notebooks.

I agree that k3d is not the most versatile tool - we have some ideas how to improve the situation, but should focus first on making more basic things work within ubermag.

Please keep reporting issues: even though we may not be able to react to them, it is still useful to learn about user experiences.

MathieuMoalic commented 2 years ago

Thank you for sharing your thoughts. I might have assumed wrongly that every 3D scalar or vector field that discretisedfield uses is "compatible" or anologous to an ovf2 file which mumax-view supports. Althought I have no experience making jupyter widgets, if I ever have the time on my hands, I will try to port mumax-view to jupyter, if anything, for my own use.

fangohr commented 2 years ago

I think there may have been an issue that mumax-view only reads the ovf files generated by mumax (not those by oommf). If I recall this correctly, it is probably because of an extra space or something like that: we had noticed this when teaching discretised field to read the ovf file from mumax. Even if correct, this can be fixed of course - it is just a matter of time invested.

Do get in touch if you make progress: if the obstacles are removed, and we could integrate additional tools with relatively little effort, that becomes more realistic and feasible.