diff options
author | 2021-10-28 09:41:48 -0700 | |
---|---|---|
committer | 2021-10-28 09:41:48 -0700 | |
commit | 288b31d3e86b1fd60c589209a0dd7b0387e5aede (patch) | |
tree | 1f4d0049438a783cd438988ef89fe026e7637a2b /Source/Initialization/PlasmaInjector.cpp | |
parent | d2340a2f2b52aef91230383cf210d8280e41f12c (diff) | |
download | WarpX-288b31d3e86b1fd60c589209a0dd7b0387e5aede.tar.gz WarpX-288b31d3e86b1fd60c589209a0dd7b0387e5aede.tar.zst WarpX-288b31d3e86b1fd60c589209a0dd7b0387e5aede.zip |
RZ: Allow initialization of only 1 particle per cell in theta, when using only `m=0` (#2505)
* Allow the initialization of only 1 particle per cell in theta direction
* Update syntax
Diffstat (limited to 'Source/Initialization/PlasmaInjector.cpp')
-rw-r--r-- | Source/Initialization/PlasmaInjector.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Initialization/PlasmaInjector.cpp b/Source/Initialization/PlasmaInjector.cpp index e6f33ccd5..af6a7a208 100644 --- a/Source/Initialization/PlasmaInjector.cpp +++ b/Source/Initialization/PlasmaInjector.cpp @@ -211,11 +211,13 @@ PlasmaInjector::PlasmaInjector (int ispecies, const std::string& name) else if (injection_style == "nrandompercell") { queryWithParser(pp_species_name, "num_particles_per_cell", num_particles_per_cell); #if WARPX_DIM_RZ + if (WarpX::n_rz_azimuthal_modes > 1) { AMREX_ALWAYS_ASSERT_WITH_MESSAGE( num_particles_per_cell>=2*WarpX::n_rz_azimuthal_modes, "Error: For accurate use of WarpX cylindrical gemoetry the number " "of particles should be at least two times n_rz_azimuthal_modes " "(Please visit PR#765 for more information.)"); + } #endif // Construct InjectorPosition with InjectorPositionRandom. h_inj_pos = std::make_unique<InjectorPosition>( @@ -227,11 +229,13 @@ PlasmaInjector::PlasmaInjector (int ispecies, const std::string& name) surface_flux = true; queryWithParser(pp_species_name, "num_particles_per_cell", num_particles_per_cell_real); #ifdef WARPX_DIM_RZ + if (WarpX::n_rz_azimuthal_modes > 1) { AMREX_ALWAYS_ASSERT_WITH_MESSAGE( num_particles_per_cell_real>=2*WarpX::n_rz_azimuthal_modes, "Error: For accurate use of WarpX cylindrical geometry the number " "of particles should be at least two times n_rz_azimuthal_modes " "(Please visit PR#765 for more information.)"); + } #endif getWithParser(pp_species_name, "surface_flux_pos", surface_flux_pos); std::string flux_normal_axis_string; @@ -289,11 +293,13 @@ PlasmaInjector::PlasmaInjector (int ispecies, const std::string& name) num_particles_per_cell_each_dim.push_back(1); #endif #if WARPX_DIM_RZ + if (WarpX::n_rz_azimuthal_modes > 1) { AMREX_ALWAYS_ASSERT_WITH_MESSAGE( num_particles_per_cell_each_dim[1]>=2*WarpX::n_rz_azimuthal_modes, "Error: For accurate use of WarpX cylindrical geometry the number " "of particles in the theta direction should be at least two times " "n_rz_azimuthal_modes (Please visit PR#765 for more information.)"); + } #endif // Construct InjectorPosition from InjectorPositionRegular. h_inj_pos = std::make_unique<InjectorPosition>( |