17 class TrajectoryDatabase;
87 std::map<std::pair<int, int>, std::list<Entry>>
_data;
114 const std::pair<int, int>& number,
117 int numberOfDataEntries,
224 int growthBetweenTwoDatabaseFlushes,
225 double positionDelta = 1e-8,
226 double dataDelta = 1e-8,
227 double timeDelta = 0.0,
229 bool deltasAreRelative =
false
239 void clear(
bool lockSemaphore =
true);
299 const std::pair<int, int>& number,
302 int numberOfDataEntries,
311 int numberOfDataEntries,
A simple particle database.
void setDataDeltaBetweenTwoSnapshots(double value, bool deltasAreRelative=false)
void clear(bool lockSemaphore=true)
static constexpr double _deltaCutOffThreshold
AddSnapshotAction getAction(const std::pair< int, int > &number, const tarch::la::Vector< Dimensions, double > &x, double timestamp)
Determine what to do with new entry.
int _rank
This is a hack: Usually, I'd just ask the rank what its number is.
TrajectoryDatabase(int growthBetweenTwoDatabaseFlushes, double positionDelta=1e-8, double dataDelta=1e-8, double timeDelta=0.0, bool clearDatabaseAfterFlush=true, bool deltasAreRelative=false)
Trajectory database.
void clearDatabaseAfterFlush(bool value)
bool _clearDatabaseAfterFlush
Flag that indicates if we erase the database after a flush.
int _thresholdForNextDatabaseFlush
void dumpCSVFile()
Dump data into CSV file.
void setTimeDeltaBetweenTwoSnapshots(double value)
void addParticleSnapshot(const std::pair< int, int > &number, double timestamp, const tarch::la::Vector< Dimensions, double > &x)
Add particle snapshot.
static tarch::logging::Log _log
const int _deltaBetweenTwoDatabaseFlushes
void setOutputFileName(const std::string &filename)
std::map< std::pair< int, int >, std::list< Entry > > _data
void setOutputPrecision(int precision)
void clearHistory(bool lockSemaphore=true)
This call does not throw away all particles, but it throws away all the history behind the particles.
int _numberOfDataPointsPerParticle
bool dumpDatabaseSnapshot()
void setPositionDeltaBetweenTwoSnapshots(double value, bool deltasAreRelative=false)
tarch::multicore::BooleanSemaphore _semaphore
const int numberOfDataEntries
Have to memorise this guy to be able to write a proper copy constructor.
tarch::la::Vector< Dimensions, double > x