Injection stride on a per injected species basis
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "generators/velocity_distribution_generator.h"
|
||||
#include "simulation/event_position_distribution.h"
|
||||
#include "simulation/velocity_distribution.h"
|
||||
#include "simulation/mpi_communication.h"
|
||||
|
||||
namespace generator {
|
||||
|
||||
@@ -39,6 +40,18 @@ std::shared_ptr<Injector> buildInjector(
|
||||
// info.multiplicity = json_int(json_object_by_path(value, {"Multiplicity"}), 1);
|
||||
// ASSERT_POSITIVE(&info.multiplicity, "The multiplicity has to be positive. " +
|
||||
// specie_name + " multiplicity: " + std::to_string(info.multiplicity));
|
||||
int injection_stride = json_int(json_object_by_path(value, {"InjectionStride"}), 1);
|
||||
ASSERT_POSITIVE(&injection_stride, "The injection stride for " + specie_name +
|
||||
" is not positive! (" + std::to_string(injection_stride) + ")");
|
||||
if(injection_stride > MpiCommunication::mpiSize()) {
|
||||
ERROR("Injection stride for " + specie_name + ": "
|
||||
+ std::to_string(injection_stride) + " is larger than the number"
|
||||
" of processes (" + std::to_string(MpiCommunication::mpiSize()) + ")");
|
||||
}
|
||||
|
||||
info.injection_stride = injection_stride;
|
||||
info.injection_group = MpiCommunication::mpi_rank % injection_stride;
|
||||
|
||||
injector_infos.push_back(info);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user