-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathtruncated8.cpp
More file actions
65 lines (50 loc) · 1.68 KB
/
Copy pathtruncated8.cpp
File metadata and controls
65 lines (50 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include "ff/evdw.h"
#include "test.h"
#include "testrt.h"
using namespace tinker;
TEST_CASE("Truncated-Octahedron", "[ff][pbc][arbox]")
{
rc_flag = calc::xyz | calc::vmask;
const char* kname = "test_t8.key";
const char* xname = "test_t8.xyz";
const double eps_e = 0.0001;
const double eps_g = 0.0002;
const double eps_v = 0.001;
const int eps_count = 1;
const char* argv[] = {"dummy", xname};
int argc = 2;
TestFile fxy(TINKER9_DIRSTR "/test/file/trunc8/arbox.xyz", xname);
TestFile fke(TINKER9_DIRSTR "/test/file/trunc8/arbox.key", kname);
TestFile fpr(TINKER9_DIRSTR "/test/file/commit_6fe8e913/amoeba09.prm");
TestReference r(TINKER9_DIRSTR "/test/ref/truncated8.1.txt");
auto ref_e = r.getEnergy();
auto ref_v = r.getVirial();
auto ref_count = r.getCount();
auto ref_g = r.getGradient();
testBeginWithArgs(argc, argv);
initialize();
energy(calc::v0);
COMPARE_REALS(esum, ref_e, eps_e);
energy(calc::v1);
COMPARE_REALS(esum, ref_e, eps_e);
COMPARE_GRADIENT(ref_g, eps_g);
for (int i = 0; i < 3; ++i)
for (int j = 0; j < 3; ++j)
COMPARE_REALS(vir[i * 3 + j], ref_v[i][j], eps_v);
energy(calc::v3);
COMPARE_REALS(esum, ref_e, eps_e);
// COMPARE_INTS(countReduce(nev), ref_count);
COMPARE_INTS_EPS(countReduce(nev), ref_count, eps_count);
energy(calc::v4);
COMPARE_REALS(esum, ref_e, eps_e);
COMPARE_GRADIENT(ref_g, eps_g);
energy(calc::v5);
COMPARE_GRADIENT(ref_g, eps_g);
energy(calc::v6);
COMPARE_GRADIENT(ref_g, eps_g);
for (int i = 0; i < 3; ++i)
for (int j = 0; j < 3; ++j)
COMPARE_REALS(vir[i * 3 + j], ref_v[i][j], eps_v);
finish();
testEnd();
}