aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles/LaserParticleContainer.cpp
diff options
context:
space:
mode:
authorGravatar Luca Fedeli <luca.fedeli@cea.fr> 2022-09-26 17:10:42 +0200
committerGravatar GitHub <noreply@github.com> 2022-09-26 17:10:42 +0200
commit3fe406c9701f61e07b23f7123cf0a7bad492c6dc (patch)
tree20d9f95da818383dfdb934678b69d2f636f2c4c5 /Source/Particles/LaserParticleContainer.cpp
parentcf74a5b3e6de44a030bdc004802050b9427dcdbc (diff)
downloadWarpX-3fe406c9701f61e07b23f7123cf0a7bad492c6dc.tar.gz
WarpX-3fe406c9701f61e07b23f7123cf0a7bad492c6dc.tar.zst
WarpX-3fe406c9701f61e07b23f7123cf0a7bad492c6dc.zip
enforce 3 components for some laser parameters (#3423)
Diffstat (limited to 'Source/Particles/LaserParticleContainer.cpp')
-rw-r--r--Source/Particles/LaserParticleContainer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/Particles/LaserParticleContainer.cpp b/Source/Particles/LaserParticleContainer.cpp
index a8df886be..94e67065d 100644
--- a/Source/Particles/LaserParticleContainer.cpp
+++ b/Source/Particles/LaserParticleContainer.cpp
@@ -99,6 +99,13 @@ LaserParticleContainer::LaserParticleContainer (AmrCore* amr_core, int ispecies,
getArrWithParser(pp_laser_name, "direction", m_nvec);
getArrWithParser(pp_laser_name, "polarization", m_p_X);
+ WARPX_ALWAYS_ASSERT_WITH_MESSAGE(m_position.size() == 3,
+ m_laser_name + ".position must have three components.");
+ WARPX_ALWAYS_ASSERT_WITH_MESSAGE(m_nvec.size() == 3,
+ m_laser_name + ".direction must have three components.");
+ WARPX_ALWAYS_ASSERT_WITH_MESSAGE(m_p_X.size() == 3,
+ m_laser_name + ".polarization must have three components.");
+
getWithParser(pp_laser_name, "wavelength", m_wavelength);
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(
m_wavelength > 0, "The laser wavelength must be >0.");