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

Enable multiple laser pulses #823

Merged
merged 12 commits into from
Nov 24, 2022
Merged

Conversation

MaxThevenet
Copy link
Member

@MaxThevenet MaxThevenet commented Nov 24, 2022

This PR enables multiple laser pulses. Files Laser.H/cpp are renamed MultiLaser.H/cpp, handling multiple laser pulses. The MultiLaser class holds a vector of Lasers, similar to beams or plasmas, with 1 notable difference: the actual data is stored into 1 single array for all lasers, and this array is in MultiLaser. Laser is almost an empty class. In the future, this will be generalised and each Laser instance will have a separate array. Important point: lambda0 is a property of MultiLaser rather than Laser, so we can solve for all lasers at the same time.

Change along the way:

  • w0 is not a scalar (previously 2 scalars for x and y but we asserted they were equal). Very easy to change.
  • The input parameters are now similar to beams and plasmas, see below. We got rid of the use_laser that @SeverinDiederichs disliked so much :).

The PR is unnecessary long, the content of MultiLaser is just the one from Laser, except for the constructor and ReadParameters. Unfortunately, git mv did not help and git is being confused here.

lasers.names = laser laser2 # deactivated with no_laser
lasers.lambda0 = .8e-6

laser.a0 = 1
laser.position_mean = 0. 0. 0
laser.w0 = 2.*kp_inv
laser.L0 = 2.*kp_inv
laser.focal_distance = 0.001

laser2.a0 = 2
laser2.position_mean = 0. 0. -4*kp_inv
laser2.w0 = 4.*kp_inv
laser2.L0 = 1.*kp_inv
laser2.focal_distance = 0.0005

On Juwels GPUs: top is laser_real, bottom is Ez, for a laser propagating upwards in a plasma. All looks fine.
Screenshot 2022-11-24 at 16 00 12

@MaxThevenet MaxThevenet added GPU Related to GPU acceleration component: laser envelope About the laser envelope solver labels Nov 24, 2022
@MaxThevenet MaxThevenet changed the title [WIP] Enable multiple laser pulses Enable multiple laser pulses Nov 24, 2022
@MaxThevenet MaxThevenet marked this pull request as ready for review November 24, 2022 15:02
@MaxThevenet MaxThevenet added the documentation Improvements or additions to documentation label Nov 24, 2022
Copy link
Member

@SeverinDiederichs SeverinDiederichs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this so quickly! Looks fine to me. Let's discuss details offline and potentially fix via follow up PRs

docs/source/run/parameters.rst Show resolved Hide resolved
MultiLaser::ReadParameters ()
{
amrex::ParmParse pp("lasers");
getWithParser(pp, "names", m_names);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we maybe make this queryWithParser and set a default name of "no_laser"?
Otherwise, we break every existing input script. Could be fine of course, but maybe we need to be clearer in the documentation about it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Just for laser? Or we could change it for beams, plasmas and lasers, to make them consistent.

@MaxThevenet MaxThevenet merged commit a26b66e into Hi-PACE:development Nov 24, 2022
@MaxThevenet MaxThevenet deleted the multilaser branch November 24, 2022 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: laser envelope About the laser envelope solver documentation Improvements or additions to documentation GPU Related to GPU acceleration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants