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
8469621f
Commit
8469621f
authored
Feb 23, 2017
by
peastman
Committed by
GitHub
Feb 23, 2017
Browse files
Merge pull request #1747 from peastman/realtype
Eliminated RealOpenMM
parents
b84e22ba
6813ca57
Changes
151
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
152 additions
and
275 deletions
+152
-275
platforms/cpu/src/CpuNonbondedForce.cpp
platforms/cpu/src/CpuNonbondedForce.cpp
+10
-10
platforms/cpu/src/CpuSETTLE.cpp
platforms/cpu/src/CpuSETTLE.cpp
+4
-4
platforms/cpu/tests/TestCpuNeighborList.cpp
platforms/cpu/tests/TestCpuNeighborList.cpp
+7
-7
platforms/cuda/src/CudaIntegrationUtilities.cpp
platforms/cuda/src/CudaIntegrationUtilities.cpp
+4
-4
platforms/opencl/src/OpenCLIntegrationUtilities.cpp
platforms/opencl/src/OpenCLIntegrationUtilities.cpp
+4
-4
platforms/opencl/src/OpenCLKernels.cpp
platforms/opencl/src/OpenCLKernels.cpp
+4
-1
platforms/opencl/src/kernels/pme.cl
platforms/opencl/src/kernels/pme.cl
+1
-1
platforms/reference/include/ObcParameters.h
platforms/reference/include/ObcParameters.h
+37
-37
platforms/reference/include/RealVec.h
platforms/reference/include/RealVec.h
+4
-133
platforms/reference/include/ReferenceAndersenThermostat.h
platforms/reference/include/ReferenceAndersenThermostat.h
+3
-2
platforms/reference/include/ReferenceAngleBondIxn.h
platforms/reference/include/ReferenceAngleBondIxn.h
+8
-7
platforms/reference/include/ReferenceBondForce.h
platforms/reference/include/ReferenceBondForce.h
+3
-3
platforms/reference/include/ReferenceBondIxn.h
platforms/reference/include/ReferenceBondIxn.h
+11
-11
platforms/reference/include/ReferenceBrownianDynamics.h
platforms/reference/include/ReferenceBrownianDynamics.h
+7
-7
platforms/reference/include/ReferenceCCMAAlgorithm.h
platforms/reference/include/ReferenceCCMAAlgorithm.h
+17
-17
platforms/reference/include/ReferenceCMAPTorsionIxn.h
platforms/reference/include/ReferenceCMAPTorsionIxn.h
+10
-10
platforms/reference/include/ReferenceConstraintAlgorithm.h
platforms/reference/include/ReferenceConstraintAlgorithm.h
+6
-5
platforms/reference/include/ReferenceConstraints.h
platforms/reference/include/ReferenceConstraints.h
+2
-2
platforms/reference/include/ReferenceCustomAngleIxn.h
platforms/reference/include/ReferenceCustomAngleIxn.h
+5
-5
platforms/reference/include/ReferenceCustomBondIxn.h
platforms/reference/include/ReferenceCustomBondIxn.h
+5
-5
No files found.
platforms/cpu/src/CpuNonbondedForce.cpp
View file @
8469621f
...
...
@@ -109,7 +109,7 @@ void CpuNonbondedForce::setUseSwitchingFunction(float distance) {
--------------------------------------------------------------------------------------- */
void
CpuNonbondedForce
::
setPeriodic
(
Real
Vec
*
periodicBoxVectors
)
{
void
CpuNonbondedForce
::
setPeriodic
(
Vec
3
*
periodicBoxVectors
)
{
assert
(
cutoff
);
assert
(
periodicBoxVectors
[
0
][
0
]
>=
2.0
*
cutoffDistance
);
...
...
@@ -241,9 +241,9 @@ void CpuNonbondedForce::tabulateExpTerms() {
}
}
void
CpuNonbondedForce
::
calculateReciprocalIxn
(
int
numberOfAtoms
,
float
*
posq
,
const
vector
<
Real
Vec
>&
atomCoordinates
,
void
CpuNonbondedForce
::
calculateReciprocalIxn
(
int
numberOfAtoms
,
float
*
posq
,
const
vector
<
Vec
3
>&
atomCoordinates
,
const
vector
<
pair
<
float
,
float
>
>&
atomParameters
,
const
vector
<
float
>
&
C6params
,
const
vector
<
set
<
int
>
>&
exclusions
,
vector
<
Real
Vec
>&
forces
,
double
*
totalEnergy
)
const
{
vector
<
Vec
3
>&
forces
,
double
*
totalEnergy
)
const
{
typedef
std
::
complex
<
float
>
d_complex
;
static
const
float
epsilon
=
1.0
;
...
...
@@ -256,10 +256,10 @@ void CpuNonbondedForce::calculateReciprocalIxn(int numberOfAtoms, float* posq, c
if
(
pme
)
{
pme_t
pmedata
;
pme_init
(
&
pmedata
,
alphaEwald
,
numberOfAtoms
,
meshDim
,
5
,
1
);
vector
<
RealOpenMM
>
charges
(
numberOfAtoms
);
vector
<
double
>
charges
(
numberOfAtoms
);
for
(
int
i
=
0
;
i
<
numberOfAtoms
;
i
++
)
charges
[
i
]
=
posq
[
4
*
i
+
3
];
RealOpenMM
recipEnergy
=
0.0
;
double
recipEnergy
=
0.0
;
pme_exec
(
pmedata
,
atomCoordinates
,
forces
,
charges
,
periodicBoxVectors
,
&
recipEnergy
);
if
(
totalEnergy
)
*
totalEnergy
+=
recipEnergy
;
...
...
@@ -269,12 +269,12 @@ void CpuNonbondedForce::calculateReciprocalIxn(int numberOfAtoms, float* posq, c
// Dispersion reciprocal space terms
pme_init
(
&
pmedata
,
alphaDispersionEwald
,
numberOfAtoms
,
dispersionMeshDim
,
5
,
1
);
std
::
vector
<
Real
Vec
>
dpmeforces
;
std
::
vector
<
Vec
3
>
dpmeforces
;
for
(
int
i
=
0
;
i
<
numberOfAtoms
;
i
++
){
charges
[
i
]
=
(
RealOpenMM
)
C6params
[
i
];
dpmeforces
.
push_back
(
Real
Vec
());
charges
[
i
]
=
C6params
[
i
];
dpmeforces
.
push_back
(
Vec
3
());
}
RealOpenMM
recipDispersionEnergy
=
0.0
;
double
recipDispersionEnergy
=
0.0
;
pme_exec_dpme
(
pmedata
,
atomCoordinates
,
dpmeforces
,
charges
,
periodicBoxVectors
,
&
recipDispersionEnergy
);
for
(
int
i
=
0
;
i
<
numberOfAtoms
;
i
++
){
forces
[
i
][
0
]
-=
2.0
*
dpmeforces
[
i
][
0
];
...
...
@@ -376,7 +376,7 @@ void CpuNonbondedForce::calculateReciprocalIxn(int numberOfAtoms, float* posq, c
}
void
CpuNonbondedForce
::
calculateDirectIxn
(
int
numberOfAtoms
,
float
*
posq
,
const
vector
<
Real
Vec
>&
atomCoordinates
,
const
vector
<
pair
<
float
,
float
>
>&
atomParameters
,
void
CpuNonbondedForce
::
calculateDirectIxn
(
int
numberOfAtoms
,
float
*
posq
,
const
vector
<
Vec
3
>&
atomCoordinates
,
const
vector
<
pair
<
float
,
float
>
>&
atomParameters
,
const
vector
<
float
>&
C6params
,
const
vector
<
set
<
int
>
>&
exclusions
,
vector
<
AlignedArray
<
float
>
>&
threadForce
,
double
*
totalEnergy
,
ThreadPool
&
threads
)
{
// Record the parameters for the threads.
...
...
platforms/cpu/src/CpuSETTLE.cpp
View file @
8469621f
...
...
@@ -38,7 +38,7 @@ using namespace std;
CpuSETTLE
::
CpuSETTLE
(
const
System
&
system
,
const
ReferenceSETTLEAlgorithm
&
settle
,
ThreadPool
&
threads
)
:
threads
(
threads
)
{
int
numBlocks
=
10
*
threads
.
getNumThreads
();
int
numClusters
=
settle
.
getNumClusters
();
vector
<
RealOpenMM
>
mass
(
system
.
getNumParticles
());
vector
<
double
>
mass
(
system
.
getNumParticles
());
for
(
int
i
=
0
;
i
<
system
.
getNumParticles
();
i
++
)
mass
[
i
]
=
system
.
getParticleMass
(
i
);
for
(
int
i
=
0
;
i
<
numBlocks
;
i
++
)
{
...
...
@@ -47,7 +47,7 @@ CpuSETTLE::CpuSETTLE(const System& system, const ReferenceSETTLEAlgorithm& settl
if
(
start
!=
end
)
{
int
numThreadClusters
=
end
-
start
;
vector
<
int
>
atom1
(
numThreadClusters
),
atom2
(
numThreadClusters
),
atom3
(
numThreadClusters
);
vector
<
RealOpenMM
>
distance1
(
numThreadClusters
),
distance2
(
numThreadClusters
);
vector
<
double
>
distance1
(
numThreadClusters
),
distance2
(
numThreadClusters
);
for
(
int
j
=
0
;
j
<
numThreadClusters
;
j
++
)
settle
.
getClusterParameters
(
start
+
j
,
atom1
[
j
],
atom2
[
j
],
atom3
[
j
],
distance1
[
j
],
distance2
[
j
]);
threadSettle
.
push_back
(
new
ReferenceSETTLEAlgorithm
(
atom1
,
atom2
,
atom3
,
distance1
,
distance2
,
mass
));
...
...
@@ -60,7 +60,7 @@ CpuSETTLE::~CpuSETTLE() {
delete
threadSettle
[
i
];
}
void
CpuSETTLE
::
apply
(
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinatesP
,
vector
<
RealOpenMM
>&
inverseMasses
,
RealOpenMM
tolerance
)
{
void
CpuSETTLE
::
apply
(
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
vector
<
OpenMM
::
Vec
3
>&
atomCoordinatesP
,
vector
<
double
>&
inverseMasses
,
double
tolerance
)
{
gmx_atomic_t
atomicCounter
;
gmx_atomic_set
(
&
atomicCounter
,
0
);
threads
.
execute
([
&
]
(
ThreadPool
&
threads
,
int
threadIndex
)
{
...
...
@@ -74,7 +74,7 @@ void CpuSETTLE::apply(vector<OpenMM::RealVec>& atomCoordinates, vector<OpenMM::R
threads
.
waitForThreads
();
}
void
CpuSETTLE
::
applyToVelocities
(
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
vector
<
OpenMM
::
Real
Vec
>&
velocities
,
vector
<
RealOpenMM
>&
inverseMasses
,
RealOpenMM
tolerance
)
{
void
CpuSETTLE
::
applyToVelocities
(
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
vector
<
OpenMM
::
Vec
3
>&
velocities
,
vector
<
double
>&
inverseMasses
,
double
tolerance
)
{
gmx_atomic_t
atomicCounter
;
gmx_atomic_set
(
&
atomicCounter
,
0
);
threads
.
execute
([
&
]
(
ThreadPool
&
threads
,
int
threadIndex
)
{
...
...
platforms/cpu/tests/TestCpuNeighborList.cpp
View file @
8469621f
...
...
@@ -51,16 +51,16 @@ using namespace std;
void
testNeighborList
(
bool
periodic
,
bool
triclinic
)
{
const
int
numParticles
=
500
;
const
float
cutoff
=
2.0
f
;
Real
Vec
boxVectors
[
3
];
Vec
3
boxVectors
[
3
];
if
(
triclinic
)
{
boxVectors
[
0
]
=
Real
Vec
(
10
,
0
,
0
);
boxVectors
[
1
]
=
Real
Vec
(
4
,
9
,
0
);
boxVectors
[
2
]
=
Real
Vec
(
-
3
,
-
3.5
,
11
);
boxVectors
[
0
]
=
Vec
3
(
10
,
0
,
0
);
boxVectors
[
1
]
=
Vec
3
(
4
,
9
,
0
);
boxVectors
[
2
]
=
Vec
3
(
-
3
,
-
3.5
,
11
);
}
else
{
boxVectors
[
0
]
=
Real
Vec
(
10
,
0
,
0
);
boxVectors
[
1
]
=
Real
Vec
(
0
,
9
,
0
);
boxVectors
[
2
]
=
Real
Vec
(
0
,
0
,
11
);
boxVectors
[
0
]
=
Vec
3
(
10
,
0
,
0
);
boxVectors
[
1
]
=
Vec
3
(
0
,
9
,
0
);
boxVectors
[
2
]
=
Vec
3
(
0
,
0
,
11
);
}
const
float
boxSize
[
3
]
=
{(
float
)
boxVectors
[
0
][
0
],
(
float
)
boxVectors
[
1
][
1
],
(
float
)
boxVectors
[
2
][
2
]};
const
int
blockSize
=
8
;
...
...
platforms/cuda/src/CudaIntegrationUtilities.cpp
View file @
8469621f
...
...
@@ -310,15 +310,15 @@ CudaIntegrationUtilities::CudaIntegrationUtilities(CudaContext& context, const S
// Record information needed by ReferenceCCMAAlgorithm.
vector
<
pair
<
int
,
int
>
>
refIndices
(
numCCMA
);
vector
<
RealOpenMM
>
refDistance
(
numCCMA
);
vector
<
double
>
refDistance
(
numCCMA
);
for
(
int
i
=
0
;
i
<
numCCMA
;
i
++
)
{
int
index
=
ccmaConstraints
[
i
];
refIndices
[
i
]
=
make_pair
(
atom1
[
index
],
atom2
[
index
]);
refDistance
[
i
]
=
distance
[
index
];
}
vector
<
RealOpenMM
>
refMasses
(
numAtoms
);
vector
<
double
>
refMasses
(
numAtoms
);
for
(
int
i
=
0
;
i
<
numAtoms
;
++
i
)
refMasses
[
i
]
=
(
RealOpenMM
)
system
.
getParticleMass
(
i
);
refMasses
[
i
]
=
system
.
getParticleMass
(
i
);
// Look up angles for CCMA.
...
...
@@ -330,7 +330,7 @@ CudaIntegrationUtilities::CudaIntegrationUtilities(CudaContext& context, const S
int
atom1
,
atom2
,
atom3
;
double
angle
,
k
;
force
->
getAngleParameters
(
j
,
atom1
,
atom2
,
atom3
,
angle
,
k
);
angles
.
push_back
(
ReferenceCCMAAlgorithm
::
AngleInfo
(
atom1
,
atom2
,
atom3
,
(
RealOpenMM
)
angle
));
angles
.
push_back
(
ReferenceCCMAAlgorithm
::
AngleInfo
(
atom1
,
atom2
,
atom3
,
angle
));
}
}
}
...
...
platforms/opencl/src/OpenCLIntegrationUtilities.cpp
View file @
8469621f
...
...
@@ -329,15 +329,15 @@ OpenCLIntegrationUtilities::OpenCLIntegrationUtilities(OpenCLContext& context, c
// Record information needed by ReferenceCCMAAlgorithm.
vector
<
pair
<
int
,
int
>
>
refIndices
(
numCCMA
);
vector
<
RealOpenMM
>
refDistance
(
numCCMA
);
vector
<
double
>
refDistance
(
numCCMA
);
for
(
int
i
=
0
;
i
<
numCCMA
;
i
++
)
{
int
index
=
ccmaConstraints
[
i
];
refIndices
[
i
]
=
make_pair
(
atom1
[
index
],
atom2
[
index
]);
refDistance
[
i
]
=
distance
[
index
];
}
vector
<
RealOpenMM
>
refMasses
(
numAtoms
);
vector
<
double
>
refMasses
(
numAtoms
);
for
(
int
i
=
0
;
i
<
numAtoms
;
++
i
)
refMasses
[
i
]
=
(
RealOpenMM
)
system
.
getParticleMass
(
i
);
refMasses
[
i
]
=
(
double
)
system
.
getParticleMass
(
i
);
// Look up angles for CCMA.
...
...
@@ -349,7 +349,7 @@ OpenCLIntegrationUtilities::OpenCLIntegrationUtilities(OpenCLContext& context, c
int
atom1
,
atom2
,
atom3
;
double
angle
,
k
;
force
->
getAngleParameters
(
j
,
atom1
,
atom2
,
atom3
,
angle
,
k
);
angles
.
push_back
(
ReferenceCCMAAlgorithm
::
AngleInfo
(
atom1
,
atom2
,
atom3
,
(
RealOpenMM
)
angle
));
angles
.
push_back
(
ReferenceCCMAAlgorithm
::
AngleInfo
(
atom1
,
atom2
,
atom3
,
angle
));
}
}
}
...
...
platforms/opencl/src/OpenCLKernels.cpp
View file @
8469621f
...
...
@@ -2077,7 +2077,10 @@ double OpenCLCalcNonbondedForceKernel::execute(ContextImpl& context, bool includ
else
pmeDispersionSpreadChargeKernel.setArg<cl::Buffer>(3, pmeGrid->getDeviceBuffer());
pmeDispersionSpreadChargeKernel.setArg<cl::Buffer>(4, pmeBsplineTheta->getDeviceBuffer());
pmeDispersionSpreadChargeKernel.setArg<cl::Buffer>(13, sigmaEpsilon->getDeviceBuffer());
if (deviceIsCpu || cl.getSupports64BitGlobalAtomics())
pmeDispersionSpreadChargeKernel.setArg<cl::Buffer>(13, sigmaEpsilon->getDeviceBuffer());
else
pmeDispersionSpreadChargeKernel.setArg<cl::Buffer>(5, sigmaEpsilon->getDeviceBuffer());
pmeDispersionConvolutionKernel.setArg<cl::Buffer>(0, pmeGrid2->getDeviceBuffer());
pmeDispersionConvolutionKernel.setArg<cl::Buffer>(1, pmeDispersionBsplineModuliX->getDeviceBuffer());
pmeDispersionConvolutionKernel.setArg<cl::Buffer>(2, pmeDispersionBsplineModuliY->getDeviceBuffer());
...
...
platforms/opencl/src/kernels/pme.cl
View file @
8469621f
...
...
@@ -38,7 +38,7 @@ __kernel void updateBsplines(__global const real4* restrict posq, __global real4
data[0]
=
scale*
(
-dr+1.0f
)
*data[0]
;
for
(
int
j
=
0
; j < PME_ORDER; j++) {
#
ifdef
USE_LJPME
const
float2
sigEps
=
sigmaEpsilon[
atom
]
;
const
float2
sigEps
=
sigmaEpsilon[
i
]
;
const
real
charge
=
8*sigEps.x*sigEps.x*sigEps.x*sigEps.y
;
#
else
const
real
charge
=
pos.w
;
...
...
platforms/reference/include/ObcParameters.h
View file @
8469621f
...
...
@@ -25,7 +25,7 @@
#ifndef __ObcParameters_H__
#define __ObcParameters_H__
#include "
Real
Vec.h"
#include "
openmm/
Vec
3
.h"
#include <vector>
namespace
OpenMM
{
...
...
@@ -44,29 +44,29 @@ class ObcParameters {
int
_numberOfAtoms
;
RealOpenMM
_solventDielectric
;
RealOpenMM
_soluteDielectric
;
RealOpenMM
_electricConstant
;
RealOpenMM
_probeRadius
;
RealOpenMM
_pi4Asolv
;
double
_solventDielectric
;
double
_soluteDielectric
;
double
_electricConstant
;
double
_probeRadius
;
double
_pi4Asolv
;
RealOpenMM
_dielectricOffset
;
RealOpenMM
_alphaObc
;
RealOpenMM
_betaObc
;
RealOpenMM
_gammaObc
;
double
_dielectricOffset
;
double
_alphaObc
;
double
_betaObc
;
double
_gammaObc
;
ObcType
_obcType
;
// scaled radius factors (S_kk in HCT paper)
std
::
vector
<
RealOpenMM
>
_atomicRadii
;
std
::
vector
<
RealOpenMM
>
_scaledRadiusFactors
;
std
::
vector
<
double
>
_atomicRadii
;
std
::
vector
<
double
>
_scaledRadiusFactors
;
// cutoff and periodic boundary conditions
bool
_cutoff
;
bool
_periodic
;
OpenMM
::
Real
Vec
_periodicBoxVectors
[
3
];
RealOpenMM
_cutoffDistance
;
OpenMM
::
Vec
3
_periodicBoxVectors
[
3
];
double
_cutoffDistance
;
/**---------------------------------------------------------------------------------------
...
...
@@ -76,7 +76,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
void
setDielectricOffset
(
RealOpenMM
dielectricOffset
);
void
setDielectricOffset
(
double
dielectricOffset
);
public:
...
...
@@ -116,7 +116,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
RealOpenMM
getElectricConstant
()
const
;
double
getElectricConstant
()
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -126,7 +126,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
RealOpenMM
getProbeRadius
()
const
;
double
getProbeRadius
()
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -136,18 +136,18 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
void
setProbeRadius
(
RealOpenMM
probeRadius
);
void
setProbeRadius
(
double
probeRadius
);
/**---------------------------------------------------------------------------------------
Get pi4Asolv: used in ACE approximation for nonpolar term
((RealOpenMM)
M_PI
)
*4.0f*0.0049f*1000.0f; (Simbios)
M_PI*4.0f*0.0049f*1000.0f; (Simbios)
@return pi4Asolv
--------------------------------------------------------------------------------------- */
RealOpenMM
getPi4Asolv
()
const
;
double
getPi4Asolv
()
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -155,7 +155,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
void
setPi4Asolv
(
RealOpenMM
pi4Asolv
);
void
setPi4Asolv
(
double
pi4Asolv
);
/**---------------------------------------------------------------------------------------
...
...
@@ -165,7 +165,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
RealOpenMM
getSolventDielectric
()
const
;
double
getSolventDielectric
()
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -175,7 +175,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
void
setSolventDielectric
(
RealOpenMM
solventDielectric
);
void
setSolventDielectric
(
double
solventDielectric
);
/**---------------------------------------------------------------------------------------
...
...
@@ -185,7 +185,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
RealOpenMM
getSoluteDielectric
()
const
;
double
getSoluteDielectric
()
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -195,7 +195,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
void
setSoluteDielectric
(
RealOpenMM
soluteDielectric
);
void
setSoluteDielectric
(
double
soluteDielectric
);
/**---------------------------------------------------------------------------------------
...
...
@@ -225,7 +225,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
RealOpenMM
getAlphaObc
()
const
;
double
getAlphaObc
()
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -235,7 +235,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
RealOpenMM
getBetaObc
()
const
;
double
getBetaObc
()
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -245,7 +245,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
RealOpenMM
getGammaObc
()
const
;
double
getGammaObc
()
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -255,7 +255,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
RealOpenMM
getDielectricOffset
()
const
;
double
getDielectricOffset
()
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -265,7 +265,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
const
std
::
vector
<
RealOpenMM
>&
getScaledRadiusFactors
()
const
;
const
std
::
vector
<
double
>&
getScaledRadiusFactors
()
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -275,7 +275,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
void
setScaledRadiusFactors
(
const
std
::
vector
<
RealOpenMM
>&
scaledRadiusFactors
);
void
setScaledRadiusFactors
(
const
std
::
vector
<
double
>&
scaledRadiusFactors
);
/**---------------------------------------------------------------------------------------
...
...
@@ -285,7 +285,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
const
std
::
vector
<
RealOpenMM
>&
getAtomicRadii
()
const
;
const
std
::
vector
<
double
>&
getAtomicRadii
()
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -295,7 +295,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
void
setAtomicRadii
(
const
std
::
vector
<
RealOpenMM
>&
atomicRadii
);
void
setAtomicRadii
(
const
std
::
vector
<
double
>&
atomicRadii
);
/**---------------------------------------------------------------------------------------
...
...
@@ -306,7 +306,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
void
setUseCutoff
(
RealOpenMM
distance
);
void
setUseCutoff
(
double
distance
);
/**---------------------------------------------------------------------------------------
...
...
@@ -322,7 +322,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
RealOpenMM
getCutoffDistance
()
const
;
double
getCutoffDistance
()
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -334,7 +334,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
void
setPeriodic
(
OpenMM
::
Real
Vec
*
vectors
);
void
setPeriodic
(
OpenMM
::
Vec
3
*
vectors
);
/**---------------------------------------------------------------------------------------
...
...
@@ -350,7 +350,7 @@ class ObcParameters {
--------------------------------------------------------------------------------------- */
const
OpenMM
::
Real
Vec
*
getPeriodicBox
();
const
OpenMM
::
Vec
3
*
getPeriodicBox
();
};
...
...
platforms/reference/include/RealVec.h
View file @
8469621f
...
...
@@ -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-201
3
Stanford University and the Authors. *
* Portions copyright (c) 2008-201
7
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -34,143 +34,14 @@
#include "SimTKOpenMMRealType.h"
#include "openmm/Vec3.h"
#include <cassert>
#include <iosfwd>
namespace
OpenMM
{
/**
* This is identical to Vec3, except that the components are of type RealOpenMM, so
* it can be compiled in either single or double precision. Automatic conversion
* between this class and Vec3 is supported.
* This file exists only for backward compatibility. RealVec is now just a typedef for Vec3.
*/
class
RealVec
{
public:
/**
* Create a RealVec whose elements are all 0.
*/
RealVec
()
{
data
[
0
]
=
data
[
1
]
=
data
[
2
]
=
0.0
;
}
/**
* Create a RealVec with specified x, y, and z components.
*/
RealVec
(
RealOpenMM
x
,
RealOpenMM
y
,
RealOpenMM
z
)
{
data
[
0
]
=
x
;
data
[
1
]
=
y
;
data
[
2
]
=
z
;
}
/**
* Create a RealVec from a Vec3.
*/
RealVec
(
Vec3
v
)
{
data
[
0
]
=
v
[
0
];
data
[
1
]
=
v
[
1
];
data
[
2
]
=
v
[
2
];
}
/**
* Create a Vec3 from a RealVec.
*/
operator
Vec3
()
const
{
return
Vec3
(
data
[
0
],
data
[
1
],
data
[
2
]);
}
RealOpenMM
operator
[](
int
index
)
const
{
assert
(
index
>=
0
&&
index
<
3
);
return
data
[
index
];
}
RealOpenMM
&
operator
[](
int
index
)
{
assert
(
index
>=
0
&&
index
<
3
);
return
data
[
index
];
}
// Arithmetic operators
// unary plus
RealVec
operator
+
()
const
{
return
RealVec
(
*
this
);
}
// plus
RealVec
operator
+
(
const
RealVec
&
rhs
)
const
{
const
RealVec
&
lhs
=
*
this
;
return
RealVec
(
lhs
[
0
]
+
rhs
[
0
],
lhs
[
1
]
+
rhs
[
1
],
lhs
[
2
]
+
rhs
[
2
]);
}
RealVec
&
operator
+=
(
const
RealVec
&
rhs
)
{
data
[
0
]
+=
rhs
[
0
];
data
[
1
]
+=
rhs
[
1
];
data
[
2
]
+=
rhs
[
2
];
return
*
this
;
}
// unary minus
RealVec
operator
-
()
const
{
const
RealVec
&
lhs
=
*
this
;
return
RealVec
(
-
lhs
[
0
],
-
lhs
[
1
],
-
lhs
[
2
]);
}
// minus
RealVec
operator
-
(
const
RealVec
&
rhs
)
const
{
const
RealVec
&
lhs
=
*
this
;
return
RealVec
(
lhs
[
0
]
-
rhs
[
0
],
lhs
[
1
]
-
rhs
[
1
],
lhs
[
2
]
-
rhs
[
2
]);
}
RealVec
&
operator
-=
(
const
RealVec
&
rhs
)
{
data
[
0
]
-=
rhs
[
0
];
data
[
1
]
-=
rhs
[
1
];
data
[
2
]
-=
rhs
[
2
];
return
*
this
;
}
// scalar product
RealVec
operator
*
(
RealOpenMM
rhs
)
const
{
const
RealVec
&
lhs
=
*
this
;
return
RealVec
(
lhs
[
0
]
*
rhs
,
lhs
[
1
]
*
rhs
,
lhs
[
2
]
*
rhs
);
}
RealVec
&
operator
*=
(
RealOpenMM
rhs
)
{
data
[
0
]
*=
rhs
;
data
[
1
]
*=
rhs
;
data
[
2
]
*=
rhs
;
return
*
this
;
}
// scalar division
RealVec
operator
/
(
double
rhs
)
const
{
const
RealVec
&
lhs
=
*
this
;
double
scale
=
1.0
/
rhs
;
return
RealVec
(
lhs
[
0
]
*
scale
,
lhs
[
1
]
*
scale
,
lhs
[
2
]
*
scale
);
}
RealVec
&
operator
/=
(
double
rhs
)
{
double
scale
=
1.0
/
rhs
;
data
[
0
]
*=
scale
;
data
[
1
]
*=
scale
;
data
[
2
]
*=
scale
;
return
*
this
;
}
// dot product
RealOpenMM
dot
(
const
RealVec
&
rhs
)
const
{
const
RealVec
&
lhs
=
*
this
;
return
lhs
[
0
]
*
rhs
[
0
]
+
lhs
[
1
]
*
rhs
[
1
]
+
lhs
[
2
]
*
rhs
[
2
];
}
// cross product
RealVec
cross
(
const
RealVec
&
rhs
)
const
{
return
RealVec
(
data
[
1
]
*
rhs
[
2
]
-
data
[
2
]
*
rhs
[
1
],
data
[
2
]
*
rhs
[
0
]
-
data
[
0
]
*
rhs
[
2
],
data
[
0
]
*
rhs
[
1
]
-
data
[
1
]
*
rhs
[
0
]);
}
private:
RealOpenMM
data
[
3
];
};
namespace
OpenMM
{
template
<
class
CHAR
,
class
TRAITS
>
std
::
basic_ostream
<
CHAR
,
TRAITS
>&
operator
<<
(
std
::
basic_ostream
<
CHAR
,
TRAITS
>&
o
,
const
RealVec
&
v
)
{
o
<<
'['
<<
v
[
0
]
<<
", "
<<
v
[
1
]
<<
", "
<<
v
[
2
]
<<
']'
;
return
o
;
}
typedef
Vec3
RealVec
;
}
// namespace OpenMM
...
...
platforms/reference/include/ReferenceAndersenThermostat.h
View file @
8469621f
...
...
@@ -25,6 +25,7 @@
#ifndef __ReferenceAndersenThermostat_H__
#define __ReferenceAndersenThermostat_H__
#include "openmm/Vec3.h"
#include <vector>
namespace
OpenMM
{
...
...
@@ -64,8 +65,8 @@ class ReferenceAndersenThermostat {
--------------------------------------------------------------------------------------- */
void
applyThermostat
(
const
std
::
vector
<
std
::
vector
<
int
>
>&
atomGroups
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomVelocities
,
std
::
vector
<
RealOpenMM
>&
atomMasses
,
RealOpenMM
temperature
,
RealOpenMM
collisionFrequency
,
RealOpenMM
stepSize
)
const
;
void
applyThermostat
(
const
std
::
vector
<
std
::
vector
<
int
>
>&
atomGroups
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomVelocities
,
std
::
vector
<
double
>&
atomMasses
,
double
temperature
,
double
collisionFrequency
,
double
stepSize
)
const
;
};
...
...
platforms/reference/include/ReferenceAngleBondIxn.h
View file @
8469621f
...
...
@@ -26,6 +26,7 @@
#define __ReferenceAngleBondIxn_H__
#include "ReferenceBondIxn.h"
#include "openmm/Vec3.h"
namespace
OpenMM
{
...
...
@@ -34,7 +35,7 @@ class OPENMM_EXPORT ReferenceAngleBondIxn : public ReferenceBondIxn {
private:
bool
usePeriodic
;
Real
Vec
boxVectors
[
3
];
Vec
3
boxVectors
[
3
];
public:
...
...
@@ -62,7 +63,7 @@ class OPENMM_EXPORT ReferenceAngleBondIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void
setPeriodic
(
OpenMM
::
Real
Vec
*
vectors
);
void
setPeriodic
(
OpenMM
::
Vec
3
*
vectors
);
/**---------------------------------------------------------------------------------------
...
...
@@ -76,8 +77,8 @@ class OPENMM_EXPORT ReferenceAngleBondIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void
getPrefactorsGivenAngleCosine
(
RealOpenMM
cosine
,
RealOpenMM
*
angleParameters
,
RealOpenMM
*
dEdR
,
RealOpenMM
*
energyTerm
)
const
;
void
getPrefactorsGivenAngleCosine
(
double
cosine
,
double
*
angleParameters
,
double
*
dEdR
,
double
*
energyTerm
)
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -92,9 +93,9 @@ class OPENMM_EXPORT ReferenceAngleBondIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void
calculateBondIxn
(
int
*
atomIndices
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
RealOpenMM
*
parameters
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
RealOpenMM
*
totalEnergy
,
double
*
energyParamDerivs
);
void
calculateBondIxn
(
int
*
atomIndices
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
double
*
parameters
,
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
double
*
totalEnergy
,
double
*
energyParamDerivs
);
};
...
...
platforms/reference/include/ReferenceBondForce.h
View file @
8469621f
...
...
@@ -68,9 +68,9 @@ class OPENMM_EXPORT ReferenceBondForce : public ReferenceForce {
--------------------------------------------------------------------------------------- */
void
calculateForce
(
int
numberOfBonds
,
int
**
atomIndices
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
RealOpenMM
**
parameters
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
RealOpenMM
*
totalEnergy
,
ReferenceBondIxn
&
referenceBondIxn
);
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
double
**
parameters
,
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
double
*
totalEnergy
,
ReferenceBondIxn
&
referenceBondIxn
);
};
...
...
platforms/reference/include/ReferenceBondIxn.h
View file @
8469621f
...
...
@@ -25,7 +25,7 @@
#ifndef __ReferenceBondIxn_H__
#define __ReferenceBondIxn_H__
#include "
Real
Vec.h"
#include "
openmm/
Vec
3
.h"
#include "openmm/internal/windowsExport.h"
#include <vector>
...
...
@@ -65,9 +65,9 @@ class OPENMM_EXPORT ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
virtual
void
calculateBondIxn
(
int
*
atomIndices
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
RealOpenMM
*
parameters
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
RealOpenMM
*
totalEnergy
,
double
*
energyParamDerivs
);
virtual
void
calculateBondIxn
(
int
*
atomIndices
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
double
*
parameters
,
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
double
*
totalEnergy
,
double
*
energyParamDerivs
);
/**---------------------------------------------------------------------------------------
...
...
@@ -82,7 +82,7 @@ class OPENMM_EXPORT ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
static
RealOpenMM
getNormedDotProduct
(
RealOpenMM
*
vector1
,
RealOpenMM
*
vector2
,
int
hasREntry
);
static
double
getNormedDotProduct
(
double
*
vector1
,
double
*
vector2
,
int
hasREntry
);
/**---------------------------------------------------------------------------------------
...
...
@@ -98,8 +98,8 @@ class OPENMM_EXPORT ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
static
RealOpenMM
getAngleBetweenTwoVectors
(
RealOpenMM
*
vector1
,
RealOpenMM
*
vector2
,
RealOpenMM
*
outputDotProduct
,
int
hasREntry
);
static
double
getAngleBetweenTwoVectors
(
double
*
vector1
,
double
*
vector2
,
double
*
outputDotProduct
,
int
hasREntry
);
/**---------------------------------------------------------------------------------------
...
...
@@ -119,10 +119,10 @@ class OPENMM_EXPORT ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
static
RealOpenMM
getDihedralAngleBetweenThreeVectors
(
RealOpenMM
*
vector1
,
RealOpenMM
*
vector2
,
RealOpenMM
*
vector3
,
RealOpenMM
**
outputCrossProduct
,
RealOpenMM
*
cosineOfAngle
,
RealOpenMM
*
signVector
,
RealOpenMM
*
signOfAngle
,
int
hasREntry
);
static
double
getDihedralAngleBetweenThreeVectors
(
double
*
vector1
,
double
*
vector2
,
double
*
vector3
,
double
**
outputCrossProduct
,
double
*
cosineOfAngle
,
double
*
signVector
,
double
*
signOfAngle
,
int
hasREntry
);
};
...
...
platforms/reference/include/ReferenceBrownianDynamics.h
View file @
8469621f
...
...
@@ -33,9 +33,9 @@ class ReferenceBrownianDynamics : public ReferenceDynamics {
private:
std
::
vector
<
OpenMM
::
Real
Vec
>
xPrime
;
std
::
vector
<
RealOpenMM
>
inverseMasses
;
RealOpenMM
friction
;
std
::
vector
<
OpenMM
::
Vec
3
>
xPrime
;
std
::
vector
<
double
>
inverseMasses
;
double
friction
;
public:
...
...
@@ -50,7 +50,7 @@ class ReferenceBrownianDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
ReferenceBrownianDynamics
(
int
numberOfAtoms
,
RealOpenMM
deltaT
,
RealOpenMM
friction
,
RealOpenMM
temperature
);
ReferenceBrownianDynamics
(
int
numberOfAtoms
,
double
deltaT
,
double
friction
,
double
temperature
);
/**---------------------------------------------------------------------------------------
...
...
@@ -68,7 +68,7 @@ class ReferenceBrownianDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
RealOpenMM
getFriction
()
const
;
double
getFriction
()
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -83,8 +83,8 @@ class ReferenceBrownianDynamics : public ReferenceDynamics {
--------------------------------------------------------------------------------------- */
void
update
(
const
OpenMM
::
System
&
system
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
velocities
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
std
::
vector
<
RealOpenMM
>&
masses
,
RealOpenMM
tolerance
);
void
update
(
const
OpenMM
::
System
&
system
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
velocities
,
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
std
::
vector
<
double
>&
masses
,
double
tolerance
);
};
...
...
platforms/reference/include/ReferenceCCMAAlgorithm.h
View file @
8469621f
...
...
@@ -37,23 +37,23 @@ class OPENMM_EXPORT ReferenceCCMAAlgorithm : public ReferenceConstraintAlgorithm
protected:
int
_maximumNumberOfIterations
;
RealOpenMM
_elementCutoff
;
double
_elementCutoff
;
int
_numberOfConstraints
;
std
::
vector
<
std
::
pair
<
int
,
int
>
>
_atomIndices
;
std
::
vector
<
RealOpenMM
>
_distance
;
std
::
vector
<
double
>
_distance
;
std
::
vector
<
OpenMM
::
Real
Vec
>
_r_ij
;
RealOpenMM
*
_d_ij2
;
RealOpenMM
*
_distanceTolerance
;
RealOpenMM
*
_reducedMasses
;
std
::
vector
<
OpenMM
::
Vec
3
>
_r_ij
;
double
*
_d_ij2
;
double
*
_distanceTolerance
;
double
*
_reducedMasses
;
bool
_hasInitializedMasses
;
std
::
vector
<
std
::
vector
<
std
::
pair
<
int
,
RealOpenMM
>
>
>
_matrix
;
std
::
vector
<
std
::
vector
<
std
::
pair
<
int
,
double
>
>
>
_matrix
;
private:
void
applyConstraints
(
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
bool
constrainingVelocities
,
RealOpenMM
tolerance
);
void
applyConstraints
(
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinatesP
,
std
::
vector
<
double
>&
inverseMasses
,
bool
constrainingVelocities
,
double
tolerance
);
public:
class
AngleInfo
;
...
...
@@ -69,7 +69,7 @@ public:
* @param angles angle force field terms
* @param elementCutoff the cutoff for which elements of the inverse matrix to keep
*/
ReferenceCCMAAlgorithm
(
int
numberOfAtoms
,
int
numberOfConstraints
,
const
std
::
vector
<
std
::
pair
<
int
,
int
>
>&
atomIndices
,
const
std
::
vector
<
RealOpenMM
>&
distance
,
std
::
vector
<
RealOpenMM
>&
masses
,
std
::
vector
<
AngleInfo
>&
angles
,
RealOpenMM
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
();
...
...
@@ -96,8 +96,8 @@ public:
* @param inverseMasses 1/mass
* @param tolerance the constraint tolerance
*/
void
apply
(
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
RealOpenMM
tolerance
);
void
apply
(
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinatesP
,
std
::
vector
<
double
>&
inverseMasses
,
double
tolerance
);
/**
* Apply the constraint algorithm to velocities.
...
...
@@ -107,14 +107,14 @@ public:
* @param inverseMasses 1/mass
* @param tolerance the constraint tolerance
*/
void
applyToVelocities
(
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
velocities
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
RealOpenMM
tolerance
);
void
applyToVelocities
(
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
velocities
,
std
::
vector
<
double
>&
inverseMasses
,
double
tolerance
);
/**
* Get the inverse constraint matrix. Each element represents one column, and contains a list
* of all non-zero elements in the form (index, value).
*/
const
std
::
vector
<
std
::
vector
<
std
::
pair
<
int
,
RealOpenMM
>
>
>&
getMatrix
()
const
;
const
std
::
vector
<
std
::
vector
<
std
::
pair
<
int
,
double
>
>
>&
getMatrix
()
const
;
};
...
...
@@ -122,8 +122,8 @@ class ReferenceCCMAAlgorithm::AngleInfo
{
public:
int
atom1
,
atom2
,
atom3
;
RealOpenMM
angle
;
AngleInfo
(
int
atom1
,
int
atom2
,
int
atom3
,
RealOpenMM
angle
)
:
double
angle
;
AngleInfo
(
int
atom1
,
int
atom2
,
int
atom3
,
double
angle
)
:
atom1
(
atom1
),
atom2
(
atom2
),
atom3
(
atom3
),
angle
(
angle
)
{
}
...
...
platforms/reference/include/ReferenceCMAPTorsionIxn.h
View file @
8469621f
...
...
@@ -35,11 +35,11 @@ class ReferenceCMAPTorsionIxn : public ReferenceBondIxn {
private:
std
::
vector
<
std
::
vector
<
std
::
vector
<
RealOpenMM
>
>
>
coeff
;
std
::
vector
<
std
::
vector
<
std
::
vector
<
double
>
>
>
coeff
;
std
::
vector
<
int
>
torsionMaps
;
std
::
vector
<
std
::
vector
<
int
>
>
torsionIndices
;
bool
usePeriodic
;
Real
Vec
boxVectors
[
3
];
Vec
3
boxVectors
[
3
];
/**---------------------------------------------------------------------------------------
...
...
@@ -52,8 +52,8 @@ private:
--------------------------------------------------------------------------------------- */
void
calculateOneIxn
(
int
index
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
RealOpenMM
*
totalEnergy
)
const
;
void
calculateOneIxn
(
int
index
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
double
*
totalEnergy
)
const
;
public:
...
...
@@ -63,7 +63,7 @@ public:
--------------------------------------------------------------------------------------- */
ReferenceCMAPTorsionIxn
(
const
std
::
vector
<
std
::
vector
<
std
::
vector
<
RealOpenMM
>
>
>&
coeff
,
ReferenceCMAPTorsionIxn
(
const
std
::
vector
<
std
::
vector
<
std
::
vector
<
double
>
>
>&
coeff
,
const
std
::
vector
<
int
>&
torsionMaps
,
const
std
::
vector
<
std
::
vector
<
int
>
>&
torsionIndices
);
...
...
@@ -75,7 +75,7 @@ public:
--------------------------------------------------------------------------------------- */
void
setPeriodic
(
OpenMM
::
Real
Vec
*
vectors
);
void
setPeriodic
(
OpenMM
::
Vec
3
*
vectors
);
/**---------------------------------------------------------------------------------------
...
...
@@ -87,7 +87,7 @@ public:
--------------------------------------------------------------------------------------- */
void
calculateIxn
(
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
RealOpenMM
*
totalEnergy
)
const
;
void
calculateIxn
(
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
double
*
totalEnergy
)
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -95,9 +95,9 @@ public:
--------------------------------------------------------------------------------------- */
void
calculateBondIxn
(
int
*
atomIndices
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
RealOpenMM
*
parameters
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
RealOpenMM
*
totalEnergy
,
double
*
energyParamDerivs
);
void
calculateBondIxn
(
int
*
atomIndices
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
double
*
parameters
,
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
double
*
totalEnergy
,
double
*
energyParamDerivs
);
// ---------------------------------------------------------------------------------------
...
...
platforms/reference/include/ReferenceConstraintAlgorithm.h
View file @
8469621f
...
...
@@ -25,8 +25,9 @@
#ifndef __ReferenceConstraintAlgorithm_H__
#define __ReferenceConstraintAlgorithm_H__
#include "
Real
Vec.h"
#include "
openmm/
Vec
3
.h"
#include "openmm/internal/windowsExport.h"
#include "SimTKOpenMMRealType.h"
#include <vector>
namespace
OpenMM
{
...
...
@@ -47,8 +48,8 @@ public:
* @param inverseMasses 1/mass
* @param tolerance the constraint tolerance
*/
virtual
void
apply
(
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
RealOpenMM
tolerance
)
=
0
;
virtual
void
apply
(
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinatesP
,
std
::
vector
<
double
>&
inverseMasses
,
double
tolerance
)
=
0
;
/**
* Apply the constraint algorithm to velocities.
...
...
@@ -58,8 +59,8 @@ public:
* @param inverseMasses 1/mass
* @param tolerance the constraint tolerance
*/
virtual
void
applyToVelocities
(
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
velocities
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
RealOpenMM
tolerance
)
=
0
;
virtual
void
applyToVelocities
(
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
velocities
,
std
::
vector
<
double
>&
inverseMasses
,
double
tolerance
)
=
0
;
};
}
// namespace OpenMM
...
...
platforms/reference/include/ReferenceConstraints.h
View file @
8469621f
...
...
@@ -55,7 +55,7 @@ public:
* @param inverseMasses 1/mass
* @param tolerance the constraint tolerance
*/
void
apply
(
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinatesP
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
RealOpenMM
tolerance
);
void
apply
(
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinatesP
,
std
::
vector
<
double
>&
inverseMasses
,
double
tolerance
);
/**
* Apply the constraint algorithm to velocities.
...
...
@@ -65,7 +65,7 @@ public:
* @param inverseMasses 1/mass
* @param tolerance the constraint tolerance
*/
void
applyToVelocities
(
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
velocities
,
std
::
vector
<
RealOpenMM
>&
inverseMasses
,
RealOpenMM
tolerance
);
void
applyToVelocities
(
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
std
::
vector
<
OpenMM
::
Vec
3
>&
velocities
,
std
::
vector
<
double
>&
inverseMasses
,
double
tolerance
);
ReferenceConstraintAlgorithm
*
ccma
;
ReferenceConstraintAlgorithm
*
settle
;
};
...
...
platforms/reference/include/ReferenceCustomAngleIxn.h
View file @
8469621f
...
...
@@ -40,7 +40,7 @@ class ReferenceCustomAngleIxn : public ReferenceBondIxn {
int
thetaIndex
;
int
numParameters
;
bool
usePeriodic
;
Real
Vec
boxVectors
[
3
];
Vec
3
boxVectors
[
3
];
public:
...
...
@@ -70,7 +70,7 @@ class ReferenceCustomAngleIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void
setPeriodic
(
OpenMM
::
Real
Vec
*
vectors
);
void
setPeriodic
(
OpenMM
::
Vec
3
*
vectors
);
/**---------------------------------------------------------------------------------------
...
...
@@ -84,9 +84,9 @@ class ReferenceCustomAngleIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void
calculateBondIxn
(
int
*
atomIndices
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
RealOpenMM
*
parameters
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
RealOpenMM
*
totalEnergy
,
double
*
energyParamDerivs
);
void
calculateBondIxn
(
int
*
atomIndices
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
double
*
parameters
,
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
double
*
totalEnergy
,
double
*
energyParamDerivs
);
};
...
...
platforms/reference/include/ReferenceCustomBondIxn.h
View file @
8469621f
...
...
@@ -41,7 +41,7 @@ class ReferenceCustomBondIxn : public ReferenceBondIxn {
int
rIndex
;
int
numParameters
;
bool
usePeriodic
;
Real
Vec
boxVectors
[
3
];
Vec
3
boxVectors
[
3
];
public:
...
...
@@ -71,7 +71,7 @@ class ReferenceCustomBondIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void
setPeriodic
(
OpenMM
::
Real
Vec
*
vectors
);
void
setPeriodic
(
OpenMM
::
Vec
3
*
vectors
);
/**---------------------------------------------------------------------------------------
...
...
@@ -85,9 +85,9 @@ class ReferenceCustomBondIxn : public ReferenceBondIxn {
--------------------------------------------------------------------------------------- */
void
calculateBondIxn
(
int
*
atomIndices
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
atomCoordinates
,
RealOpenMM
*
parameters
,
std
::
vector
<
OpenMM
::
Real
Vec
>&
forces
,
RealOpenMM
*
totalEnergy
,
double
*
energyParamDerivs
);
void
calculateBondIxn
(
int
*
atomIndices
,
std
::
vector
<
OpenMM
::
Vec
3
>&
atomCoordinates
,
double
*
parameters
,
std
::
vector
<
OpenMM
::
Vec
3
>&
forces
,
double
*
totalEnergy
,
double
*
energyParamDerivs
);
};
...
...
Prev
1
2
3
4
5
6
…
8
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