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
51f82c02
Commit
51f82c02
authored
Dec 15, 2015
by
Peter Eastman
Browse files
Merge branch 'genpt' of
https://github.com/andysim/openmm
into
extrapolated
parents
cab0faf8
2913b686
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
937 additions
and
17 deletions
+937
-17
plugins/amoeba/openmmapi/include/openmm/AmoebaMultipoleForce.h
...ns/amoeba/openmmapi/include/openmm/AmoebaMultipoleForce.h
+24
-1
plugins/amoeba/openmmapi/src/AmoebaMultipoleForce.cpp
plugins/amoeba/openmmapi/src/AmoebaMultipoleForce.cpp
+13
-0
plugins/amoeba/platforms/reference/src/AmoebaReferenceKernels.cpp
...amoeba/platforms/reference/src/AmoebaReferenceKernels.cpp
+5
-0
plugins/amoeba/platforms/reference/src/AmoebaReferenceKernels.h
...s/amoeba/platforms/reference/src/AmoebaReferenceKernels.h
+1
-0
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceMultipoleForce.cpp
...ence/src/SimTKReference/AmoebaReferenceMultipoleForce.cpp
+335
-12
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceMultipoleForce.h
...erence/src/SimTKReference/AmoebaReferenceMultipoleForce.h
+36
-4
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaPTPolarization.cpp
...rms/reference/tests/TestReferenceAmoebaPTPolarization.cpp
+522
-0
wrappers/python/src/swig_doxygen/swigInputConfig.py
wrappers/python/src/swig_doxygen/swigInputConfig.py
+1
-0
No files found.
plugins/amoeba/openmmapi/include/openmm/AmoebaMultipoleForce.h
View file @
51f82c02
...
@@ -79,7 +79,13 @@ public:
...
@@ -79,7 +79,13 @@ public:
/**
/**
* Direct polarization
* Direct polarization
*/
*/
Direct
=
1
Direct
=
1
,
/**
* Optimized perturbation theory
*/
OPT
=
2
};
};
enum
MultipoleAxisTypes
{
ZThenX
=
0
,
Bisector
=
1
,
ZBisect
=
2
,
ThreeFold
=
3
,
ZOnly
=
4
,
NoAxisType
=
5
,
LastAxisTypeIndex
=
6
};
enum
MultipoleAxisTypes
{
ZThenX
=
0
,
Bisector
=
1
,
ZBisect
=
2
,
ThreeFold
=
3
,
ZOnly
=
4
,
NoAxisType
=
5
,
LastAxisTypeIndex
=
6
};
...
@@ -298,6 +304,21 @@ public:
...
@@ -298,6 +304,21 @@ public:
*/
*/
void
setMutualInducedTargetEpsilon
(
double
inputMutualInducedTargetEpsilon
);
void
setMutualInducedTargetEpsilon
(
double
inputMutualInducedTargetEpsilon
);
/**
* Set the coefficients for the mu_0, mu_1, mu_2, ..., mu_n terms in the perturbation
* theory algorithm for induced dipoles.
*
* @param optCoefficients a vector whose mth entry specifies the coefficient for mu_m
*
*/
void
setOPTCoefficients
(
const
std
::
vector
<
double
>
&
OPTFullCoefficientsIn
);
/**
* Get the coefficients for the mu_0, mu_1, mu_2, ..., mu_n terms in the perturbation
* theory algorithm for induced dipoles.
*/
const
std
::
vector
<
double
>&
getOPTCoefficients
()
const
;
/**
/**
* Get the error tolerance for Ewald summation. This corresponds to the fractional error in the forces
* Get the error tolerance for Ewald summation. This corresponds to the fractional error in the forces
* which is acceptable. This value is used to select the grid dimensions and separation (alpha)
* which is acceptable. This value is used to select the grid dimensions and separation (alpha)
...
@@ -384,6 +405,8 @@ private:
...
@@ -384,6 +405,8 @@ private:
int
pmeBSplineOrder
;
int
pmeBSplineOrder
;
std
::
vector
<
int
>
pmeGridDimension
;
std
::
vector
<
int
>
pmeGridDimension
;
int
mutualInducedMaxIterations
;
int
mutualInducedMaxIterations
;
std
::
vector
<
double
>
OPTFullCoefficients
;
double
mutualInducedTargetEpsilon
;
double
mutualInducedTargetEpsilon
;
double
scalingDistanceCutoff
;
double
scalingDistanceCutoff
;
double
electricConstant
;
double
electricConstant
;
...
...
plugins/amoeba/openmmapi/src/AmoebaMultipoleForce.cpp
View file @
51f82c02
...
@@ -61,6 +61,19 @@ void AmoebaMultipoleForce::setPolarizationType(AmoebaMultipoleForce::Polarizatio
...
@@ -61,6 +61,19 @@ void AmoebaMultipoleForce::setPolarizationType(AmoebaMultipoleForce::Polarizatio
polarizationType
=
type
;
polarizationType
=
type
;
}
}
void
AmoebaMultipoleForce
::
setOPTCoefficients
(
const
std
::
vector
<
double
>
&
OPTFullCoefficientsIn
)
{
size_t
maxPTOrder
=
OPTFullCoefficientsIn
.
size
();
OPTFullCoefficients
.
resize
(
maxPTOrder
);
std
::
copy
(
OPTFullCoefficientsIn
.
begin
(),
OPTFullCoefficientsIn
.
end
(),
OPTFullCoefficients
.
begin
());
}
const
std
::
vector
<
double
>
&
AmoebaMultipoleForce
::
getOPTCoefficients
()
const
{
return
OPTFullCoefficients
;
}
double
AmoebaMultipoleForce
::
getCutoffDistance
()
const
{
double
AmoebaMultipoleForce
::
getCutoffDistance
()
const
{
return
cutoffDistance
;
return
cutoffDistance
;
}
}
...
...
plugins/amoeba/platforms/reference/src/AmoebaReferenceKernels.cpp
View file @
51f82c02
...
@@ -565,6 +565,8 @@ void ReferenceCalcAmoebaMultipoleForceKernel::initialize(const System& system, c
...
@@ -565,6 +565,8 @@ void ReferenceCalcAmoebaMultipoleForceKernel::initialize(const System& system, c
if
(
polarizationType
==
AmoebaMultipoleForce
::
Mutual
)
{
if
(
polarizationType
==
AmoebaMultipoleForce
::
Mutual
)
{
mutualInducedMaxIterations
=
force
.
getMutualInducedMaxIterations
();
mutualInducedMaxIterations
=
force
.
getMutualInducedMaxIterations
();
mutualInducedTargetEpsilon
=
force
.
getMutualInducedTargetEpsilon
();
mutualInducedTargetEpsilon
=
force
.
getMutualInducedTargetEpsilon
();
}
else
if
(
polarizationType
==
AmoebaMultipoleForce
::
OPT
)
{
OPTFullCoefficients
=
force
.
getOPTCoefficients
();
}
}
// PME
// PME
...
@@ -667,6 +669,9 @@ AmoebaReferenceMultipoleForce* ReferenceCalcAmoebaMultipoleForceKernel::setupAmo
...
@@ -667,6 +669,9 @@ AmoebaReferenceMultipoleForce* ReferenceCalcAmoebaMultipoleForceKernel::setupAmo
amoebaReferenceMultipoleForce
->
setMaximumMutualInducedDipoleIterations
(
mutualInducedMaxIterations
);
amoebaReferenceMultipoleForce
->
setMaximumMutualInducedDipoleIterations
(
mutualInducedMaxIterations
);
}
else
if
(
polarizationType
==
AmoebaMultipoleForce
::
Direct
)
{
}
else
if
(
polarizationType
==
AmoebaMultipoleForce
::
Direct
)
{
amoebaReferenceMultipoleForce
->
setPolarizationType
(
AmoebaReferenceMultipoleForce
::
Direct
);
amoebaReferenceMultipoleForce
->
setPolarizationType
(
AmoebaReferenceMultipoleForce
::
Direct
);
}
else
if
(
polarizationType
==
AmoebaMultipoleForce
::
OPT
)
{
amoebaReferenceMultipoleForce
->
setPolarizationType
(
AmoebaReferenceMultipoleForce
::
OPT
);
amoebaReferenceMultipoleForce
->
setOPTCoefficients
(
OPTFullCoefficients
);
}
else
{
}
else
{
throw
OpenMMException
(
"Polarization type not recognzied."
);
throw
OpenMMException
(
"Polarization type not recognzied."
);
}
}
...
...
plugins/amoeba/platforms/reference/src/AmoebaReferenceKernels.h
View file @
51f82c02
...
@@ -432,6 +432,7 @@ private:
...
@@ -432,6 +432,7 @@ private:
int
mutualInducedMaxIterations
;
int
mutualInducedMaxIterations
;
RealOpenMM
mutualInducedTargetEpsilon
;
RealOpenMM
mutualInducedTargetEpsilon
;
std
::
vector
<
double
>
OPTFullCoefficients
;
bool
usePme
;
bool
usePme
;
RealOpenMM
alphaEwald
;
RealOpenMM
alphaEwald
;
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceMultipoleForce.cpp
View file @
51f82c02
This diff is collapsed.
Click to expand it.
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceMultipoleForce.h
View file @
51f82c02
...
@@ -345,11 +345,16 @@ public:
...
@@ -345,11 +345,16 @@ public:
*/
*/
Mutual
=
0
,
Mutual
=
0
,
/**
/**
* Direct polarization
* Direct polarization
*/
*/
Direct
=
1
Direct
=
1
,
};
/**
* Optimized perturbation theory
*/
OPT
=
2
};
/**
/**
* Constructor
* Constructor
...
@@ -422,6 +427,15 @@ public:
...
@@ -422,6 +427,15 @@ public:
*/
*/
RealOpenMM
getMutualInducedDipoleEpsilon
()
const
;
RealOpenMM
getMutualInducedDipoleEpsilon
()
const
;
/**
* Set the coefficients for the µ_0, µ_1, µ_2, µ_n terms in the pertubation
* theory algorithm for induced dipoles
*
* @param optCoefficients a vector whose mth entry specifies the coefficient for µ_m
*
*/
void
setOPTCoefficients
(
const
std
::
vector
<
RealOpenMM
>
&
OPTFullCoefficients
);
/**
/**
* Set the target epsilon for converging mutual induced dipoles.
* Set the target epsilon for converging mutual induced dipoles.
*
*
...
@@ -628,6 +642,7 @@ protected:
...
@@ -628,6 +642,7 @@ protected:
std
::
vector
<
OpenMM
::
RealVec
>*
fixedMultipoleField
;
std
::
vector
<
OpenMM
::
RealVec
>*
fixedMultipoleField
;
std
::
vector
<
OpenMM
::
RealVec
>*
inducedDipoles
;
std
::
vector
<
OpenMM
::
RealVec
>*
inducedDipoles
;
std
::
vector
<
OpenMM
::
RealVec
>
inducedDipoleField
;
std
::
vector
<
OpenMM
::
RealVec
>
inducedDipoleField
;
std
::
vector
<
std
::
vector
<
RealOpenMM
>
>
inducedDipoleFieldGradient
;
};
};
unsigned
int
_numParticles
;
unsigned
int
_numParticles
;
...
@@ -651,10 +666,19 @@ protected:
...
@@ -651,10 +666,19 @@ protected:
std
::
vector
<
RealVec
>
_fixedMultipoleFieldPolar
;
std
::
vector
<
RealVec
>
_fixedMultipoleFieldPolar
;
std
::
vector
<
RealVec
>
_inducedDipole
;
std
::
vector
<
RealVec
>
_inducedDipole
;
std
::
vector
<
RealVec
>
_inducedDipolePolar
;
std
::
vector
<
RealVec
>
_inducedDipolePolar
;
std
::
vector
<
std
::
vector
<
RealVec
>
>
_ptDipoleP
;
std
::
vector
<
std
::
vector
<
RealVec
>
>
_ptDipoleD
;
std
::
vector
<
std
::
vector
<
RealOpenMM
>
>
_ptDipoleFieldGradientP
;
std
::
vector
<
std
::
vector
<
RealOpenMM
>
>
_ptDipoleFieldGradientD
;
int
_mutualInducedDipoleConverged
;
int
_mutualInducedDipoleConverged
;
int
_mutualInducedDipoleIterations
;
int
_mutualInducedDipoleIterations
;
int
_maximumMutualInducedDipoleIterations
;
int
_maximumMutualInducedDipoleIterations
;
int
_maxPTOrder
;
std
::
vector
<
RealOpenMM
>
_OPTFullCoefficients
;
std
::
vector
<
RealOpenMM
>
_OPTPartCoefficients
;
RealOpenMM
_mutualInducedDipoleEpsilon
;
RealOpenMM
_mutualInducedDipoleEpsilon
;
RealOpenMM
_mutualInducedDipoleTargetEpsilon
;
RealOpenMM
_mutualInducedDipoleTargetEpsilon
;
RealOpenMM
_polarSOR
;
RealOpenMM
_polarSOR
;
...
@@ -904,7 +928,7 @@ protected:
...
@@ -904,7 +928,7 @@ protected:
/**
/**
* Calculate fields due induced dipoles at each site.
* Calculate fields due induced dipoles at each site.
*
*
* @param particleI positions and parameters (charge, labFrame dipoles, quadrupoles, ...) for particle I
* @param particleI positions and parameters (charge, labFrame dipoles, quadrupoles, ...) for particle I
* @param particleJ positions and parameters (charge, labFrame dipoles, quadrupoles, ...) for particle J
* @param particleJ positions and parameters (charge, labFrame dipoles, quadrupoles, ...) for particle J
* @param updateInducedDipoleFields vector of UpdateInducedDipoleFieldStruct containing input induced dipoles and output fields
* @param updateInducedDipoleFields vector of UpdateInducedDipoleFieldStruct containing input induced dipoles and output fields
...
@@ -920,6 +944,14 @@ protected:
...
@@ -920,6 +944,14 @@ protected:
*/
*/
virtual
void
calculateInducedDipoleFields
(
const
std
::
vector
<
MultipoleParticleData
>&
particleData
,
virtual
void
calculateInducedDipoleFields
(
const
std
::
vector
<
MultipoleParticleData
>&
particleData
,
std
::
vector
<
UpdateInducedDipoleFieldStruct
>&
updateInducedDipoleFields
);
std
::
vector
<
UpdateInducedDipoleFieldStruct
>&
updateInducedDipoleFields
);
/**
* Calculated induced dipoles using Optimized Perturbation Theory.
*
* @param particleData vector of particle positions and parameters (charge, labFrame dipoles, quadrupoles, ...)
* @param updateInducedDipoleFields vector of UpdateInducedDipoleFieldStruct containing input induced dipoles and output fields
*/
void
convergeInduceDipolesByOPT
(
const
std
::
vector
<
MultipoleParticleData
>&
particleData
,
std
::
vector
<
UpdateInducedDipoleFieldStruct
>&
calculateInducedDipoleField
);
/**
/**
* Converge induced dipoles.
* Converge induced dipoles.
*
*
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaPTPolarization.cpp
0 → 100644
View file @
51f82c02
This diff is collapsed.
Click to expand it.
wrappers/python/src/swig_doxygen/swigInputConfig.py
View file @
51f82c02
...
@@ -247,6 +247,7 @@ UNITS = {
...
@@ -247,6 +247,7 @@ UNITS = {
(
"AmoebaMultipoleForce"
,
"getPmeBSplineOrder"
)
:
(
None
,()),
(
"AmoebaMultipoleForce"
,
"getPmeBSplineOrder"
)
:
(
None
,()),
(
"AmoebaMultipoleForce"
,
"getMutualInducedMaxIterations"
)
:
(
None
,
()),
(
"AmoebaMultipoleForce"
,
"getMutualInducedMaxIterations"
)
:
(
None
,
()),
(
"AmoebaMultipoleForce"
,
"getMutualInducedTargetEpsilon"
)
:
(
None
,
()),
(
"AmoebaMultipoleForce"
,
"getMutualInducedTargetEpsilon"
)
:
(
None
,
()),
(
"AmoebaMultipoleForce"
,
"getOPTCoefficients"
)
:
(
None
,
()),
(
"AmoebaMultipoleForce"
,
"getEwaldErrorTolerance"
)
:
(
None
,
()),
(
"AmoebaMultipoleForce"
,
"getEwaldErrorTolerance"
)
:
(
None
,
()),
(
"AmoebaMultipoleForce"
,
"getPmeGridDimensions"
)
:
(
None
,()),
(
"AmoebaMultipoleForce"
,
"getPmeGridDimensions"
)
:
(
None
,()),
...
...
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