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
0843c5f3
Commit
0843c5f3
authored
Jan 03, 2011
by
Peter Eastman
Browse files
First stage of a refactoring to clean up the reference platform
parent
bacc1eff
Changes
86
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
813 deletions
+38
-813
plugins/freeEnergy/platforms/reference/src/SimTKReference/ReferenceFreeEnergyLJCoulombSoftcoreIxn.cpp
...imTKReference/ReferenceFreeEnergyLJCoulombSoftcoreIxn.cpp
+9
-61
plugins/freeEnergy/platforms/reference/src/SimTKReference/ReferenceFreeEnergyLJCoulombSoftcoreIxn.h
.../SimTKReference/ReferenceFreeEnergyLJCoulombSoftcoreIxn.h
+9
-8
plugins/freeEnergy/platforms/reference/src/gbsa/CpuGBVISoftcore.cpp
...eeEnergy/platforms/reference/src/gbsa/CpuGBVISoftcore.cpp
+7
-4
plugins/freeEnergy/platforms/reference/src/gbsa/CpuGBVISoftcore.h
...freeEnergy/platforms/reference/src/gbsa/CpuGBVISoftcore.h
+4
-4
plugins/freeEnergy/platforms/reference/src/gbsa/CpuObcSoftcore.cpp
...reeEnergy/platforms/reference/src/gbsa/CpuObcSoftcore.cpp
+6
-662
plugins/freeEnergy/platforms/reference/src/gbsa/CpuObcSoftcore.h
.../freeEnergy/platforms/reference/src/gbsa/CpuObcSoftcore.h
+3
-74
No files found.
plugins/freeEnergy/platforms/reference/src/SimTKReference/ReferenceFreeEnergyLJCoulombSoftcoreIxn.cpp
View file @
0843c5f3
...
...
@@ -39,6 +39,7 @@
#include "openmm/internal/MSVC_erfc.h"
using
std
::
vector
;
using
OpenMM
::
RealVec
;
/**---------------------------------------------------------------------------------------
...
...
@@ -238,9 +239,9 @@ int ReferenceFreeEnergyLJCoulombSoftcoreIxn::getDerivedParameters( RealOpenMM c6
--------------------------------------------------------------------------------------- */
int
ReferenceFreeEnergyLJCoulombSoftcoreIxn
::
calculateEwaldIxn
(
int
numberOfAtoms
,
RealOpenMM
**
atomCoordinates
,
int
ReferenceFreeEnergyLJCoulombSoftcoreIxn
::
calculateEwaldIxn
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
*
fixedParameters
,
RealOpenMM
**
forces
,
RealOpenMM
*
fixedParameters
,
vector
<
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
{
#if 0
typedef std::complex<RealOpenMM> d_complex;
...
...
@@ -546,9 +547,9 @@ int ReferenceFreeEnergyLJCoulombSoftcoreIxn::calculateEwaldIxn( int numberOfAtom
--------------------------------------------------------------------------------------- */
int
ReferenceFreeEnergyLJCoulombSoftcoreIxn
::
calculatePMEIxn
(
int
numberOfAtoms
,
RealOpenMM
**
atomCoordinates
,
int
ReferenceFreeEnergyLJCoulombSoftcoreIxn
::
calculatePMEIxn
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
*
fixedParameters
,
RealOpenMM
**
forces
,
RealOpenMM
*
fixedParameters
,
vector
<
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
{
...
...
@@ -678,9 +679,9 @@ int ReferenceFreeEnergyLJCoulombSoftcoreIxn::calculatePMEIxn( int numberOfAtoms,
--------------------------------------------------------------------------------------- */
int
ReferenceFreeEnergyLJCoulombSoftcoreIxn
::
calculatePairIxn
(
int
numberOfAtoms
,
RealOpenMM
**
atomCoordinates
,
int
ReferenceFreeEnergyLJCoulombSoftcoreIxn
::
calculatePairIxn
(
int
numberOfAtoms
,
vector
<
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
*
fixedParameters
,
RealOpenMM
**
forces
,
RealOpenMM
*
fixedParameters
,
vector
<
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
{
if
(
ewald
||
pme
)
...
...
@@ -739,8 +740,8 @@ int ReferenceFreeEnergyLJCoulombSoftcoreIxn::calculatePairIxn( int numberOfAtoms
--------------------------------------------------------------------------------------- */
int
ReferenceFreeEnergyLJCoulombSoftcoreIxn
::
calculateOneIxn
(
int
ii
,
int
jj
,
RealOpenMM
**
atomCoordinates
,
RealOpenMM
**
atomParameters
,
RealOpenMM
**
forces
,
int
ReferenceFreeEnergyLJCoulombSoftcoreIxn
::
calculateOneIxn
(
int
ii
,
int
jj
,
vector
<
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
vector
<
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
{
// ---------------------------------------------------------------------------------------
...
...
@@ -826,59 +827,6 @@ int ReferenceFreeEnergyLJCoulombSoftcoreIxn::calculateOneIxn( int ii, int jj, Re
energyByAtom
[
jj
]
+=
energy
;
}
}
// debug
if
(
debug
==
ii
){
static
bool
printHeader
=
false
;
std
::
stringstream
message
;
message
<<
methodName
;
message
<<
std
::
endl
;
int
pairArray
[
2
]
=
{
ii
,
jj
};
if
(
!
printHeader
){
printHeader
=
true
;
message
<<
std
::
endl
;
message
<<
methodName
.
c_str
()
<<
" a0 k [c q p s] r1 r2 angle dt rp p[] dot cosine angle dEdR*r F[]"
<<
std
::
endl
;
}
message
<<
std
::
endl
;
for
(
int
kk
=
0
;
kk
<
2
;
kk
++
){
message
<<
" Atm "
<<
pairArray
[
kk
]
<<
" ["
<<
atomCoordinates
[
pairArray
[
kk
]][
0
]
<<
" "
<<
atomCoordinates
[
pairArray
[
kk
]][
1
]
<<
" "
<<
atomCoordinates
[
pairArray
[
kk
]][
2
]
<<
"] "
;
}
message
<<
std
::
endl
<<
" Delta:"
;
for
(
int
kk
=
0
;
kk
<
(
LastAtomIndex
-
1
);
kk
++
){
message
<<
" ["
;
for
(
int
jj
=
0
;
jj
<
ReferenceForce
::
LastDeltaRIndex
;
jj
++
){
message
<<
deltaR
[
kk
][
jj
]
<<
" "
;
}
message
<<
"]"
;
}
message
<<
std
::
endl
;
for
(
int
kk
=
0
;
kk
<
2
;
kk
++
){
message
<<
" p"
<<
pairArray
[
kk
]
<<
" ["
;
message
<<
atomParameters
[
pairArray
[
kk
]][
0
]
<<
" "
<<
atomParameters
[
pairArray
[
kk
]][
1
]
<<
" "
<<
atomParameters
[
pairArray
[
kk
]][
2
];
message
<<
"]"
;
}
message
<<
std
::
endl
;
message
<<
" dEdR="
<<
dEdR
;
message
<<
" E="
<<
energy
<<
" force factors: "
;
message
<<
"F=compute force; f=cumulative force"
;
message
<<
std
::
endl
<<
" "
;
message
<<
" f"
<<
ii
<<
"["
;
SimTKOpenMMUtilities
::
formatRealStringStream
(
message
,
deltaR
[
0
],
threeI
,
dEdR
);
message
<<
"]"
;
for
(
int
kk
=
0
;
kk
<
2
;
kk
++
){
message
<<
" F"
<<
pairArray
[
kk
]
<<
" ["
;
SimTKOpenMMUtilities
::
formatRealStringStream
(
message
,
forces
[
pairArray
[
kk
]],
threeI
);
message
<<
"]"
;
}
//SimTKOpenMMLog::printMessage( message );
}
return
ReferenceForce
::
DefaultReturn
;
}
...
...
plugins/freeEnergy/platforms/reference/src/SimTKReference/ReferenceFreeEnergyLJCoulombSoftcoreIxn.h
View file @
0843c5f3
...
...
@@ -26,6 +26,7 @@
#include "SimTKReference/ReferencePairIxn.h"
#include "SimTKReference/ReferenceNeighborList.h"
#include <vector>
// ---------------------------------------------------------------------------------------
...
...
@@ -68,8 +69,8 @@ class ReferenceFreeEnergyLJCoulombSoftcoreIxn : public ReferencePairIxn {
--------------------------------------------------------------------------------------- */
int
calculateOneIxn
(
int
atom1
,
int
atom2
,
RealOpenMM
**
atomCoordinates
,
RealOpenMM
**
atomParameters
,
RealOpenMM
**
forces
,
int
calculateOneIxn
(
int
atom1
,
int
atom2
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
;
...
...
@@ -194,9 +195,9 @@ class ReferenceFreeEnergyLJCoulombSoftcoreIxn : public ReferencePairIxn {
--------------------------------------------------------------------------------------- */
int
calculatePairIxn
(
int
numberOfAtoms
,
RealOpenMM
**
atomCoordinates
,
int
calculatePairIxn
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
*
fixedParameters
,
RealOpenMM
**
forces
,
RealOpenMM
*
fixedParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
;
private:
...
...
@@ -220,9 +221,9 @@ private:
--------------------------------------------------------------------------------------- */
int
calculateEwaldIxn
(
int
numberOfAtoms
,
RealOpenMM
**
atomCoordinates
,
int
calculateEwaldIxn
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
*
fixedParameters
,
RealOpenMM
**
forces
,
RealOpenMM
*
fixedParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
;
/**---------------------------------------------------------------------------------------
...
...
@@ -245,9 +246,9 @@ private:
--------------------------------------------------------------------------------------- */
int
calculatePMEIxn
(
int
numberOfAtoms
,
RealOpenMM
**
atomCoordinates
,
int
calculatePMEIxn
(
int
numberOfAtoms
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
RealOpenMM
**
atomParameters
,
int
**
exclusions
,
RealOpenMM
*
fixedParameters
,
RealOpenMM
**
forces
,
RealOpenMM
*
fixedParameters
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
,
RealOpenMM
*
energyByAtom
,
RealOpenMM
*
totalEnergy
)
const
;
/**---------------------------------------------------------------------------------------
...
...
plugins/freeEnergy/platforms/reference/src/gbsa/CpuGBVISoftcore.cpp
View file @
0843c5f3
...
...
@@ -32,6 +32,9 @@
#include "../SimTKReference/ReferenceForce.h"
#include <math.h>
using
std
::
vector
;
using
OpenMM
::
RealVec
;
/**---------------------------------------------------------------------------------------
CpuGBVISoftcore constructor
...
...
@@ -319,7 +322,7 @@ int CpuGBVISoftcore::computeBornRadiiUsingQuinticSpline( RealOpenMM atomicRadius
#define GBVISoftcoreDebug 0
int
CpuGBVISoftcore
::
computeBornRadii
(
RealOpenMM
**
atomCoordinates
,
RealOpenMM
*
bornRadii
,
RealOpenMM
*
switchDeriviative
){
int
CpuGBVISoftcore
::
computeBornRadii
(
vector
<
RealVec
>&
atomCoordinates
,
RealOpenMM
*
bornRadii
,
RealOpenMM
*
switchDeriviative
){
// ---------------------------------------------------------------------------------------
...
...
@@ -604,7 +607,7 @@ RealOpenMM CpuGBVISoftcore::Sgb( RealOpenMM t ){
--------------------------------------------------------------------------------------- */
RealOpenMM
CpuGBVISoftcore
::
computeBornEnergy
(
const
RealOpenMM
*
bornRadii
,
RealOpenMM
**
atomCoordinates
,
RealOpenMM
CpuGBVISoftcore
::
computeBornEnergy
(
const
RealOpenMM
*
bornRadii
,
vector
<
RealVec
>&
atomCoordinates
,
const
RealOpenMM
*
partialCharges
){
// ---------------------------------------------------------------------------------------
...
...
@@ -720,8 +723,8 @@ RealOpenMM e3 = -partialChargeI2*partialCharges[atomJ]*Sgb( t )/deltaR[Reference
--------------------------------------------------------------------------------------- */
int
CpuGBVISoftcore
::
computeBornForces
(
const
RealOpenMM
*
bornRadii
,
RealOpenMM
**
atomCoordinates
,
const
RealOpenMM
*
partialCharges
,
RealOpenMM
**
inputForces
){
int
CpuGBVISoftcore
::
computeBornForces
(
const
RealOpenMM
*
bornRadii
,
vector
<
RealVec
>&
atomCoordinates
,
const
RealOpenMM
*
partialCharges
,
vector
<
RealVec
>&
inputForces
){
// ---------------------------------------------------------------------------------------
...
...
plugins/freeEnergy/platforms/reference/src/gbsa/CpuGBVISoftcore.h
View file @
0843c5f3
...
...
@@ -115,7 +115,7 @@ class CpuGBVISoftcore : public CpuImplicitSolvent {
--------------------------------------------------------------------------------------- */
int
computeBornRadii
(
RealOpenMM
**
atomCoordinates
,
RealOpenMM
*
bornRadii
,
int
computeBornRadii
(
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
RealOpenMM
*
bornRadii
,
RealOpenMM
*
switchDeriviative
=
NULL
);
/**---------------------------------------------------------------------------------------
...
...
@@ -210,7 +210,7 @@ class CpuGBVISoftcore : public CpuImplicitSolvent {
--------------------------------------------------------------------------------------- */
RealOpenMM
computeBornEnergy
(
const
RealOpenMM
*
bornRadii
,
RealOpenMM
**
atomCoordinates
,
RealOpenMM
computeBornEnergy
(
const
RealOpenMM
*
bornRadii
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
const
RealOpenMM
*
partialCharges
);
/**---------------------------------------------------------------------------------------
...
...
@@ -226,8 +226,8 @@ class CpuGBVISoftcore : public CpuImplicitSolvent {
--------------------------------------------------------------------------------------- */
int
computeBornForces
(
const
RealOpenMM
*
bornRadii
,
RealOpenMM
**
atomCoordinates
,
const
RealOpenMM
*
partialCharges
,
RealOpenMM
**
inputForces
);
int
computeBornForces
(
const
RealOpenMM
*
bornRadii
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
const
RealOpenMM
*
partialCharges
,
std
::
vector
<
OpenMM
::
RealVec
>&
inputForces
);
/**---------------------------------------------------------------------------------------
...
...
plugins/freeEnergy/platforms/reference/src/gbsa/CpuObcSoftcore.cpp
View file @
0843c5f3
This diff is collapsed.
Click to expand it.
plugins/freeEnergy/platforms/reference/src/gbsa/CpuObcSoftcore.h
View file @
0843c5f3
...
...
@@ -128,7 +128,7 @@ class CpuObcSoftcore : public CpuImplicitSolvent {
--------------------------------------------------------------------------------------- */
int
computeBornRadii
(
RealOpenMM
**
atomCoordinates
,
RealOpenMM
*
bornRadii
,
int
computeBornRadii
(
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
RealOpenMM
*
bornRadii
,
RealOpenMM
*
obcChain
=
NULL
);
/**---------------------------------------------------------------------------------------
...
...
@@ -162,79 +162,8 @@ class CpuObcSoftcore : public CpuImplicitSolvent {
--------------------------------------------------------------------------------------- */
int
computeBornEnergyForces
(
RealOpenMM
*
bornRadii
,
RealOpenMM
**
atomCoordinates
,
const
RealOpenMM
*
partialCharges
,
RealOpenMM
**
forces
);
int
computeBornEnergyForcesPrint
(
RealOpenMM
*
bornRadii
,
RealOpenMM
**
atomCoordinates
,
const
RealOpenMM
*
partialCharges
,
RealOpenMM
**
forces
);
/**---------------------------------------------------------------------------------------
Get state
title title (optional)
@return state string
--------------------------------------------------------------------------------------- */
std
::
string
getStateString
(
const
char
*
title
)
const
;
/**---------------------------------------------------------------------------------------
Write Born energy and forces (Simbios)
@param atomCoordinates atomic coordinates
@param partialCharges partial atom charges
@param forces force array
@param resultsFileName output file name
@return SimTKOpenMMCommon::DefaultReturn if file opened; else return SimTKOpenMMCommon::ErrorReturn
--------------------------------------------------------------------------------------- */
int
writeBornEnergyForces
(
RealOpenMM
**
atomCoordinates
,
const
RealOpenMM
*
partialCharges
,
RealOpenMM
**
forces
,
const
std
::
string
&
resultsFileName
)
const
;
/**---------------------------------------------------------------------------------------
Write results from first loop
@param atomCoordinates atomic coordinates
@param RealOpenMM forces forces
@param outputFileName output file name
@return SimTKOpenMMCommon::DefaultReturn unless
file cannot be opened
in which case return SimTKOpenMMCommon::ErrorReturn
--------------------------------------------------------------------------------------- */
static
int
writeForceLoop1
(
int
numberOfAtoms
,
RealOpenMM
**
forces
,
const
RealOpenMM
*
bornForce
,
const
std
::
string
&
outputFileName
);
/**---------------------------------------------------------------------------------------
Write results
@param numberOfAtoms number of atoms
@param chunkSizes vector of chunk sizes for realRealOpenMMVector
@param realRealOpenMMVector vector of RealOpenMM**
@param realVector vector of RealOpenMM*
@param outputFileName output file name
@return SimTKOpenMMCommon::DefaultReturn unless
file cannot be opened
in which case return SimTKOpenMMCommon::ErrorReturn
--------------------------------------------------------------------------------------- */
static
int
writeForceLoop
(
int
numberOfAtoms
,
const
IntVector
&
chunkSizes
,
const
RealOpenMMPtrPtrVector
&
realRealOpenMMVector
,
const
RealOpenMMPtrVector
&
realVector
,
const
std
::
string
&
outputFileName
);
int
computeBornEnergyForces
(
RealOpenMM
*
bornRadii
,
std
::
vector
<
OpenMM
::
RealVec
>&
atomCoordinates
,
const
RealOpenMM
*
partialCharges
,
std
::
vector
<
OpenMM
::
RealVec
>&
forces
);
};
// ---------------------------------------------------------------------------------------
...
...
Prev
1
2
3
4
5
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