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

Separate grid for Laser #1106

Merged
merged 27 commits into from
May 29, 2024

Conversation

AlexanderSinn
Copy link
Member

@AlexanderSinn AlexanderSinn commented Apr 24, 2024

In this PR, the grid of the laser is decoupled from the field's grid. To facilitate this, this PR...

  • uses the laser geometry inside of laser functions
  • adds interpolation for aabs.
  • adds interpolation for chi.
  • adds a way to get chi outside the fields grid.
  • adds a check for laser functions if the current slice contains a laser.
  • adds support for the laser MPI communication to skip slices outside the laser grid.
  • changes the diagnostics to support getting the laser envelope on the laser grid and not the fields grid.

Test of getting chi outside the field:
Chi on the laser grid (changed diagnostic) with a slightly wrong box to transition between chi inside and outside the fields grid.
image
Chi on the laser grid with the correct box
image
Chi on the fields grid
image

  • Small enough (< few 100s of lines), otherwise it should probably be split into smaller PRs
  • Tested (describe the tests in the PR description)
  • Runs on GPU (basic: the code compiles and run well with the new module)
  • Contains an automated test (checksum and/or comparison with theory)
  • Documented: all elements (classes and their members, functions, namespaces, etc.) are documented
  • Constified (All that can be const is const)
  • Code is clean (no unwanted comments, )
  • Style and code conventions are respected at the bottom of https://github.com/Hi-PACE/hipace
  • Proper label and GitHub project, if applicable

@AlexanderSinn AlexanderSinn added the component: laser envelope About the laser envelope solver label Apr 28, 2024
@@ -1063,9 +1258,9 @@ MultiLaser::InitLaserSlice (const amrex::Geometry& geom, const int islice, const
bx,
[=] AMREX_GPU_DEVICE(int i, int j, int k)
{
const amrex::Real z = plo[2] + (islice+0.5_rt)*dx_arr[2] - z0;
Copy link
Member Author

@AlexanderSinn AlexanderSinn May 2, 2024

Choose a reason for hiding this comment

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

I changed how x, y, z is calculated here because the old way was wrong if the laser zeta axis was smaller compared to the full domain.

@AlexanderSinn AlexanderSinn changed the title [WIP] separate grid for laser Separate grid for Laser May 2, 2024
@AlexanderSinn AlexanderSinn requested a review from MaxThevenet May 2, 2024 18:46
Copy link
Member

@MaxThevenet MaxThevenet 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 this PR, looks great! See comments below. This is non-backward-compatible, right? @huixingjian could you give it a try for your simulations?

docs/source/run/parameters.rst Show resolved Hide resolved
docs/source/run/parameters.rst Outdated Show resolved Hide resolved
src/laser/MultiLaser.cpp Show resolved Hide resolved
src/laser/MultiLaser.cpp Show resolved Hide resolved
src/diagnostics/Diagnostic.cpp Outdated Show resolved Hide resolved
src/diagnostics/Diagnostic.cpp Outdated Show resolved Hide resolved
src/utils/MultiBuffer.cpp Show resolved Hide resolved
@AlexanderSinn
Copy link
Member Author

This would be non-backwards compatible only because of the changes to diagnostic.base_geometry. The laser should work the same if the laser box is the same as level 0 (which is the default).

@MaxThevenet MaxThevenet added the non-backward-compatible Changes the behavior of the code, old input file may give different results label May 29, 2024
@MaxThevenet MaxThevenet merged commit cb4858b into Hi-PACE:development May 29, 2024
10 checks passed
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 non-backward-compatible Changes the behavior of the code, old input file may give different results
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants