Merge pull request #1561 from akohlmey/fix-user-intel-nve-bug

Fix bug in fix nve/intel
This commit is contained in:
Axel Kohlmeyer 2019-07-12 19:59:21 -04:00 committed by GitHub
commit 6742f371ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -335,7 +335,7 @@ void FixNHIntel::reset_dt()
if (nlocal > _nlocal_max) { if (nlocal > _nlocal_max) {
if (_nlocal_max) memory->destroy(_dtfm); if (_nlocal_max) memory->destroy(_dtfm);
_nlocal_max = static_cast<int>(1.20 * nlocal); _nlocal_max = static_cast<int>(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; _nlocal3 = nlocal * 3;

View File

@ -75,6 +75,7 @@ void FixNVEIntel::initial_integrate(int /*vflag*/)
x[i] += dtv * v[i]; x[i] += dtv * v[i];
} }
} else if (igroup == 0) { } else if (igroup == 0) {
if (neighbor->ago == 0) reset_dt();
#if defined(LMP_SIMD_COMPILER) #if defined(LMP_SIMD_COMPILER)
#pragma vector aligned #pragma vector aligned
#pragma simd #pragma simd
@ -84,6 +85,7 @@ void FixNVEIntel::initial_integrate(int /*vflag*/)
x[i] += dtv * v[i]; x[i] += dtv * v[i];
} }
} else { } else {
if (neighbor->ago == 0) reset_dt();
#if defined(LMP_SIMD_COMPILER) #if defined(LMP_SIMD_COMPILER)
#pragma vector aligned #pragma vector aligned
#pragma simd #pragma simd
@ -114,6 +116,15 @@ void FixNVEIntel::final_integrate()
#endif #endif
for (int i = 0; i < _nlocal3; i++) for (int i = 0; i < _nlocal3; i++)
v[i] += dtfm * f[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 { } else {
if (neighbor->ago == 0) reset_dt(); if (neighbor->ago == 0) reset_dt();
#if defined(LMP_SIMD_COMPILER) #if defined(LMP_SIMD_COMPILER)