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
89904a9e
Commit
89904a9e
authored
Nov 02, 2015
by
Robert McGibbon
Browse files
Update RPMD enforcePeriodicBox to support triclinic unit cells
parent
704b15bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
plugins/rpmd/openmmapi/src/RPMDIntegrator.cpp
plugins/rpmd/openmmapi/src/RPMDIntegrator.cpp
+6
-12
No files found.
plugins/rpmd/openmmapi/src/RPMDIntegrator.cpp
View file @
89904a9e
...
@@ -128,21 +128,15 @@ State RPMDIntegrator::getState(int copy, int types, bool enforcePeriodicBox, int
...
@@ -128,21 +128,15 @@ State RPMDIntegrator::getState(int copy, int types, bool enforcePeriodicBox, int
center
*=
1.0
/
molecules
[
i
].
size
();
center
*=
1.0
/
molecules
[
i
].
size
();
// Find the displacement to move it into the first periodic box.
// Find the displacement to move it into the first periodic box.
Vec3
diff
;
int
xcell
=
(
int
)
floor
(
center
[
0
]
/
periodicBoxSize
[
0
][
0
]);
diff
-=
periodicBoxSize
[
0
]
*
static_cast
<
int
>
(
center
[
0
]
/
periodicBoxSize
[
0
][
0
]);
int
ycell
=
(
int
)
floor
(
center
[
1
]
/
periodicBoxSize
[
1
][
1
]);
diff
-=
periodicBoxSize
[
1
]
*
static_cast
<
int
>
(
center
[
1
]
/
periodicBoxSize
[
1
][
1
]);
int
zcell
=
(
int
)
floor
(
center
[
2
]
/
periodicBoxSize
[
2
][
2
]);
diff
-=
periodicBoxSize
[
2
]
*
static_cast
<
int
>
(
center
[
2
]
/
periodicBoxSize
[
2
][
2
]);
double
dx
=
xcell
*
periodicBoxSize
[
0
][
0
];
double
dy
=
ycell
*
periodicBoxSize
[
1
][
1
];
double
dz
=
zcell
*
periodicBoxSize
[
2
][
2
];
// Translate all the particles in the molecule.
// Translate all the particles in the molecule.
for
(
int
j
=
0
;
j
<
(
int
)
molecules
[
i
].
size
();
j
++
)
{
for
(
int
j
=
0
;
j
<
(
int
)
molecules
[
i
].
size
();
j
++
)
{
Vec3
&
pos
=
positions
[
molecules
[
i
][
j
]];
Vec3
&
pos
=
positions
[
molecules
[
i
][
j
]];
pos
[
0
]
-=
dx
;
pos
-=
diff
;
pos
[
1
]
-=
dy
;
pos
[
2
]
-=
dz
;
}
}
}
}
...
@@ -170,7 +164,7 @@ double RPMDIntegrator::computeKineticEnergy() {
...
@@ -170,7 +164,7 @@ double RPMDIntegrator::computeKineticEnergy() {
void
RPMDIntegrator
::
step
(
int
steps
)
{
void
RPMDIntegrator
::
step
(
int
steps
)
{
if
(
context
==
NULL
)
if
(
context
==
NULL
)
throw
OpenMMException
(
"This Integrator is not bound to a context!"
);
throw
OpenMMException
(
"This Integrator is not bound to a context!"
);
if
(
!
hasSetPosition
)
{
if
(
!
hasSetPosition
)
{
// Initialize the positions from the context.
// Initialize the positions from the context.
...
...
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