File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Source/Particles/Resampling Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -44,10 +44,8 @@ ParticleSplitting::ParticleSplitting (const std::string& species_name)
4444 " - position_axes_aligned_split\n "
4545 " - position_velocity_aligned_split.\n " );
4646
47- if (!m_resampling_random_splitting_angle) {
48- utils::parser::queryWithParser (
49- pp_species_name, " resampling_splitting_angle" , m_splitting_angle);
50- }
47+ utils::parser::queryWithParser (
48+ pp_species_name, " resampling_splitting_angle" , m_splitting_angle);
5149}
5250void ParticleSplitting::operator () (
5351 const amrex::Geometry& geom_lev, WarpXParIter& pti,
@@ -171,8 +169,10 @@ void ParticleSplitting::operator() (
171169#endif
172170
173171 const auto resampling_random_splitting_angle = m_resampling_random_splitting_angle;
174- const amrex::Real splitting_angle = resampling_random_splitting_angle ?
175- amrex::Random (engine) * 2 .0_rt * MathConst::pi : m_splitting_angle;
172+ const amrex::Real splitting_angle_fixed = m_splitting_angle;
173+ const amrex::Real random_number = amrex::Random (engine);
174+
175+ amrex::Real splitting_angle = resampling_random_splitting_angle ? random_number * 2 .0_rt * MathConst::pi : splitting_angle_fixed;
176176
177177 // Starting index for new children particles for i_cell
178178 const int new_particle_start = num_particles_tile + offset_ptr[i_cell];
You can’t perform that action at this time.
0 commit comments