ECP-WarpX / WarpX

WarpX is an advanced, time-based electromagnetic & electrostatic Particle-In-Cell code.
https://ecp-warpx.github.io
Other
276 stars 176 forks source link

Improve `<diags>.<species>.variables = none` #4917

Open ax3l opened 2 months ago

ax3l commented 2 months ago

Tested with Examples/Physics_applications/laser_acceleration/inputs_3d.

Even with

diag1.electrons.variables = none

we still write runtime integer attribute regionofinterest unconditionally

electrons.addIntegerAttributes = regionofinterest
electrons.addRealAttributes = initialenergy

(but interestingly not the real attribute initialenergy)

And the id of a particle is also written unconditionally.

This should be improved.

Follow-up to #4914

ax3l commented 2 months ago

Also, seen with Examples/Physics_applications/laser_acceleration/inputs_rz, filtering of positions in RZ does not really work.

The whole m_plot_flags logic should be factored out of ParticleDiag.cpp and either put directly into the backends or generalized with the r,z,theta -> x,y,z logic that is supported in (some?) of the backends.

This whole upfront parsing and bookkeeping in unrelated arrays like m_plot_flags is too fragile and error-prone, not dealing properly with runtime-added attributes, etc.

ax3l commented 2 months ago

Another test to to run: dumping the phi runtime attribute in ES examples (exists only in the pinned, filtered PC).

RemiLehe commented 2 months ago

Here is the PR that added the phi output: https://github.com/ECP-WarpX/WarpX/pull/4599

ax3l commented 2 months ago

Discussed: The implicit solver also adds runtime attributes that might become out of sync with the dump flags (even if we do not mean to dump the auxiliary positions&momenta we add).