From b92eda8ab884669f440be4ebb23484dd98b496c4 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 9 Aug 2020 17:36:15 -0400 Subject: [PATCH] enable testing with r-RESPA for real --- unittest/force-styles/test_fix_timestep.cpp | 25 ++++++++++++--------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/unittest/force-styles/test_fix_timestep.cpp b/unittest/force-styles/test_fix_timestep.cpp index cc20dae0ca..2dfd494a23 100644 --- a/unittest/force-styles/test_fix_timestep.cpp +++ b/unittest/force-styles/test_fix_timestep.cpp @@ -295,7 +295,7 @@ TEST(FixTimestep, plain) int argc = sizeof(args) / sizeof(char *); ::testing::internal::CaptureStdout(); - LAMMPS *lmp = init_lammps(argc, argv, test_config, false); + LAMMPS *lmp = init_lammps(argc, argv, test_config); std::string output = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << output; @@ -523,11 +523,13 @@ TEST(FixTimestep, plain) if (!verbose) ::testing::internal::GetCapturedStdout(); ::testing::internal::CaptureStdout(); - lmp = init_lammps(argc, argv, test_config, false); - + lmp = init_lammps(argc, argv, test_config, true); output = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << output; + // lower required precision by one order of magnitude to accommodate respa + epsilon *= 10.0; + x = lmp->atom->x; tag = lmp->atom->tag; stats.reset(); @@ -588,7 +590,7 @@ TEST(FixTimestep, plain) } if (!verbose) ::testing::internal::CaptureStdout(); - restart_lammps(lmp, test_config, false, false); + restart_lammps(lmp, test_config, false, true); if (!verbose) ::testing::internal::GetCapturedStdout(); x = lmp->atom->x; @@ -651,7 +653,7 @@ TEST(FixTimestep, plain) } if (!verbose) ::testing::internal::CaptureStdout(); - restart_lammps(lmp, test_config, true, false); + restart_lammps(lmp, test_config, true, true); if (!verbose) ::testing::internal::GetCapturedStdout(); x = lmp->atom->x; @@ -729,8 +731,7 @@ TEST(FixTimestep, omp) int argc = sizeof(args) / sizeof(char *); ::testing::internal::CaptureStdout(); - LAMMPS *lmp = init_lammps(argc, argv, test_config, false); - + LAMMPS *lmp = init_lammps(argc, argv, test_config); std::string output = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << output; @@ -958,11 +959,13 @@ TEST(FixTimestep, omp) if (!verbose) ::testing::internal::GetCapturedStdout(); ::testing::internal::CaptureStdout(); - lmp = init_lammps(argc, argv, test_config, false); - + lmp = init_lammps(argc, argv, test_config, true); output = ::testing::internal::GetCapturedStdout(); if (verbose) std::cout << output; + // lower required precision by one order of magnitude to accommodate respa + epsilon *= 10.0; + x = lmp->atom->x; tag = lmp->atom->tag; stats.reset(); @@ -1023,7 +1026,7 @@ TEST(FixTimestep, omp) } if (!verbose) ::testing::internal::CaptureStdout(); - restart_lammps(lmp, test_config, false, false); + restart_lammps(lmp, test_config, false, true); if (!verbose) ::testing::internal::GetCapturedStdout(); x = lmp->atom->x; @@ -1086,7 +1089,7 @@ TEST(FixTimestep, omp) } if (!verbose) ::testing::internal::CaptureStdout(); - restart_lammps(lmp, test_config, true, false); + restart_lammps(lmp, test_config, true, true); if (!verbose) ::testing::internal::GetCapturedStdout(); x = lmp->atom->x;