Skip to content

Commit

Permalink
Increased tolerance on some assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
peastman committed Nov 7, 2023
1 parent bc250d3 commit 81f7a02
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions platforms/cuda/tests/TestCudaPlumedForce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void testMetadynamics() {
double expected = x*x;
for (int j = 0; j < centers.size(); j++)
expected += 0.1*exp(-(x-centers[j])*(x-centers[j])/(2*0.5*0.5));
ASSERT_EQUAL_TOL(expected, state.getPotentialEnergy(), 1e-3);
ASSERT_EQUAL_TOL(expected, state.getPotentialEnergy(), 1e-2);
if (i > 0)
centers.push_back(x);
}
Expand Down Expand Up @@ -169,7 +169,7 @@ void testWellTemperedMetadynamics() {
heights.push_back(height0*exp(-bias/(delta_temperature*BOLTZ)));
}

ASSERT_EQUAL_TOL(bias + x*x, state.getPotentialEnergy(), 1e-3);
ASSERT_EQUAL_TOL(bias + x*x, state.getPotentialEnergy(), 1e-2);
}
}

Expand Down
4 changes: 2 additions & 2 deletions platforms/opencl/tests/TestOpenCLPlumedForce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void testMetadynamics() {
double expected = x*x;
for (int j = 0; j < centers.size(); j++)
expected += 0.1*exp(-(x-centers[j])*(x-centers[j])/(2*0.5*0.5));
ASSERT_EQUAL_TOL(expected, state.getPotentialEnergy(), 1e-3);
ASSERT_EQUAL_TOL(expected, state.getPotentialEnergy(), 1e-2);
if (i > 0)
centers.push_back(x);
}
Expand Down Expand Up @@ -169,7 +169,7 @@ void testWellTemperedMetadynamics() {
heights.push_back(height0*exp(-bias/(delta_temperature*BOLTZ)));
}

ASSERT_EQUAL_TOL(bias + x*x, state.getPotentialEnergy(), 1e-3);
ASSERT_EQUAL_TOL(bias + x*x, state.getPotentialEnergy(), 1e-2);
}
}

Expand Down
4 changes: 2 additions & 2 deletions platforms/reference/tests/TestReferencePlumedForce.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void testMetadynamics() {
double expected = x*x;
for (int j = 0; j < centers.size(); j++)
expected += 0.1*exp(-(x-centers[j])*(x-centers[j])/(2*0.5*0.5));
ASSERT_EQUAL_TOL(expected, state.getPotentialEnergy(), 1e-3);
ASSERT_EQUAL_TOL(expected, state.getPotentialEnergy(), 1e-2);
if (i > 0)
centers.push_back(x);
}
Expand Down Expand Up @@ -169,7 +169,7 @@ void testWellTemperedMetadynamics() {
heights.push_back(height0*exp(-bias/(delta_temperature*BOLTZ)));
}

ASSERT_EQUAL_TOL(bias + x*x, state.getPotentialEnergy(), 1e-3);
ASSERT_EQUAL_TOL(bias + x*x, state.getPotentialEnergy(), 1e-2);
}
}

Expand Down

0 comments on commit 81f7a02

Please sign in to comment.