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
c24c619e
Unverified
Commit
c24c619e
authored
Nov 06, 2025
by
Peter Eastman
Committed by
GitHub
Nov 06, 2025
Browse files
Code cleanup (#5127)
parent
b1a5324c
Changes
80
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
31 additions
and
354 deletions
+31
-354
openmmapi/src/MonteCarloMembraneBarostatImpl.cpp
openmmapi/src/MonteCarloMembraneBarostatImpl.cpp
+4
-8
openmmapi/src/NonbondedForceImpl.cpp
openmmapi/src/NonbondedForceImpl.cpp
+1
-3
openmmapi/src/NoseHooverIntegrator.cpp
openmmapi/src/NoseHooverIntegrator.cpp
+1
-3
openmmapi/src/OrientationRestraintForceImpl.cpp
openmmapi/src/OrientationRestraintForceImpl.cpp
+1
-3
openmmapi/src/PeriodicTorsionForceImpl.cpp
openmmapi/src/PeriodicTorsionForceImpl.cpp
+1
-3
openmmapi/src/QTBIntegrator.cpp
openmmapi/src/QTBIntegrator.cpp
+1
-3
openmmapi/src/RBTorsionForceImpl.cpp
openmmapi/src/RBTorsionForceImpl.cpp
+1
-3
openmmapi/src/RGForceImpl.cpp
openmmapi/src/RGForceImpl.cpp
+1
-3
openmmapi/src/RMSDForceImpl.cpp
openmmapi/src/RMSDForceImpl.cpp
+1
-3
openmmapi/src/VariableLangevinIntegrator.cpp
openmmapi/src/VariableLangevinIntegrator.cpp
+1
-3
openmmapi/src/VariableVerletIntegrator.cpp
openmmapi/src/VariableVerletIntegrator.cpp
+1
-3
openmmapi/src/VerletIntegrator.cpp
openmmapi/src/VerletIntegrator.cpp
+1
-3
platforms/reference/include/ReferenceCCMAAlgorithm.h
platforms/reference/include/ReferenceCCMAAlgorithm.h
+2
-6
platforms/reference/include/SimTKOpenMMUtilities.h
platforms/reference/include/SimTKOpenMMUtilities.h
+0
-86
platforms/reference/src/ReferenceKernels.cpp
platforms/reference/src/ReferenceKernels.cpp
+7
-34
platforms/reference/src/SimTKReference/ReferenceCCMAAlgorithm.cpp
...s/reference/src/SimTKReference/ReferenceCCMAAlgorithm.cpp
+4
-18
platforms/reference/src/SimTKReference/SimTKOpenMMUtilities.cpp
...rms/reference/src/SimTKReference/SimTKOpenMMUtilities.cpp
+0
-166
plugins/amoeba/openmmapi/include/openmm/internal/AmoebaGeneralizedKirkwoodForceImpl.h
...lude/openmm/internal/AmoebaGeneralizedKirkwoodForceImpl.h
+1
-1
plugins/amoeba/openmmapi/include/openmm/internal/AmoebaMultipoleForceImpl.h
...nmmapi/include/openmm/internal/AmoebaMultipoleForceImpl.h
+1
-1
plugins/amoeba/openmmapi/include/openmm/internal/AmoebaTorsionTorsionForceImpl.h
...i/include/openmm/internal/AmoebaTorsionTorsionForceImpl.h
+1
-1
No files found.
openmmapi/src/MonteCarloMembraneBarostatImpl.cpp
View file @
c24c619e
...
@@ -143,17 +143,13 @@ void MonteCarloMembraneBarostatImpl::updateContextState(ContextImpl& context, bo
...
@@ -143,17 +143,13 @@ void MonteCarloMembraneBarostatImpl::updateContextState(ContextImpl& context, bo
}
}
map
<
string
,
double
>
MonteCarloMembraneBarostatImpl
::
getDefaultParameters
()
{
map
<
string
,
double
>
MonteCarloMembraneBarostatImpl
::
getDefaultParameters
()
{
map
<
string
,
double
>
parameters
;
return
{{
MonteCarloMembraneBarostat
::
Pressure
(),
getOwner
().
getDefaultPressure
()},
parameters
[
MonteCarloMembraneBarostat
::
Pressure
()]
=
getOwner
().
getDefaultPressure
();
{
MonteCarloMembraneBarostat
::
SurfaceTension
(),
getOwner
().
getDefaultSurfaceTension
()},
parameters
[
MonteCarloMembraneBarostat
::
SurfaceTension
()]
=
getOwner
().
getDefaultSurfaceTension
();
{
MonteCarloMembraneBarostat
::
Temperature
(),
getOwner
().
getDefaultTemperature
()}};
parameters
[
MonteCarloMembraneBarostat
::
Temperature
()]
=
getOwner
().
getDefaultTemperature
();
return
parameters
;
}
}
vector
<
string
>
MonteCarloMembraneBarostatImpl
::
getKernelNames
()
{
vector
<
string
>
MonteCarloMembraneBarostatImpl
::
getKernelNames
()
{
vector
<
string
>
names
;
return
{
ApplyMonteCarloBarostatKernel
::
Name
()};
names
.
push_back
(
ApplyMonteCarloBarostatKernel
::
Name
());
return
names
;
}
}
Vec3
MonteCarloMembraneBarostatImpl
::
computeCurrentPressure
(
ContextImpl
&
context
)
{
Vec3
MonteCarloMembraneBarostatImpl
::
computeCurrentPressure
(
ContextImpl
&
context
)
{
...
...
openmmapi/src/NonbondedForceImpl.cpp
View file @
c24c619e
...
@@ -153,9 +153,7 @@ map<string, double> NonbondedForceImpl::getDefaultParameters() {
...
@@ -153,9 +153,7 @@ map<string, double> NonbondedForceImpl::getDefaultParameters() {
}
}
std
::
vector
<
std
::
string
>
NonbondedForceImpl
::
getKernelNames
()
{
std
::
vector
<
std
::
string
>
NonbondedForceImpl
::
getKernelNames
()
{
std
::
vector
<
std
::
string
>
names
;
return
{
CalcNonbondedForceKernel
::
Name
()};
names
.
push_back
(
CalcNonbondedForceKernel
::
Name
());
return
names
;
}
}
class
NonbondedForceImpl
::
ErrorFunction
{
class
NonbondedForceImpl
::
ErrorFunction
{
...
...
openmmapi/src/NoseHooverIntegrator.cpp
View file @
c24c619e
...
@@ -348,9 +348,7 @@ void NoseHooverIntegrator::cleanup() {
...
@@ -348,9 +348,7 @@ void NoseHooverIntegrator::cleanup() {
}
}
vector
<
string
>
NoseHooverIntegrator
::
getKernelNames
()
{
vector
<
string
>
NoseHooverIntegrator
::
getKernelNames
()
{
std
::
vector
<
std
::
string
>
names
;
return
{
IntegrateNoseHooverStepKernel
::
Name
()};
names
.
push_back
(
IntegrateNoseHooverStepKernel
::
Name
());
return
names
;
}
}
void
NoseHooverIntegrator
::
step
(
int
steps
)
{
void
NoseHooverIntegrator
::
step
(
int
steps
)
{
...
...
openmmapi/src/OrientationRestraintForceImpl.cpp
View file @
c24c619e
...
@@ -78,9 +78,7 @@ double OrientationRestraintForceImpl::calcForcesAndEnergy(ContextImpl& context,
...
@@ -78,9 +78,7 @@ double OrientationRestraintForceImpl::calcForcesAndEnergy(ContextImpl& context,
}
}
vector
<
string
>
OrientationRestraintForceImpl
::
getKernelNames
()
{
vector
<
string
>
OrientationRestraintForceImpl
::
getKernelNames
()
{
vector
<
string
>
names
;
return
{
CalcOrientationRestraintForceKernel
::
Name
()};
names
.
push_back
(
CalcOrientationRestraintForceKernel
::
Name
());
return
names
;
}
}
void
OrientationRestraintForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
void
OrientationRestraintForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
...
...
openmmapi/src/PeriodicTorsionForceImpl.cpp
View file @
c24c619e
...
@@ -71,9 +71,7 @@ double PeriodicTorsionForceImpl::calcForcesAndEnergy(ContextImpl& context, bool
...
@@ -71,9 +71,7 @@ double PeriodicTorsionForceImpl::calcForcesAndEnergy(ContextImpl& context, bool
}
}
std
::
vector
<
std
::
string
>
PeriodicTorsionForceImpl
::
getKernelNames
()
{
std
::
vector
<
std
::
string
>
PeriodicTorsionForceImpl
::
getKernelNames
()
{
std
::
vector
<
std
::
string
>
names
;
return
{
CalcPeriodicTorsionForceKernel
::
Name
()};
names
.
push_back
(
CalcPeriodicTorsionForceKernel
::
Name
());
return
names
;
}
}
void
PeriodicTorsionForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
,
int
firstTorsion
,
int
lastTorsion
)
{
void
PeriodicTorsionForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
,
int
firstTorsion
,
int
lastTorsion
)
{
...
...
openmmapi/src/QTBIntegrator.cpp
View file @
c24c619e
...
@@ -122,9 +122,7 @@ void QTBIntegrator::cleanup() {
...
@@ -122,9 +122,7 @@ void QTBIntegrator::cleanup() {
}
}
vector
<
string
>
QTBIntegrator
::
getKernelNames
()
{
vector
<
string
>
QTBIntegrator
::
getKernelNames
()
{
vector
<
std
::
string
>
names
;
return
{
IntegrateQTBStepKernel
::
Name
()};
names
.
push_back
(
IntegrateQTBStepKernel
::
Name
());
return
names
;
}
}
double
QTBIntegrator
::
computeKineticEnergy
()
{
double
QTBIntegrator
::
computeKineticEnergy
()
{
...
...
openmmapi/src/RBTorsionForceImpl.cpp
View file @
c24c619e
...
@@ -69,9 +69,7 @@ double RBTorsionForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includ
...
@@ -69,9 +69,7 @@ double RBTorsionForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includ
}
}
std
::
vector
<
std
::
string
>
RBTorsionForceImpl
::
getKernelNames
()
{
std
::
vector
<
std
::
string
>
RBTorsionForceImpl
::
getKernelNames
()
{
std
::
vector
<
std
::
string
>
names
;
return
{
CalcRBTorsionForceKernel
::
Name
()};
names
.
push_back
(
CalcRBTorsionForceKernel
::
Name
());
return
names
;
}
}
void
RBTorsionForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
void
RBTorsionForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
...
...
openmmapi/src/RGForceImpl.cpp
View file @
c24c619e
...
@@ -76,7 +76,5 @@ double RGForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces
...
@@ -76,7 +76,5 @@ double RGForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces
}
}
vector
<
string
>
RGForceImpl
::
getKernelNames
()
{
vector
<
string
>
RGForceImpl
::
getKernelNames
()
{
vector
<
string
>
names
;
return
{
CalcRGForceKernel
::
Name
()};
names
.
push_back
(
CalcRGForceKernel
::
Name
());
return
names
;
}
}
openmmapi/src/RMSDForceImpl.cpp
View file @
c24c619e
...
@@ -78,9 +78,7 @@ double RMSDForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForc
...
@@ -78,9 +78,7 @@ double RMSDForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForc
}
}
vector
<
string
>
RMSDForceImpl
::
getKernelNames
()
{
vector
<
string
>
RMSDForceImpl
::
getKernelNames
()
{
vector
<
string
>
names
;
return
{
CalcRMSDForceKernel
::
Name
()};
names
.
push_back
(
CalcRMSDForceKernel
::
Name
());
return
names
;
}
}
void
RMSDForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
void
RMSDForceImpl
::
updateParametersInContext
(
ContextImpl
&
context
)
{
...
...
openmmapi/src/VariableLangevinIntegrator.cpp
View file @
c24c619e
...
@@ -88,9 +88,7 @@ void VariableLangevinIntegrator::cleanup() {
...
@@ -88,9 +88,7 @@ void VariableLangevinIntegrator::cleanup() {
}
}
vector
<
string
>
VariableLangevinIntegrator
::
getKernelNames
()
{
vector
<
string
>
VariableLangevinIntegrator
::
getKernelNames
()
{
std
::
vector
<
std
::
string
>
names
;
return
{
IntegrateVariableLangevinStepKernel
::
Name
()};
names
.
push_back
(
IntegrateVariableLangevinStepKernel
::
Name
());
return
names
;
}
}
double
VariableLangevinIntegrator
::
computeKineticEnergy
()
{
double
VariableLangevinIntegrator
::
computeKineticEnergy
()
{
...
...
openmmapi/src/VariableVerletIntegrator.cpp
View file @
c24c619e
...
@@ -70,9 +70,7 @@ void VariableVerletIntegrator::cleanup() {
...
@@ -70,9 +70,7 @@ void VariableVerletIntegrator::cleanup() {
}
}
vector
<
string
>
VariableVerletIntegrator
::
getKernelNames
()
{
vector
<
string
>
VariableVerletIntegrator
::
getKernelNames
()
{
std
::
vector
<
std
::
string
>
names
;
return
{
IntegrateVariableVerletStepKernel
::
Name
()};
names
.
push_back
(
IntegrateVariableVerletStepKernel
::
Name
());
return
names
;
}
}
double
VariableVerletIntegrator
::
computeKineticEnergy
()
{
double
VariableVerletIntegrator
::
computeKineticEnergy
()
{
...
...
openmmapi/src/VerletIntegrator.cpp
View file @
c24c619e
...
@@ -57,9 +57,7 @@ void VerletIntegrator::cleanup() {
...
@@ -57,9 +57,7 @@ void VerletIntegrator::cleanup() {
}
}
vector
<
string
>
VerletIntegrator
::
getKernelNames
()
{
vector
<
string
>
VerletIntegrator
::
getKernelNames
()
{
std
::
vector
<
std
::
string
>
names
;
return
{
IntegrateVerletStepKernel
::
Name
()};
names
.
push_back
(
IntegrateVerletStepKernel
::
Name
());
return
names
;
}
}
double
VerletIntegrator
::
computeKineticEnergy
()
{
double
VerletIntegrator
::
computeKineticEnergy
()
{
...
...
platforms/reference/include/ReferenceCCMAAlgorithm.h
View file @
c24c619e
...
@@ -43,10 +43,8 @@ protected:
...
@@ -43,10 +43,8 @@ protected:
std
::
vector
<
std
::
pair
<
int
,
int
>
>
_atomIndices
;
std
::
vector
<
std
::
pair
<
int
,
int
>
>
_atomIndices
;
std
::
vector
<
double
>
_distance
;
std
::
vector
<
double
>
_distance
;
std
::
vector
<
OpenMM
::
Vec3
>
_r_ij
;
std
::
vector
<
OpenMM
::
Vec3
>
r_ij
;
double
*
_d_ij2
;
std
::
vector
<
double
>
d_ij2
,
_distanceTolerance
,
reducedMasses
;
double
*
_distanceTolerance
;
double
*
_reducedMasses
;
bool
_hasInitializedMasses
;
bool
_hasInitializedMasses
;
std
::
vector
<
std
::
vector
<
std
::
pair
<
int
,
double
>
>
>
_matrix
;
std
::
vector
<
std
::
vector
<
std
::
pair
<
int
,
double
>
>
>
_matrix
;
...
@@ -71,8 +69,6 @@ public:
...
@@ -71,8 +69,6 @@ public:
*/
*/
ReferenceCCMAAlgorithm
(
int
numberOfAtoms
,
int
numberOfConstraints
,
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>&
atomIndices
,
const
std
::
vector
<
double
>&
distance
,
std
::
vector
<
double
>&
masses
,
std
::
vector
<
AngleInfo
>&
angles
,
double
elementCutoff
);
ReferenceCCMAAlgorithm
(
int
numberOfAtoms
,
int
numberOfConstraints
,
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>&
atomIndices
,
const
std
::
vector
<
double
>&
distance
,
std
::
vector
<
double
>&
masses
,
std
::
vector
<
AngleInfo
>&
angles
,
double
elementCutoff
);
~
ReferenceCCMAAlgorithm
();
/**
/**
* Get the number of constraints.
* Get the number of constraints.
*/
*/
...
...
platforms/reference/include/SimTKOpenMMUtilities.h
View file @
c24c619e
...
@@ -58,92 +58,6 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
...
@@ -58,92 +58,6 @@ class OPENMM_EXPORT SimTKOpenMMUtilities {
SimTKOpenMMUtilities
()
{};
SimTKOpenMMUtilities
()
{};
~
SimTKOpenMMUtilities
()
{};
~
SimTKOpenMMUtilities
()
{};
/**---------------------------------------------------------------------------------------
Allocate 1D double array (Simbios)
array[i]
@param iSize i-dimension
@param array1D array (if null on entry allocated)
@param initialize if true, then initialize array
@param initialValue intitial value
@param idString id string
@return array
--------------------------------------------------------------------------------------- */
static
double
*
allocateOneDRealOpenMMArray
(
int
iSize
,
double
*
array1D
,
int
initialize
,
double
initialValue
,
const
std
::
string
&
idString
=
std
::
string
(
"1DArray"
));
/**---------------------------------------------------------------------------------------
Allocate 2D double array (Simbios)
array[i][j]
@param iSize i-dimension
@param jSize j-dimension
@param array2D array (if null on entry allocated)
@param initialize if true, then initialize array
@param initialValue intitial value
@param idString id string
@return array
--------------------------------------------------------------------------------------- */
static
double
**
allocateTwoDRealOpenMMArray
(
int
iSize
,
int
jSize
,
double
**
array2D
,
int
initialize
,
double
initialValue
,
const
std
::
string
&
idString
=
std
::
string
(
"2DArray"
));
/* ---------------------------------------------------------------------------------------
Free 2D double array (Simbios)
array[i][j]
@param array2D array (if null on entry allocated)
@param idString id string
--------------------------------------------------------------------------------------- */
static
void
freeOneDRealOpenMMArray
(
double
*
array1D
,
const
std
::
string
&
idString
=
std
::
string
(
"1DArray"
));
/* ---------------------------------------------------------------------------------------
Free 2D double array (Simbios)
array[i][j]
@param array2D array (if null on entry allocated)
@param idString id string
--------------------------------------------------------------------------------------- */
static
void
freeTwoDRealOpenMMArray
(
double
**
array2D
,
const
std
::
string
&
idString
=
std
::
string
(
"2DArray"
));
/**---------------------------------------------------------------------------------------
Initialize 2D double array (Simbios)
array[i][j]
@param iSize i-dimension
@param jSize j-dimension
@param array2D array (if null on entry allocated)
@param initialValue intitial value
--------------------------------------------------------------------------------------- */
static
void
initialize2DRealOpenMMArray
(
int
iSize
,
int
jSize
,
double
**
array2D
,
double
initialValue
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
...
...
platforms/reference/src/ReferenceKernels.cpp
View file @
c24c619e
...
@@ -173,11 +173,8 @@ void ReferenceCalcForcesAndEnergyKernel::beginComputation(ContextImpl& context,
...
@@ -173,11 +173,8 @@ void ReferenceCalcForcesAndEnergyKernel::beginComputation(ContextImpl& context,
vector
<
Vec3
>&
forceData
=
extractForces
(
context
);
vector
<
Vec3
>&
forceData
=
extractForces
(
context
);
if
(
includeForces
)
{
if
(
includeForces
)
{
int
numParticles
=
context
.
getSystem
().
getNumParticles
();
int
numParticles
=
context
.
getSystem
().
getNumParticles
();
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
{
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
forceData
[
i
][
0
]
=
0.0
;
forceData
[
i
]
=
Vec3
();
forceData
[
i
][
1
]
=
0.0
;
forceData
[
i
][
2
]
=
0.0
;
}
}
}
else
else
savedForces
=
forceData
;
savedForces
=
forceData
;
...
@@ -217,39 +214,19 @@ void ReferenceUpdateStateDataKernel::setStepCount(const ContextImpl& context, lo
...
@@ -217,39 +214,19 @@ void ReferenceUpdateStateDataKernel::setStepCount(const ContextImpl& context, lo
}
}
void
ReferenceUpdateStateDataKernel
::
getPositions
(
ContextImpl
&
context
,
std
::
vector
<
Vec3
>&
positions
)
{
void
ReferenceUpdateStateDataKernel
::
getPositions
(
ContextImpl
&
context
,
std
::
vector
<
Vec3
>&
positions
)
{
int
numParticles
=
context
.
getSystem
().
getNumParticles
();
positions
=
extractPositions
(
context
);
vector
<
Vec3
>&
posData
=
extractPositions
(
context
);
positions
.
resize
(
numParticles
);
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
positions
[
i
]
=
Vec3
(
posData
[
i
][
0
],
posData
[
i
][
1
],
posData
[
i
][
2
]);
}
}
void
ReferenceUpdateStateDataKernel
::
setPositions
(
ContextImpl
&
context
,
const
std
::
vector
<
Vec3
>&
positions
)
{
void
ReferenceUpdateStateDataKernel
::
setPositions
(
ContextImpl
&
context
,
const
std
::
vector
<
Vec3
>&
positions
)
{
int
numParticles
=
context
.
getSystem
().
getNumParticles
();
extractPositions
(
context
)
=
positions
;
vector
<
Vec3
>&
posData
=
extractPositions
(
context
);
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
{
posData
[
i
][
0
]
=
positions
[
i
][
0
];
posData
[
i
][
1
]
=
positions
[
i
][
1
];
posData
[
i
][
2
]
=
positions
[
i
][
2
];
}
}
}
void
ReferenceUpdateStateDataKernel
::
getVelocities
(
ContextImpl
&
context
,
std
::
vector
<
Vec3
>&
velocities
)
{
void
ReferenceUpdateStateDataKernel
::
getVelocities
(
ContextImpl
&
context
,
std
::
vector
<
Vec3
>&
velocities
)
{
int
numParticles
=
context
.
getSystem
().
getNumParticles
();
velocities
=
extractVelocities
(
context
);
vector
<
Vec3
>&
velData
=
extractVelocities
(
context
);
velocities
.
resize
(
numParticles
);
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
velocities
[
i
]
=
Vec3
(
velData
[
i
][
0
],
velData
[
i
][
1
],
velData
[
i
][
2
]);
}
}
void
ReferenceUpdateStateDataKernel
::
setVelocities
(
ContextImpl
&
context
,
const
std
::
vector
<
Vec3
>&
velocities
)
{
void
ReferenceUpdateStateDataKernel
::
setVelocities
(
ContextImpl
&
context
,
const
std
::
vector
<
Vec3
>&
velocities
)
{
int
numParticles
=
context
.
getSystem
().
getNumParticles
();
extractVelocities
(
context
)
=
velocities
;
vector
<
Vec3
>&
velData
=
extractVelocities
(
context
);
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
{
velData
[
i
][
0
]
=
velocities
[
i
][
0
];
velData
[
i
][
1
]
=
velocities
[
i
][
1
];
velData
[
i
][
2
]
=
velocities
[
i
][
2
];
}
}
}
void
ReferenceUpdateStateDataKernel
::
computeShiftedVelocities
(
ContextImpl
&
context
,
double
timeShift
,
std
::
vector
<
Vec3
>&
velocities
)
{
void
ReferenceUpdateStateDataKernel
::
computeShiftedVelocities
(
ContextImpl
&
context
,
double
timeShift
,
std
::
vector
<
Vec3
>&
velocities
)
{
...
@@ -280,11 +257,7 @@ void ReferenceUpdateStateDataKernel::computeShiftedVelocities(ContextImpl& conte
...
@@ -280,11 +257,7 @@ void ReferenceUpdateStateDataKernel::computeShiftedVelocities(ContextImpl& conte
}
}
void
ReferenceUpdateStateDataKernel
::
getForces
(
ContextImpl
&
context
,
std
::
vector
<
Vec3
>&
forces
)
{
void
ReferenceUpdateStateDataKernel
::
getForces
(
ContextImpl
&
context
,
std
::
vector
<
Vec3
>&
forces
)
{
int
numParticles
=
context
.
getSystem
().
getNumParticles
();
forces
=
extractForces
(
context
);
vector
<
Vec3
>&
forceData
=
extractForces
(
context
);
forces
.
resize
(
numParticles
);
for
(
int
i
=
0
;
i
<
numParticles
;
++
i
)
forces
[
i
]
=
Vec3
(
forceData
[
i
][
0
],
forceData
[
i
][
1
],
forceData
[
i
][
2
]);
}
}
void
ReferenceUpdateStateDataKernel
::
getEnergyParameterDerivatives
(
ContextImpl
&
context
,
map
<
string
,
double
>&
derivs
)
{
void
ReferenceUpdateStateDataKernel
::
getEnergyParameterDerivatives
(
ContextImpl
&
context
,
map
<
string
,
double
>&
derivs
)
{
...
...
platforms/reference/src/SimTKReference/ReferenceCCMAAlgorithm.cpp
View file @
c24c619e
...
@@ -57,10 +57,10 @@ ReferenceCCMAAlgorithm::ReferenceCCMAAlgorithm(int numberOfAtoms,
...
@@ -57,10 +57,10 @@ ReferenceCCMAAlgorithm::ReferenceCCMAAlgorithm(int numberOfAtoms,
// work arrays
// work arrays
if
(
_numberOfConstraints
>
0
)
{
if
(
_numberOfConstraints
>
0
)
{
_
r_ij
.
resize
(
numberOfConstraints
);
r_ij
.
resize
(
numberOfConstraints
);
_
d_ij2
=
SimTKOpenMMUtilities
::
allocateOneDRealOpenMMArray
(
numberOfConstraints
,
NULL
,
1
,
0.0
,
"dij_2"
);
d_ij2
.
resize
(
numberOfConstraints
);
_distanceTolerance
=
SimTKOpenMMUtilities
::
allocateOneDRealOpenMMArray
(
numberOfConstraints
,
NULL
,
1
,
0.0
,
"distanceTolerance"
);
_distanceTolerance
.
resize
(
numberOfConstraints
);
_
reducedMasses
=
SimTKOpenMMUtilities
::
allocateOneDRealOpenMMArray
(
numberOfConstraints
,
NULL
,
1
,
0.0
,
"reducedMasses"
);
reducedMasses
.
resize
(
numberOfConstraints
);
}
}
if
(
numberOfConstraints
>
0
)
if
(
numberOfConstraints
>
0
)
{
{
...
@@ -201,14 +201,6 @@ ReferenceCCMAAlgorithm::ReferenceCCMAAlgorithm(int numberOfAtoms,
...
@@ -201,14 +201,6 @@ ReferenceCCMAAlgorithm::ReferenceCCMAAlgorithm(int numberOfAtoms,
}
}
}
}
ReferenceCCMAAlgorithm
::~
ReferenceCCMAAlgorithm
()
{
if
(
_numberOfConstraints
>
0
)
{
SimTKOpenMMUtilities
::
freeOneDRealOpenMMArray
(
_d_ij2
,
"d_ij2"
);
SimTKOpenMMUtilities
::
freeOneDRealOpenMMArray
(
_distanceTolerance
,
"distanceTolerance"
);
SimTKOpenMMUtilities
::
freeOneDRealOpenMMArray
(
_reducedMasses
,
"reducedMasses"
);
}
}
int
ReferenceCCMAAlgorithm
::
getNumberOfConstraints
()
const
{
int
ReferenceCCMAAlgorithm
::
getNumberOfConstraints
()
const
{
return
_numberOfConstraints
;
return
_numberOfConstraints
;
}
}
...
@@ -235,12 +227,6 @@ void ReferenceCCMAAlgorithm::applyToVelocities(std::vector<OpenMM::Vec3>& atomCo
...
@@ -235,12 +227,6 @@ void ReferenceCCMAAlgorithm::applyToVelocities(std::vector<OpenMM::Vec3>& atomCo
void
ReferenceCCMAAlgorithm
::
applyConstraints
(
vector
<
Vec3
>&
atomCoordinates
,
void
ReferenceCCMAAlgorithm
::
applyConstraints
(
vector
<
Vec3
>&
atomCoordinates
,
vector
<
Vec3
>&
atomCoordinatesP
,
vector
<
Vec3
>&
atomCoordinatesP
,
vector
<
double
>&
inverseMasses
,
bool
constrainingVelocities
,
double
tolerance
)
{
vector
<
double
>&
inverseMasses
,
bool
constrainingVelocities
,
double
tolerance
)
{
// temp arrays
vector
<
Vec3
>&
r_ij
=
_r_ij
;
double
*
d_ij2
=
_d_ij2
;
double
*
reducedMasses
=
_reducedMasses
;
// calculate reduced masses on 1st pass
// calculate reduced masses on 1st pass
if
(
!
_hasInitializedMasses
)
{
if
(
!
_hasInitializedMasses
)
{
...
...
platforms/reference/src/SimTKReference/SimTKOpenMMUtilities.cpp
View file @
c24c619e
...
@@ -43,172 +43,6 @@ bool SimTKOpenMMUtilities::nextGaussianIsValid = false;
...
@@ -43,172 +43,6 @@ bool SimTKOpenMMUtilities::nextGaussianIsValid = false;
double
SimTKOpenMMUtilities
::
nextGaussian
=
0
;
double
SimTKOpenMMUtilities
::
nextGaussian
=
0
;
OpenMM_SFMT
::
SFMT
SimTKOpenMMUtilities
::
sfmt
;
OpenMM_SFMT
::
SFMT
SimTKOpenMMUtilities
::
sfmt
;
/* ---------------------------------------------------------------------------------------
Allocate 1D double array (Simbios)
array[i]
@param iSize i-dimension
@param array1D array (if null on entry allocated)
@param initialize if true, then initialize array
@param initialValue intitial value
@param idString id string
@return allocated array
--------------------------------------------------------------------------------------- */
double
*
SimTKOpenMMUtilities
::
allocateOneDRealOpenMMArray
(
int
iSize
,
double
*
array1D
,
int
initialize
,
double
initialValue
,
const
std
::
string
&
idString
)
{
if
(
array1D
==
NULL
)
{
array1D
=
new
double
[
iSize
];
}
if
(
initialize
)
{
if
(
initialValue
==
0.0
)
{
memset
(
array1D
,
0
,
iSize
*
sizeof
(
double
));
}
else
{
for
(
int
ii
=
0
;
ii
<
iSize
;
ii
++
)
{
array1D
[
ii
]
=
initialValue
;
}
}
}
return
array1D
;
}
/* ---------------------------------------------------------------------------------------
Allocate 2D double array (Simbios)
array[i][j]
@param iSize i-dimension
@param jSize j-dimension
@param array2D array (if null on entry allocated)
@param initialize if true, then initialize array
@param initialValue intitial value
@param idString id string
@return allocated array
--------------------------------------------------------------------------------------- */
double
**
SimTKOpenMMUtilities
::
allocateTwoDRealOpenMMArray
(
int
iSize
,
int
jSize
,
double
**
array2D
,
int
initialize
,
double
initialValue
,
const
std
::
string
&
idString
)
{
if
(
array2D
==
NULL
)
{
array2D
=
new
double
*
[
iSize
];
std
::
string
blockString
=
idString
;
blockString
.
append
(
"Block"
);
double
*
block
=
new
double
[
jSize
*
iSize
];
for
(
int
ii
=
0
;
ii
<
iSize
;
ii
++
)
{
array2D
[
ii
]
=
block
;
block
+=
jSize
;
}
}
if
(
initialize
)
{
initialize2DRealOpenMMArray
(
iSize
,
jSize
,
array2D
,
initialValue
);
}
return
array2D
;
}
/* ---------------------------------------------------------------------------------------
Free 2D double array (Simbios)
array[i][j]
@param array2D array (if null on entry allocated)
@param idString id string
--------------------------------------------------------------------------------------- */
void
SimTKOpenMMUtilities
::
freeTwoDRealOpenMMArray
(
double
**
array2D
,
const
std
::
string
&
idString
)
{
if
(
array2D
!=
NULL
)
{
std
::
string
blockString
=
idString
;
blockString
.
append
(
"Block"
);
delete
[]
array2D
[
0
];
delete
[]
array2D
;
}
}
/* ---------------------------------------------------------------------------------------
Free 1D double array (Simbios)
array[i]
@param array1D array (if null on entry allocated)
@param idString id string
--------------------------------------------------------------------------------------- */
void
SimTKOpenMMUtilities
::
freeOneDRealOpenMMArray
(
double
*
array1D
,
const
std
::
string
&
idString
)
{
if
(
array1D
!=
NULL
)
{
delete
[]
array1D
;
}
}
/* ---------------------------------------------------------------------------------------
Initialize 2D double array (Simbios)
array[i][j]
@param iSize i-dimension
@param jSize j-dimension
@param array2D array (if null on entry allocated)
@param initialValue intitial value
--------------------------------------------------------------------------------------- */
void
SimTKOpenMMUtilities
::
initialize2DRealOpenMMArray
(
int
iSize
,
int
jSize
,
double
**
array2D
,
double
initialValue
)
{
bool
useMemset
;
bool
useMemsetSingleBlock
;
if
(
initialValue
==
0.0
f
)
{
useMemset
=
true
;
if
(
jSize
>
1
&&
(
array2D
[
0
]
+
jSize
)
==
array2D
[
1
])
{
useMemsetSingleBlock
=
true
;
}
else
{
useMemsetSingleBlock
=
false
;
}
}
else
{
useMemset
=
false
;
}
if
(
useMemset
)
{
if
(
useMemsetSingleBlock
)
{
memset
(
array2D
[
0
],
0
,
iSize
*
jSize
*
sizeof
(
double
));
}
else
{
for
(
int
ii
=
0
;
ii
<
iSize
;
ii
++
)
{
memset
(
array2D
[
ii
],
0
,
jSize
*
sizeof
(
double
));
}
}
}
else
{
for
(
int
ii
=
0
;
ii
<
iSize
;
ii
++
)
{
for
(
int
jj
=
0
;
jj
<
jSize
;
jj
++
)
{
array2D
[
ii
][
jj
]
=
initialValue
;
}
}
}
}
/* ---------------------------------------------------------------------------------------
/* ---------------------------------------------------------------------------------------
Compute cross product of two 3-vectors and place in 3rd vector -- helper method
Compute cross product of two 3-vectors and place in 3rd vector -- helper method
...
...
plugins/amoeba/openmmapi/include/openmm/internal/AmoebaGeneralizedKirkwoodForceImpl.h
View file @
c24c619e
...
@@ -53,7 +53,7 @@ public:
...
@@ -53,7 +53,7 @@ public:
}
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
std
::
map
<
std
::
string
,
double
>
getDefaultParameters
()
{
std
::
map
<
std
::
string
,
double
>
getDefaultParameters
()
{
return
std
::
map
<
std
::
string
,
double
>
()
;
// This force field doesn't define any parameters.
return
{}
;
// This force field doesn't define any parameters.
}
}
std
::
vector
<
std
::
string
>
getKernelNames
();
std
::
vector
<
std
::
string
>
getKernelNames
();
Kernel
&
getKernel
()
{
Kernel
&
getKernel
()
{
...
...
plugins/amoeba/openmmapi/include/openmm/internal/AmoebaMultipoleForceImpl.h
View file @
c24c619e
...
@@ -56,7 +56,7 @@ public:
...
@@ -56,7 +56,7 @@ public:
}
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
std
::
map
<
std
::
string
,
double
>
getDefaultParameters
()
{
std
::
map
<
std
::
string
,
double
>
getDefaultParameters
()
{
return
std
::
map
<
std
::
string
,
double
>
()
;
// This force field doesn't define any parameters.
return
{}
;
// This force field doesn't define any parameters.
}
}
std
::
vector
<
std
::
string
>
getKernelNames
();
std
::
vector
<
std
::
string
>
getKernelNames
();
...
...
plugins/amoeba/openmmapi/include/openmm/internal/AmoebaTorsionTorsionForceImpl.h
View file @
c24c619e
...
@@ -55,7 +55,7 @@ public:
...
@@ -55,7 +55,7 @@ public:
}
}
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
double
calcForcesAndEnergy
(
ContextImpl
&
context
,
bool
includeForces
,
bool
includeEnergy
,
int
groups
);
std
::
map
<
std
::
string
,
double
>
getDefaultParameters
()
{
std
::
map
<
std
::
string
,
double
>
getDefaultParameters
()
{
return
std
::
map
<
std
::
string
,
double
>
()
;
// This force field doesn't define any parameters.
return
{}
;
// This force field doesn't define any parameters.
}
}
std
::
vector
<
std
::
string
>
getKernelNames
();
std
::
vector
<
std
::
string
>
getKernelNames
();
...
...
Prev
1
2
3
4
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