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
2b8ad703
"csrc/vscode:/vscode.git/clone" did not exist on "34489f466e8f6ddf3b7318cd1556a5df8759c005"
Unverified
Commit
2b8ad703
authored
Jun 02, 2025
by
Peter Eastman
Committed by
GitHub
Jun 02, 2025
Browse files
Fixed exception when computing pressure (#4954)
parent
88f32f2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
15 deletions
+14
-15
platforms/common/src/CommonKernels.cpp
platforms/common/src/CommonKernels.cpp
+14
-15
No files found.
platforms/common/src/CommonKernels.cpp
View file @
2b8ad703
...
@@ -3768,21 +3768,6 @@ void CommonApplyMonteCarloBarostatKernel::initialize(const System& system, const
...
@@ -3768,21 +3768,6 @@ void CommonApplyMonteCarloBarostatKernel::initialize(const System& system, const
void
CommonApplyMonteCarloBarostatKernel
::
saveCoordinates
(
ContextImpl
&
context
)
{
void
CommonApplyMonteCarloBarostatKernel
::
saveCoordinates
(
ContextImpl
&
context
)
{
ContextSelector
selector
(
cc
);
ContextSelector
selector
(
cc
);
cc
.
getPosq
().
copyTo
(
savedPositions
);
cc
.
getVelm
().
copyTo
(
savedVelocities
);
cc
.
getLongForceBuffer
().
copyTo
(
savedLongForces
);
if
(
savedFloatForces
.
isInitialized
())
cc
.
getFloatForceBuffer
().
copyTo
(
savedFloatForces
);
lastPosCellOffsets
=
cc
.
getPosCellOffsets
();
lastAtomOrder
=
cc
.
getAtomIndex
();
}
void
CommonApplyMonteCarloBarostatKernel
::
scaleCoordinates
(
ContextImpl
&
context
,
double
scaleX
,
double
scaleY
,
double
scaleZ
)
{
ContextSelector
selector
(
cc
);
// check if atoms were reordered from energy evaluation before scaling
atomsWereReordered
=
cc
.
getAtomsWereReordered
();
if
(
!
hasInitializedKernels
)
{
if
(
!
hasInitializedKernels
)
{
hasInitializedKernels
=
true
;
hasInitializedKernels
=
true
;
...
@@ -3829,6 +3814,20 @@ void CommonApplyMonteCarloBarostatKernel::scaleCoordinates(ContextImpl& context,
...
@@ -3829,6 +3814,20 @@ void CommonApplyMonteCarloBarostatKernel::scaleCoordinates(ContextImpl& context,
for
(
int
i
=
0
;
i
<
components
;
i
++
)
for
(
int
i
=
0
;
i
<
components
;
i
++
)
kineticEnergyKernel
->
addArg
(
energyBuffers
[
i
]);
kineticEnergyKernel
->
addArg
(
energyBuffers
[
i
]);
}
}
cc
.
getPosq
().
copyTo
(
savedPositions
);
cc
.
getVelm
().
copyTo
(
savedVelocities
);
cc
.
getLongForceBuffer
().
copyTo
(
savedLongForces
);
if
(
savedFloatForces
.
isInitialized
())
cc
.
getFloatForceBuffer
().
copyTo
(
savedFloatForces
);
lastPosCellOffsets
=
cc
.
getPosCellOffsets
();
lastAtomOrder
=
cc
.
getAtomIndex
();
}
void
CommonApplyMonteCarloBarostatKernel
::
scaleCoordinates
(
ContextImpl
&
context
,
double
scaleX
,
double
scaleY
,
double
scaleZ
)
{
ContextSelector
selector
(
cc
);
// check if atoms were reordered from energy evaluation before scaling
atomsWereReordered
=
cc
.
getAtomsWereReordered
();
kernel
->
setArg
(
0
,
(
float
)
scaleX
);
kernel
->
setArg
(
0
,
(
float
)
scaleX
);
kernel
->
setArg
(
1
,
(
float
)
scaleY
);
kernel
->
setArg
(
1
,
(
float
)
scaleY
);
kernel
->
setArg
(
2
,
(
float
)
scaleZ
);
kernel
->
setArg
(
2
,
(
float
)
scaleZ
);
...
...
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