diff options
author | 2023-02-21 09:04:09 -0800 | |
---|---|---|
committer | 2023-02-21 09:04:09 -0800 | |
commit | 7eae30870646a2efbdf9164d46c75e540251e5f0 (patch) | |
tree | 06a756bf7416f4f60f317d5781d67e9df2eda8ed /Source/WarpX.cpp | |
parent | 892958903f96367df47242b4f6c63b20fa11221e (diff) | |
download | WarpX-7eae30870646a2efbdf9164d46c75e540251e5f0.tar.gz WarpX-7eae30870646a2efbdf9164d46c75e540251e5f0.tar.zst WarpX-7eae30870646a2efbdf9164d46c75e540251e5f0.zip |
Add warning message in RZ for < 2 azimuthal modes (#3655)
* Add warning message in RZ for < 2 azimuthal modes
* Simplify if statements
C++ operator precedence doesn't require double parenthesis in `if` statements
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r-- | Source/WarpX.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 06939b419..21945d6fa 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -1033,6 +1033,19 @@ WarpX::ReadParameters () std::vector<std::string> lasers_names; pp_lasers.queryarr("names", lasers_names); +#ifdef WARPX_DIM_RZ + // Here we check if the simulation includes laser and the number of + // azimuthal modes is less than 2. + // In that case we should throw a specific warning since + // representation of a laser pulse in cylindrical coordinates + // requires at least 2 azimuthal modes + if (lasers_names.size() > 0 && n_rz_azimuthal_modes < 2) { + ablastr::warn_manager::WMRecordWarning("Laser", + "Laser pulse representation in RZ requires at least 2 azimuthal modes", + ablastr::warn_manager::WarnPriority::high); + } +#endif + std::vector<std::string> sort_intervals_string_vec = {"-1"}; int particle_shape; if (!species_names.empty() || !lasers_names.empty()) { |