Add simulaton setup advanced parameter for running particle generation only
In some cases it is useful to only generate initial attributes of particles (in order to feed them as an input to a subsequent simulation run). Particle tracking and particle detection unnecessarily consume CPU time in this case.
Proposal
Add an advanced (boolean) parameter <Simulation/OnlyGenerateParticles>
. When this parameter is set then only particle generation is performed during an iteration.
Implementation
Create a new method Iteration.execute_only_particle_generation
:
def execute_only_particle_generation(self):
self._particle_generation.generate_particles(self._progress)
The IPMSimulation
class then chooses the appropriate execute method based on the given parameters:
if setup.only_generate_particles:
self._execute_iteration = Iteration.execute_only_particle_generation
else:
self._execute_iteration = Iteration.execute
Then an iteration is executed via:
self._execute_iteration(iteration)