From 3fe406c9701f61e07b23f7123cf0a7bad492c6dc Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Mon, 26 Sep 2022 17:10:42 +0200 Subject: enforce 3 components for some laser parameters (#3423) --- Source/Particles/LaserParticleContainer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Source/Particles/LaserParticleContainer.cpp') 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."); -- cgit v1.2.3