From 89df0f2ffc8ed950eba18ab83a1ba71789ce7c51 Mon Sep 17 00:00:00 2001 From: Yu Liu <77716030+YuLiu98@users.noreply.github.com> Date: Sat, 14 Dec 2024 09:14:02 +0800 Subject: [PATCH] Fix: update kinetic energy when all atoms are fixed (#5729) * Fix: update kinetic energy when all atoms are fixed * fix wrong order --- source/module_md/md_func.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/module_md/md_func.cpp b/source/module_md/md_func.cpp index 3d40ca3f7e..07bc1f03f2 100644 --- a/source/module_md/md_func.cpp +++ b/source/module_md/md_func.cpp @@ -453,6 +453,7 @@ double current_temp(double& kinetic, { if (3 * natom == frozen_freedom) { + kinetic = 0.0; return 0.0; } else