must lower test epsilon with single precision FFTs and pppm used

This commit is contained in:
Axel Kohlmeyer
2023-07-21 12:12:53 -04:00
parent cccc362b3f
commit 21d4be321a
2 changed files with 11 additions and 1 deletions

View File

@ -279,6 +279,10 @@ TEST(FixTimestep, plain)
ASSERT_EQ(lmp->atom->natoms, nlocal);
double epsilon = test_config.epsilon;
// relax test precision when using pppm and single precision FFTs
#if defined(FFT_SINGLE)
if (lmp->force->kspace && utils::strmatch(lmp->force->kspace_style, "^pppm")) epsilon *= 2.0e8;
#endif
ErrorStats stats;
@ -411,7 +415,6 @@ TEST(FixTimestep, plain)
ifix = lmp->modify->find_fix("test");
if (!utils::strmatch(lmp->modify->fix[ifix]->style, "^rigid") &&
!utils::strmatch(lmp->modify->fix[ifix]->style, "^nve/limit")) {
if (!verbose) ::testing::internal::CaptureStdout();
cleanup_lammps(lmp, test_config);
if (!verbose) ::testing::internal::GetCapturedStdout();
@ -579,6 +582,10 @@ TEST(FixTimestep, omp)
ASSERT_EQ(lmp->atom->natoms, nlocal);
double epsilon = test_config.epsilon;
// relax test precision when using pppm and single precision FFTs
#if defined(FFT_SINGLE)
if (lmp->force->kspace && utils::strmatch(lmp->force->kspace_style, "^pppm")) epsilon *= 2.0e8;
#endif
ErrorStats stats;