Skip to content

Commit

Permalink
better position of velocity correction
Browse files Browse the repository at this point in the history
  • Loading branch information
brucefan1983 committed Jul 9, 2024
1 parent 5cb5d48 commit 83e1cf3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/main_gpumd/run.cu
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@ void Run::perform_a_run()

for (int step = 0; step < number_of_steps; ++step) {

velocity.correct_velocity(
step,
group,
atom.cpu_mass,
atom.position_per_atom,
atom.cpu_position_per_atom,
atom.cpu_velocity_per_atom,
atom.velocity_per_atom);

calculate_time_step(
max_distance_per_step, atom.velocity_per_atom, initial_time_step, time_step);
global_time += time_step;
Expand Down Expand Up @@ -280,15 +289,6 @@ void Run::perform_a_run()
atom,
force);

velocity.correct_velocity(
step,
group,
atom.cpu_mass,
atom.position_per_atom,
atom.cpu_position_per_atom,
atom.cpu_velocity_per_atom,
atom.velocity_per_atom);

int base = (10 <= number_of_steps) ? (number_of_steps / 10) : 1;
if (0 == (step + 1) % base) {
printf(" %d steps completed.\n", step + 1);
Expand Down

0 comments on commit 83e1cf3

Please sign in to comment.