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
8cd52036
"platforms/cuda/src/CudaExpressionUtilities.cpp" did not exist on "4e1e1b1162036a617d6ecadd5e218a799e0ecc6b"
Commit
8cd52036
authored
Apr 24, 2020
by
peastman
Browse files
Checkpoint records choice of current integrator
parent
5ee23330
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
openmmapi/src/CompoundIntegrator.cpp
openmmapi/src/CompoundIntegrator.cpp
+2
-0
tests/TestCompoundIntegrator.h
tests/TestCompoundIntegrator.h
+3
-0
No files found.
openmmapi/src/CompoundIntegrator.cpp
View file @
8cd52036
...
@@ -130,11 +130,13 @@ double CompoundIntegrator::computeKineticEnergy() {
...
@@ -130,11 +130,13 @@ double CompoundIntegrator::computeKineticEnergy() {
}
}
void
CompoundIntegrator
::
createCheckpoint
(
std
::
ostream
&
stream
)
const
{
void
CompoundIntegrator
::
createCheckpoint
(
std
::
ostream
&
stream
)
const
{
stream
.
write
((
char
*
)
&
currentIntegrator
,
sizeof
(
int
));
for
(
int
i
=
0
;
i
<
integrators
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
integrators
.
size
();
i
++
)
integrators
[
i
]
->
createCheckpoint
(
stream
);
integrators
[
i
]
->
createCheckpoint
(
stream
);
}
}
void
CompoundIntegrator
::
loadCheckpoint
(
std
::
istream
&
stream
)
{
void
CompoundIntegrator
::
loadCheckpoint
(
std
::
istream
&
stream
)
{
stream
.
read
((
char
*
)
&
currentIntegrator
,
sizeof
(
int
));
for
(
int
i
=
0
;
i
<
integrators
.
size
();
i
++
)
for
(
int
i
=
0
;
i
<
integrators
.
size
();
i
++
)
integrators
[
i
]
->
loadCheckpoint
(
stream
);
integrators
[
i
]
->
loadCheckpoint
(
stream
);
}
}
tests/TestCompoundIntegrator.h
View file @
8cd52036
...
@@ -218,6 +218,7 @@ void testCheckpoint() {
...
@@ -218,6 +218,7 @@ void testCheckpoint() {
custom
->
addPerDofVariable
(
"b"
,
2.0
);
custom
->
addPerDofVariable
(
"b"
,
2.0
);
CompoundIntegrator
integrator
;
CompoundIntegrator
integrator
;
integrator
.
addIntegrator
(
custom
);
integrator
.
addIntegrator
(
custom
);
integrator
.
addIntegrator
(
new
VerletIntegrator
(
0.005
));
Context
context
(
system
,
integrator
,
platform
);
Context
context
(
system
,
integrator
,
platform
);
vector
<
Vec3
>
positions
(
1
,
Vec3
());
vector
<
Vec3
>
positions
(
1
,
Vec3
());
context
.
setPositions
(
positions
);
context
.
setPositions
(
positions
);
...
@@ -229,7 +230,9 @@ void testCheckpoint() {
...
@@ -229,7 +230,9 @@ void testCheckpoint() {
custom
->
setGlobalVariable
(
0
,
10.0
);
custom
->
setGlobalVariable
(
0
,
10.0
);
vector
<
Vec3
>
b2
(
1
,
Vec3
(
4
,
5
,
6
));
vector
<
Vec3
>
b2
(
1
,
Vec3
(
4
,
5
,
6
));
custom
->
setPerDofVariable
(
0
,
b2
);
custom
->
setPerDofVariable
(
0
,
b2
);
integrator
.
setCurrentIntegrator
(
1
);
context
.
loadCheckpoint
(
checkpoint
);
context
.
loadCheckpoint
(
checkpoint
);
ASSERT_EQUAL
(
0
,
integrator
.
getCurrentIntegrator
());
ASSERT_EQUAL
(
5.0
,
custom
->
getGlobalVariable
(
0
));
ASSERT_EQUAL
(
5.0
,
custom
->
getGlobalVariable
(
0
));
vector
<
Vec3
>
b3
;
vector
<
Vec3
>
b3
;
custom
->
getPerDofVariable
(
0
,
b3
);
custom
->
getPerDofVariable
(
0
,
b3
);
...
...
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