Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
3db6b8ee
"plugins/rpmd/vscode:/vscode.git/clone" did not exist on "bb8c2c6f4934bf21e13a69d3ec1f4fd0b31b00bd"
Commit
3db6b8ee
authored
Feb 07, 2015
by
Jason Swails
Browse files
Merge branch 'master' into gbn-chk
parents
5d8e92ff
3a80b0f1
Changes
121
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
plugins/cpupme/tests/TestCpuPme.cpp
plugins/cpupme/tests/TestCpuPme.cpp
+16
-4
No files found.
plugins/cpupme/tests/TestCpuPme.cpp
View file @
3db6b8ee
...
...
@@ -61,14 +61,25 @@ public:
}
};
void
testPME
()
{
void
testPME
(
bool
triclinic
)
{
// Create a cloud of random point charges.
const
int
numParticles
=
51
;
const
double
boxWidth
=
5.0
;
const
double
cutoff
=
1.0
;
Vec3
boxVectors
[
3
];
if
(
triclinic
)
{
boxVectors
[
0
]
=
Vec3
(
boxWidth
,
0
,
0
);
boxVectors
[
1
]
=
Vec3
(
0.2
*
boxWidth
,
boxWidth
,
0
);
boxVectors
[
2
]
=
Vec3
(
-
0.3
*
boxWidth
,
-
0.1
*
boxWidth
,
boxWidth
);
}
else
{
boxVectors
[
0
]
=
Vec3
(
boxWidth
,
0
,
0
);
boxVectors
[
1
]
=
Vec3
(
0
,
boxWidth
,
0
);
boxVectors
[
2
]
=
Vec3
(
0
,
0
,
boxWidth
);
}
System
system
;
system
.
setDefaultPeriodicBoxVectors
(
Vec3
(
boxWidth
,
0
,
0
),
Vec3
(
0
,
boxWidth
,
0
),
Vec3
(
0
,
0
,
boxWidth
)
);
system
.
setDefaultPeriodicBoxVectors
(
boxVectors
[
0
],
boxVectors
[
1
],
boxVectors
[
2
]
);
NonbondedForce
*
force
=
new
NonbondedForce
();
system
.
addForce
(
force
);
vector
<
Vec3
>
positions
(
numParticles
);
...
...
@@ -112,7 +123,7 @@ void testPME() {
}
double
ewaldSelfEnergy
=
-
ONE_4PI_EPS0
*
alpha
*
sumSquaredCharges
/
sqrt
(
M_PI
);
pme
.
initialize
(
gridx
,
gridy
,
gridz
,
numParticles
,
alpha
);
pme
.
beginComputation
(
io
,
Vec3
(
boxWidth
,
boxWidth
,
boxWidth
)
,
true
);
pme
.
beginComputation
(
io
,
boxVectors
,
true
);
double
energy
=
pme
.
finishComputation
(
io
);
// See if they match.
...
...
@@ -128,7 +139,8 @@ int main(int argc, char* argv[]) {
cout
<<
"CPU is not supported. Exiting."
<<
endl
;
return
0
;
}
testPME
();
testPME
(
false
);
testPME
(
true
);
}
catch
(
const
exception
&
e
)
{
cout
<<
"exception: "
<<
e
.
what
()
<<
endl
;
...
...
Prev
1
…
3
4
5
6
7
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment