#ifndef RESTART_H #define RESTART_H #include #include #include #include #include "IO/hdf5_reader.h" #include "IO/mpi_particle_reader.h" namespace species { class TrackedSpecie; enum class ImplementedSpecies; }; // namespace species namespace particle { class SerializedParticle; }; class DynamicDensityField; class PoissonSolver; class RandomNumbers; // Note: The restarts for the DensityField and the PoissonSolver require that the // partitioning of the simulation space does not change between the original and // the restarted simulation // Note: think if it's better (or more consistent) to set the dynamic electric field // here after the potential is loaded; would need the electric field class to be included class Restart { public: // Restart(bool do_restart, std::string absolute_filename, // std::string restart_identifier); Restart(bool do_restart, std::string absolute_filename_without_extension, std::string restart_identifier, int particle_restart_at); void restart(std::map>& species, PoissonSolver* poisson_solver, RandomNumbers* random_numbers, std::vector& storage_queue); private: void restartTimer(species::TrackedSpecie* reference_specie); // only necessary for densityfield that is drawn from void restartDrawingDensityField(DynamicDensityField* field, std::string path); // only load in the potential and calc the electric field void restartPoissonSolver(PoissonSolver* solver); void restartRandomNumbers(RandomNumbers* random); void restartParticles(std::vector& storage_queue); bool do_restart_; std::string restart_identifier_; // i.e. "LastSyncPeriod" or "SyncPeriod_*" Hdf5Reader reader_; MpiParticleReader particle_reader_; }; #endif /* RESTART_H */