Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spatial resolution of the lab frame snapshot for boosted frame simulations (question) #5581

Open
rl3418 opened this issue Jan 21, 2025 · 3 comments
Labels
component: diagnostics all types of outputs question Further information is requested

Comments

@rl3418
Copy link

rl3418 commented Jan 21, 2025

The BackTransformed Diagnostics write snapshot at time t in the lab frame based on the information in the boosted frame. I wish to know what is the spatial resolution for the snapshot at time t in the lab frame.

The spatial slice x'=(t/gamma_frame - t') * c/beta_frame at t' in the boosted frame is located at x=(t-t'/gamma_f)*c/beta_frame. I guess if the fields are dumped to the lab frame for every time iteration in the boosted frame the spatial resolution in the lab frame is dx=dt' * c/(gamma_frame * beta_frame). Are the fields automatically backtransformed to the lab frame at every iteration, or are they only transformed during data dumps in the boosted frame?

If the transformation occurs only during data dumps in the boosted frame, is there a way to delete the boosted frame data after it has been backtransformed? I am only interested in the lab frame data.

@ax3l ax3l added component: diagnostics all types of outputs question Further information is requested labels Jan 22, 2025
@ax3l
Copy link
Member

ax3l commented Jan 22, 2025

Hi @rl3418,

Thank you for your question. This sounds to me like you are running an input set that creates diagnostics for both the boosted frame as well as the back-transformed lab frame.

Yes, you can simply disable the boosted frame (regular) diagnostics. We do not need this data on disk to run a boosted frame sim.

This is a quick primer how the boosted frame works in WarpX:
https://warpx.readthedocs.io/en/latest/usage/faq.html#what-do-i-need-to-know-about-using-the-boosted-frame
We automatically convert your lab-based input to the boosted frame and always keep the simulation data in memory boosted. We do not need that data on disk. (For checkpoints & restarts we automatically manage it for you, if you enable that option.)

The back-transformed diagnostics (BTD), a primer is here https://warpx.readthedocs.io/en/latest/usage/faq.html#what-about-back-transformed-diagnostics-btd, does on every time step transform back your data to the lab frame and dumps it every so many steps to disk.

Does that answer your question? If you like to share you input script and the diagnostics section in particular we can also guide you which lines to remove.

@rl3418
Copy link
Author

rl3418 commented Jan 22, 2025

diagnostics.diags_names = diag2 diag1

diag2.diag_type = Full
diag2.file_prefix = ./boost
diag2.format = openpmd
diag2.intervals = 1000
diag2.openpmd_backend = h5
diag2.species = electrons
diag2.write_species = 1
diag2.fields_to_plot = By Ex
diag2.electrons.variables= x y z ux uy uz

diag1.diag_type = BackTransformed
diag1.do_back_transformed_fields = 1
diag1.do_back_transformed_particles=1
diag1.fields_to_plot = Ex Ey Ez Bx By Bz

diag1.dz_snapshots_lab = 0.007

diag1.intervals=3:307:16

diag1.electrons.variables= x y z ux uy uz
diag1.format = openpmd
diag1.openpmd_backend = h5
diag1.file_prefix = ./lab
diag1.buffer_size = 32
diag1.write_species = 1

These are my inputs for the diagnostics. If I understand correctly, the boosted frame data are always backtransformed and written to lab diagnostics for every time iteration in the boosted frame. This doesn't depend on how often you dump the data in the boosted frame.

@rl3418
Copy link
Author

rl3418 commented Jan 24, 2025

Thanks for the clarification. It seems to work as I expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: diagnostics all types of outputs question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants