Changed initializtion of potential-grid, included

a variable for minimum cycles before first poisson solution
This commit is contained in:
2024-01-29 11:21:07 +01:00
parent 3a802d8f8d
commit 331e887f04
5 changed files with 54 additions and 34 deletions
+7 -1
View File
@@ -95,6 +95,10 @@ void Simulation::start() {
parameter_.intValue(json_path({"Simulation", "EventStride"}), 1);
const int total_simulated_events =
parameter_.intValue(json_path({"Simulation", "SimulatedEvents"}), 1);
// Minimum number of cpu syncs before the potential is done the first time
// afterwards the potential is recalculated every cpu sync (maybe change to a stride)
const int poisson_offset =
parameter_.intValue(json_path({"Simulation", "PoissonOffset"}), 0);
SIM_INFO("Total simulated events: " + std::to_string(total_simulated_events));
SIM_INFO("Simulated events before cpu sync: " + std::to_string(event_stride));
const int events_this_cpu = eventsThisCpu(total_simulated_events);
@@ -119,7 +123,9 @@ void Simulation::start() {
SIM_INFO("Poisson step.");
SimulationTimer::eventStartPoint(std::string("PoissonStep"));
poisson_solver_->solvePotential(chargedensity());
if(num_cpu_syncs > poisson_offset) {
poisson_solver_->solvePotential(chargedensity());
}
SimulationTimer::eventStopPoint(std::string("PoissonStep"));
electric_field_->updateDynamicField(poisson_solver_->staticElectricField());