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
13b93e62
Unverified
Commit
13b93e62
authored
Apr 13, 2023
by
Peter Eastman
Committed by
GitHub
Apr 13, 2023
Browse files
Prevent molecules from accidentally getting wrapped by barostat (#4034)
parent
4a26bca4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
platforms/common/include/openmm/common/CommonKernels.h
platforms/common/include/openmm/common/CommonKernels.h
+2
-1
platforms/common/include/openmm/common/ComputeContext.h
platforms/common/include/openmm/common/ComputeContext.h
+7
-1
platforms/common/src/CommonKernels.cpp
platforms/common/src/CommonKernels.cpp
+2
-0
No files found.
platforms/common/include/openmm/common/CommonKernels.h
View file @
13b93e62
...
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2008-202
2
Stanford University and the Authors. *
* Portions copyright (c) 2008-202
3
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -1576,6 +1576,7 @@ private:
ComputeArray
moleculeStartIndex
;
ComputeKernel
kernel
;
std
::
vector
<
int
>
lastAtomOrder
;
std
::
vector
<
mm_int4
>
lastPosCellOffsets
;
};
}
// namespace OpenMM
...
...
platforms/common/include/openmm/common/ComputeContext.h
View file @
13b93e62
...
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2019-202
2
Stanford University and the Authors. *
* Portions copyright (c) 2019-202
3
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -397,6 +397,12 @@ public:
std
::
vector
<
mm_int4
>&
getPosCellOffsets
()
{
return
posCellOffsets
;
}
/**
* Set the number of cells by which the positions are offset.
*/
void
setPosCellOffsets
(
std
::
vector
<
mm_int4
>&
offsets
)
{
posCellOffsets
=
offsets
;
}
/**
* Replace all occurrences of a list of substrings.
*
...
...
platforms/common/src/CommonKernels.cpp
View file @
13b93e62
...
...
@@ -7787,12 +7787,14 @@ void CommonApplyMonteCarloBarostatKernel::scaleCoordinates(ContextImpl& context,
setPeriodicBoxArgs
(
cc
,
kernel
,
4
);
kernel
->
execute
(
cc
.
getNumAtoms
());
lastAtomOrder
=
cc
.
getAtomIndex
();
lastPosCellOffsets
=
cc
.
getPosCellOffsets
();
}
void
CommonApplyMonteCarloBarostatKernel
::
restoreCoordinates
(
ContextImpl
&
context
)
{
ContextSelector
selector
(
cc
);
savedPositions
.
copyTo
(
cc
.
getPosq
());
savedLongForces
.
copyTo
(
cc
.
getLongForceBuffer
());
cc
.
setPosCellOffsets
(
lastPosCellOffsets
);
if
(
savedFloatForces
.
isInitialized
())
savedFloatForces
.
copyTo
(
cc
.
getFloatForceBuffer
());
}
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