restructured fields for cpu sync;

no longer whole object in species but additional
fields in the corresponding classes
This commit is contained in:
2024-08-13 15:00:13 +02:00
parent 9dda12b60a
commit 2e5923ab6f
12 changed files with 93 additions and 106 deletions
+2 -5
View File
@@ -24,13 +24,10 @@ class CpuSynchronizer {
tracked_species, bool reset);
void synchronize(DynamicDensityField* field,
DynamicDensityField* last_sync_field,
DynamicDensityField* density_for_drawing,
bool reset);
void synchronize(CurrentCollector* collector,
CurrentCollector* last_sync_collector);
void synchronize(DeletionLogger* logger,
DeletionLogger* last_sync_logger);
void synchronize(CurrentCollector* collector);
void synchronize(DeletionLogger* logger);
void synchronize(Timer* timer, Timer* last_sync_timer);
+9
View File
@@ -67,6 +67,15 @@ class CurrentCollector {
blitz::Array<double, 3> r_negative_crossings;
blitz::Array<double, 3> r_positive_crossings;
blitz::Array<double, 3> sync_z_negative_crossings;
blitz::Array<double, 3> sync_z_positive_crossings;
blitz::Array<double, 3> sync_phi_negative_crossings;
blitz::Array<double, 3> sync_phi_positive_crossings;
blitz::Array<double, 3> sync_r_negative_crossings;
blitz::Array<double, 3> sync_r_positive_crossings;
blitz::Array<double, 3> collector_areas_r;
blitz::Array<double, 3> collector_areas_phi;
blitz::Array<double, 3> collector_areas_z;
+4
View File
@@ -80,6 +80,10 @@ class DynamicDensityField : public DensityField {
blitz::Array<double, 4> time_in_bin_s_;
blitz::Array<long int, 4> deleted_particles_;
blitz::Array<double, 4> sync_time_in_bin_s_;
blitz::Array<long int, 4> sync_deleted_particles_;
blitz::Array<double, 4> density_per_m3_;
blitz::Array<double, 3> bin_volume_m3_;
+1
View File
@@ -29,6 +29,7 @@ class DeletionLogger {
private:
std::map<DeletionType, long int> num_deletions;
std::map<DeletionType, long int> sync_num_deletions;
};
#endif /* LOGGER_H */
-16
View File
@@ -62,7 +62,6 @@ class TrackedSpecie : public Specie {
std::shared_ptr<DynamicDensityField> density_field,
std::shared_ptr<VelocityDistribution> velocity_distribution,
std::shared_ptr<DriftVelocity> drift_velocity,
std::shared_ptr<DynamicDensityField> last_sync_density_field,
std::shared_ptr<DynamicDensityField> density_for_drawing);
DensityField* densityField();
@@ -70,7 +69,6 @@ class TrackedSpecie : public Specie {
DriftVelocity* driftVelocity();
DynamicDensityField* dynamicDensityField();
DynamicDensityField* lastSyncDensityField();
Mover* mover();
Terminator* terminator();
Reflector* reflector();
@@ -78,18 +76,11 @@ class TrackedSpecie : public Specie {
DeletionLogger* deletionLogger();
void deletionLogger(std::shared_ptr<DeletionLogger> new_logger);
DeletionLogger* lastSyncDeletionLogger();
void lastSyncDeletionLogger(std::shared_ptr<DeletionLogger> new_logger);
DynamicDensityField* densityForDrawing();
CurrentCollector* currentCollector();
void currentCollector(std::shared_ptr<CurrentCollector> new_collector);
CurrentCollector* lastSyncCurrentCollector();
void lastSyncCurrentCollector(
std::shared_ptr<CurrentCollector> new_collector);
std::vector<std::shared_ptr<interaction::Interaction>> interactions();
void addInteraction(std::shared_ptr<interaction::Interaction> interaction);
@@ -106,13 +97,6 @@ class TrackedSpecie : public Specie {
std::shared_ptr<CurrentCollector> current_collector_;
std::vector<std::shared_ptr<interaction::Interaction>> interactions_;
// fields to store the date of the last synchronization
// (after a synchronization the last_sync field and the non-last_sync field
// contain the same data)
std::shared_ptr<DynamicDensityField> last_sync_density_field_;
std::shared_ptr<DeletionLogger> last_sync_deletion_logger_;
std::shared_ptr<CurrentCollector> last_sync_current_collector_;
std::shared_ptr<DynamicDensityField> density_for_drawing_;
};