Skip to content

Commit

Permalink
Update BDHM.c
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLueders authored Apr 16, 2024
1 parent d43eaf6 commit d08533a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions BDHM/BDHM.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -189,14 +192,15 @@ 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;
}
if(start_calc_velocity) {
// 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;
}
}
Expand All @@ -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
Expand Down

0 comments on commit d08533a

Please sign in to comment.