From 9773dbb85fa93d9ee51a955c23e335d5d66d3f92 Mon Sep 17 00:00:00 2001 From: Alexander Sinn <64009254+AlexanderSinn@users.noreply.github.com> Date: Tue, 26 Nov 2024 20:33:33 +0100 Subject: [PATCH 1/3] Remove Unused Variable (#1187) --- src/particles/plasma/PlasmaParticleContainer.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/particles/plasma/PlasmaParticleContainer.cpp b/src/particles/plasma/PlasmaParticleContainer.cpp index 7aab49c676..6c5e03f66a 100644 --- a/src/particles/plasma/PlasmaParticleContainer.cpp +++ b/src/particles/plasma/PlasmaParticleContainer.cpp @@ -292,8 +292,6 @@ IonizationModule (const int lev, amrex::Real const x_pos_offset = GetPosOffset(0, geom, slice_fab.box()); const amrex::Real y_pos_offset = GetPosOffset(1, geom, slice_fab.box()); - const int depos_order_xy = Hipace::m_depos_order_xy; - auto& plevel_ion = GetParticles(0); auto index = std::make_pair(mfi_ion.index(), mfi_ion.LocalTileIndex()); if(plevel_ion.find(index) == plevel_ion.end()) continue; From 3d0e4af8c51d5f640176a48ab510cb3fa2bb25aa Mon Sep 17 00:00:00 2001 From: Alexander Sinn <64009254+AlexanderSinn@users.noreply.github.com> Date: Wed, 18 Dec 2024 18:27:54 +0100 Subject: [PATCH 2/3] Fix matplotlib install in CI (#1192) --- .github/workflows/setup/ubuntu.sh | 2 +- .github/workflows/setup/ubuntu_ompi.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/setup/ubuntu.sh b/.github/workflows/setup/ubuntu.sh index b2890bc232..5ba05ab5f6 100755 --- a/.github/workflows/setup/ubuntu.sh +++ b/.github/workflows/setup/ubuntu.sh @@ -31,4 +31,4 @@ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2 sudo update-alternatives --set python /usr/bin/python3 python -m pip install --upgrade pip -python -m pip install --upgrade matplotlib==3.2.2 numpy scipy openpmd-viewer openpmd-api +python -m pip install --upgrade matplotlib numpy scipy openpmd-viewer openpmd-api diff --git a/.github/workflows/setup/ubuntu_ompi.sh b/.github/workflows/setup/ubuntu_ompi.sh index 136e72c305..76b4b38828 100755 --- a/.github/workflows/setup/ubuntu_ompi.sh +++ b/.github/workflows/setup/ubuntu_ompi.sh @@ -33,4 +33,4 @@ sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2 sudo update-alternatives --set python /usr/bin/python3 python -m pip install --upgrade pip -python -m pip install --upgrade matplotlib==3.2.2 numpy scipy openpmd-viewer openpmd-api +python -m pip install --upgrade matplotlib numpy scipy openpmd-viewer openpmd-api From 9b8431762cffe7953d63a3faf32fb28835cb39ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxence=20Th=C3=A9venet?= Date: Wed, 18 Dec 2024 18:42:54 +0100 Subject: [PATCH 3/3] Laser circular polarization (#1191) --- src/laser/MultiLaser.H | 1 + src/laser/MultiLaser.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/laser/MultiLaser.H b/src/laser/MultiLaser.H index d50d5b0de8..29f8616be8 100644 --- a/src/laser/MultiLaser.H +++ b/src/laser/MultiLaser.H @@ -194,6 +194,7 @@ private: * the central wavelength influences the solver. As long as all the lasers are on the same grid * (part of MultiLaser), this must be a property of MultiLaser. */ amrex::Real m_lambda0 {0.}; + bool m_linear_polarization {true}; /**< Whether polarization is linear. Otherwise, circular */ amrex::Vector m_names {"no_laser"}; /**< name of the laser */ int m_nlasers; /**< Number of laser pulses */ amrex::Vector m_all_lasers; /**< Each is a laser pulse */ diff --git a/src/laser/MultiLaser.cpp b/src/laser/MultiLaser.cpp index 049248ab28..6ac2a28f08 100644 --- a/src/laser/MultiLaser.cpp +++ b/src/laser/MultiLaser.cpp @@ -34,6 +34,10 @@ MultiLaser::ReadParameters () if (!m_use_laser) return; queryWithParser(pp, "lambda0", m_lambda0); DeprecatedInput("lasers", "3d_on_host", "comms_buffer.on_gpu", "", true); + std::string polarization = "linear"; + queryWithParser(pp, "polarization", polarization); + AMREX_ALWAYS_ASSERT(polarization == "linear" || polarization == "circular"); + m_linear_polarization = polarization == "linear"; queryWithParser(pp, "use_phase", m_use_phase); queryWithParser(pp, "solver_type", m_solver_type); AMREX_ALWAYS_ASSERT(m_solver_type == "multigrid" || m_solver_type == "fft"); @@ -250,6 +254,7 @@ MultiLaser::UpdateLaserAabs (const int islice, const int current_N_level, Fields const int y_lo = m_slice_box.smallEnd(1); const int y_hi = m_slice_box.bigEnd(1); + const bool linear_polarization = m_linear_polarization; amrex::ParallelFor( amrex::TypeList>{}, {m_interp_order}, @@ -279,7 +284,10 @@ MultiLaser::UpdateLaserAabs (const int islice, const int current_N_level, Fields } } } - + // The ponderomotive force is 2x larger in circular polarization: + // - circular: <|a|^2> = <|a_env|^2> + // - linear : <|a|^2> = <|a_env|^2 * cos^2(k*z)> = <|a_env|^2> * 1/2 + if (!linear_polarization) aabs *= 2; field_arr(i,j) = aabs; }); }