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
029302df
"...src/ssh:/git@developer.sourcefind.cn:2222/tsoc/openmm.git" did not exist on "6bde69d9d2e7325c170a97bda6f1d7cae74b8adb"
Commit
029302df
authored
Sep 22, 2015
by
Andy Simmonett
Browse files
Added hooks for the Optimized Perturbation Theory Reference impl.
parent
9a3877b9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
4 deletions
+79
-4
plugins/amoeba/openmmapi/include/openmm/AmoebaMultipoleForce.h
...ns/amoeba/openmmapi/include/openmm/AmoebaMultipoleForce.h
+27
-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
+13
-0
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceMultipoleForce.h
...erence/src/SimTKReference/AmoebaReferenceMultipoleForce.h
+20
-3
No files found.
plugins/amoeba/openmmapi/include/openmm/AmoebaMultipoleForce.h
View file @
029302df
...
@@ -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
};
...
@@ -296,6 +302,24 @@ public:
...
@@ -296,6 +302,24 @@ public:
*/
*/
void
setMutualInducedTargetEpsilon
(
double
inputMutualInducedTargetEpsilon
);
void
setMutualInducedTargetEpsilon
(
double
inputMutualInducedTargetEpsilon
);
/**
* 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
<
double
>
&
OPTFullCoefficientsIn
);
/**
* 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
*
*/
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)
...
@@ -382,6 +406,8 @@ private:
...
@@ -382,6 +406,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 @
029302df
...
@@ -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 @
029302df
...
@@ -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 @
029302df
...
@@ -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 @
029302df
...
@@ -162,6 +162,19 @@ RealOpenMM AmoebaReferenceMultipoleForce::getMutualInducedDipoleTargetEpsilon()
...
@@ -162,6 +162,19 @@ RealOpenMM AmoebaReferenceMultipoleForce::getMutualInducedDipoleTargetEpsilon()
return
_mutualInducedDipoleTargetEpsilon
;
return
_mutualInducedDipoleTargetEpsilon
;
}
}
void
AmoebaReferenceMultipoleForce
::
setOPTCoefficients
(
const
std
::
vector
<
RealOpenMM
>
&
OPTFullCoefficients
)
{
_maxPTOrder
=
OPTFullCoefficients
.
size
();
// This accounts for the zero-based counting; actual highest order is 1 less
_OPTFullCoefficients
.
resize
(
_maxPTOrder
);
_OPTPartCoefficients
.
resize
(
_maxPTOrder
);
std
::
copy
(
OPTFullCoefficients
.
begin
(),
OPTFullCoefficients
.
end
(),
_OPTFullCoefficients
.
begin
());
for
(
int
i
=
0
;
i
<
_maxPTOrder
;
++
i
){
_OPTPartCoefficients
[
i
]
=
0.0
;
for
(
int
j
=
i
;
j
<
_maxPTOrder
;
++
j
)
_OPTPartCoefficients
[
i
]
+=
_OPTFullCoefficients
[
j
];
}
}
void
AmoebaReferenceMultipoleForce
::
setMutualInducedDipoleTargetEpsilon
(
RealOpenMM
mutualInducedDipoleTargetEpsilon
)
void
AmoebaReferenceMultipoleForce
::
setMutualInducedDipoleTargetEpsilon
(
RealOpenMM
mutualInducedDipoleTargetEpsilon
)
{
{
_mutualInducedDipoleTargetEpsilon
=
mutualInducedDipoleTargetEpsilon
;
_mutualInducedDipoleTargetEpsilon
=
mutualInducedDipoleTargetEpsilon
;
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceMultipoleForce.h
View file @
029302df
...
@@ -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.
*
*
...
@@ -655,6 +669,9 @@ protected:
...
@@ -655,6 +669,9 @@ protected:
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
;
...
...
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