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
43c792f4
Commit
43c792f4
authored
Aug 07, 2010
by
Mark Friedrichs
Browse files
Added tests for Gk + cavity term
parent
a80b8a02
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
15 deletions
+36
-15
plugins/amoeba/platforms/cuda/src/AmoebaCudaData.cpp
plugins/amoeba/platforms/cuda/src/AmoebaCudaData.cpp
+1
-0
plugins/amoeba/platforms/cuda/src/AmoebaCudaKernelFactory.cpp
...ins/amoeba/platforms/cuda/src/AmoebaCudaKernelFactory.cpp
+0
-1
plugins/amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
...amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
+34
-14
plugins/amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.h
...s/amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.h
+1
-0
No files found.
plugins/amoeba/platforms/cuda/src/AmoebaCudaData.cpp
View file @
43c792f4
...
...
@@ -113,6 +113,7 @@ void AmoebaCudaData::initializeGpu( void ) {
}
amoebaGpuBuildOutputBuffers
(
amoebaGpu
);
amoebaGpuBuildThreadBlockWorkList
(
amoebaGpu
);
amoebaGpuBuildScalingList
(
amoebaGpu
);
amoebaGpuSetConstants
(
amoebaGpu
);
gpuInitialized
=
true
;
if
(
log
){
...
...
plugins/amoeba/platforms/cuda/src/AmoebaCudaKernelFactory.cpp
View file @
43c792f4
...
...
@@ -90,7 +90,6 @@ KernelImpl* AmoebaCudaKernelFactory::createKernelImpl(std::string name, const Pl
contextToAmoebaDataMap
[
&
context
]
=
amoebaCudaData
;
amoebaCudaData
->
setLog
(
stderr
);
amoebaCudaData
->
setContextImpl
(
static_cast
<
void
*>
(
&
context
)
);
//(void) fprintf( stderr, "AmoebaCudaKernelFactory::createKernelImpl amoebaCudaDataV=%p\n", static_cast<void*>(amoebaCudaData) );
}
else
{
amoebaCudaData
=
mapIterator
->
second
;
}
...
...
plugins/amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
View file @
43c792f4
...
...
@@ -3776,22 +3776,25 @@ Integrator* readAmoebaParameterFile( const std::string& inputParameterFile, MapS
readAmoebaGeneralizedKirkwoodParameters
(
filePtr
,
forceMap
,
tokens
,
system
,
useOpenMMUnits
,
supplementary
,
inputArgumentMap
,
&
lineCount
,
log
);
}
else
if
(
field
==
"AmoebaGkForce"
){
readVec3
(
filePtr
,
tokens
,
forces
[
AMOEBA_GK_FORCE
],
&
lineCount
,
field
,
log
);
}
else
if
(
field
==
"AmoebaGk_A_ForceAndTorque"
||
}
else
if
(
field
==
"AmoebaGkAndCavityForce"
){
readVec3
(
filePtr
,
tokens
,
forces
[
AMOEBA_GK_CAVITY_FORCE
],
&
lineCount
,
field
,
log
);
}
else
if
(
field
==
"AmoebaGk_A_ForceAndTorque"
||
field
==
"AmoebaGk_A_Force"
||
field
==
"AmoebaGk_A_DrB"
||
field
==
"AmoebaDBorn"
||
field
==
"AmoebaBorn1Force"
||
field
==
"AmoebaBornForce"
||
field
==
"AmoebaGkEdiffForceAndTorque"
||
field
==
"AmoebaGkEdiffForce"
){
field
==
"AmoebaGkEdiffForce"
){
std
::
vector
<
std
::
vector
<
double
>
>
vectorOfDoubleVectors
;
readVectorOfDoubleVectors
(
filePtr
,
tokens
,
vectorOfDoubleVectors
,
&
lineCount
,
field
,
log
);
supplementary
[
field
]
=
vectorOfDoubleVectors
;
}
else
if
(
field
==
"AmoebaGkEnergy"
||
field
==
"AmoebaGkEdiffEnergy"
||
field
==
"AmoebaGk_A_Energy"
||
field
==
"AmoebaBorn1Energy"
||
field
==
"AmoebaBornEnergy"
){
}
else
if
(
field
==
"AmoebaGkEnergy"
||
field
==
"AmoebaGkEdiffEnergy"
||
field
==
"AmoebaGk_A_Energy"
||
field
==
"AmoebaBorn1Energy"
||
field
==
"AmoebaBornEnergy"
||
field
==
"AmoebaGkAndCavityEnergy"
){
double
value
=
atof
(
tokens
[
1
].
c_str
()
);
std
::
vector
<
std
::
vector
<
double
>
>
vectorOfDoubleVectors
;
std
::
vector
<
double
>
doubleVectors
;
...
...
@@ -3800,6 +3803,8 @@ Integrator* readAmoebaParameterFile( const std::string& inputParameterFile, MapS
supplementary
[
field
]
=
vectorOfDoubleVectors
;
if
(
field
==
"AmoebaGkEnergy"
){
potentialEnergy
[
AMOEBA_GK_FORCE
]
=
value
;
}
else
if
(
field
==
"AmoebaGkAndCavityEnergy"
){
potentialEnergy
[
AMOEBA_GK_CAVITY_FORCE
]
=
value
;
}
// Amoeba SASA
...
...
@@ -3871,7 +3876,7 @@ Integrator* readAmoebaParameterFile( const std::string& inputParameterFile, MapS
for
(
MapStringDoubleI
ii
=
potentialEnergy
.
begin
();
ii
!=
potentialEnergy
.
end
();
ii
++
){
if
(
ii
->
first
==
ALL_FORCES
){
allEnergy
=
ii
->
second
;
}
else
{
}
else
if
(
ii
->
first
!=
AMOEBA_GK_CAVITY_FORCE
)
{
totalPotentialEnergy
+=
ii
->
second
;
}
if
(
log
)(
void
)
fprintf
(
log
,
"%30s %15.7e
\n
"
,
ii
->
first
.
c_str
(),
ii
->
second
);
...
...
@@ -3879,6 +3884,11 @@ Integrator* readAmoebaParameterFile( const std::string& inputParameterFile, MapS
potentialEnergy
[
"SumOfInputEnergies"
]
=
totalPotentialEnergy
;
if
(
log
){
MapStringDoubleI
isPresent
=
potentialEnergy
.
find
(
AMOEBA_GK_CAVITY_FORCE
);
if
(
isPresent
!=
potentialEnergy
.
end
()
){
double
cavityEnergy
=
potentialEnergy
[
AMOEBA_GK_CAVITY_FORCE
]
-
potentialEnergy
[
AMOEBA_GK_FORCE
];
(
void
)
fprintf
(
log
,
"Cavity energy %15.7e
\n
"
,
cavityEnergy
);
}
(
void
)
fprintf
(
log
,
"Total PE %15.7e %15.7e
\n
"
,
totalPotentialEnergy
,
allEnergy
);
(
void
)
fprintf
(
log
,
"Read %d lines from file=<%s>
\n
"
,
lineCount
,
inputParameterFile
.
c_str
()
);
(
void
)
fflush
(
log
);
...
...
@@ -4646,18 +4656,21 @@ void testUsingAmoebaTinkerParameterFile( const std::string& amoebaTinkerParamete
// ---------------------------------------------------------------------------------------
int
applyAssert
=
0
;
int
includeCavityTerm
=
0
;
double
tolerance
=
1.0e-02
;
static
const
std
::
string
methodName
=
"testUsingAmoebaTinkerParameterFile"
;
// ---------------------------------------------------------------------------------------
setIntFromMap
(
inputArgumentMap
,
"applyAssert"
,
applyAssert
);
setDoubleFromMap
(
inputArgumentMap
,
"tolerance"
,
tolerance
);
setIntFromMap
(
inputArgumentMap
,
"applyAssert"
,
applyAssert
);
setDoubleFromMap
(
inputArgumentMap
,
"tolerance"
,
tolerance
);
setIntFromMap
(
inputArgumentMap
,
INCLUDE_OBC_CAVITY_TERM
,
includeCavityTerm
);
MapStringVec3
tinkerForces
;
MapStringDouble
tinkerEnergies
;
MapStringVectorOfVectors
supplementary
;
MapStringIntI
isPresent
=
forceMap
.
find
(
AMOEBA_GK_FORCE
);
bool
gkIsActive
;
if
(
isPresent
!=
forceMap
.
end
()
&&
isPresent
->
second
!=
0
){
...
...
@@ -4684,12 +4697,17 @@ void testUsingAmoebaTinkerParameterFile( const std::string& amoebaTinkerParamete
std
::
string
activeForceNames
;
for
(
MapStringInt
::
const_iterator
ii
=
forceMap
.
begin
();
ii
!=
forceMap
.
end
();
ii
++
){
if
(
ii
->
second
){
forceList
.
push_back
(
ii
->
first
);
activeForceNames
+=
ii
->
first
+
":"
;
if
(
includeCavityTerm
&&
ii
->
first
==
AMOEBA_GK_FORCE
){
forceList
.
push_back
(
AMOEBA_GK_CAVITY_FORCE
);
activeForceNames
+=
AMOEBA_GK_CAVITY_FORCE
+
":"
;
}
else
{
forceList
.
push_back
(
ii
->
first
);
activeForceNames
+=
ii
->
first
+
":"
;
}
}
}
if
(
forceList
.
size
()
>=
11
){
activeForceNames
=
ALL_FORCES
;
activeForceNames
=
ALL_FORCES
;
}
std
::
vector
<
Vec3
>
expectedForces
;
...
...
@@ -4805,6 +4823,7 @@ void testUsingAmoebaTinkerParameterFile( const std::string& amoebaTinkerParamete
coordinateConversion
*
(
box
[
1
][
2
]
-
box
[
0
][
2
])
);
unsigned
int
maxPrint
=
5
;
/*
(void) fprintf( filePtr, "Sample raw coordinates (w/o conversion) %8u\n", static_cast<unsigned int>(coordinates.size()) );
for( unsigned int ii = 0; ii < coordinates.size(); ii++ ){
(void) fprintf( filePtr, "%8u [%16.7f %16.7f %16.7f]\n", ii,
...
...
@@ -4813,6 +4832,7 @@ void testUsingAmoebaTinkerParameterFile( const std::string& amoebaTinkerParamete
ii = coordinates.size() - maxPrint - 1;
}
}
*/
(
void
)
fflush
(
filePtr
);
}
}
...
...
@@ -4844,7 +4864,7 @@ void testUsingAmoebaTinkerParameterFile( const std::string& amoebaTinkerParamete
}
}
}
(
void
)
fprintf
(
filePtr
,
"%
3
0s maxRelF/E %10.3e %10.3e E[%15.7e %15.7e] %20s %d
\n
"
,
activeForceNames
.
c_str
(),
maxRelativeDelta
,
(
void
)
fprintf
(
filePtr
,
"%
4
0s maxRelF/E %10.3e %10.3e E[%15.7e %15.7e] %20s %d
\n
"
,
activeForceNames
.
c_str
(),
maxRelativeDelta
,
deltaE
,
expectedEnergy
,
energyConversion
*
state
.
getPotentialEnergy
(),
amoebaTinkerParameterFileName
.
c_str
(),
useOpenMMUnits
);
(
void
)
fflush
(
filePtr
);
}
...
...
plugins/amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.h
View file @
43c792f4
...
...
@@ -74,6 +74,7 @@ static std::string AMOEBA_OUT_OF_PLANE_BEND_FORCE = "AmoebaO
static
std
::
string
AMOEBA_TORSION_TORSION_FORCE
=
"AmoebaTorsionTorsion"
;
static
std
::
string
AMOEBA_MULTIPOLE_FORCE
=
"AmoebaMultipole"
;
static
std
::
string
AMOEBA_GK_FORCE
=
"AmoebaGk"
;
static
std
::
string
AMOEBA_GK_CAVITY_FORCE
=
"AmoebaGkAndCavity"
;
static
std
::
string
AMOEBA_VDW_FORCE
=
"AmoebaVdw"
;
static
std
::
string
AMOEBA_WCA_DISPERSION_FORCE
=
"AmoebaWcaDispersion"
;
static
std
::
string
AMOEBA_SASA_FORCE
=
"AmoebaSASA"
;
...
...
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