Skip to content

Add custom laser profile injection to epoch2d/3d - #917

Open
ZheyuanChen wants to merge 5 commits into
epochpic:mainfrom
ZheyuanChen:upstream-pr-custom-laser-injection
Open

ZheyuanChen wants to merge 5 commits into
epochpic:mainfrom
ZheyuanChen:upstream-pr-custom-laser-injection

Conversation

@ZheyuanChen

Copy link
Copy Markdown

This continues the discussion from #910 : it adds support for loading a laser's amplitude and (optionally) phase profile from an external raw binary data file, instead of specifying it as an analytic deck expression. Implemented in epoch2d and epoch3d; epoch1d is unmodified. Also, this contains some uptates (continuously re-slabbing for 3D simulations) since my last PR a few weeks ago (deleted because of out-of-date).

Two modes, selected per laser block:

  • Spatiotemporal (use_spatiotemporal_profile = T): the full amplitude A(transverse, t) is interpolated from file at every time step.
  • Static spatial (use_spatiotemporal_profile = F): a time-independent spatial profile is interpolated onto the boundary once at start-up; the temporal envelope is set as usual via t_profile.

The file format is raw binary with no embedded header (access='stream'), matching EPOCH's own documented convention for external data files (particles_from_file and others) rather than introducing a new one. Grid shape and bounds are declared in the deck, not the file. Each laser block owns its own grid declaration and data, so two custom-file laser blocks on the same boundary (e.g. one per transverse polarisation channel via pol = 0 / pol = 90) load independent files.

Full details, the deck element reference, the file format spec, the phase sign convention, and current limitations are in the attached DOCUMENTATION_LASER_INJECTION.pdf.

Example

Runnable 2D and 3D examples, each with a script to generate the amplitude/phase files, are in example_decks/ in both epoch2d and epoch3d. For more examples see here

Backward compatibility

use_custom_profile defaults to F; every new deck element introduced here is inert unless a laser block opts in, so existing decks and analytic laser profiles are unaffected.

Testing and Validation

See here.

Best regards,
Zheyuan

Copied from the developer's branch. Sanitised the comments and
formatting, and reset the Makefile to the upstream default.
Example decks and generator scripts are in epoch2d/example_decks and
epoch3d/example_decks. Documentation is in DOCUMENTATION_LASER_INJECTION.pdf.
Rebuilds the title, author affiliation, and two-channel
polarisation section after review feedback.
local_slab_window fell back to the full plane on every rank for
the whole run whenever use_balance was set, since the windowed
slab relied on the domain settling once and staying put. Continuous
dynamic load balancing never settles, so a laser needing both a
large injected file and real load balancing had no way to keep the
per-rank windowing.

Add reslab_custom_laser_files, called from balance_workload right
after redistribute_domain, which re-derives each spatiotemporal
laser's window and reloads its file against the new domain. Defer
the first load under use_balance the same way already done for
use_pre_balance, since the reload now keeps the saving current
rather than needing it to be final.
Track the LaTeX source behind DOCUMENTATION_LASER_INJECTION.pdf,
which was previously committed as a compiled artefact only. Update
the memory-cost section to describe the use_balance re-slabbing
added in the previous commit, and regenerate the PDF.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant