From d08533a2d831e26453a607d13dbb93858e13edd7 Mon Sep 17 00:00:00 2001 From: AntonLueders <145451222+AntonLueders@users.noreply.github.com> Date: Tue, 16 Apr 2024 11:23:03 +0200 Subject: [PATCH] Update BDHM.c --- BDHM/BDHM.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/BDHM/BDHM.c b/BDHM/BDHM.c index de0b3d3..48c73bb 100644 --- a/BDHM/BDHM.c +++ b/BDHM/BDHM.c @@ -112,10 +112,13 @@ int main(int argc, char *argv[]) { // Init. the linked lists that store the particles in the simulations InitPartLists(); // partmanagement.c - + + // Some bool to check if new particles are added or deleted + // when using an additional flow field. bool part_was_deleted = false; bool part_was_added = false; - + + // Needed when the particle front velocity is calculated bool start_calc_velocity = false; int start_time_calc_velocity = 0; @@ -189,7 +192,7 @@ int main(int argc, char *argv[]) { // Velocity calculation if (stationary_mode && calc_velocity) { if(!start_calc_velocity) { - // Checks if the particle reached the start line + // Checks if the particle reached the start line start_calc_velocity = CalcVelocityStart(P); // See calc.c start_time_calc_velocity = step; } @@ -197,6 +200,7 @@ int main(int argc, char *argv[]) { // Checks if the particle reached the finish line if (CalcVelocity(P)) { // See calc.c PrintVelocity(step - start_time_calc_velocity); // See calc.c + // Simulation ends when velocity is determined break; } } @@ -210,7 +214,7 @@ int main(int argc, char *argv[]) { part_was_deleted = CheckForDeletion(P); // See partmanagement.c } - // Checks for unexpected displacements + // Checks for unexpected displacements (simulations end after unphysical "jumps") CheckStability(P); // See partmanagement.c // Rotates the external H field