15#if !defined(AssignmentChecks) and !defined(noAssignmentChecks) \
17#define AssignmentChecks
23 namespace assignmentchecks {
84 std::map<ParticleIdentifier, ParticleEvents, std::less<>>
_data;
201 const int newVertexDepth
255 size_t nFirstEventsToSkip = 0
stores the actual particle histories.
int getNumberOfSnapshots() const
Return number of snapshots.
Database(const Database &)=delete
void setMaxParticleSnapshotsToKeepTrackOf(const size_t n)
Sets the number of snapshots to keep in the database.
tarch::multicore::MultiReadSingleWriteSemaphore _semaphore
Event addEvent(ParticleIdentifier identifier, Event &event)
Add a new event to the database.
std::string particleHistory(const ParticleIdentifier &identifier)
Print history of one particle.
size_t _maxParticleEventsToKeepTrackOf
Of how many previous associations do we want to keep track.
int getTotalParticleEntries(const ParticleIdentifier &identifier)
Count total number of entries for a particle.
size_t getCurrentMeshSweepIndex() const
Grab the current index of mesh sweeps.
static Database & getInstance()
std::vector< MeshSweepData > _meshSweepData
void startMeshSweep(const std::string &meshSweepName)
Add an entry for a new mesh sweep.
std::vector< MeshSweepData > & getMeshSweepData()
Get a handle on the mesh sweep data of the database.
ParticleEvents getParticleHistory(const ParticleIdentifier &identifier)
Return the stored event history of a particle.
std::string toString()
Dump the whole database.
std::string lastMeshSweepSnapshot()
Returns the recorded events of the latest mesh sweep.
void reset()
Delete all entries in the database and reset it to the initial state.
void eliminateExistingParticles()
Eliminate existing particles from the database.
Event getPreviousEvent(ParticleEvents &particleHistory, int spacetreeId, size_t nFirstEventsToSkip=0)
get the previous event from a particle history.
void shiftIdentifierVertexInd(ParticleIdentifier &identifier, tarch::la::Vector< Dimensions, long long > &newVertexInd, const int newVertexDepth)
Change the particle's vertexIndex in the map identifier.
static constexpr int AnyTree
void replaceEvent(ParticleIdentifier identifier, Event &oldEvent, Event &newEvent)
Replace an (old) particle event with a new one.
std::map< ParticleIdentifier, ParticleEvents, std::less<> > _data
int getNumberOfTracedParticles() const
Get the number of currently traced particles in the database.
void operator=(const Database &)=delete
int _currentMeshSweepIndex
std::string sweepHistory()
Get the history of stored mesh sweep (names).
std::vector< Event > ParticleEvents
ParticleIdentifier is used as a key to the 'database' map to keep the particles' history as the map's...