Added counting of physical losses at a wall

to deletion logger
This commit is contained in:
2025-07-09 16:39:56 +02:00
parent 603434e161
commit 0237292c5c
6 changed files with 65 additions and 5 deletions
+17 -2
View File
@@ -3,8 +3,9 @@
#include <map>
#include <vector>
#include "simulation/coordinates.h"
#include "simulation/particle.h"
// to count numerical particle deletions
enum class DeletionType {
wall,
recombination,
@@ -13,13 +14,23 @@ enum class DeletionType {
cluster_formation
};
// to count physical particle deletion
enum class PhysicalDeletionType {
wall
};
class Coordinate;
class DeletionLogger {
public:
DeletionLogger(std::vector<DeletionType> used_types);
DeletionLogger(std::vector<DeletionType> used_types,
std::vector<PhysicalDeletionType> used_phys_types);
// why a coordinate as a parameter -> not used in implementation
virtual void logDeletion(const Coordinate& coordinate, DeletionType type);
virtual void logDeletion(const particle::Particle& particle,
PhysicalDeletionType type);
std::map<DeletionType, long int> numDeletions() const;
std::map<PhysicalDeletionType, double> numPhysDeletions() const;
void numDeletions(long int new_value, DeletionType type);
long int numDeletions(DeletionType type) const;
@@ -30,6 +41,10 @@ class DeletionLogger {
private:
std::map<DeletionType, long int> num_deletions;
std::map<DeletionType, long int> sync_num_deletions;
std::map<PhysicalDeletionType, double> num_phys_deletions;
std::map<PhysicalDeletionType, double> sync_num_phys_deletions;
};
#endif /* LOGGER_H */