From 944c3bc91d3b372397f5dc30f843cca787110cb0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 11 Jul 2019 17:42:58 -0400 Subject: [PATCH] fix bug reported by jesse carter on lammps-users --- src/USER-INTEL/fix_nh_intel.cpp | 2 +- src/USER-INTEL/fix_nve_intel.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/USER-INTEL/fix_nh_intel.cpp b/src/USER-INTEL/fix_nh_intel.cpp index bf4764f104..a072e823a4 100644 --- a/src/USER-INTEL/fix_nh_intel.cpp +++ b/src/USER-INTEL/fix_nh_intel.cpp @@ -335,7 +335,7 @@ void FixNHIntel::reset_dt() if (nlocal > _nlocal_max) { if (_nlocal_max) memory->destroy(_dtfm); _nlocal_max = static_cast(1.20 * nlocal); - memory->create(_dtfm, _nlocal_max * 3, "fix_nve_intel:dtfm"); + memory->create(_dtfm, _nlocal_max * 3, "fix_nh_intel:dtfm"); } _nlocal3 = nlocal * 3; diff --git a/src/USER-INTEL/fix_nve_intel.cpp b/src/USER-INTEL/fix_nve_intel.cpp index 7dee31d2f4..f5d0513b65 100644 --- a/src/USER-INTEL/fix_nve_intel.cpp +++ b/src/USER-INTEL/fix_nve_intel.cpp @@ -75,6 +75,7 @@ void FixNVEIntel::initial_integrate(int /*vflag*/) x[i] += dtv * v[i]; } } else if (igroup == 0) { + if (neighbor->ago == 0) reset_dt(); #if defined(LMP_SIMD_COMPILER) #pragma vector aligned #pragma simd @@ -84,6 +85,7 @@ void FixNVEIntel::initial_integrate(int /*vflag*/) x[i] += dtv * v[i]; } } else { + if (neighbor->ago == 0) reset_dt(); #if defined(LMP_SIMD_COMPILER) #pragma vector aligned #pragma simd @@ -114,6 +116,15 @@ void FixNVEIntel::final_integrate() #endif for (int i = 0; i < _nlocal3; i++) v[i] += dtfm * f[i]; + } else if (igroup == 0) { + if (neighbor->ago == 0) reset_dt(); + #if defined(LMP_SIMD_COMPILER) + #pragma vector aligned + #pragma simd + #endif + for (int i = 0; i < _nlocal3; i++) { + v[i] += _dtfm[i] * f[i]; + } } else { if (neighbor->ago == 0) reset_dt(); #if defined(LMP_SIMD_COMPILER)