Plasma.jl icon indicating copy to clipboard operation
Plasma.jl copied to clipboard

Plot recipes

Open SebastianM-C opened this issue 2 years ago • 7 comments

Hi! Thanks for writing this package. I was looking over the code and I noticed that for plotting the GLMakie backend is hardcoded. I think that if would be better to define (Makie) plot recipes for PlasmaSolution types and thus depend on Makie / MakieCore and not on a specific backend. This will mean that WGLMakie will work "for free" and in the case of 2D plots, CairoMakie too.

I'd like to help with a PR that implements this if you want.

SebastianM-C avatar Nov 26 '21 13:11 SebastianM-C

That's a great idea! The current version is pretty hacky 😄

Feel free to open a PR. I can help if you have any questions as well.

killah-t-cell avatar Nov 26 '21 13:11 killah-t-cell

Do you have an estimate for how long a simulation should take? I tried running examples from the README and from the tests, but they did not complete (I left them to run for couple of hours).

SebastianM-C avatar Dec 01 '21 12:12 SebastianM-C

They are very heavy. I'm working on making them faster right now – they currently take a few hours. My tip is to test changes with as low a dimension as possible (so 1D1V).

10x speed improvements are my current focus (basically integration is really inefficient right now, and that can be sped up).

killah-t-cell avatar Dec 01 '21 13:12 killah-t-cell

Do you have a MWE for that? I tried using the example in runtests.jl but I saw that the loss decreased for some time and then started increasing.

With regards to performance, I saw some things that might cause type instabilities, but I'm not sure if those are optimized by MTK when constructing the equations symbolically.

SebastianM-C avatar Dec 01 '21 14:12 SebastianM-C

I'll push some pre-trained weights and an MWE asap :)

What do you see that would cause type instabilities?

killah-t-cell avatar Dec 01 '21 14:12 killah-t-cell

What do you see that would cause type instabilities?

I did not look too close at the code, but https://github.com/killah-t-cell/Plasma.jl/blob/41476321f30f2ac3f8c33e0f8442ad1b23d77720/src/solve.jl#L68-L72

might lead to some Anys because qs and ms are initialized as Vector{Any}. I'm not sure if this will create any notable performance problems though (I didn't benchmark or profile the code yet).

I'll try to take a close look at the code and open an issue if I find something else.

SebastianM-C avatar Dec 01 '21 17:12 SebastianM-C

Oh nice catch. I don't think this will cause problems, but I think normalisation would matter more here. Setting m to 1 instead of to the electron mass, for example.

killah-t-cell avatar Dec 02 '21 07:12 killah-t-cell