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
8190f243
Commit
8190f243
authored
Apr 21, 2016
by
peastman
Browse files
Merge pull request #1467 from peastman/amoebaperiodic
Periodic boundary conditions for AMOEBA bonded forces
parents
fd289aae
c54126a0
Changes
68
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
296 additions
and
180 deletions
+296
-180
platforms/reference/include/ReferenceForce.h
platforms/reference/include/ReferenceForce.h
+28
-0
platforms/reference/src/SimTKReference/ReferenceForce.cpp
platforms/reference/src/SimTKReference/ReferenceForce.cpp
+13
-0
plugins/amoeba/openmmapi/include/openmm/AmoebaAngleForce.h
plugins/amoeba/openmmapi/include/openmm/AmoebaAngleForce.h
+9
-5
plugins/amoeba/openmmapi/include/openmm/AmoebaBondForce.h
plugins/amoeba/openmmapi/include/openmm/AmoebaBondForce.h
+9
-5
plugins/amoeba/openmmapi/include/openmm/AmoebaInPlaneAngleForce.h
...amoeba/openmmapi/include/openmm/AmoebaInPlaneAngleForce.h
+9
-5
plugins/amoeba/openmmapi/include/openmm/AmoebaOutOfPlaneBendForce.h
...oeba/openmmapi/include/openmm/AmoebaOutOfPlaneBendForce.h
+9
-5
plugins/amoeba/openmmapi/include/openmm/AmoebaPiTorsionForce.h
...ns/amoeba/openmmapi/include/openmm/AmoebaPiTorsionForce.h
+9
-5
plugins/amoeba/openmmapi/include/openmm/AmoebaStretchBendForce.h
.../amoeba/openmmapi/include/openmm/AmoebaStretchBendForce.h
+9
-5
plugins/amoeba/openmmapi/include/openmm/AmoebaTorsionTorsionForce.h
...oeba/openmmapi/include/openmm/AmoebaTorsionTorsionForce.h
+9
-5
plugins/amoeba/openmmapi/src/AmoebaAngleForce.cpp
plugins/amoeba/openmmapi/src/AmoebaAngleForce.cpp
+10
-2
plugins/amoeba/openmmapi/src/AmoebaBondForce.cpp
plugins/amoeba/openmmapi/src/AmoebaBondForce.cpp
+10
-2
plugins/amoeba/openmmapi/src/AmoebaInPlaneAngleForce.cpp
plugins/amoeba/openmmapi/src/AmoebaInPlaneAngleForce.cpp
+10
-2
plugins/amoeba/openmmapi/src/AmoebaOutOfPlaneBendForce.cpp
plugins/amoeba/openmmapi/src/AmoebaOutOfPlaneBendForce.cpp
+10
-2
plugins/amoeba/openmmapi/src/AmoebaPiTorsionForce.cpp
plugins/amoeba/openmmapi/src/AmoebaPiTorsionForce.cpp
+10
-2
plugins/amoeba/openmmapi/src/AmoebaStretchBendForce.cpp
plugins/amoeba/openmmapi/src/AmoebaStretchBendForce.cpp
+10
-2
plugins/amoeba/openmmapi/src/AmoebaTorsionTorsionForce.cpp
plugins/amoeba/openmmapi/src/AmoebaTorsionTorsionForce.cpp
+10
-2
plugins/amoeba/platforms/cuda/src/AmoebaCudaKernels.cpp
plugins/amoeba/platforms/cuda/src/AmoebaCudaKernels.cpp
+8
-3
plugins/amoeba/platforms/cuda/src/kernels/amoebaInPlaneForce.cu
...s/amoeba/platforms/cuda/src/kernels/amoebaInPlaneForce.cu
+43
-45
plugins/amoeba/platforms/cuda/src/kernels/amoebaOutOfPlaneBendForce.cu
...a/platforms/cuda/src/kernels/amoebaOutOfPlaneBendForce.cu
+40
-48
plugins/amoeba/platforms/cuda/src/kernels/amoebaPiTorsionForce.cu
...amoeba/platforms/cuda/src/kernels/amoebaPiTorsionForce.cu
+31
-35
No files found.
platforms/reference/include/ReferenceForce.h
View file @
8190f243
...
@@ -83,6 +83,19 @@ class OPENMM_EXPORT ReferenceForce {
...
@@ -83,6 +83,19 @@ class OPENMM_EXPORT ReferenceForce {
static
void
getDeltaR
(
const
OpenMM
::
RealVec
&
atomCoordinatesI
,
const
OpenMM
::
RealVec
&
atomCoordinatesJ
,
static
void
getDeltaR
(
const
OpenMM
::
RealVec
&
atomCoordinatesI
,
const
OpenMM
::
RealVec
&
atomCoordinatesJ
,
RealOpenMM
*
deltaR
);
RealOpenMM
*
deltaR
);
/**---------------------------------------------------------------------------------------
Get deltaR between atomI and atomJ (static method)
deltaR: j - i
@param atomCoordinatesI atom i coordinates
@param atomCoordinatesI atom j coordinates
@return the displacement
--------------------------------------------------------------------------------------- */
static
RealVec
getDeltaR
(
const
OpenMM
::
RealVec
&
atomCoordinatesI
,
const
OpenMM
::
RealVec
&
atomCoordinatesJ
);
/**---------------------------------------------------------------------------------------
/**---------------------------------------------------------------------------------------
Get deltaR and distance and distance**2 between atomI and atomJ, assuming periodic
Get deltaR and distance and distance**2 between atomI and atomJ, assuming periodic
...
@@ -113,6 +126,21 @@ class OPENMM_EXPORT ReferenceForce {
...
@@ -113,6 +126,21 @@ class OPENMM_EXPORT ReferenceForce {
static
void
getDeltaRPeriodic
(
const
OpenMM
::
RealVec
&
atomCoordinatesI
,
const
OpenMM
::
RealVec
&
atomCoordinatesJ
,
static
void
getDeltaRPeriodic
(
const
OpenMM
::
RealVec
&
atomCoordinatesI
,
const
OpenMM
::
RealVec
&
atomCoordinatesJ
,
const
OpenMM
::
RealVec
*
boxVectors
,
RealOpenMM
*
deltaR
);
const
OpenMM
::
RealVec
*
boxVectors
,
RealOpenMM
*
deltaR
);
/**---------------------------------------------------------------------------------------
Get deltaR between atomI and atomJ, assuming periodic boundary conditions (static method);
deltaR: j - i
@param atomCoordinatesI atom i coordinates
@param atomCoordinatesI atom j coordinates
@param boxVectors the vectors defining the periodic box
@return the displacement
--------------------------------------------------------------------------------------- */
static
RealVec
getDeltaRPeriodic
(
const
OpenMM
::
RealVec
&
atomCoordinatesI
,
const
OpenMM
::
RealVec
&
atomCoordinatesJ
,
const
OpenMM
::
RealVec
*
boxVectors
);
/**
/**
* Get a pointer to the memory for setting a variable in a CompiledExpression. If the expression
* Get a pointer to the memory for setting a variable in a CompiledExpression. If the expression
* does not use the specified variable, return NULL.
* does not use the specified variable, return NULL.
...
...
platforms/reference/src/SimTKReference/ReferenceForce.cpp
View file @
8190f243
...
@@ -73,6 +73,10 @@ void ReferenceForce::getDeltaR(const RealVec& atomCoordinatesI, const RealVec& a
...
@@ -73,6 +73,10 @@ void ReferenceForce::getDeltaR(const RealVec& atomCoordinatesI, const RealVec& a
deltaR
[
RIndex
]
=
(
RealOpenMM
)
SQRT
(
deltaR
[
R2Index
]);
deltaR
[
RIndex
]
=
(
RealOpenMM
)
SQRT
(
deltaR
[
R2Index
]);
}
}
RealVec
ReferenceForce
::
getDeltaR
(
const
RealVec
&
atomCoordinatesI
,
const
RealVec
&
atomCoordinatesJ
)
{
return
atomCoordinatesJ
-
atomCoordinatesI
;
}
void
ReferenceForce
::
getDeltaRPeriodic
(
const
RealVec
&
atomCoordinatesI
,
const
RealVec
&
atomCoordinatesJ
,
void
ReferenceForce
::
getDeltaRPeriodic
(
const
RealVec
&
atomCoordinatesI
,
const
RealVec
&
atomCoordinatesJ
,
const
RealOpenMM
*
boxSize
,
RealOpenMM
*
deltaR
)
{
const
RealOpenMM
*
boxSize
,
RealOpenMM
*
deltaR
)
{
deltaR
[
XIndex
]
=
periodicDifference
(
atomCoordinatesJ
[
0
],
atomCoordinatesI
[
0
],
boxSize
[
0
]);
deltaR
[
XIndex
]
=
periodicDifference
(
atomCoordinatesJ
[
0
],
atomCoordinatesI
[
0
],
boxSize
[
0
]);
...
@@ -96,6 +100,15 @@ void ReferenceForce::getDeltaRPeriodic(const RealVec& atomCoordinatesI, const Re
...
@@ -96,6 +100,15 @@ void ReferenceForce::getDeltaRPeriodic(const RealVec& atomCoordinatesI, const Re
deltaR
[
RIndex
]
=
SQRT
(
deltaR
[
R2Index
]);
deltaR
[
RIndex
]
=
SQRT
(
deltaR
[
R2Index
]);
}
}
RealVec
ReferenceForce
::
getDeltaRPeriodic
(
const
RealVec
&
atomCoordinatesI
,
const
RealVec
&
atomCoordinatesJ
,
const
RealVec
*
boxVectors
)
{
RealVec
diff
=
atomCoordinatesJ
-
atomCoordinatesI
;
diff
-=
boxVectors
[
2
]
*
floor
(
diff
[
2
]
/
boxVectors
[
2
][
2
]
+
0.5
);
diff
-=
boxVectors
[
1
]
*
floor
(
diff
[
1
]
/
boxVectors
[
1
][
1
]
+
0.5
);
diff
-=
boxVectors
[
0
]
*
floor
(
diff
[
0
]
/
boxVectors
[
0
][
0
]
+
0.5
);
return
diff
;
}
double
*
ReferenceForce
::
getVariablePointer
(
Lepton
::
CompiledExpression
&
expression
,
const
std
::
string
&
name
)
{
double
*
ReferenceForce
::
getVariablePointer
(
Lepton
::
CompiledExpression
&
expression
,
const
std
::
string
&
name
)
{
if
(
expression
.
getVariables
().
find
(
name
)
==
expression
.
getVariables
().
end
())
if
(
expression
.
getVariables
().
find
(
name
)
==
expression
.
getVariables
().
end
())
return
NULL
;
return
NULL
;
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaAngleForce.h
View file @
8190f243
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-201
2
Stanford University and the Authors. *
* Portions copyright (c) 2008-201
6
Stanford University and the Authors. *
* Authors: Mark Friedrichs, Peter Eastman *
* Authors: Mark Friedrichs, Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -166,21 +166,25 @@ public:
...
@@ -166,21 +166,25 @@ public:
* in an angle cannot be changed, nor can new angles be added.
* in an angle cannot be changed, nor can new angles be added.
*/
*/
void
updateParametersInContext
(
Context
&
context
);
void
updateParametersInContext
(
Context
&
context
);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void
setUsesPeriodicBoundaryConditions
(
bool
periodic
);
/**
/**
* Returns whether or not this force makes use of periodic boundary
* Returns whether or not this force makes use of periodic boundary
* conditions.
* conditions.
*
*
* @returns true if
nonbondedMethod
uses PBC and false otherwise
* @returns true if
force
uses PBC and false otherwise
*/
*/
bool
usesPeriodicBoundaryConditions
()
const
{
bool
usesPeriodicBoundaryConditions
()
const
;
return
false
;
}
protected:
protected:
ForceImpl
*
createImpl
()
const
;
ForceImpl
*
createImpl
()
const
;
double
_globalCubicK
,
_globalQuarticK
,
_globalPenticK
,
_globalSexticK
;
double
_globalCubicK
,
_globalQuarticK
,
_globalPenticK
,
_globalSexticK
;
private:
private:
class
AngleInfo
;
class
AngleInfo
;
std
::
vector
<
AngleInfo
>
angles
;
std
::
vector
<
AngleInfo
>
angles
;
bool
usePeriodic
;
};
};
/**
/**
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaBondForce.h
View file @
8190f243
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-201
2
Stanford University and the Authors. *
* Portions copyright (c) 2008-201
6
Stanford University and the Authors. *
* Authors: Mark Friedrichs, Peter Eastman *
* Authors: Mark Friedrichs, Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -138,21 +138,25 @@ public:
...
@@ -138,21 +138,25 @@ public:
* in a bond cannot be changed, nor can new bonds be added.
* in a bond cannot be changed, nor can new bonds be added.
*/
*/
void
updateParametersInContext
(
Context
&
context
);
void
updateParametersInContext
(
Context
&
context
);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void
setUsesPeriodicBoundaryConditions
(
bool
periodic
);
/**
/**
* Returns whether or not this force makes use of periodic boundary
* Returns whether or not this force makes use of periodic boundary
* conditions.
* conditions.
*
*
* @returns true if
nonbondedMethod
uses PBC and false otherwise
* @returns true if
force
uses PBC and false otherwise
*/
*/
bool
usesPeriodicBoundaryConditions
()
const
{
bool
usesPeriodicBoundaryConditions
()
const
;
return
false
;
}
protected:
protected:
double
_globalQuarticK
,
_globalCubicK
;
double
_globalQuarticK
,
_globalCubicK
;
ForceImpl
*
createImpl
()
const
;
ForceImpl
*
createImpl
()
const
;
private:
private:
class
BondInfo
;
class
BondInfo
;
std
::
vector
<
BondInfo
>
bonds
;
std
::
vector
<
BondInfo
>
bonds
;
bool
usePeriodic
;
};
};
/**
/**
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaInPlaneAngleForce.h
View file @
8190f243
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-201
2
Stanford University and the Authors. *
* Portions copyright (c) 2008-201
6
Stanford University and the Authors. *
* Authors: Mark Friedrichs, Peter Eastman *
* Authors: Mark Friedrichs, Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -171,21 +171,25 @@ public:
...
@@ -171,21 +171,25 @@ public:
* in an angle cannot be changed, nor can new angles be added.
* in an angle cannot be changed, nor can new angles be added.
*/
*/
void
updateParametersInContext
(
Context
&
context
);
void
updateParametersInContext
(
Context
&
context
);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void
setUsesPeriodicBoundaryConditions
(
bool
periodic
);
/**
/**
* Returns whether or not this force makes use of periodic boundary
* Returns whether or not this force makes use of periodic boundary
* conditions.
* conditions.
*
*
* @returns true if
nonbondedMethod
uses PBC and false otherwise
* @returns true if
force
uses PBC and false otherwise
*/
*/
bool
usesPeriodicBoundaryConditions
()
const
{
bool
usesPeriodicBoundaryConditions
()
const
;
return
false
;
}
protected:
protected:
ForceImpl
*
createImpl
()
const
;
ForceImpl
*
createImpl
()
const
;
double
_globalCubicK
,
_globalQuarticK
,
_globalPenticK
,
_globalSexticK
;
double
_globalCubicK
,
_globalQuarticK
,
_globalPenticK
,
_globalSexticK
;
private:
private:
class
AngleInfo
;
class
AngleInfo
;
std
::
vector
<
AngleInfo
>
angles
;
std
::
vector
<
AngleInfo
>
angles
;
bool
usePeriodic
;
};
};
/**
/**
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaOutOfPlaneBendForce.h
View file @
8190f243
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-201
2
Stanford University and the Authors. *
* Portions copyright (c) 2008-201
6
Stanford University and the Authors. *
* Authors: Mark Friedrichs, Peter Eastman *
* Authors: Mark Friedrichs, Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -163,21 +163,25 @@ public:
...
@@ -163,21 +163,25 @@ public:
* in a term cannot be changed, nor can new terms be added.
* in a term cannot be changed, nor can new terms be added.
*/
*/
void
updateParametersInContext
(
Context
&
context
);
void
updateParametersInContext
(
Context
&
context
);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void
setUsesPeriodicBoundaryConditions
(
bool
periodic
);
/**
/**
* Returns whether or not this force makes use of periodic boundary
* Returns whether or not this force makes use of periodic boundary
* conditions.
* conditions.
*
*
* @returns true if
nonbondedMethod
uses PBC and false otherwise
* @returns true if
force
uses PBC and false otherwise
*/
*/
bool
usesPeriodicBoundaryConditions
()
const
{
bool
usesPeriodicBoundaryConditions
()
const
;
return
false
;
}
protected:
protected:
ForceImpl
*
createImpl
()
const
;
ForceImpl
*
createImpl
()
const
;
double
_globalCubicK
,
_globalQuarticK
,
_globalPenticK
,
_globalSexticK
;
double
_globalCubicK
,
_globalQuarticK
,
_globalPenticK
,
_globalSexticK
;
private:
private:
class
OutOfPlaneBendInfo
;
class
OutOfPlaneBendInfo
;
std
::
vector
<
OutOfPlaneBendInfo
>
outOfPlaneBends
;
std
::
vector
<
OutOfPlaneBendInfo
>
outOfPlaneBends
;
bool
usePeriodic
;
};
};
/**
/**
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaPiTorsionForce.h
View file @
8190f243
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-201
2
Stanford University and the Authors. *
* Portions copyright (c) 2008-201
6
Stanford University and the Authors. *
* Authors: Mark Friedrichs, Peter Eastman *
* Authors: Mark Friedrichs, Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -113,20 +113,24 @@ public:
...
@@ -113,20 +113,24 @@ public:
* in a torsion cannot be changed, nor can new torsions be added.
* in a torsion cannot be changed, nor can new torsions be added.
*/
*/
void
updateParametersInContext
(
Context
&
context
);
void
updateParametersInContext
(
Context
&
context
);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void
setUsesPeriodicBoundaryConditions
(
bool
periodic
);
/**
/**
* Returns whether or not this force makes use of periodic boundary
* Returns whether or not this force makes use of periodic boundary
* conditions.
* conditions.
*
*
* @returns true if
nonbondedMethod
uses PBC and false otherwise
* @returns true if
force
uses PBC and false otherwise
*/
*/
bool
usesPeriodicBoundaryConditions
()
const
{
bool
usesPeriodicBoundaryConditions
()
const
;
return
false
;
}
protected:
protected:
ForceImpl
*
createImpl
()
const
;
ForceImpl
*
createImpl
()
const
;
private:
private:
class
PiTorsionInfo
;
class
PiTorsionInfo
;
std
::
vector
<
PiTorsionInfo
>
piTorsions
;
std
::
vector
<
PiTorsionInfo
>
piTorsions
;
bool
usePeriodic
;
};
};
/**
/**
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaStretchBendForce.h
View file @
8190f243
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-201
2
Stanford University and the Authors. *
* Portions copyright (c) 2008-201
6
Stanford University and the Authors. *
* Authors: Mark Friedrichs, Peter Eastman *
* Authors: Mark Friedrichs, Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -119,20 +119,24 @@ public:
...
@@ -119,20 +119,24 @@ public:
* in a term cannot be changed, nor can new terms be added.
* in a term cannot be changed, nor can new terms be added.
*/
*/
void
updateParametersInContext
(
Context
&
context
);
void
updateParametersInContext
(
Context
&
context
);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void
setUsesPeriodicBoundaryConditions
(
bool
periodic
);
/**
/**
* Returns whether or not this force makes use of periodic boundary
* Returns whether or not this force makes use of periodic boundary
* conditions.
* conditions.
*
*
* @returns true if
nonbondedMethod
uses PBC and false otherwise
* @returns true if
force
uses PBC and false otherwise
*/
*/
bool
usesPeriodicBoundaryConditions
()
const
{
bool
usesPeriodicBoundaryConditions
()
const
;
return
false
;
}
protected:
protected:
ForceImpl
*
createImpl
()
const
;
ForceImpl
*
createImpl
()
const
;
private:
private:
class
StretchBendInfo
;
class
StretchBendInfo
;
std
::
vector
<
StretchBendInfo
>
stretchBends
;
std
::
vector
<
StretchBendInfo
>
stretchBends
;
bool
usePeriodic
;
};
};
/**
/**
...
...
plugins/amoeba/openmmapi/include/openmm/AmoebaTorsionTorsionForce.h
View file @
8190f243
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-201
2
Stanford University and the Authors. *
* Portions copyright (c) 2008-201
6
Stanford University and the Authors. *
* Authors: Mark Friedrichs, Peter Eastman *
* Authors: Mark Friedrichs, Peter Eastman *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -137,15 +137,18 @@ public:
...
@@ -137,15 +137,18 @@ public:
* grid[x][y][5] = dEd(xy) value
* grid[x][y][5] = dEd(xy) value
*/
*/
void
setTorsionTorsionGrid
(
int
index
,
const
std
::
vector
<
std
::
vector
<
std
::
vector
<
double
>
>
>&
grid
);
void
setTorsionTorsionGrid
(
int
index
,
const
std
::
vector
<
std
::
vector
<
std
::
vector
<
double
>
>
>&
grid
);
/**
* Set whether this force should apply periodic boundary conditions when calculating displacements.
* Usually this is not appropriate for bonded forces, but there are situations when it can be useful.
*/
void
setUsesPeriodicBoundaryConditions
(
bool
periodic
);
/**
/**
* Returns whether or not this force makes use of periodic boundary
* Returns whether or not this force makes use of periodic boundary
* conditions.
* conditions.
*
*
* @returns true if
nonbondedMethod
uses PBC and false otherwise
* @returns true if
force
uses PBC and false otherwise
*/
*/
bool
usesPeriodicBoundaryConditions
()
const
{
bool
usesPeriodicBoundaryConditions
()
const
;
return
false
;
}
protected:
protected:
ForceImpl
*
createImpl
()
const
;
ForceImpl
*
createImpl
()
const
;
private:
private:
...
@@ -153,6 +156,7 @@ private:
...
@@ -153,6 +156,7 @@ private:
class
TorsionTorsionGridInfo
;
class
TorsionTorsionGridInfo
;
std
::
vector
<
TorsionTorsionInfo
>
torsionTorsions
;
std
::
vector
<
TorsionTorsionInfo
>
torsionTorsions
;
std
::
vector
<
TorsionTorsionGridInfo
>
torsionTorsionGrids
;
std
::
vector
<
TorsionTorsionGridInfo
>
torsionTorsionGrids
;
bool
usePeriodic
;
};
};
/**
/**
...
...
plugins/amoeba/openmmapi/src/AmoebaAngleForce.cpp
View file @
8190f243
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-20
09
Stanford University and the Authors. *
* Portions copyright (c) 2008-20
16
Stanford University and the Authors. *
* Authors: *
* Authors: *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
AmoebaAngleForce
::
AmoebaAngleForce
()
{
AmoebaAngleForce
::
AmoebaAngleForce
()
:
usePeriodic
(
false
)
{
_globalCubicK
=
_globalQuarticK
=
_globalPenticK
=
_globalSexticK
=
0.0
;
_globalCubicK
=
_globalQuarticK
=
_globalPenticK
=
_globalSexticK
=
0.0
;
}
}
...
@@ -102,3 +102,11 @@ ForceImpl* AmoebaAngleForce::createImpl() const {
...
@@ -102,3 +102,11 @@ ForceImpl* AmoebaAngleForce::createImpl() const {
void
AmoebaAngleForce
::
updateParametersInContext
(
Context
&
context
)
{
void
AmoebaAngleForce
::
updateParametersInContext
(
Context
&
context
)
{
dynamic_cast
<
AmoebaAngleForceImpl
&>
(
getImplInContext
(
context
)).
updateParametersInContext
(
getContextImpl
(
context
));
dynamic_cast
<
AmoebaAngleForceImpl
&>
(
getImplInContext
(
context
)).
updateParametersInContext
(
getContextImpl
(
context
));
}
}
void
AmoebaAngleForce
::
setUsesPeriodicBoundaryConditions
(
bool
periodic
)
{
usePeriodic
=
periodic
;
}
bool
AmoebaAngleForce
::
usesPeriodicBoundaryConditions
()
const
{
return
usePeriodic
;
}
plugins/amoeba/openmmapi/src/AmoebaBondForce.cpp
View file @
8190f243
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-20
09
Stanford University and the Authors. *
* Portions copyright (c) 2008-20
16
Stanford University and the Authors. *
* Authors: *
* Authors: *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
AmoebaBondForce
::
AmoebaBondForce
()
{
AmoebaBondForce
::
AmoebaBondForce
()
:
usePeriodic
(
false
)
{
_globalCubicK
=
_globalQuarticK
=
0.0
;
_globalCubicK
=
_globalQuarticK
=
0.0
;
}
}
...
@@ -82,3 +82,11 @@ ForceImpl* AmoebaBondForce::createImpl() const {
...
@@ -82,3 +82,11 @@ ForceImpl* AmoebaBondForce::createImpl() const {
void
AmoebaBondForce
::
updateParametersInContext
(
Context
&
context
)
{
void
AmoebaBondForce
::
updateParametersInContext
(
Context
&
context
)
{
dynamic_cast
<
AmoebaBondForceImpl
&>
(
getImplInContext
(
context
)).
updateParametersInContext
(
getContextImpl
(
context
));
dynamic_cast
<
AmoebaBondForceImpl
&>
(
getImplInContext
(
context
)).
updateParametersInContext
(
getContextImpl
(
context
));
}
}
void
AmoebaBondForce
::
setUsesPeriodicBoundaryConditions
(
bool
periodic
)
{
usePeriodic
=
periodic
;
}
bool
AmoebaBondForce
::
usesPeriodicBoundaryConditions
()
const
{
return
usePeriodic
;
}
plugins/amoeba/openmmapi/src/AmoebaInPlaneAngleForce.cpp
View file @
8190f243
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-20
09
Stanford University and the Authors. *
* Portions copyright (c) 2008-20
16
Stanford University and the Authors. *
* Authors: *
* Authors: *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
AmoebaInPlaneAngleForce
::
AmoebaInPlaneAngleForce
()
{
AmoebaInPlaneAngleForce
::
AmoebaInPlaneAngleForce
()
:
usePeriodic
(
false
)
{
_globalCubicK
=
_globalQuarticK
=
_globalPenticK
=
_globalSexticK
=
0.0
;
_globalCubicK
=
_globalQuarticK
=
_globalPenticK
=
_globalSexticK
=
0.0
;
}
}
...
@@ -104,3 +104,11 @@ ForceImpl* AmoebaInPlaneAngleForce::createImpl() const {
...
@@ -104,3 +104,11 @@ ForceImpl* AmoebaInPlaneAngleForce::createImpl() const {
void
AmoebaInPlaneAngleForce
::
updateParametersInContext
(
Context
&
context
)
{
void
AmoebaInPlaneAngleForce
::
updateParametersInContext
(
Context
&
context
)
{
dynamic_cast
<
AmoebaInPlaneAngleForceImpl
&>
(
getImplInContext
(
context
)).
updateParametersInContext
(
getContextImpl
(
context
));
dynamic_cast
<
AmoebaInPlaneAngleForceImpl
&>
(
getImplInContext
(
context
)).
updateParametersInContext
(
getContextImpl
(
context
));
}
}
void
AmoebaInPlaneAngleForce
::
setUsesPeriodicBoundaryConditions
(
bool
periodic
)
{
usePeriodic
=
periodic
;
}
bool
AmoebaInPlaneAngleForce
::
usesPeriodicBoundaryConditions
()
const
{
return
usePeriodic
;
}
plugins/amoeba/openmmapi/src/AmoebaOutOfPlaneBendForce.cpp
View file @
8190f243
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-20
09
Stanford University and the Authors. *
* Portions copyright (c) 2008-20
16
Stanford University and the Authors. *
* Authors: *
* Authors: *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
AmoebaOutOfPlaneBendForce
::
AmoebaOutOfPlaneBendForce
()
{
AmoebaOutOfPlaneBendForce
::
AmoebaOutOfPlaneBendForce
()
:
usePeriodic
(
false
)
{
_globalCubicK
=
-
0.1400000E-01
;
_globalCubicK
=
-
0.1400000E-01
;
_globalQuarticK
=
0.5600000E-04
;
_globalQuarticK
=
0.5600000E-04
;
_globalPenticK
=
-
0.7000000E-06
;
_globalPenticK
=
-
0.7000000E-06
;
...
@@ -106,3 +106,11 @@ ForceImpl* AmoebaOutOfPlaneBendForce::createImpl() const {
...
@@ -106,3 +106,11 @@ ForceImpl* AmoebaOutOfPlaneBendForce::createImpl() const {
void
AmoebaOutOfPlaneBendForce
::
updateParametersInContext
(
Context
&
context
)
{
void
AmoebaOutOfPlaneBendForce
::
updateParametersInContext
(
Context
&
context
)
{
dynamic_cast
<
AmoebaOutOfPlaneBendForceImpl
&>
(
getImplInContext
(
context
)).
updateParametersInContext
(
getContextImpl
(
context
));
dynamic_cast
<
AmoebaOutOfPlaneBendForceImpl
&>
(
getImplInContext
(
context
)).
updateParametersInContext
(
getContextImpl
(
context
));
}
}
void
AmoebaOutOfPlaneBendForce
::
setUsesPeriodicBoundaryConditions
(
bool
periodic
)
{
usePeriodic
=
periodic
;
}
bool
AmoebaOutOfPlaneBendForce
::
usesPeriodicBoundaryConditions
()
const
{
return
usePeriodic
;
}
plugins/amoeba/openmmapi/src/AmoebaPiTorsionForce.cpp
View file @
8190f243
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-20
09
Stanford University and the Authors. *
* Portions copyright (c) 2008-20
16
Stanford University and the Authors. *
* Authors: *
* Authors: *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
AmoebaPiTorsionForce
::
AmoebaPiTorsionForce
()
{
AmoebaPiTorsionForce
::
AmoebaPiTorsionForce
()
:
usePeriodic
(
false
)
{
}
}
int
AmoebaPiTorsionForce
::
addPiTorsion
(
int
particle1
,
int
particle2
,
int
particle3
,
int
particle4
,
int
particle5
,
int
particle6
,
double
k
)
{
int
AmoebaPiTorsionForce
::
addPiTorsion
(
int
particle1
,
int
particle2
,
int
particle3
,
int
particle4
,
int
particle5
,
int
particle6
,
double
k
)
{
...
@@ -71,3 +71,11 @@ ForceImpl* AmoebaPiTorsionForce::createImpl() const {
...
@@ -71,3 +71,11 @@ ForceImpl* AmoebaPiTorsionForce::createImpl() const {
void
AmoebaPiTorsionForce
::
updateParametersInContext
(
Context
&
context
)
{
void
AmoebaPiTorsionForce
::
updateParametersInContext
(
Context
&
context
)
{
dynamic_cast
<
AmoebaPiTorsionForceImpl
&>
(
getImplInContext
(
context
)).
updateParametersInContext
(
getContextImpl
(
context
));
dynamic_cast
<
AmoebaPiTorsionForceImpl
&>
(
getImplInContext
(
context
)).
updateParametersInContext
(
getContextImpl
(
context
));
}
}
void
AmoebaPiTorsionForce
::
setUsesPeriodicBoundaryConditions
(
bool
periodic
)
{
usePeriodic
=
periodic
;
}
bool
AmoebaPiTorsionForce
::
usesPeriodicBoundaryConditions
()
const
{
return
usePeriodic
;
}
plugins/amoeba/openmmapi/src/AmoebaStretchBendForce.cpp
View file @
8190f243
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-20
09
Stanford University and the Authors. *
* Portions copyright (c) 2008-20
16
Stanford University and the Authors. *
* Authors: *
* Authors: *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
AmoebaStretchBendForce
::
AmoebaStretchBendForce
()
{
AmoebaStretchBendForce
::
AmoebaStretchBendForce
()
:
usePeriodic
(
false
)
{
}
}
int
AmoebaStretchBendForce
::
addStretchBend
(
int
particle1
,
int
particle2
,
int
particle3
,
int
AmoebaStretchBendForce
::
addStretchBend
(
int
particle1
,
int
particle2
,
int
particle3
,
...
@@ -76,3 +76,11 @@ ForceImpl* AmoebaStretchBendForce::createImpl() const {
...
@@ -76,3 +76,11 @@ ForceImpl* AmoebaStretchBendForce::createImpl() const {
void
AmoebaStretchBendForce
::
updateParametersInContext
(
Context
&
context
)
{
void
AmoebaStretchBendForce
::
updateParametersInContext
(
Context
&
context
)
{
dynamic_cast
<
AmoebaStretchBendForceImpl
&>
(
getImplInContext
(
context
)).
updateParametersInContext
(
getContextImpl
(
context
));
dynamic_cast
<
AmoebaStretchBendForceImpl
&>
(
getImplInContext
(
context
)).
updateParametersInContext
(
getContextImpl
(
context
));
}
}
void
AmoebaStretchBendForce
::
setUsesPeriodicBoundaryConditions
(
bool
periodic
)
{
usePeriodic
=
periodic
;
}
bool
AmoebaStretchBendForce
::
usesPeriodicBoundaryConditions
()
const
{
return
usePeriodic
;
}
plugins/amoeba/openmmapi/src/AmoebaTorsionTorsionForce.cpp
View file @
8190f243
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2008-201
6
Stanford University and the Authors. *
* Authors: *
* Authors: *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
AmoebaTorsionTorsionForce
::
AmoebaTorsionTorsionForce
()
{
AmoebaTorsionTorsionForce
::
AmoebaTorsionTorsionForce
()
:
usePeriodic
(
false
)
{
}
}
int
AmoebaTorsionTorsionForce
::
addTorsionTorsion
(
int
particle1
,
int
particle2
,
int
particle3
,
int
AmoebaTorsionTorsionForce
::
addTorsionTorsion
(
int
particle1
,
int
particle2
,
int
particle3
,
...
@@ -183,3 +183,11 @@ AmoebaTorsionTorsionForce::TorsionTorsionGridInfo::TorsionTorsionGridInfo(const
...
@@ -183,3 +183,11 @@ AmoebaTorsionTorsionForce::TorsionTorsionGridInfo::TorsionTorsionGridInfo(const
}
}
}
}
}
}
void
AmoebaTorsionTorsionForce
::
setUsesPeriodicBoundaryConditions
(
bool
periodic
)
{
usePeriodic
=
periodic
;
}
bool
AmoebaTorsionTorsionForce
::
usesPeriodicBoundaryConditions
()
const
{
return
usePeriodic
;
}
plugins/amoeba/platforms/cuda/src/AmoebaCudaKernels.cpp
View file @
8190f243
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* *
* Portions copyright (c) 2008-201
5
Stanford University and the Authors. *
* Portions copyright (c) 2008-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman, Mark Friedrichs *
* Authors: Peter Eastman, Mark Friedrichs *
* Contributors: *
* Contributors: *
* *
* *
...
@@ -117,7 +117,7 @@ void CudaCalcAmoebaBondForceKernel::initialize(const System& system, const Amoeb
...
@@ -117,7 +117,7 @@ void CudaCalcAmoebaBondForceKernel::initialize(const System& system, const Amoeb
}
}
params
->
upload
(
paramVector
);
params
->
upload
(
paramVector
);
map
<
string
,
string
>
replacements
;
map
<
string
,
string
>
replacements
;
replacements
[
"APPLY_PERIODIC"
]
=
"0"
;
replacements
[
"APPLY_PERIODIC"
]
=
(
force
.
usesPeriodicBoundaryConditions
()
?
"1"
:
"0"
)
;
replacements
[
"COMPUTE_FORCE"
]
=
CudaAmoebaKernelSources
::
amoebaBondForce
;
replacements
[
"COMPUTE_FORCE"
]
=
CudaAmoebaKernelSources
::
amoebaBondForce
;
replacements
[
"PARAMS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
params
->
getDevicePointer
(),
"float2"
);
replacements
[
"PARAMS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
params
->
getDevicePointer
(),
"float2"
);
replacements
[
"CUBIC_K"
]
=
cu
.
doubleToString
(
force
.
getAmoebaGlobalBondCubic
());
replacements
[
"CUBIC_K"
]
=
cu
.
doubleToString
(
force
.
getAmoebaGlobalBondCubic
());
...
@@ -215,7 +215,7 @@ void CudaCalcAmoebaAngleForceKernel::initialize(const System& system, const Amoe
...
@@ -215,7 +215,7 @@ void CudaCalcAmoebaAngleForceKernel::initialize(const System& system, const Amoe
}
}
params
->
upload
(
paramVector
);
params
->
upload
(
paramVector
);
map
<
string
,
string
>
replacements
;
map
<
string
,
string
>
replacements
;
replacements
[
"APPLY_PERIODIC"
]
=
"0"
;
replacements
[
"APPLY_PERIODIC"
]
=
(
force
.
usesPeriodicBoundaryConditions
()
?
"1"
:
"0"
)
;
replacements
[
"COMPUTE_FORCE"
]
=
CudaAmoebaKernelSources
::
amoebaAngleForce
;
replacements
[
"COMPUTE_FORCE"
]
=
CudaAmoebaKernelSources
::
amoebaAngleForce
;
replacements
[
"PARAMS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
params
->
getDevicePointer
(),
"float2"
);
replacements
[
"PARAMS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
params
->
getDevicePointer
(),
"float2"
);
replacements
[
"CUBIC_K"
]
=
cu
.
doubleToString
(
force
.
getAmoebaGlobalAngleCubic
());
replacements
[
"CUBIC_K"
]
=
cu
.
doubleToString
(
force
.
getAmoebaGlobalAngleCubic
());
...
@@ -317,6 +317,7 @@ void CudaCalcAmoebaInPlaneAngleForceKernel::initialize(const System& system, con
...
@@ -317,6 +317,7 @@ void CudaCalcAmoebaInPlaneAngleForceKernel::initialize(const System& system, con
}
}
params
->
upload
(
paramVector
);
params
->
upload
(
paramVector
);
map
<
string
,
string
>
replacements
;
map
<
string
,
string
>
replacements
;
replacements
[
"APPLY_PERIODIC"
]
=
(
force
.
usesPeriodicBoundaryConditions
()
?
"1"
:
"0"
);
replacements
[
"PARAMS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
params
->
getDevicePointer
(),
"float2"
);
replacements
[
"PARAMS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
params
->
getDevicePointer
(),
"float2"
);
replacements
[
"CUBIC_K"
]
=
cu
.
doubleToString
(
force
.
getAmoebaGlobalInPlaneAngleCubic
());
replacements
[
"CUBIC_K"
]
=
cu
.
doubleToString
(
force
.
getAmoebaGlobalInPlaneAngleCubic
());
replacements
[
"QUARTIC_K"
]
=
cu
.
doubleToString
(
force
.
getAmoebaGlobalInPlaneAngleQuartic
());
replacements
[
"QUARTIC_K"
]
=
cu
.
doubleToString
(
force
.
getAmoebaGlobalInPlaneAngleQuartic
());
...
@@ -419,6 +420,7 @@ void CudaCalcAmoebaPiTorsionForceKernel::initialize(const System& system, const
...
@@ -419,6 +420,7 @@ void CudaCalcAmoebaPiTorsionForceKernel::initialize(const System& system, const
}
}
params
->
upload
(
paramVector
);
params
->
upload
(
paramVector
);
map
<
string
,
string
>
replacements
;
map
<
string
,
string
>
replacements
;
replacements
[
"APPLY_PERIODIC"
]
=
(
force
.
usesPeriodicBoundaryConditions
()
?
"1"
:
"0"
);
replacements
[
"PARAMS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
params
->
getDevicePointer
(),
"float"
);
replacements
[
"PARAMS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
params
->
getDevicePointer
(),
"float"
);
cu
.
getBondedUtilities
().
addInteraction
(
atoms
,
cu
.
replaceStrings
(
CudaAmoebaKernelSources
::
amoebaPiTorsionForce
,
replacements
),
force
.
getForceGroup
());
cu
.
getBondedUtilities
().
addInteraction
(
atoms
,
cu
.
replaceStrings
(
CudaAmoebaKernelSources
::
amoebaPiTorsionForce
,
replacements
),
force
.
getForceGroup
());
cu
.
addForce
(
new
ForceInfo
(
force
));
cu
.
addForce
(
new
ForceInfo
(
force
));
...
@@ -519,6 +521,7 @@ void CudaCalcAmoebaStretchBendForceKernel::initialize(const System& system, cons
...
@@ -519,6 +521,7 @@ void CudaCalcAmoebaStretchBendForceKernel::initialize(const System& system, cons
params1
->
upload
(
paramVector
);
params1
->
upload
(
paramVector
);
params2
->
upload
(
paramVectorK
);
params2
->
upload
(
paramVectorK
);
map
<
string
,
string
>
replacements
;
map
<
string
,
string
>
replacements
;
replacements
[
"APPLY_PERIODIC"
]
=
(
force
.
usesPeriodicBoundaryConditions
()
?
"1"
:
"0"
);
replacements
[
"PARAMS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
params1
->
getDevicePointer
(),
"float3"
);
replacements
[
"PARAMS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
params1
->
getDevicePointer
(),
"float3"
);
replacements
[
"FORCE_CONSTANTS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
params2
->
getDevicePointer
(),
"float2"
);
replacements
[
"FORCE_CONSTANTS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
params2
->
getDevicePointer
(),
"float2"
);
replacements
[
"RAD_TO_DEG"
]
=
cu
.
doubleToString
(
180
/
M_PI
);
replacements
[
"RAD_TO_DEG"
]
=
cu
.
doubleToString
(
180
/
M_PI
);
...
@@ -619,6 +622,7 @@ void CudaCalcAmoebaOutOfPlaneBendForceKernel::initialize(const System& system, c
...
@@ -619,6 +622,7 @@ void CudaCalcAmoebaOutOfPlaneBendForceKernel::initialize(const System& system, c
}
}
params
->
upload
(
paramVector
);
params
->
upload
(
paramVector
);
map
<
string
,
string
>
replacements
;
map
<
string
,
string
>
replacements
;
replacements
[
"APPLY_PERIODIC"
]
=
(
force
.
usesPeriodicBoundaryConditions
()
?
"1"
:
"0"
);
replacements
[
"PARAMS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
params
->
getDevicePointer
(),
"float"
);
replacements
[
"PARAMS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
params
->
getDevicePointer
(),
"float"
);
replacements
[
"CUBIC_K"
]
=
cu
.
doubleToString
(
force
.
getAmoebaGlobalOutOfPlaneBendCubic
());
replacements
[
"CUBIC_K"
]
=
cu
.
doubleToString
(
force
.
getAmoebaGlobalOutOfPlaneBendCubic
());
replacements
[
"QUARTIC_K"
]
=
cu
.
doubleToString
(
force
.
getAmoebaGlobalOutOfPlaneBendQuartic
());
replacements
[
"QUARTIC_K"
]
=
cu
.
doubleToString
(
force
.
getAmoebaGlobalOutOfPlaneBendQuartic
());
...
@@ -750,6 +754,7 @@ void CudaCalcAmoebaTorsionTorsionForceKernel::initialize(const System& system, c
...
@@ -750,6 +754,7 @@ void CudaCalcAmoebaTorsionTorsionForceKernel::initialize(const System& system, c
gridValues
->
upload
(
gridValuesVec
);
gridValues
->
upload
(
gridValuesVec
);
gridParams
->
upload
(
gridParamsVec
);
gridParams
->
upload
(
gridParamsVec
);
map
<
string
,
string
>
replacements
;
map
<
string
,
string
>
replacements
;
replacements
[
"APPLY_PERIODIC"
]
=
(
force
.
usesPeriodicBoundaryConditions
()
?
"1"
:
"0"
);
replacements
[
"GRID_VALUES"
]
=
cu
.
getBondedUtilities
().
addArgument
(
gridValues
->
getDevicePointer
(),
"float4"
);
replacements
[
"GRID_VALUES"
]
=
cu
.
getBondedUtilities
().
addArgument
(
gridValues
->
getDevicePointer
(),
"float4"
);
replacements
[
"GRID_PARAMS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
gridParams
->
getDevicePointer
(),
"float4"
);
replacements
[
"GRID_PARAMS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
gridParams
->
getDevicePointer
(),
"float4"
);
replacements
[
"TORSION_PARAMS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
torsionParams
->
getDevicePointer
(),
"int2"
);
replacements
[
"TORSION_PARAMS"
]
=
cu
.
getBondedUtilities
().
addArgument
(
torsionParams
->
getDevicePointer
(),
"int2"
);
...
...
plugins/amoeba/platforms/cuda/src/kernels/amoebaInPlaneForce.cu
View file @
8190f243
float2
angleParams
=
PARAMS
[
index
];
float2
angleParams
=
PARAMS
[
index
];
real
x
ad
=
pos1
.
x
-
pos4
.
x
;
real
3
ad
=
make_real3
(
pos1
.
x
-
pos4
.
x
,
pos1
.
y
-
pos4
.
y
,
pos1
.
z
-
pos4
.
z
)
;
real
ya
d
=
pos1
.
y
-
pos4
.
y
;
real
3
b
d
=
make_real3
(
pos2
.
x
-
pos4
.
x
,
pos2
.
y
-
pos4
.
y
,
pos2
.
z
-
pos4
.
z
)
;
real
za
d
=
pos1
.
z
-
pos4
.
z
;
real
3
c
d
=
make_real3
(
pos3
.
x
-
pos4
.
x
,
pos3
.
y
-
pos4
.
y
,
pos3
.
z
-
pos4
.
z
)
;
real
xbd
=
pos2
.
x
-
pos4
.
x
;
#if APPLY_PERIODIC
real
ybd
=
pos2
.
y
-
pos4
.
y
;
APPLY_PERIODIC_TO_DELTA
(
ad
)
real
zbd
=
pos2
.
z
-
pos4
.
z
;
APPLY_PERIODIC_TO_DELTA
(
bd
)
APPLY_PERIODIC_TO_DELTA
(
cd
)
#endif
real
xcd
=
pos3
.
x
-
pos4
.
x
;
real
xt
=
ad
.
y
*
cd
.
z
-
ad
.
z
*
cd
.
y
;
real
ycd
=
pos3
.
y
-
pos4
.
y
;
real
yt
=
ad
.
z
*
cd
.
x
-
ad
.
x
*
cd
.
z
;
real
zcd
=
pos3
.
z
-
pos4
.
z
;
real
zt
=
ad
.
x
*
cd
.
y
-
ad
.
y
*
cd
.
x
;
real
xt
=
yad
*
zcd
-
zad
*
ycd
;
real
yt
=
zad
*
xcd
-
xad
*
zcd
;
real
zt
=
xad
*
ycd
-
yad
*
xcd
;
real
rt2
=
xt
*
xt
+
yt
*
yt
+
zt
*
zt
;
real
rt2
=
xt
*
xt
+
yt
*
yt
+
zt
*
zt
;
real
delta
=
-
(
xt
*
x
bd
+
yt
*
y
bd
+
zt
*
z
bd
)
/
rt2
;
real
delta
=
-
(
xt
*
bd
.
x
+
yt
*
bd
.
y
+
zt
*
bd
.
z
)
/
rt2
;
real
xip
=
pos2
.
x
+
xt
*
delta
;
real
xip
=
pos2
.
x
+
xt
*
delta
;
real
yip
=
pos2
.
y
+
yt
*
delta
;
real
yip
=
pos2
.
y
+
yt
*
delta
;
real
zip
=
pos2
.
z
+
zt
*
delta
;
real
zip
=
pos2
.
z
+
zt
*
delta
;
real
xap
=
pos1
.
x
-
xip
;
real3
ap
=
make_real3
(
pos1
.
x
-
xip
,
pos1
.
y
-
yip
,
pos1
.
z
-
zip
);
real
yap
=
pos1
.
y
-
yip
;
real3
cp
=
make_real3
(
pos3
.
x
-
xip
,
pos3
.
y
-
yip
,
pos3
.
z
-
zip
);
real
zap
=
pos1
.
z
-
zip
;
real
xcp
=
pos3
.
x
-
xip
;
#if APPLY_PERIODIC
real
ycp
=
pos3
.
y
-
yip
;
APPLY_PERIODIC_TO_DELTA
(
ap
)
real
zcp
=
pos3
.
z
-
zip
;
APPLY_PERIODIC_TO_DELTA
(
cp
)
#endif
real
rap2
=
x
ap
*
xap
+
y
ap
*
yap
+
z
ap
*
zap
;
real
rap2
=
ap
.
x
*
ap
.
x
+
ap
.
y
*
ap
.
y
+
ap
.
z
*
ap
.
z
;
real
rcp2
=
x
cp
*
xcp
+
y
cp
*
ycp
+
z
cp
*
zcp
;
real
rcp2
=
cp
.
x
*
cp
.
x
+
cp
.
y
*
cp
.
y
+
cp
.
z
*
cp
.
z
;
real
xm
=
y
cp
*
zap
-
z
cp
*
yap
;
real
xm
=
cp
.
y
*
ap
.
z
-
cp
.
z
*
ap
.
y
;
real
ym
=
z
cp
*
xap
-
x
cp
*
zap
;
real
ym
=
cp
.
z
*
ap
.
x
-
cp
.
x
*
ap
.
z
;
real
zm
=
x
cp
*
yap
-
y
cp
*
xap
;
real
zm
=
cp
.
x
*
ap
.
y
-
cp
.
y
*
ap
.
x
;
real
rm
=
max
(
SQRT
(
xm
*
xm
+
ym
*
ym
+
zm
*
zm
),
(
real
)
1e-6
f
);
real
rm
=
max
(
SQRT
(
xm
*
xm
+
ym
*
ym
+
zm
*
zm
),
(
real
)
1e-6
f
);
real
dotp
=
x
ap
*
xcp
+
y
ap
*
ycp
+
z
ap
*
zcp
;
real
dotp
=
ap
.
x
*
cp
.
x
+
ap
.
y
*
cp
.
y
+
ap
.
z
*
cp
.
z
;
real
product
=
SQRT
(
rap2
*
rcp2
);
real
product
=
SQRT
(
rap2
*
rcp2
);
real
cosine
=
(
product
>
0
?
(
dotp
/
product
)
:
0
);
real
cosine
=
(
product
>
0
?
(
dotp
/
product
)
:
0
);
cosine
=
max
(
min
(
cosine
,
(
real
)
1
),
(
real
)
-
1
);
cosine
=
max
(
min
(
cosine
,
(
real
)
1
),
(
real
)
-
1
);
real
angle
;
real
angle
;
if
(
cosine
>
0.99
f
||
cosine
<
-
0.99
f
)
{
if
(
cosine
>
0.99
f
||
cosine
<
-
0.99
f
)
{
real3
cross_prod
=
cross
(
make_real3
(
xap
,
yap
,
zap
),
make_real3
(
xcp
,
ycp
,
zcp
)
);
real3
cross_prod
=
cross
(
ap
,
cp
);
angle
=
ASIN
(
SQRT
(
dot
(
cross_prod
,
cross_prod
)
/
(
rap2
*
rcp2
)))
*
RAD_TO_DEG
;
angle
=
ASIN
(
SQRT
(
dot
(
cross_prod
,
cross_prod
)
/
(
rap2
*
rcp2
)))
*
RAD_TO_DEG
;
if
(
cosine
<
0.0
f
)
if
(
cosine
<
0.0
f
)
angle
=
180
-
angle
;
angle
=
180
-
angle
;
...
@@ -67,13 +65,13 @@ dEdAngle *= RAD_TO_DEG;
...
@@ -67,13 +65,13 @@ dEdAngle *= RAD_TO_DEG;
real
terma
=
-
dEdAngle
/
(
rap2
*
rm
);
real
terma
=
-
dEdAngle
/
(
rap2
*
rm
);
real
termc
=
dEdAngle
/
(
rcp2
*
rm
);
real
termc
=
dEdAngle
/
(
rcp2
*
rm
);
real
dedxia
=
terma
*
(
y
ap
*
zm
-
z
ap
*
ym
);
real
dedxia
=
terma
*
(
ap
.
y
*
zm
-
ap
.
z
*
ym
);
real
dedyia
=
terma
*
(
z
ap
*
xm
-
x
ap
*
zm
);
real
dedyia
=
terma
*
(
ap
.
z
*
xm
-
ap
.
x
*
zm
);
real
dedzia
=
terma
*
(
x
ap
*
ym
-
y
ap
*
xm
);
real
dedzia
=
terma
*
(
ap
.
x
*
ym
-
ap
.
y
*
xm
);
real
dedxic
=
termc
*
(
y
cp
*
zm
-
z
cp
*
ym
);
real
dedxic
=
termc
*
(
cp
.
y
*
zm
-
cp
.
z
*
ym
);
real
dedyic
=
termc
*
(
z
cp
*
xm
-
x
cp
*
zm
);
real
dedyic
=
termc
*
(
cp
.
z
*
xm
-
cp
.
x
*
zm
);
real
dedzic
=
termc
*
(
x
cp
*
ym
-
y
cp
*
xm
);
real
dedzic
=
termc
*
(
cp
.
x
*
ym
-
cp
.
y
*
xm
);
real
dedxip
=
-
dedxia
-
dedxic
;
real
dedxip
=
-
dedxia
-
dedxic
;
real
dedyip
=
-
dedyia
-
dedyic
;
real
dedyip
=
-
dedyia
-
dedyic
;
...
@@ -82,23 +80,23 @@ real dedzip = -dedzia - dedzic;
...
@@ -82,23 +80,23 @@ real dedzip = -dedzia - dedzic;
real
delta2
=
2.0
f
*
delta
;
real
delta2
=
2.0
f
*
delta
;
real
ptrt2
=
(
dedxip
*
xt
+
dedyip
*
yt
+
dedzip
*
zt
)
/
rt2
;
real
ptrt2
=
(
dedxip
*
xt
+
dedyip
*
yt
+
dedzip
*
zt
)
/
rt2
;
real
term
=
(
z
cd
*
ybd
-
ycd
*
zbd
)
+
delta2
*
(
yt
*
z
cd
-
zt
*
y
cd
);
real
term
=
(
cd
.
z
*
bd
.
y
-
cd
.
y
*
bd
.
z
)
+
delta2
*
(
yt
*
cd
.
z
-
zt
*
cd
.
y
);
real
dpdxia
=
delta
*
(
y
cd
*
dedzip
-
z
cd
*
dedyip
)
+
term
*
ptrt2
;
real
dpdxia
=
delta
*
(
cd
.
y
*
dedzip
-
cd
.
z
*
dedyip
)
+
term
*
ptrt2
;
term
=
(
x
cd
*
zbd
-
zcd
*
xbd
)
+
delta2
*
(
zt
*
x
cd
-
xt
*
z
cd
);
term
=
(
cd
.
x
*
bd
.
z
-
cd
.
z
*
bd
.
x
)
+
delta2
*
(
zt
*
cd
.
x
-
xt
*
cd
.
z
);
real
dpdyia
=
delta
*
(
z
cd
*
dedxip
-
x
cd
*
dedzip
)
+
term
*
ptrt2
;
real
dpdyia
=
delta
*
(
cd
.
z
*
dedxip
-
cd
.
x
*
dedzip
)
+
term
*
ptrt2
;
term
=
(
y
cd
*
xbd
-
xcd
*
ybd
)
+
delta2
*
(
xt
*
y
cd
-
yt
*
x
cd
);
term
=
(
cd
.
y
*
bd
.
x
-
cd
.
x
*
bd
.
y
)
+
delta2
*
(
xt
*
cd
.
y
-
yt
*
cd
.
x
);
real
dpdzia
=
delta
*
(
x
cd
*
dedyip
-
y
cd
*
dedxip
)
+
term
*
ptrt2
;
real
dpdzia
=
delta
*
(
cd
.
x
*
dedyip
-
cd
.
y
*
dedxip
)
+
term
*
ptrt2
;
term
=
(
y
ad
*
zbd
-
zad
*
ybd
)
+
delta2
*
(
zt
*
y
ad
-
yt
*
z
ad
);
term
=
(
ad
.
y
*
bd
.
z
-
ad
.
z
*
bd
.
y
)
+
delta2
*
(
zt
*
ad
.
y
-
yt
*
ad
.
z
);
real
dpdxic
=
delta
*
(
z
ad
*
dedyip
-
y
ad
*
dedzip
)
+
term
*
ptrt2
;
real
dpdxic
=
delta
*
(
ad
.
z
*
dedyip
-
ad
.
y
*
dedzip
)
+
term
*
ptrt2
;
term
=
(
z
ad
*
xbd
-
xad
*
zbd
)
+
delta2
*
(
xt
*
z
ad
-
zt
*
x
ad
);
term
=
(
ad
.
z
*
bd
.
x
-
ad
.
x
*
bd
.
z
)
+
delta2
*
(
xt
*
ad
.
z
-
zt
*
ad
.
x
);
real
dpdyic
=
delta
*
(
x
ad
*
dedzip
-
z
ad
*
dedxip
)
+
term
*
ptrt2
;
real
dpdyic
=
delta
*
(
ad
.
x
*
dedzip
-
ad
.
z
*
dedxip
)
+
term
*
ptrt2
;
term
=
(
x
ad
*
ybd
-
yad
*
xbd
)
+
delta2
*
(
yt
*
x
ad
-
xt
*
y
ad
);
term
=
(
ad
.
x
*
bd
.
y
-
ad
.
y
*
bd
.
x
)
+
delta2
*
(
yt
*
ad
.
x
-
xt
*
ad
.
y
);
real
dpdzic
=
delta
*
(
y
ad
*
dedxip
-
x
ad
*
dedyip
)
+
term
*
ptrt2
;
real
dpdzic
=
delta
*
(
ad
.
y
*
dedxip
-
ad
.
x
*
dedyip
)
+
term
*
ptrt2
;
dedxia
=
dedxia
+
dpdxia
;
dedxia
=
dedxia
+
dpdxia
;
dedyia
=
dedyia
+
dpdyia
;
dedyia
=
dedyia
+
dpdyia
;
...
...
plugins/amoeba/platforms/cuda/src/kernels/amoebaOutOfPlaneBendForce.cu
View file @
8190f243
// compute the value of the bond angle
// compute the value of the bond angle
real
xab
=
pos1
.
x
-
pos2
.
x
;
real3
ab
=
make_real3
(
pos1
.
x
-
pos2
.
x
,
pos1
.
y
-
pos2
.
y
,
pos1
.
z
-
pos2
.
z
);
real
yab
=
pos1
.
y
-
pos2
.
y
;
real3
cb
=
make_real3
(
pos3
.
x
-
pos2
.
x
,
pos3
.
y
-
pos2
.
y
,
pos3
.
z
-
pos2
.
z
);
real
zab
=
pos1
.
z
-
pos2
.
z
;
real3
db
=
make_real3
(
pos4
.
x
-
pos2
.
x
,
pos4
.
y
-
pos2
.
y
,
pos4
.
z
-
pos2
.
z
);
real3
ad
=
make_real3
(
pos1
.
x
-
pos4
.
x
,
pos1
.
y
-
pos4
.
y
,
pos1
.
z
-
pos4
.
z
);
real
xcb
=
pos3
.
x
-
pos2
.
x
;
real3
cd
=
make_real3
(
pos3
.
x
-
pos4
.
x
,
pos3
.
y
-
pos4
.
y
,
pos3
.
z
-
pos4
.
z
);
real
ycb
=
pos3
.
y
-
pos2
.
y
;
real
zcb
=
pos3
.
z
-
pos2
.
z
;
#if APPLY_PERIODIC
APPLY_PERIODIC_TO_DELTA
(
ab
)
// compute the out-of-plane bending angle
APPLY_PERIODIC_TO_DELTA
(
cb
)
APPLY_PERIODIC_TO_DELTA
(
db
)
real
xdb
=
pos4
.
x
-
pos2
.
x
;
APPLY_PERIODIC_TO_DELTA
(
ad
)
real
ydb
=
pos4
.
y
-
pos2
.
y
;
APPLY_PERIODIC_TO_DELTA
(
cd
)
real
zdb
=
pos4
.
z
-
pos2
.
z
;
#endif
real
xad
=
pos1
.
x
-
pos4
.
x
;
real
rdb2
=
db
.
x
*
db
.
x
+
db
.
y
*
db
.
y
+
db
.
z
*
db
.
z
;
real
yad
=
pos1
.
y
-
pos4
.
y
;
real
rad2
=
ad
.
x
*
ad
.
x
+
ad
.
y
*
ad
.
y
+
ad
.
z
*
ad
.
z
;
real
zad
=
pos1
.
z
-
pos4
.
z
;
real
rcd2
=
cd
.
x
*
cd
.
x
+
cd
.
y
*
cd
.
y
+
cd
.
z
*
cd
.
z
;
real
xcd
=
pos3
.
x
-
pos4
.
x
;
real
ee
=
ab
.
x
*
(
cb
.
y
*
db
.
z
-
cb
.
z
*
db
.
y
)
+
ab
.
y
*
(
cb
.
z
*
db
.
x
-
cb
.
x
*
db
.
z
)
+
ab
.
z
*
(
cb
.
x
*
db
.
y
-
cb
.
y
*
db
.
x
);
real
ycd
=
pos3
.
y
-
pos4
.
y
;
real
zcd
=
pos3
.
z
-
pos4
.
z
;
real
dot
=
ad
.
x
*
cd
.
x
+
ad
.
y
*
cd
.
y
+
ad
.
z
*
cd
.
z
;
real
rdb2
=
xdb
*
xdb
+
ydb
*
ydb
+
zdb
*
zdb
;
real
rad2
=
xad
*
xad
+
yad
*
yad
+
zad
*
zad
;
real
rcd2
=
xcd
*
xcd
+
ycd
*
ycd
+
zcd
*
zcd
;
real
ee
=
xab
*
(
ycb
*
zdb
-
zcb
*
ydb
)
+
yab
*
(
zcb
*
xdb
-
xcb
*
zdb
)
+
zab
*
(
xcb
*
ydb
-
ycb
*
xdb
);
real
dot
=
xad
*
xcd
+
yad
*
ycd
+
zad
*
zcd
;
real
cc
=
rad2
*
rcd2
-
dot
*
dot
;
real
cc
=
rad2
*
rcd2
-
dot
*
dot
;
real
bkk2
=
(
cc
!=
0
?
(
ee
*
ee
)
/
(
cc
)
:
(
real
)
0
);
real
bkk2
=
(
cc
!=
0
?
(
ee
*
ee
)
/
(
cc
)
:
(
real
)
0
);
bkk2
=
rdb2
-
bkk2
;
bkk2
=
rdb2
-
bkk2
;
real
adXcd_0
=
y
ad
*
zcd
-
z
ad
*
ycd
;
real
adXcd_0
=
ad
.
y
*
cd
.
z
-
ad
.
z
*
cd
.
y
;
real
adXcd_1
=
z
ad
*
xcd
-
x
ad
*
zcd
;
real
adXcd_1
=
ad
.
z
*
cd
.
x
-
ad
.
x
*
cd
.
z
;
real
adXcd_2
=
x
ad
*
ycd
-
y
ad
*
xcd
;
real
adXcd_2
=
ad
.
x
*
cd
.
y
-
ad
.
y
*
cd
.
x
;
real
adXcd_nrm2
=
adXcd_0
*
adXcd_0
+
adXcd_1
*
adXcd_1
+
adXcd_2
*
adXcd_2
;
real
adXcd_nrm2
=
adXcd_0
*
adXcd_0
+
adXcd_1
*
adXcd_1
+
adXcd_2
*
adXcd_2
;
real
adXcd_dot_db
=
x
db
*
adXcd_0
+
y
db
*
adXcd_1
+
z
db
*
adXcd_2
;
real
adXcd_dot_db
=
db
.
x
*
adXcd_0
+
db
.
y
*
adXcd_1
+
db
.
z
*
adXcd_2
;
adXcd_dot_db
/=
SQRT
(
rdb2
*
adXcd_nrm2
);
adXcd_dot_db
/=
SQRT
(
rdb2
*
adXcd_nrm2
);
real
angle
=
abs
(
ASIN
(
adXcd_dot_db
));
real
angle
=
abs
(
ASIN
(
adXcd_dot_db
));
...
@@ -62,13 +54,13 @@ real dedcos = -deddt*eeSign/SQRT(cc*bkk2);
...
@@ -62,13 +54,13 @@ real dedcos = -deddt*eeSign/SQRT(cc*bkk2);
real
term
=
ee
/
cc
;
real
term
=
ee
/
cc
;
real
dccdxia
=
(
x
ad
*
rcd2
-
x
cd
*
dot
)
*
term
;
real
dccdxia
=
(
ad
.
x
*
rcd2
-
cd
.
x
*
dot
)
*
term
;
real
dccdyia
=
(
y
ad
*
rcd2
-
y
cd
*
dot
)
*
term
;
real
dccdyia
=
(
ad
.
y
*
rcd2
-
cd
.
y
*
dot
)
*
term
;
real
dccdzia
=
(
z
ad
*
rcd2
-
z
cd
*
dot
)
*
term
;
real
dccdzia
=
(
ad
.
z
*
rcd2
-
cd
.
z
*
dot
)
*
term
;
real
dccdxic
=
(
x
cd
*
rad2
-
x
ad
*
dot
)
*
term
;
real
dccdxic
=
(
cd
.
x
*
rad2
-
ad
.
x
*
dot
)
*
term
;
real
dccdyic
=
(
y
cd
*
rad2
-
y
ad
*
dot
)
*
term
;
real
dccdyic
=
(
cd
.
y
*
rad2
-
ad
.
y
*
dot
)
*
term
;
real
dccdzic
=
(
z
cd
*
rad2
-
z
ad
*
dot
)
*
term
;
real
dccdzic
=
(
cd
.
z
*
rad2
-
ad
.
z
*
dot
)
*
term
;
real
dccdxid
=
-
dccdxia
-
dccdxic
;
real
dccdxid
=
-
dccdxia
-
dccdxic
;
real
dccdyid
=
-
dccdyia
-
dccdyic
;
real
dccdyid
=
-
dccdyia
-
dccdyic
;
...
@@ -76,17 +68,17 @@ real dccdzid = -dccdzia - dccdzic;
...
@@ -76,17 +68,17 @@ real dccdzid = -dccdzia - dccdzic;
term
=
ee
/
rdb2
;
term
=
ee
/
rdb2
;
real
deedxia
=
y
db
*
zcb
-
z
db
*
ycb
;
real
deedxia
=
db
.
y
*
cb
.
z
-
db
.
z
*
cb
.
y
;
real
deedyia
=
z
db
*
xcb
-
x
db
*
zcb
;
real
deedyia
=
db
.
z
*
cb
.
x
-
db
.
x
*
cb
.
z
;
real
deedzia
=
x
db
*
ycb
-
y
db
*
xcb
;
real
deedzia
=
db
.
x
*
cb
.
y
-
db
.
y
*
cb
.
x
;
real
deedxic
=
y
ab
*
zdb
-
z
ab
*
ydb
;
real
deedxic
=
ab
.
y
*
db
.
z
-
ab
.
z
*
db
.
y
;
real
deedyic
=
z
ab
*
xdb
-
x
ab
*
zdb
;
real
deedyic
=
ab
.
z
*
db
.
x
-
ab
.
x
*
db
.
z
;
real
deedzic
=
x
ab
*
ydb
-
y
ab
*
xdb
;
real
deedzic
=
ab
.
x
*
db
.
y
-
ab
.
y
*
db
.
x
;
real
deedxid
=
y
cb
*
zab
-
z
cb
*
yab
+
x
db
*
term
;
real
deedxid
=
cb
.
y
*
ab
.
z
-
cb
.
z
*
ab
.
y
+
db
.
x
*
term
;
real
deedyid
=
z
cb
*
xab
-
x
cb
*
zab
+
y
db
*
term
;
real
deedyid
=
cb
.
z
*
ab
.
x
-
cb
.
x
*
ab
.
z
+
db
.
y
*
term
;
real
deedzid
=
x
cb
*
yab
-
y
cb
*
xab
+
z
db
*
term
;
real
deedzid
=
cb
.
x
*
ab
.
y
-
cb
.
y
*
ab
.
x
+
db
.
z
*
term
;
// compute first derivative components for this angle
// compute first derivative components for this angle
...
...
plugins/amoeba/platforms/cuda/src/kernels/amoebaPiTorsionForce.cu
View file @
8190f243
// compute the value of the pi-orbital torsion angle
// compute the value of the pi-orbital torsion angle
real
xad
=
pos1
.
x
-
pos4
.
x
;
real3
ad
=
make_real3
(
pos1
.
x
-
pos4
.
x
,
pos1
.
y
-
pos4
.
y
,
pos1
.
z
-
pos4
.
z
);
real
yad
=
pos1
.
y
-
pos4
.
y
;
real3
bd
=
make_real3
(
pos2
.
x
-
pos4
.
x
,
pos2
.
y
-
pos4
.
y
,
pos2
.
z
-
pos4
.
z
);
real
zad
=
pos1
.
z
-
pos4
.
z
;
real3
ec
=
make_real3
(
pos5
.
x
-
pos3
.
x
,
pos5
.
y
-
pos3
.
y
,
pos5
.
z
-
pos3
.
z
);
real3
gc
=
make_real3
(
pos6
.
x
-
pos3
.
x
,
pos6
.
y
-
pos3
.
y
,
pos6
.
z
-
pos3
.
z
);
real
xbd
=
pos2
.
x
-
pos4
.
x
;
real
ybd
=
pos2
.
y
-
pos4
.
y
;
#if APPLY_PERIODIC
real
zbd
=
pos2
.
z
-
pos4
.
z
;
APPLY_PERIODIC_TO_DELTA
(
ad
)
APPLY_PERIODIC_TO_DELTA
(
bd
)
real
xec
=
pos5
.
x
-
pos3
.
x
;
APPLY_PERIODIC_TO_DELTA
(
ec
)
real
yec
=
pos5
.
y
-
pos3
.
y
;
APPLY_PERIODIC_TO_DELTA
(
gc
)
real
zec
=
pos5
.
z
-
pos3
.
z
;
#endif
real
xgc
=
pos6
.
x
-
pos3
.
x
;
real
xip
=
ad
.
y
*
bd
.
z
-
bd
.
y
*
ad
.
z
+
pos3
.
x
;
real
ygc
=
pos6
.
y
-
pos3
.
y
;
real
yip
=
ad
.
z
*
bd
.
x
-
bd
.
z
*
ad
.
x
+
pos3
.
y
;
real
zgc
=
pos6
.
z
-
pos3
.
z
;
real
zip
=
ad
.
x
*
bd
.
y
-
bd
.
x
*
ad
.
y
+
pos3
.
z
;
real
xip
=
yad
*
zbd
-
ybd
*
zad
+
pos3
.
x
;
real
xiq
=
ec
.
y
*
gc
.
z
-
gc
.
y
*
ec
.
z
+
pos4
.
x
;
real
yip
=
zad
*
xbd
-
zbd
*
xad
+
pos3
.
y
;
real
yiq
=
ec
.
z
*
gc
.
x
-
gc
.
z
*
ec
.
x
+
pos4
.
y
;
real
zip
=
xad
*
ybd
-
xbd
*
yad
+
pos3
.
z
;
real
ziq
=
ec
.
x
*
gc
.
y
-
gc
.
x
*
ec
.
y
+
pos4
.
z
;
real
xiq
=
yec
*
zgc
-
ygc
*
zec
+
pos4
.
x
;
real
yiq
=
zec
*
xgc
-
zgc
*
xec
+
pos4
.
y
;
real
ziq
=
xec
*
ygc
-
xgc
*
yec
+
pos4
.
z
;
real
xcp
=
pos3
.
x
-
xip
;
real
xcp
=
pos3
.
x
-
xip
;
real
ycp
=
pos3
.
y
-
yip
;
real
ycp
=
pos3
.
y
-
yip
;
...
@@ -112,21 +108,21 @@ real dedziq = ydc*dedxu - xdc*dedyu;
...
@@ -112,21 +108,21 @@ real dedziq = ydc*dedxu - xdc*dedyu;
// compute first derivative components for individual atoms
// compute first derivative components for individual atoms
real
dedxia
=
y
bd
*
dedzip
-
z
bd
*
dedyip
;
real
dedxia
=
bd
.
y
*
dedzip
-
bd
.
z
*
dedyip
;
real
dedyia
=
z
bd
*
dedxip
-
x
bd
*
dedzip
;
real
dedyia
=
bd
.
z
*
dedxip
-
bd
.
x
*
dedzip
;
real
dedzia
=
x
bd
*
dedyip
-
y
bd
*
dedxip
;
real
dedzia
=
bd
.
x
*
dedyip
-
bd
.
y
*
dedxip
;
real
dedxib
=
z
ad
*
dedyip
-
y
ad
*
dedzip
;
real
dedxib
=
ad
.
z
*
dedyip
-
ad
.
y
*
dedzip
;
real
dedyib
=
x
ad
*
dedzip
-
z
ad
*
dedxip
;
real
dedyib
=
ad
.
x
*
dedzip
-
ad
.
z
*
dedxip
;
real
dedzib
=
y
ad
*
dedxip
-
x
ad
*
dedyip
;
real
dedzib
=
ad
.
y
*
dedxip
-
ad
.
x
*
dedyip
;
real
dedxie
=
y
gc
*
dedziq
-
z
gc
*
dedyiq
;
real
dedxie
=
gc
.
y
*
dedziq
-
gc
.
z
*
dedyiq
;
real
dedyie
=
z
gc
*
dedxiq
-
x
gc
*
dedziq
;
real
dedyie
=
gc
.
z
*
dedxiq
-
gc
.
x
*
dedziq
;
real
dedzie
=
x
gc
*
dedyiq
-
y
gc
*
dedxiq
;
real
dedzie
=
gc
.
x
*
dedyiq
-
gc
.
y
*
dedxiq
;
real
dedxig
=
z
ec
*
dedyiq
-
y
ec
*
dedziq
;
real
dedxig
=
ec
.
z
*
dedyiq
-
ec
.
y
*
dedziq
;
real
dedyig
=
x
ec
*
dedziq
-
z
ec
*
dedxiq
;
real
dedyig
=
ec
.
x
*
dedziq
-
ec
.
z
*
dedxiq
;
real
dedzig
=
y
ec
*
dedxiq
-
x
ec
*
dedyiq
;
real
dedzig
=
ec
.
y
*
dedxiq
-
ec
.
x
*
dedyiq
;
dedxic
=
dedxic
+
dedxip
-
dedxie
-
dedxig
;
dedxic
=
dedxic
+
dedxip
-
dedxie
-
dedxig
;
dedyic
=
dedyic
+
dedyip
-
dedyie
-
dedyig
;
dedyic
=
dedyic
+
dedyip
-
dedyie
-
dedyig
;
...
...
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