aboutsummaryrefslogtreecommitdiff
path: root/Source/Laser
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Laser')
-rw-r--r--Source/Laser/LaserProfilesImpl/LaserProfileGaussian.cpp1
-rw-r--r--Source/Laser/LaserProfilesImpl/LaserProfileHarris.cpp17
2 files changed, 15 insertions, 3 deletions
diff --git a/Source/Laser/LaserProfilesImpl/LaserProfileGaussian.cpp b/Source/Laser/LaserProfilesImpl/LaserProfileGaussian.cpp
index fc7fc59aa..33de9c1da 100644
--- a/Source/Laser/LaserProfilesImpl/LaserProfileGaussian.cpp
+++ b/Source/Laser/LaserProfilesImpl/LaserProfileGaussian.cpp
@@ -63,6 +63,7 @@ WarpXLaserProfiles::GaussianLaserProfile::init (
m_common_params.nvec.begin(),
m_common_params.nvec.end(),
m_params.stc_direction.begin(), 0.0);
+
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(std::abs(dp2) < 1.0e-14,
"stc_direction is not perpendicular to the laser plane vector");
diff --git a/Source/Laser/LaserProfilesImpl/LaserProfileHarris.cpp b/Source/Laser/LaserProfilesImpl/LaserProfileHarris.cpp
index 1440222c5..6ea8070db 100644
--- a/Source/Laser/LaserProfilesImpl/LaserProfileHarris.cpp
+++ b/Source/Laser/LaserProfilesImpl/LaserProfileHarris.cpp
@@ -69,10 +69,21 @@ WarpXLaserProfiles::HarrisLaserProfile::fill_amplitude (
// time envelope is given by the Harris function
Real time_envelope = 0.;
+
+ constexpr auto norm = 1._rt/32._rt;
+ constexpr auto c_0 = 10._rt;
+ constexpr auto c_1 = -15._rt;
+ constexpr auto c_2 = 6._rt;
+ constexpr auto c_3 = -1._rt;
+ constexpr auto a_1 = 1._rt;
+ constexpr auto a_2 = 2._rt;
+ constexpr auto a_3 = 3._rt;
+
if (t < m_params.duration)
- time_envelope = 1._rt/32._rt * (10._rt - 15._rt*std::cos(arg_env) +
- 6._rt*std::cos(2._rt*arg_env) -
- std::cos(3._rt*arg_env));
+ time_envelope = norm * (c_0 +
+ c_1*std::cos(a_1*arg_env) +
+ c_2*std::cos(a_2*arg_env) +
+ c_3*std::cos(a_3*arg_env));
// Copy member variables to tmp copies for GPU runs.
const auto tmp_e_max = m_common_params.e_max;