From 83e1cf38d8b397a714bab0e4cd08395087fc1bfa Mon Sep 17 00:00:00 2001 From: brucefan1983 Date: Tue, 9 Jul 2024 15:32:22 +0800 Subject: [PATCH] better position of velocity correction --- src/main_gpumd/run.cu | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main_gpumd/run.cu b/src/main_gpumd/run.cu index 5666ce820..78647ac4e 100644 --- a/src/main_gpumd/run.cu +++ b/src/main_gpumd/run.cu @@ -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; @@ -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);