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
accc4ccd
Commit
accc4ccd
authored
Aug 04, 2010
by
Mark Friedrichs
Browse files
Mods to quiet gcc (Ubuntu 4.3.3-5ubuntu4)
parent
545a83ee
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
89 additions
and
67 deletions
+89
-67
plugins/amoeba/platforms/cuda/src/kernels/AmoebaGpu.cpp
plugins/amoeba/platforms/cuda/src/kernels/AmoebaGpu.cpp
+6
-6
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaElectrostatic.cu
...rms/cuda/src/kernels/kCalculateAmoebaCudaElectrostatic.cu
+1
-1
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwood.cu
...latforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwood.cu
+1
-1
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwoodEDiff.cu
...rms/cuda/src/kernels/kCalculateAmoebaCudaKirkwoodEDiff.cu
+4
-2
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaMutualInducedAndGkFields.cu
...c/kernels/kCalculateAmoebaCudaMutualInducedAndGkFields.cu
+2
-0
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaWcaDispersion.cu
...rms/cuda/src/kernels/kCalculateAmoebaCudaWcaDispersion.cu
+1
-1
plugins/amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
...amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
+74
-56
No files found.
plugins/amoeba/platforms/cuda/src/kernels/AmoebaGpu.cpp
View file @
accc4ccd
...
@@ -504,7 +504,7 @@ void gpuSetAmoebaAngleParameters(amoebaGpuContext amoebaGpu, const std::vector<i
...
@@ -504,7 +504,7 @@ void gpuSetAmoebaAngleParameters(amoebaGpuContext amoebaGpu, const std::vector<i
#define DUMP_PARAMETERS 5
#define DUMP_PARAMETERS 5
#if (DUMP_PARAMETERS > 0 )
#if (DUMP_PARAMETERS > 0 )
if
(
(
i
<
DUMP_PARAMETERS
||
i
>
bond_angles
-
(
DUMP_PARAMETERS
+
1
))
&&
amoebaGpu
->
log
)
if
(
(
i
<
DUMP_PARAMETERS
||
i
>
bond_angles
-
(
DUMP_PARAMETERS
+
1
))
&&
amoebaGpu
->
log
)
fprintf
(
amoebaGpu
->
log
,
"Angles: %5d [%5d %5d %5d
] [%5d
%5d %5d] A=%15.7e k
[%15.7e
%15.7e
]
[%5d %5d %5d]
\n
"
,
i
,
fprintf
(
amoebaGpu
->
log
,
"Angles: %5d [%5d %5d %5d
%5d] [
%5d %5d] A=%15.7e k
=
%15.7e [%5d %5d %5d]
\n
"
,
i
,
(
*
psAngleID1
)[
i
].
x
,
(
*
psAngleID1
)[
i
].
y
,
(
*
psAngleID1
)[
i
].
z
,
(
*
psAngleID1
)[
i
].
w
,
(
*
psAngleID1
)[
i
].
x
,
(
*
psAngleID1
)[
i
].
y
,
(
*
psAngleID1
)[
i
].
z
,
(
*
psAngleID1
)[
i
].
w
,
(
*
psAngleID2
)[
i
].
x
,
(
*
psAngleID2
)[
i
].
y
,
(
*
psAngleID2
)[
i
].
x
,
(
*
psAngleID2
)[
i
].
y
,
(
*
psAngleParameter
)[
i
].
x
,
(
*
psAngleParameter
)[
i
].
y
,
(
*
psAngleParameter
)[
i
].
x
,
(
*
psAngleParameter
)[
i
].
y
,
...
@@ -564,7 +564,7 @@ void gpuSetAmoebaInPlaneAngleParameters(amoebaGpuContext amoebaGpu, const std::v
...
@@ -564,7 +564,7 @@ void gpuSetAmoebaInPlaneAngleParameters(amoebaGpuContext amoebaGpu, const std::v
#define DUMP_PARAMETERS 5
#define DUMP_PARAMETERS 5
#if (DUMP_PARAMETERS > 0 )
#if (DUMP_PARAMETERS > 0 )
if
(
(
i
<
DUMP_PARAMETERS
||
i
>
bond_angles
-
(
DUMP_PARAMETERS
+
1
))
&&
amoebaGpu
->
log
)
if
(
(
i
<
DUMP_PARAMETERS
||
i
>
bond_angles
-
(
DUMP_PARAMETERS
+
1
))
&&
amoebaGpu
->
log
)
fprintf
(
amoebaGpu
->
log
,
"InPlaneAngles: %5d [%5d %5d %5d %5d] [%5d %5d %5d %5d] A=%15.7e k
[%15.7e %15.7e %15.7e %15.7e %15.7e]
[%5d %5d %5d %5d]
\n
"
,
i
,
fprintf
(
amoebaGpu
->
log
,
"InPlaneAngles: %5d [%5d %5d %5d %5d] [%5d %5d %5d %5d] A=%15.7e k
=%15.7e
[%5d %5d %5d %5d]
\n
"
,
i
,
(
*
psAngleID1
)[
i
].
x
,
(
*
psAngleID1
)[
i
].
y
,
(
*
psAngleID1
)[
i
].
z
,
(
*
psAngleID1
)[
i
].
w
,
(
*
psAngleID1
)[
i
].
x
,
(
*
psAngleID1
)[
i
].
y
,
(
*
psAngleID1
)[
i
].
z
,
(
*
psAngleID1
)[
i
].
w
,
(
*
psAngleID2
)[
i
].
x
,
(
*
psAngleID2
)[
i
].
y
,
(
*
psAngleID2
)[
i
].
z
,
(
*
psAngleID2
)[
i
].
w
,
(
*
psAngleID2
)[
i
].
x
,
(
*
psAngleID2
)[
i
].
y
,
(
*
psAngleID2
)[
i
].
z
,
(
*
psAngleID2
)[
i
].
w
,
(
*
psAngleParameter
)[
i
].
x
,
(
*
psAngleParameter
)[
i
].
y
,
(
*
psAngleParameter
)[
i
].
x
,
(
*
psAngleParameter
)[
i
].
y
,
...
@@ -2100,7 +2100,7 @@ void gpuSetAmoebaVdwParameters( amoebaGpuContext amoebaGpu,
...
@@ -2100,7 +2100,7 @@ void gpuSetAmoebaVdwParameters( amoebaGpuContext amoebaGpu,
psVdwReductionID
->
_pSysStream
[
0
][
count
].
w
=
ii
;
psVdwReductionID
->
_pSysStream
[
0
][
count
].
w
=
ii
;
}
}
if
(
ivMapping
[
ii
].
size
()
>
3
){
if
(
ivMapping
[
ii
].
size
()
>
3
){
(
void
)
fprintf
(
stderr
,
"Atom %u has %u reductions -- invalid -- aborting"
,
ii
,
ivMapping
[
ii
].
size
()
);
(
void
)
fprintf
(
stderr
,
"Atom %u has %u reductions -- invalid -- aborting"
,
ii
,
static_cast
<
unsigned
int
>
(
ivMapping
[
ii
].
size
()
)
);
exit
(
1
);
exit
(
1
);
}
}
count
++
;
count
++
;
...
@@ -2335,7 +2335,7 @@ void amoebaGpuBuildVdwExclusionList( amoebaGpuContext amoebaGpu, const std::vec
...
@@ -2335,7 +2335,7 @@ void amoebaGpuBuildVdwExclusionList( amoebaGpuContext amoebaGpu, const std::vec
for
(
unsigned
int
ii
=
0
;
ii
<
actualAtoms
;
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
actualAtoms
;
ii
++
){
bool
error
=
false
;
bool
error
=
false
;
if
(
exclusions
[
ii
].
size
()
!=
echoExclusions
[
ii
].
size
()
){
if
(
exclusions
[
ii
].
size
()
!=
echoExclusions
[
ii
].
size
()
){
(
void
)
fprintf
(
amoebaGpu
->
log
,
"
\n
Atom %6d sz %6u %6u XX
\n
"
,
ii
,
exclusions
[
ii
].
size
(),
echoExclusions
[
ii
].
size
()
);
(
void
)
fprintf
(
amoebaGpu
->
log
,
"
\n
Atom %6d sz %6u %6u XX
\n
"
,
ii
,
static_cast
<
unsigned
int
>
(
exclusions
[
ii
].
size
()
)
,
static_cast
<
unsigned
int
>
(
echoExclusions
[
ii
].
size
()
)
);
error
=
true
;
error
=
true
;
totalErrors
++
;
totalErrors
++
;
}
}
...
@@ -2736,7 +2736,7 @@ static int matchMaps( std::string idString, MapIntFloat* map1, MapIntFloat* map
...
@@ -2736,7 +2736,7 @@ static int matchMaps( std::string idString, MapIntFloat* map1, MapIntFloat* map
int
equalSizes
=
1
;
int
equalSizes
=
1
;
int
error
=
0
;
int
error
=
0
;
if
(
map1
->
size
()
!=
map2
->
size
()
){
if
(
map1
->
size
()
!=
map2
->
size
()
){
(
void
)
fprintf
(
log
,
"%s sizes unequal: %u %u
\n
"
,
idString
.
c_str
(),
map1
->
size
(),
map2
->
size
()
);
(
void
)
fprintf
(
log
,
"%s sizes unequal: %u %u
\n
"
,
idString
.
c_str
(),
static_cast
<
unsigned
int
>
(
map1
->
size
()
)
,
static_cast
<
unsigned
int
>
(
map2
->
size
()
)
);
equalSizes
=
0
;
equalSizes
=
0
;
error
++
;
error
++
;
}
}
...
@@ -3713,7 +3713,7 @@ void cudaWriteVectorOfDoubleVectorsToFile( char* fname, std::vector<int>& fileId
...
@@ -3713,7 +3713,7 @@ void cudaWriteVectorOfDoubleVectorsToFile( char* fname, std::vector<int>& fileId
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
FILE
*
filePtr
=
getWriteToFilePtrV
(
fname
,
fileId
);
FILE
*
filePtr
=
getWriteToFilePtrV
(
fname
,
fileId
);
(
void
)
fprintf
(
filePtr
,
"%u
\n
"
,
outputVector
.
size
()
);
(
void
)
fprintf
(
filePtr
,
"%u
\n
"
,
static_cast
<
unsigned
int
>
(
outputVector
.
size
()
)
);
float
values
[
50
];
float
values
[
50
];
for
(
unsigned
int
ii
=
0
;
ii
<
outputVector
.
size
();
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
outputVector
.
size
();
ii
++
){
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaElectrostatic.cu
View file @
accc4ccd
...
@@ -829,7 +829,7 @@ void cudaComputeAmoebaElectrostatic( amoebaGpuContext amoebaGpu )
...
@@ -829,7 +829,7 @@ void cudaComputeAmoebaElectrostatic( amoebaGpuContext amoebaGpu )
if
(
gpu
->
bOutputBufferPerWarp
){
if
(
gpu
->
bOutputBufferPerWarp
){
(
void
)
fprintf
(
amoebaGpu
->
log
,
"kCalculateAmoebaCudaElectrostaticN2Forces warp: numBlocks=%u numThreads=%u bufferPerWarp=%u atm=%u shrd=%u Ebuf=%u ixnCt=%u workUnits=%u
\n
"
,
(
void
)
fprintf
(
amoebaGpu
->
log
,
"kCalculateAmoebaCudaElectrostaticN2Forces warp: numBlocks=%u numThreads=%u bufferPerWarp=%u atm=%
l
u shrd=%
l
u Ebuf=%u ixnCt=%
l
u workUnits=%u
\n
"
,
amoebaGpu
->
nonbondBlocks
,
threadsPerBlock
,
amoebaGpu
->
bOutputBufferPerWarp
,
amoebaGpu
->
nonbondBlocks
,
threadsPerBlock
,
amoebaGpu
->
bOutputBufferPerWarp
,
sizeof
(
ElectrostaticParticle
),
sizeof
(
ElectrostaticParticle
)
*
threadsPerBlock
,
amoebaGpu
->
energyOutputBuffers
,
(
*
gpu
->
psInteractionCount
)[
0
],
gpu
->
sim
.
workUnits
);
sizeof
(
ElectrostaticParticle
),
sizeof
(
ElectrostaticParticle
)
*
threadsPerBlock
,
amoebaGpu
->
energyOutputBuffers
,
(
*
gpu
->
psInteractionCount
)[
0
],
gpu
->
sim
.
workUnits
);
(
void
)
fflush
(
amoebaGpu
->
log
);
(
void
)
fflush
(
amoebaGpu
->
log
);
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwood.cu
View file @
accc4ccd
...
@@ -1971,7 +1971,7 @@ void kCalculateAmoebaKirkwood( amoebaGpuContext amoebaGpu )
...
@@ -1971,7 +1971,7 @@ void kCalculateAmoebaKirkwood( amoebaGpuContext amoebaGpu )
if
(
amoebaGpu
->
log
){
if
(
amoebaGpu
->
log
){
(
void
)
fprintf
(
amoebaGpu
->
log
,
"kCalculateAmoebaCudaKirkwood: blcks=%u tds=%u %u bPrWrp=%u atm=%u shrd=%u Ebuf=%u ixnCt=%u workUnits=%u
\n
"
,
(
void
)
fprintf
(
amoebaGpu
->
log
,
"kCalculateAmoebaCudaKirkwood: blcks=%u tds=%u %u bPrWrp=%u atm=%
l
u shrd=%
l
u Ebuf=%u ixnCt=%
l
u workUnits=%u
\n
"
,
amoebaGpu
->
nonbondBlocks
,
threadsPerBlock
,
maxThreads
,
amoebaGpu
->
bOutputBufferPerWarp
,
amoebaGpu
->
nonbondBlocks
,
threadsPerBlock
,
maxThreads
,
amoebaGpu
->
bOutputBufferPerWarp
,
sizeof
(
KirkwoodParticle
),
sizeof
(
KirkwoodParticle
)
*
threadsPerBlock
,
sizeof
(
KirkwoodParticle
),
sizeof
(
KirkwoodParticle
)
*
threadsPerBlock
,
amoebaGpu
->
energyOutputBuffers
,
(
*
gpu
->
psInteractionCount
)[
0
],
gpu
->
sim
.
workUnits
);
amoebaGpu
->
energyOutputBuffers
,
(
*
gpu
->
psInteractionCount
)[
0
],
gpu
->
sim
.
workUnits
);
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaKirkwoodEDiff.cu
View file @
accc4ccd
...
@@ -1031,6 +1031,7 @@ __device__ void calculateKirkwoodEDiffPairIxn_kernel( float4 atomCoordinatesI,
...
@@ -1031,6 +1031,7 @@ __device__ void calculateKirkwoodEDiffPairIxn_kernel( float4 atomCoordinatesI,
}
}
#ifdef AMOEBA_DEBUG
__device__
static
int
debugAccumulate
(
unsigned
int
index
,
float4
*
debugArray
,
float
*
field
,
unsigned
int
addMask
,
float
idLabel
)
__device__
static
int
debugAccumulate
(
unsigned
int
index
,
float4
*
debugArray
,
float
*
field
,
unsigned
int
addMask
,
float
idLabel
)
{
{
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
...
@@ -1041,6 +1042,7 @@ __device__ static int debugAccumulate( unsigned int index, float4* debugArray, f
...
@@ -1041,6 +1042,7 @@ __device__ static int debugAccumulate( unsigned int index, float4* debugArray, f
return
index
;
return
index
;
}
}
#endif
__device__
void
zeroKirkwoodEDiffParticleSharedField
(
struct
KirkwoodEDiffParticle
*
sA
)
__device__
void
zeroKirkwoodEDiffParticleSharedField
(
struct
KirkwoodEDiffParticle
*
sA
)
{
{
...
@@ -1154,11 +1156,11 @@ void kCalculateAmoebaKirkwoodEDiff( amoebaGpuContext amoebaGpu )
...
@@ -1154,11 +1156,11 @@ void kCalculateAmoebaKirkwoodEDiff( amoebaGpuContext amoebaGpu )
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
static
const
char
*
methodName
=
"kCalculateAmoebaKirkwoodEDiff"
;
static
unsigned
int
threadsPerBlock
=
0
;
static
unsigned
int
threadsPerBlock
=
0
;
static
int
timestep
=
0
;
static
int
timestep
=
0
;
timestep
++
;
timestep
++
;
#ifdef AMOEBA_DEBUG
#ifdef AMOEBA_DEBUG
static
const
char
*
methodName
=
"kCalculateAmoebaKirkwoodEDiff"
;
std
::
vector
<
int
>
fileId
;
std
::
vector
<
int
>
fileId
;
fileId
.
resize
(
2
);
fileId
.
resize
(
2
);
fileId
[
0
]
=
timestep
;
fileId
[
0
]
=
timestep
;
...
@@ -1201,7 +1203,7 @@ void kCalculateAmoebaKirkwoodEDiff( amoebaGpuContext amoebaGpu )
...
@@ -1201,7 +1203,7 @@ void kCalculateAmoebaKirkwoodEDiff( amoebaGpuContext amoebaGpu )
}
}
if
(
amoebaGpu
->
log
&&
timestep
==
1
){
if
(
amoebaGpu
->
log
&&
timestep
==
1
){
(
void
)
fprintf
(
amoebaGpu
->
log
,
"kCalculateAmoebaCudaKirkwoodEDiffN2Forces: numBlocks=%u numThreads=%u bufferPerWarp=%u atm=%u shrd=%u Ebuf=%u ixnCt=%u workUnits=%u
\n
"
,
(
void
)
fprintf
(
amoebaGpu
->
log
,
"kCalculateAmoebaCudaKirkwoodEDiffN2Forces: numBlocks=%u numThreads=%u bufferPerWarp=%u atm=%
l
u shrd=%
l
u Ebuf=%u ixnCt=%
l
u workUnits=%u
\n
"
,
amoebaGpu
->
nonbondBlocks
,
threadsPerBlock
,
amoebaGpu
->
bOutputBufferPerWarp
,
amoebaGpu
->
nonbondBlocks
,
threadsPerBlock
,
amoebaGpu
->
bOutputBufferPerWarp
,
sizeof
(
KirkwoodEDiffParticle
),
sizeof
(
KirkwoodEDiffParticle
)
*
threadsPerBlock
,
sizeof
(
KirkwoodEDiffParticle
),
sizeof
(
KirkwoodEDiffParticle
)
*
threadsPerBlock
,
amoebaGpu
->
energyOutputBuffers
,
(
*
gpu
->
psInteractionCount
)[
0
],
gpu
->
sim
.
workUnits
);
amoebaGpu
->
energyOutputBuffers
,
(
*
gpu
->
psInteractionCount
)[
0
],
gpu
->
sim
.
workUnits
);
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaMutualInducedAndGkFields.cu
View file @
accc4ccd
...
@@ -267,6 +267,7 @@ __device__ void calculateMutualInducedAndGkFieldsGkPairIxn_kernel( float4 atomCo
...
@@ -267,6 +267,7 @@ __device__ void calculateMutualInducedAndGkFieldsGkPairIxn_kernel( float4 atomCo
}
}
#ifdef AMOEBA_DEBUG
__device__
static
int
debugAccumulate
(
int
index
,
float4
*
debugArray
,
float
*
field
,
unsigned
int
addMask
,
float
idLabel
)
__device__
static
int
debugAccumulate
(
int
index
,
float4
*
debugArray
,
float
*
field
,
unsigned
int
addMask
,
float
idLabel
)
{
{
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
index
+=
cAmoebaSim
.
paddedNumberOfAtoms
;
...
@@ -277,6 +278,7 @@ __device__ static int debugAccumulate( int index, float4* debugArray, float* fie
...
@@ -277,6 +278,7 @@ __device__ static int debugAccumulate( int index, float4* debugArray, float* fie
return
index
;
return
index
;
}
}
#endif
#define GK
#define GK
#include "kCalculateAmoebaCudaMutualInducedParticle.h"
#include "kCalculateAmoebaCudaMutualInducedParticle.h"
...
...
plugins/amoeba/platforms/cuda/src/kernels/kCalculateAmoebaCudaWcaDispersion.cu
View file @
accc4ccd
...
@@ -31,7 +31,7 @@ void GetCalculateAmoebaCudaWcaDispersionSim(amoebaGpuContext amoebaGpu)
...
@@ -31,7 +31,7 @@ void GetCalculateAmoebaCudaWcaDispersionSim(amoebaGpuContext amoebaGpu)
gpuContext
gpu
=
amoebaGpu
->
gpuContext
;
gpuContext
gpu
=
amoebaGpu
->
gpuContext
;
status
=
cudaMemcpyFromSymbol
(
&
gpu
->
sim
,
cSim
,
sizeof
(
cudaGmxSimulation
));
status
=
cudaMemcpyFromSymbol
(
&
gpu
->
sim
,
cSim
,
sizeof
(
cudaGmxSimulation
));
fprintf
(
stderr
,
"In GetCalculateAmoebaCudaWcaDispersionSim: %p %u %u
\n
"
,
fprintf
(
stderr
,
"In GetCalculateAmoebaCudaWcaDispersionSim: %p %
l
u %u
\n
"
,
gpu
->
psInteractionCount
->
_pSysStream
[
0
],
gpu
->
psInteractionCount
->
_pSysStream
[
0
][
0
],
gpu
->
sim
.
workUnits
);
gpu
->
psInteractionCount
->
_pSysStream
[
0
],
gpu
->
psInteractionCount
->
_pSysStream
[
0
][
0
],
gpu
->
sim
.
workUnits
);
RTERROR
(
status
,
"GetCalculateAmoebaCudaWcaDispersionSim: cudaMemcpyFromSymbol: SetSim copy from cSim failed"
);
RTERROR
(
status
,
"GetCalculateAmoebaCudaWcaDispersionSim: cudaMemcpyFromSymbol: SetSim copy from cSim failed"
);
...
...
plugins/amoeba/platforms/cuda/tests/AmoebaTinkerParameterFile.cpp
View file @
accc4ccd
...
@@ -306,7 +306,7 @@ static int setDoubleFromMap( MapStringString& argumentMap, std::string fieldToCh
...
@@ -306,7 +306,7 @@ static int setDoubleFromMap( MapStringString& argumentMap, std::string fieldToCh
--------------------------------------------------------------------------------------- */
--------------------------------------------------------------------------------------- */
static
char
*
readLine
(
FILE
*
filePtr
,
StringVector
&
tokens
,
int
*
lineCount
,
FILE
*
log
){
static
int
readLine
(
FILE
*
filePtr
,
StringVector
&
tokens
,
int
*
lineCount
,
FILE
*
log
){
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
...
@@ -323,7 +323,7 @@ static char* readLine( FILE* filePtr, StringVector& tokens, int* lineCount, FILE
...
@@ -323,7 +323,7 @@ static char* readLine( FILE* filePtr, StringVector& tokens, int* lineCount, FILE
(
*
lineCount
)
++
;
(
*
lineCount
)
++
;
tokenizeString
(
buffer
,
tokens
,
delimiter
);
tokenizeString
(
buffer
,
tokens
,
delimiter
);
}
}
return
isNotEof
;
return
0
;
}
}
...
@@ -367,7 +367,7 @@ static int readFile( std::string fileName, StringVectorVector& fileContents, FIL
...
@@ -367,7 +367,7 @@ static int readFile( std::string fileName, StringVectorVector& fileContents, FIL
StringVector
firstLine
;
StringVector
firstLine
;
int
lineCount
=
0
;
int
lineCount
=
0
;
char
*
isNotEof
=
readLine
(
filePtr
,
firstLine
,
&
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
firstLine
,
&
lineCount
,
log
);
fileContents
.
push_back
(
firstLine
);
fileContents
.
push_back
(
firstLine
);
while
(
isNotEof
){
while
(
isNotEof
){
StringVector
lineTokens
;
StringVector
lineTokens
;
...
@@ -418,7 +418,7 @@ static int readVectorOfDoubleVectors( FILE* filePtr, const StringVector& tokens,
...
@@ -418,7 +418,7 @@ static int readVectorOfDoubleVectors( FILE* filePtr, const StringVector& tokens,
for
(
int
ii
=
0
;
ii
<
numberToRead
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberToRead
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
1
){
if
(
lineTokens
.
size
()
>
1
){
int
index
=
atoi
(
lineTokens
[
0
].
c_str
()
);
int
index
=
atoi
(
lineTokens
[
0
].
c_str
()
);
std
::
vector
<
double
>
nextEntry
;
std
::
vector
<
double
>
nextEntry
;
...
@@ -497,7 +497,7 @@ static int readVectorOfIntVectors( FILE* filePtr, const StringVector& tokens, st
...
@@ -497,7 +497,7 @@ static int readVectorOfIntVectors( FILE* filePtr, const StringVector& tokens, st
}
}
for
(
int
ii
=
0
;
ii
<
numberToRead
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberToRead
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
1
){
if
(
lineTokens
.
size
()
>
1
){
int
index
=
atoi
(
lineTokens
[
0
].
c_str
()
);
int
index
=
atoi
(
lineTokens
[
0
].
c_str
()
);
std
::
vector
<
int
>
nextEntry
;
std
::
vector
<
int
>
nextEntry
;
...
@@ -659,7 +659,7 @@ static int readMasses( FILE* filePtr, const StringVector& tokens, System& system
...
@@ -659,7 +659,7 @@ static int readMasses( FILE* filePtr, const StringVector& tokens, System& system
}
}
for
(
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>=
1
){
if
(
lineTokens
.
size
()
>=
1
){
int
tokenIndex
=
0
;
int
tokenIndex
=
0
;
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
...
@@ -744,7 +744,7 @@ static int readAmoebaHarmonicBondParameters( FILE* filePtr, MapStringInt& forceM
...
@@ -744,7 +744,7 @@ static int readAmoebaHarmonicBondParameters( FILE* filePtr, MapStringInt& forceM
}
}
for
(
int
ii
=
0
;
ii
<
numberOfBonds
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfBonds
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
4
){
if
(
lineTokens
.
size
()
>
4
){
int
tokenIndex
=
0
;
int
tokenIndex
=
0
;
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
...
@@ -761,7 +761,7 @@ static int readAmoebaHarmonicBondParameters( FILE* filePtr, MapStringInt& forceM
...
@@ -761,7 +761,7 @@ static int readAmoebaHarmonicBondParameters( FILE* filePtr, MapStringInt& forceM
// get cubic and quartic factors
// get cubic and quartic factors
char
*
isNotEof
=
"1"
;
int
isNotEof
=
1
;
int
hits
=
0
;
int
hits
=
0
;
while
(
hits
<
2
){
while
(
hits
<
2
){
StringVector
tokens
;
StringVector
tokens
;
...
@@ -885,7 +885,7 @@ static int readAmoebaHarmonicAngleParameters( FILE* filePtr, MapStringInt& force
...
@@ -885,7 +885,7 @@ static int readAmoebaHarmonicAngleParameters( FILE* filePtr, MapStringInt& force
}
}
for
(
int
ii
=
0
;
ii
<
numberOfAngles
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfAngles
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
5
){
if
(
lineTokens
.
size
()
>
5
){
int
tokenIndex
=
0
;
int
tokenIndex
=
0
;
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
...
@@ -904,7 +904,7 @@ static int readAmoebaHarmonicAngleParameters( FILE* filePtr, MapStringInt& force
...
@@ -904,7 +904,7 @@ static int readAmoebaHarmonicAngleParameters( FILE* filePtr, MapStringInt& force
// get cubic, quartic, pentic, sextic factors
// get cubic, quartic, pentic, sextic factors
char
*
isNotEof
=
"1"
;
int
isNotEof
=
1
;
int
hits
=
0
;
int
hits
=
0
;
while
(
hits
<
4
){
while
(
hits
<
4
){
StringVector
tokens
;
StringVector
tokens
;
...
@@ -1047,7 +1047,7 @@ static int readAmoebaHarmonicInPlaneAngleParameters( FILE* filePtr, MapStringInt
...
@@ -1047,7 +1047,7 @@ static int readAmoebaHarmonicInPlaneAngleParameters( FILE* filePtr, MapStringInt
}
}
for
(
int
ii
=
0
;
ii
<
numberOfAngles
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfAngles
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
6
){
if
(
lineTokens
.
size
()
>
6
){
int
tokenIndex
=
0
;
int
tokenIndex
=
0
;
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
...
@@ -1066,7 +1066,7 @@ static int readAmoebaHarmonicInPlaneAngleParameters( FILE* filePtr, MapStringInt
...
@@ -1066,7 +1066,7 @@ static int readAmoebaHarmonicInPlaneAngleParameters( FILE* filePtr, MapStringInt
// get cubic, quartic, pentic, sextic factors
// get cubic, quartic, pentic, sextic factors
char
*
isNotEof
=
"1"
;
int
isNotEof
=
1
;
int
hits
=
0
;
int
hits
=
0
;
while
(
hits
<
4
){
while
(
hits
<
4
){
StringVector
tokens
;
StringVector
tokens
;
...
@@ -1208,7 +1208,7 @@ static int readAmoebaTorsionParameters( FILE* filePtr, MapStringInt& forceMap, c
...
@@ -1208,7 +1208,7 @@ static int readAmoebaTorsionParameters( FILE* filePtr, MapStringInt& forceMap, c
}
}
for
(
int
ii
=
0
;
ii
<
numberOfTorsions
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfTorsions
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
10
){
if
(
lineTokens
.
size
()
>
10
){
std
::
vector
<
double
>
torsion1
;
std
::
vector
<
double
>
torsion1
;
std
::
vector
<
double
>
torsion2
;
std
::
vector
<
double
>
torsion2
;
...
@@ -1364,7 +1364,7 @@ static int readAmoebaPiTorsionParameters( FILE* filePtr, MapStringInt& forceMap,
...
@@ -1364,7 +1364,7 @@ static int readAmoebaPiTorsionParameters( FILE* filePtr, MapStringInt& forceMap,
}
}
for
(
int
ii
=
0
;
ii
<
numberOfPiTorsions
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfPiTorsions
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
7
){
if
(
lineTokens
.
size
()
>
7
){
std
::
vector
<
double
>
torsionK
;
std
::
vector
<
double
>
torsionK
;
int
index
=
0
;
int
index
=
0
;
...
@@ -1497,7 +1497,7 @@ static int readAmoebaStretchBendParameters( FILE* filePtr, MapStringInt& forceMa
...
@@ -1497,7 +1497,7 @@ static int readAmoebaStretchBendParameters( FILE* filePtr, MapStringInt& forceMa
}
}
for
(
int
ii
=
0
;
ii
<
numberOfStretchBends
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfStretchBends
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
7
){
if
(
lineTokens
.
size
()
>
7
){
int
tokenIndex
=
0
;
int
tokenIndex
=
0
;
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
...
@@ -1629,7 +1629,7 @@ static int readAmoebaOutOfPlaneBendParameters( FILE* filePtr, MapStringInt& forc
...
@@ -1629,7 +1629,7 @@ static int readAmoebaOutOfPlaneBendParameters( FILE* filePtr, MapStringInt& forc
}
}
for
(
int
ii
=
0
;
ii
<
numberOfOutOfPlaneBends
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfOutOfPlaneBends
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
5
){
if
(
lineTokens
.
size
()
>
5
){
int
tokenIndex
=
0
;
int
tokenIndex
=
0
;
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
...
@@ -1647,7 +1647,7 @@ static int readAmoebaOutOfPlaneBendParameters( FILE* filePtr, MapStringInt& forc
...
@@ -1647,7 +1647,7 @@ static int readAmoebaOutOfPlaneBendParameters( FILE* filePtr, MapStringInt& forc
// get cubic, quartic, pentic, sextic factors
// get cubic, quartic, pentic, sextic factors
char
*
isNotEof
=
"1"
;
int
isNotEof
=
1
;
int
hits
=
0
;
int
hits
=
0
;
while
(
hits
<
4
){
while
(
hits
<
4
){
StringVector
tokens
;
StringVector
tokens
;
...
@@ -1784,7 +1784,7 @@ static int readAmoebaTorsionTorsionGrid( FILE* filePtr, int numX, int numY, Tors
...
@@ -1784,7 +1784,7 @@ static int readAmoebaTorsionTorsionGrid( FILE* filePtr, int numX, int numY, Tors
}
}
for
(
int
ii
=
0
;
ii
<
gridCount
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
gridCount
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
8
){
if
(
lineTokens
.
size
()
>
8
){
int
tokenIndex
=
0
;
int
tokenIndex
=
0
;
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
...
@@ -1924,7 +1924,7 @@ static int readAmoebaTorsionTorsionParameters( FILE* filePtr, MapStringInt& forc
...
@@ -1924,7 +1924,7 @@ static int readAmoebaTorsionTorsionParameters( FILE* filePtr, MapStringInt& forc
}
}
for
(
int
ii
=
0
;
ii
<
numberOfTorsionTorsions
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfTorsionTorsions
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
7
){
if
(
lineTokens
.
size
()
>
7
){
int
tokenIndex
=
0
;
int
tokenIndex
=
0
;
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
...
@@ -1944,7 +1944,7 @@ static int readAmoebaTorsionTorsionParameters( FILE* filePtr, MapStringInt& forc
...
@@ -1944,7 +1944,7 @@ static int readAmoebaTorsionTorsionParameters( FILE* filePtr, MapStringInt& forc
// get grid
// get grid
char
*
isNotEof
=
"1"
;
int
isNotEof
=
1
;
int
totalNumberOfGrids
=
1
;
int
totalNumberOfGrids
=
1
;
int
gridCount
=
0
;
int
gridCount
=
0
;
while
(
gridCount
<
totalNumberOfGrids
){
while
(
gridCount
<
totalNumberOfGrids
){
...
@@ -2039,7 +2039,7 @@ static void readAmoebaMultipoleCovalent( FILE* filePtr, AmoebaMultipoleForce* mu
...
@@ -2039,7 +2039,7 @@ static void readAmoebaMultipoleCovalent( FILE* filePtr, AmoebaMultipoleForce* mu
AmoebaMultipoleForce
::
PolarizationCovalent13
,
AmoebaMultipoleForce
::
PolarizationCovalent13
,
AmoebaMultipoleForce
::
PolarizationCovalent14
};
AmoebaMultipoleForce
::
PolarizationCovalent14
};
char
*
isNotEof
=
"1"
;
int
isNotEof
=
1
;
for
(
int
ii
=
0
;
ii
<
numberOfMultipoles
&&
isNotEof
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfMultipoles
&&
isNotEof
;
ii
++
){
for
(
unsigned
int
jj
=
0
;
jj
<
numberOfCovalentTypes
&&
isNotEof
;
jj
++
){
for
(
unsigned
int
jj
=
0
;
jj
<
numberOfCovalentTypes
&&
isNotEof
;
jj
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
...
@@ -2109,7 +2109,7 @@ static int readAmoebaMultipoleParameters( FILE* filePtr, MapStringInt& forceMap,
...
@@ -2109,7 +2109,7 @@ static int readAmoebaMultipoleParameters( FILE* filePtr, MapStringInt& forceMap,
}
}
for
(
int
ii
=
0
;
ii
<
numberOfMultipoles
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfMultipoles
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
7
){
if
(
lineTokens
.
size
()
>
7
){
std
::
vector
<
double
>
dipole
;
std
::
vector
<
double
>
dipole
;
std
::
vector
<
double
>
quadrupole
;
std
::
vector
<
double
>
quadrupole
;
...
@@ -2146,7 +2146,7 @@ static int readAmoebaMultipoleParameters( FILE* filePtr, MapStringInt& forceMap,
...
@@ -2146,7 +2146,7 @@ static int readAmoebaMultipoleParameters( FILE* filePtr, MapStringInt& forceMap,
// get supplementary fields
// get supplementary fields
char
*
isNotEof
=
"1"
;
int
isNotEof
=
1
;
int
totalFields
=
2
;
int
totalFields
=
2
;
int
fieldCount
=
0
;
int
fieldCount
=
0
;
int
done
=
0
;
int
done
=
0
;
...
@@ -2199,7 +2199,7 @@ static int readAmoebaMultipoleParameters( FILE* filePtr, MapStringInt& forceMap,
...
@@ -2199,7 +2199,7 @@ static int readAmoebaMultipoleParameters( FILE* filePtr, MapStringInt& forceMap,
if
(
log
){
if
(
log
){
(
void
)
fprintf
(
log
,
"%s Supplementary fields %u: "
,
methodName
.
c_str
(),
supplementary
.
size
()
);
(
void
)
fprintf
(
log
,
"%s Supplementary fields %u: "
,
methodName
.
c_str
(),
static_cast
<
unsigned
int
>
(
supplementary
.
size
()
)
);
for
(
MapStringVectorOfVectorsCI
ii
=
supplementary
.
begin
();
ii
!=
supplementary
.
end
();
ii
++
){
for
(
MapStringVectorOfVectorsCI
ii
=
supplementary
.
begin
();
ii
!=
supplementary
.
end
();
ii
++
){
(
void
)
fprintf
(
log
,
"%s "
,
(
*
ii
).
first
.
c_str
()
);
(
void
)
fprintf
(
log
,
"%s "
,
(
*
ii
).
first
.
c_str
()
);
}
}
...
@@ -2241,7 +2241,7 @@ static int readAmoebaMultipoleParameters( FILE* filePtr, MapStringInt& forceMap,
...
@@ -2241,7 +2241,7 @@ static int readAmoebaMultipoleParameters( FILE* filePtr, MapStringInt& forceMap,
for
(
int
jj
=
0
;
jj
<
AmoebaMultipoleForce
::
CovalentEnd
;
jj
++
){
for
(
int
jj
=
0
;
jj
<
AmoebaMultipoleForce
::
CovalentEnd
;
jj
++
){
std
::
vector
<
int
>
covalentAtoms
;
std
::
vector
<
int
>
covalentAtoms
;
multipoleForce
->
getCovalentMap
(
ii
,
covalentTypes
[
jj
],
covalentAtoms
);
multipoleForce
->
getCovalentMap
(
ii
,
covalentTypes
[
jj
],
covalentAtoms
);
(
void
)
fprintf
(
log
,
" CovTypeId=%d %u ["
,
jj
,
covalentAtoms
.
size
()
);
(
void
)
fprintf
(
log
,
" CovTypeId=%d %u ["
,
jj
,
static_cast
<
unsigned
int
>
(
covalentAtoms
.
size
()
)
);
for
(
unsigned
int
kk
=
0
;
kk
<
covalentAtoms
.
size
();
kk
++
){
for
(
unsigned
int
kk
=
0
;
kk
<
covalentAtoms
.
size
();
kk
++
){
(
void
)
fprintf
(
log
,
"%5d "
,
covalentAtoms
[
kk
]
);
(
void
)
fprintf
(
log
,
"%5d "
,
covalentAtoms
[
kk
]
);
}
}
...
@@ -2364,7 +2364,7 @@ static int readAmoebaGeneralizedKirkwoodParameters( FILE* filePtr, MapStringInt&
...
@@ -2364,7 +2364,7 @@ static int readAmoebaGeneralizedKirkwoodParameters( FILE* filePtr, MapStringInt&
}
}
for
(
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
tokenIndex
=
0
;
int
tokenIndex
=
0
;
if
(
lineTokens
.
size
()
>
3
){
if
(
lineTokens
.
size
()
>
3
){
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
...
@@ -2380,7 +2380,7 @@ static int readAmoebaGeneralizedKirkwoodParameters( FILE* filePtr, MapStringInt&
...
@@ -2380,7 +2380,7 @@ static int readAmoebaGeneralizedKirkwoodParameters( FILE* filePtr, MapStringInt&
}
}
}
}
char
*
isNotEof
=
"1"
;
int
isNotEof
=
1
;
int
hits
=
0
;
int
hits
=
0
;
while
(
hits
<
2
){
while
(
hits
<
2
){
StringVector
tokens
;
StringVector
tokens
;
...
@@ -2396,13 +2396,13 @@ static int readAmoebaGeneralizedKirkwoodParameters( FILE* filePtr, MapStringInt&
...
@@ -2396,13 +2396,13 @@ static int readAmoebaGeneralizedKirkwoodParameters( FILE* filePtr, MapStringInt&
hits
++
;
hits
++
;
}
else
{
}
else
{
char
buffer
[
1024
];
char
buffer
[
1024
];
(
void
)
sprintf
(
buffer
,
"%s read past GK block at line=%d
\n
"
,
methodName
.
c_str
(),
lineCount
);
(
void
)
sprintf
(
buffer
,
"%s read past GK block at line=%d
\n
"
,
methodName
.
c_str
(),
*
lineCount
);
throwException
(
__FILE__
,
__LINE__
,
buffer
);
throwException
(
__FILE__
,
__LINE__
,
buffer
);
exit
(
-
1
);
exit
(
-
1
);
}
}
}
else
{
}
else
{
char
buffer
[
1024
];
char
buffer
[
1024
];
(
void
)
sprintf
(
buffer
,
"%s invalid token count at line=%d?
\n
"
,
methodName
.
c_str
(),
lineCount
);
(
void
)
sprintf
(
buffer
,
"%s invalid token count at line=%d?
\n
"
,
methodName
.
c_str
(),
*
lineCount
);
throwException
(
__FILE__
,
__LINE__
,
buffer
);
throwException
(
__FILE__
,
__LINE__
,
buffer
);
exit
(
-
1
);
exit
(
-
1
);
}
}
...
@@ -2410,7 +2410,7 @@ static int readAmoebaGeneralizedKirkwoodParameters( FILE* filePtr, MapStringInt&
...
@@ -2410,7 +2410,7 @@ static int readAmoebaGeneralizedKirkwoodParameters( FILE* filePtr, MapStringInt&
// get supplementart fields
// get supplementart fields
isNotEof
=
"1"
;
isNotEof
=
1
;
int
totalFields
=
2
;
int
totalFields
=
2
;
int
fieldCount
=
0
;
int
fieldCount
=
0
;
int
done
=
0
;
int
done
=
0
;
...
@@ -2551,7 +2551,7 @@ static int readAmoebaVdwParameters( FILE* filePtr, MapStringInt& forceMap, const
...
@@ -2551,7 +2551,7 @@ static int readAmoebaVdwParameters( FILE* filePtr, MapStringInt& forceMap, const
vdwForce
->
setSigEpsTableSize
(
tableSize
);
vdwForce
->
setSigEpsTableSize
(
tableSize
);
for
(
int
ii
=
0
;
ii
<
tableSize
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
tableSize
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
2
){
if
(
lineTokens
.
size
()
>
2
){
int
tokenIndex
=
0
;
int
tokenIndex
=
0
;
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
...
@@ -2569,7 +2569,7 @@ static int readAmoebaVdwParameters( FILE* filePtr, MapStringInt& forceMap, const
...
@@ -2569,7 +2569,7 @@ static int readAmoebaVdwParameters( FILE* filePtr, MapStringInt& forceMap, const
}
}
StringVector
lineTokensT
;
StringVector
lineTokensT
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokensT
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokensT
,
lineCount
,
log
);
numberOfParticles
=
atoi
(
lineTokensT
[
1
].
c_str
()
);
numberOfParticles
=
atoi
(
lineTokensT
[
1
].
c_str
()
);
}
else
{
}
else
{
numberOfParticles
=
atoi
(
tokens
[
1
].
c_str
()
);
numberOfParticles
=
atoi
(
tokens
[
1
].
c_str
()
);
...
@@ -2582,7 +2582,7 @@ static int readAmoebaVdwParameters( FILE* filePtr, MapStringInt& forceMap, const
...
@@ -2582,7 +2582,7 @@ static int readAmoebaVdwParameters( FILE* filePtr, MapStringInt& forceMap, const
}
}
for
(
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
2
){
if
(
lineTokens
.
size
()
>
2
){
int
tokenIndex
=
0
;
int
tokenIndex
=
0
;
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
...
@@ -2605,7 +2605,7 @@ static int readAmoebaVdwParameters( FILE* filePtr, MapStringInt& forceMap, const
...
@@ -2605,7 +2605,7 @@ static int readAmoebaVdwParameters( FILE* filePtr, MapStringInt& forceMap, const
// abort if have changed
// abort if have changed
StringVector
lineTokensT
;
StringVector
lineTokensT
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokensT
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokensT
,
lineCount
,
log
);
if
(
lineTokensT
[
0
]
==
"AmoebaVdw14_7Scales"
){
if
(
lineTokensT
[
0
]
==
"AmoebaVdw14_7Scales"
){
int
tokenIndex
=
1
;
int
tokenIndex
=
1
;
double
scale2
=
atof
(
lineTokensT
[
tokenIndex
++
].
c_str
()
);
double
scale2
=
atof
(
lineTokensT
[
tokenIndex
++
].
c_str
()
);
...
@@ -2631,7 +2631,7 @@ static int readAmoebaVdwParameters( FILE* filePtr, MapStringInt& forceMap, const
...
@@ -2631,7 +2631,7 @@ static int readAmoebaVdwParameters( FILE* filePtr, MapStringInt& forceMap, const
int
numberOfParticles
=
atoi
(
lineTokensT
[
1
].
c_str
()
);
int
numberOfParticles
=
atoi
(
lineTokensT
[
1
].
c_str
()
);
for
(
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
std
::
vector
<
int
>
exclusions
;
std
::
vector
<
int
>
exclusions
;
if
(
lineTokens
.
size
()
>
1
){
if
(
lineTokens
.
size
()
>
1
){
int
tokenIndex
=
0
;
int
tokenIndex
=
0
;
...
@@ -2725,7 +2725,7 @@ static int readAmoebaVdwParameters( FILE* filePtr, MapStringInt& forceMap, const
...
@@ -2725,7 +2725,7 @@ static int readAmoebaVdwParameters( FILE* filePtr, MapStringInt& forceMap, const
(
void
)
fprintf
(
log
,
"%8d %8d %8d sig=[%10.4f %10.4f] eps=[ %10.4f %10.4f] redct=%10.4f "
,
(
void
)
fprintf
(
log
,
"%8d %8d %8d sig=[%10.4f %10.4f] eps=[ %10.4f %10.4f] redct=%10.4f "
,
ii
,
indexIV
,
indexClass
,
sigma
,
sigma4
,
epsilon
,
epsilon4
,
reduction
);
ii
,
indexIV
,
indexClass
,
sigma
,
sigma4
,
epsilon
,
epsilon4
,
reduction
);
(
void
)
fprintf
(
log
,
"Excl=%3u ["
,
exclusions
.
size
()
);
(
void
)
fprintf
(
log
,
"Excl=%3u ["
,
static_cast
<
unsigned
int
>
(
exclusions
.
size
()
)
);
for
(
unsigned
int
jj
=
0
;
jj
<
exclusions
.
size
();
jj
++
){
for
(
unsigned
int
jj
=
0
;
jj
<
exclusions
.
size
();
jj
++
){
(
void
)
fprintf
(
log
,
"%5d "
,
exclusions
[
jj
]
);
(
void
)
fprintf
(
log
,
"%5d "
,
exclusions
[
jj
]
);
}
}
...
@@ -2867,7 +2867,7 @@ static int readAmoebaWcaDispersionParameters( FILE* filePtr, MapStringInt& force
...
@@ -2867,7 +2867,7 @@ static int readAmoebaWcaDispersionParameters( FILE* filePtr, MapStringInt& force
std
::
vector
<
double
>
maxDispersionEnergyVector
;
std
::
vector
<
double
>
maxDispersionEnergyVector
;
for
(
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
2
){
if
(
lineTokens
.
size
()
>
2
){
int
tokenIndex
=
0
;
int
tokenIndex
=
0
;
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
...
@@ -2886,7 +2886,7 @@ static int readAmoebaWcaDispersionParameters( FILE* filePtr, MapStringInt& force
...
@@ -2886,7 +2886,7 @@ static int readAmoebaWcaDispersionParameters( FILE* filePtr, MapStringInt& force
}
}
}
}
char
*
isNotEof
=
"1"
;
int
isNotEof
=
1
;
int
hits
=
0
;
int
hits
=
0
;
while
(
hits
<
6
){
while
(
hits
<
6
){
StringVector
tokens
;
StringVector
tokens
;
...
@@ -2915,13 +2915,13 @@ static int readAmoebaWcaDispersionParameters( FILE* filePtr, MapStringInt& force
...
@@ -2915,13 +2915,13 @@ static int readAmoebaWcaDispersionParameters( FILE* filePtr, MapStringInt& force
hits
++
;
hits
++
;
}
else
{
}
else
{
char
buffer
[
1024
];
char
buffer
[
1024
];
(
void
)
sprintf
(
buffer
,
"%s read past WcaDispersion block at line=%d
\n
"
,
methodName
.
c_str
(),
lineCount
);
(
void
)
sprintf
(
buffer
,
"%s read past WcaDispersion block at line=%d
\n
"
,
methodName
.
c_str
(),
*
lineCount
);
throwException
(
__FILE__
,
__LINE__
,
buffer
);
throwException
(
__FILE__
,
__LINE__
,
buffer
);
exit
(
-
1
);
exit
(
-
1
);
}
}
}
else
{
}
else
{
char
buffer
[
1024
];
char
buffer
[
1024
];
(
void
)
sprintf
(
buffer
,
"%s invalid token count at line=%d?
\n
"
,
methodName
.
c_str
(),
lineCount
);
(
void
)
sprintf
(
buffer
,
"%s invalid token count at line=%d?
\n
"
,
methodName
.
c_str
(),
*
lineCount
);
throwException
(
__FILE__
,
__LINE__
,
buffer
);
throwException
(
__FILE__
,
__LINE__
,
buffer
);
exit
(
-
1
);
exit
(
-
1
);
}
}
...
@@ -2971,7 +2971,7 @@ static int readAmoebaWcaDispersionParameters( FILE* filePtr, MapStringInt& force
...
@@ -2971,7 +2971,7 @@ static int readAmoebaWcaDispersionParameters( FILE* filePtr, MapStringInt& force
wcaDispersionForce
->
getMaximumDispersionEnergy
(
ii
,
maxDispersionEnergy
);
wcaDispersionForce
->
getMaximumDispersionEnergy
(
ii
,
maxDispersionEnergy
);
double
delta
=
fabs
(
maxDispersionEnergy
-
maxDispersionEnergyVector
[
ii
]
);
double
delta
=
fabs
(
maxDispersionEnergy
-
maxDispersionEnergyVector
[
ii
]
);
if
(
delta
>
1.0e-05
){
if
(
delta
>
1.0e-05
){
(
void
)
fprintf
(
log
,
" maxDispEDiff=%12.5e %14.7f %14.7f XXX
\n
"
);
(
void
)
fprintf
(
log
,
" maxDispEDiff=%12.5e %14.7f %14.7f XXX
\n
"
,
delta
,
maxDispersionEnergy
,
maxDispersionEnergyVector
[
ii
]
);
errors
++
;
errors
++
;
}
}
}
}
...
@@ -3101,7 +3101,7 @@ static int readAmoebaSurfaceParameters( FILE* filePtr, MapStringInt& forceMap, c
...
@@ -3101,7 +3101,7 @@ static int readAmoebaSurfaceParameters( FILE* filePtr, MapStringInt& forceMap, c
}
}
for
(
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
2
){
if
(
lineTokens
.
size
()
>
2
){
int
tokenIndex
=
0
;
int
tokenIndex
=
0
;
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
int
index
=
atoi
(
lineTokens
[
tokenIndex
++
].
c_str
()
);
...
@@ -3114,7 +3114,7 @@ static int readAmoebaSurfaceParameters( FILE* filePtr, MapStringInt& forceMap, c
...
@@ -3114,7 +3114,7 @@ static int readAmoebaSurfaceParameters( FILE* filePtr, MapStringInt& forceMap, c
}
}
}
}
char
*
isNotEof
=
"1"
;
int
isNotEof
=
1
;
int
hits
=
0
;
int
hits
=
0
;
while
(
hits
<
1
){
while
(
hits
<
1
){
StringVector
tokens
;
StringVector
tokens
;
...
@@ -3127,13 +3127,13 @@ static int readAmoebaSurfaceParameters( FILE* filePtr, MapStringInt& forceMap, c
...
@@ -3127,13 +3127,13 @@ static int readAmoebaSurfaceParameters( FILE* filePtr, MapStringInt& forceMap, c
hits
++
;
hits
++
;
}
else
{
}
else
{
char
buffer
[
1024
];
char
buffer
[
1024
];
(
void
)
sprintf
(
buffer
,
"%s read past SASA block at line=%d
\n
"
,
methodName
.
c_str
(),
lineCount
);
(
void
)
sprintf
(
buffer
,
"%s read past SASA block at line=%d
\n
"
,
methodName
.
c_str
(),
*
lineCount
);
throwException
(
__FILE__
,
__LINE__
,
buffer
);
throwException
(
__FILE__
,
__LINE__
,
buffer
);
exit
(
-
1
);
exit
(
-
1
);
}
}
}
else
{
}
else
{
char
buffer
[
1024
];
char
buffer
[
1024
];
(
void
)
sprintf
(
buffer
,
"%s invalid token count at line=%d?
\n
"
,
methodName
.
c_str
(),
lineCount
);
(
void
)
sprintf
(
buffer
,
"%s invalid token count at line=%d?
\n
"
,
methodName
.
c_str
(),
*
lineCount
);
throwException
(
__FILE__
,
__LINE__
,
buffer
);
throwException
(
__FILE__
,
__LINE__
,
buffer
);
exit
(
-
1
);
exit
(
-
1
);
}
}
...
@@ -3204,7 +3204,7 @@ static int readConstraints( FILE* filePtr, const StringVector& tokens, System& s
...
@@ -3204,7 +3204,7 @@ static int readConstraints( FILE* filePtr, const StringVector& tokens, System& s
}
}
for
(
int
ii
=
0
;
ii
<
numberOfConstraints
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfConstraints
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
3
){
if
(
lineTokens
.
size
()
>
3
){
int
index
=
atoi
(
lineTokens
[
0
].
c_str
()
);
int
index
=
atoi
(
lineTokens
[
0
].
c_str
()
);
int
particle1
=
atoi
(
lineTokens
[
1
].
c_str
()
);
int
particle1
=
atoi
(
lineTokens
[
1
].
c_str
()
);
...
@@ -3313,7 +3313,7 @@ static Integrator* readIntegrator( FILE* filePtr, const StringVector& tokens, Sy
...
@@ -3313,7 +3313,7 @@ static Integrator* readIntegrator( FILE* filePtr, const StringVector& tokens, Sy
for
(
int
ii
=
0
;
ii
<
readLines
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
readLines
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
1
){
if
(
lineTokens
.
size
()
>
1
){
if
(
lineTokens
[
0
]
==
"StepSize"
){
if
(
lineTokens
[
0
]
==
"StepSize"
){
stepSize
=
atof
(
lineTokens
[
1
].
c_str
()
);
stepSize
=
atof
(
lineTokens
[
1
].
c_str
()
);
...
@@ -3418,7 +3418,7 @@ static int readVec3( FILE* filePtr, const StringVector& tokens, std::vector<Vec3
...
@@ -3418,7 +3418,7 @@ static int readVec3( FILE* filePtr, const StringVector& tokens, std::vector<Vec3
}
}
for
(
int
ii
=
0
;
ii
<
numberOfCoordinates
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfCoordinates
;
ii
++
){
StringVector
lineTokens
;
StringVector
lineTokens
;
char
*
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
int
isNotEof
=
readLine
(
filePtr
,
lineTokens
,
lineCount
,
log
);
if
(
lineTokens
.
size
()
>
3
){
if
(
lineTokens
.
size
()
>
3
){
int
index
=
atoi
(
lineTokens
[
0
].
c_str
()
);
int
index
=
atoi
(
lineTokens
[
0
].
c_str
()
);
double
xCoord
=
atof
(
lineTokens
[
1
].
c_str
()
);
double
xCoord
=
atof
(
lineTokens
[
1
].
c_str
()
);
...
@@ -3733,7 +3733,7 @@ Integrator* readAmoebaParameterFile( const std::string& inputParameterFile, MapS
...
@@ -3733,7 +3733,7 @@ Integrator* readAmoebaParameterFile( const std::string& inputParameterFile, MapS
int
lineCount
=
0
;
int
lineCount
=
0
;
std
::
string
version
=
"0.1"
;
std
::
string
version
=
"0.1"
;
char
*
isNotEof
=
"1"
;
int
isNotEof
=
1
;
Integrator
*
returnIntegrator
=
NULL
;
Integrator
*
returnIntegrator
=
NULL
;
// loop over lines in file
// loop over lines in file
...
@@ -4561,9 +4561,12 @@ Context* createContext( const std::string& amoebaTinkerParameterFileName, MapStr
...
@@ -4561,9 +4561,12 @@ Context* createContext( const std::string& amoebaTinkerParameterFileName, MapStr
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
static
const
std
::
string
methodName
=
"createContext"
;
static
const
std
::
string
methodName
=
"createContext"
;
int
cudaDevice
=
-
1
;
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
setIntFromMap
(
inputArgumentMap
,
"cudaDevice"
,
cudaDevice
);
System
*
system
=
new
System
();
System
*
system
=
new
System
();
std
::
vector
<
Vec3
>
coordinates
;
std
::
vector
<
Vec3
>
coordinates
;
...
@@ -4583,7 +4586,22 @@ Context* createContext( const std::string& amoebaTinkerParameterFileName, MapStr
...
@@ -4583,7 +4586,22 @@ Context* createContext( const std::string& amoebaTinkerParameterFileName, MapStr
tinkerForces
,
tinkerEnergies
,
supplementary
,
useOpenMMUnits
,
inputArgumentMap
,
log
);
tinkerForces
,
tinkerEnergies
,
supplementary
,
useOpenMMUnits
,
inputArgumentMap
,
log
);
Integrator
*
integrator
=
getIntegrator
(
inputArgumentMap
,
log
);
Integrator
*
integrator
=
getIntegrator
(
inputArgumentMap
,
log
);
Context
*
context
=
new
Context
(
*
system
,
*
integrator
,
Platform
::
getPlatformByName
(
"Cuda"
));
Context
*
context
;
if
(
getenv
(
"CudaDevice"
)
||
cudaDevice
>
-
1
){
Platform
&
platform
=
Platform
::
getPlatformByName
(
"Cuda"
);
map
<
string
,
string
>
properties
;
if
(
getenv
(
"CudaDevice"
)
){
properties
[
"CudaDevice"
]
=
getenv
(
"CudaDevice"
);
}
else
{
std
::
stringstream
cudaDeviceStrStr
;
cudaDeviceStrStr
<<
cudaDevice
;
properties
[
"CudaDevice"
]
=
cudaDeviceStrStr
.
str
();
}
context
=
new
Context
(
*
system
,
*
integrator
,
platform
,
properties
);
}
else
{
context
=
new
Context
(
*
system
,
*
integrator
,
Platform
::
getPlatformByName
(
"Cuda"
));
}
context
->
setPositions
(
coordinates
);
context
->
setPositions
(
coordinates
);
return
context
;
return
context
;
...
@@ -4679,7 +4697,7 @@ fprintf( log, "\n" ); fflush( log ); */
...
@@ -4679,7 +4697,7 @@ fprintf( log, "\n" ); fflush( log ); */
if
(
skip
){
if
(
skip
){
(
void
)
fprintf
(
log
,
"Skipping state=%u line=%u
\n
"
,
stateIndex
,
lineIndex
);
(
void
)
fprintf
(
log
,
"Skipping state=%u line=%u
\n
"
,
stateIndex
,
lineIndex
);
}
else
{
}
else
{
(
void
)
fprintf
(
log
,
"State=%u coordinates=%u
\n
"
,
stateIndex
,
coordinates
.
size
()
);
(
void
)
fprintf
(
log
,
"State=%u coordinates=%u
\n
"
,
stateIndex
,
static_cast
<
unsigned
int
>
(
coordinates
.
size
()
)
);
context
->
setPositions
(
coordinates
);
context
->
setPositions
(
coordinates
);
State
state
=
context
->
getState
(
State
::
Forces
|
State
::
Energy
);
State
state
=
context
->
getState
(
State
::
Forces
|
State
::
Energy
);
System
&
system
=
context
->
getSystem
();
System
&
system
=
context
->
getSystem
();
...
@@ -4820,7 +4838,7 @@ void testUsingAmoebaTinkerParameterFile( const std::string& amoebaTinkerParamete
...
@@ -4820,7 +4838,7 @@ void testUsingAmoebaTinkerParameterFile( const std::string& amoebaTinkerParamete
deltaE
,
expectedEnergy
,
energyConversion
*
state
.
getPotentialEnergy
(),
deltaE
,
expectedEnergy
,
energyConversion
*
state
.
getPotentialEnergy
(),
amoebaTinkerParameterFileName
.
c_str
(),
activeForceNames
.
c_str
()
);
amoebaTinkerParameterFileName
.
c_str
(),
activeForceNames
.
c_str
()
);
(
void
)
fprintf
(
filePtr
,
"%s: %u %u Active forces: %s
\n
"
,
(
void
)
fprintf
(
filePtr
,
"%s: %u %u Active forces: %s
\n
"
,
methodName
.
c_str
(),
expectedForces
.
size
(),
forces
.
size
(),
activeForceNames
.
c_str
()
);
methodName
.
c_str
(),
static_cast
<
unsigned
int
>
(
expectedForces
.
size
()
)
,
static_cast
<
unsigned
int
>
(
forces
.
size
()
)
,
activeForceNames
.
c_str
()
);
double
maxRelativeDelta
=
-
1.0e+30
;
double
maxRelativeDelta
=
-
1.0e+30
;
unsigned
int
maxRelativeDeltaIndex
=
-
1
;
unsigned
int
maxRelativeDeltaIndex
=
-
1
;
for
(
unsigned
int
ii
=
0
;
ii
<
forces
.
size
();
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
forces
.
size
();
ii
++
){
...
@@ -4882,7 +4900,7 @@ void testUsingAmoebaTinkerParameterFile( const std::string& amoebaTinkerParamete
...
@@ -4882,7 +4900,7 @@ void testUsingAmoebaTinkerParameterFile( const std::string& amoebaTinkerParamete
coordinateConversion
*
(
box
[
1
][
2
]
-
box
[
0
][
2
])
);
coordinateConversion
*
(
box
[
1
][
2
]
-
box
[
0
][
2
])
);
unsigned
int
maxPrint
=
5
;
unsigned
int
maxPrint
=
5
;
(
void
)
fprintf
(
filePtr
,
"Sample raw coordinates (w/o conversion) %8u
\n
"
,
coordinates
.
size
()
);
(
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
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
coordinates
.
size
();
ii
++
){
(
void
)
fprintf
(
filePtr
,
"%8u [%16.7f %16.7f %16.7f]
\n
"
,
ii
,
(
void
)
fprintf
(
filePtr
,
"%8u [%16.7f %16.7f %16.7f]
\n
"
,
ii
,
coordinates
[
ii
][
0
],
coordinates
[
ii
][
1
],
coordinates
[
ii
][
2
]
);
coordinates
[
ii
][
0
],
coordinates
[
ii
][
1
],
coordinates
[
ii
][
2
]
);
...
@@ -5263,7 +5281,7 @@ void writeIntermediateStateFile( Context& context, FILE* intermediateStateFile,
...
@@ -5263,7 +5281,7 @@ void writeIntermediateStateFile( Context& context, FILE* intermediateStateFile,
const
std
::
vector
<
Vec3
>
forces
=
state
.
getForces
();
const
std
::
vector
<
Vec3
>
forces
=
state
.
getForces
();
(
void
)
fprintf
(
intermediateStateFile
,
"%7u %12.3f %15.7e %15.7e %15.7e State (x,v,f)
\n
"
,
(
void
)
fprintf
(
intermediateStateFile
,
"%7u %12.3f %15.7e %15.7e %15.7e State (x,v,f)
\n
"
,
positions
.
size
(),
state
.
getTime
(),
state
.
getKineticEnergy
(),
state
.
getPotentialEnergy
(),
static_cast
<
unsigned
int
>
(
positions
.
size
()
)
,
state
.
getTime
(),
state
.
getKineticEnergy
(),
state
.
getPotentialEnergy
(),
state
.
getKineticEnergy
()
+
state
.
getPotentialEnergy
()
);
state
.
getKineticEnergy
()
+
state
.
getPotentialEnergy
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
positions
.
size
();
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
positions
.
size
();
ii
++
){
...
@@ -5601,7 +5619,7 @@ void testEnergyConservation( std::string parameterFileName, MapStringInt& forceM
...
@@ -5601,7 +5619,7 @@ void testEnergyConservation( std::string parameterFileName, MapStringInt& forceM
(
void
)
fprintf
(
log
,
"Final Simulation: %12.3f E=%15.7e [%15.7e %15.7e] total wall time=%12.3e ns/day=%.3e
\n
"
,
(
void
)
fprintf
(
log
,
"Final Simulation: %12.3f E=%15.7e [%15.7e %15.7e] total wall time=%12.3e ns/day=%.3e
\n
"
,
currentTime
,
(
kineticEnergy
+
potentialEnergy
),
kineticEnergy
,
potentialEnergy
,
currentTime
,
(
kineticEnergy
+
potentialEnergy
),
kineticEnergy
,
potentialEnergy
,
totalWallClockTime
,
nsPerDay
);
totalWallClockTime
,
nsPerDay
);
(
void
)
fprintf
(
log
,
"
\n
%8u Energies
\n
"
,
kineticEnergyArray
.
size
()
);
(
void
)
fprintf
(
log
,
"
\n
%8u Energies
\n
"
,
static_cast
<
unsigned
int
>
(
kineticEnergyArray
.
size
()
)
);
for
(
unsigned
int
ii
=
0
;
ii
<
kineticEnergyArray
.
size
();
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
kineticEnergyArray
.
size
();
ii
++
){
(
void
)
fprintf
(
log
,
"%15.7e %15.7e %15.7e %15.7e Energies
\n
"
,
(
void
)
fprintf
(
log
,
"%15.7e %15.7e %15.7e %15.7e Energies
\n
"
,
timeArray
[
ii
],
kineticEnergyArray
[
ii
],
potentialEnergyArray
[
ii
],
totalEnergyArray
[
ii
]
);
timeArray
[
ii
],
kineticEnergyArray
[
ii
],
potentialEnergyArray
[
ii
],
totalEnergyArray
[
ii
]
);
...
@@ -5803,7 +5821,7 @@ int runTestsUsingAmoebaTinkerParameterFile( MapStringString& argumentMap ){
...
@@ -5803,7 +5821,7 @@ int runTestsUsingAmoebaTinkerParameterFile( MapStringString& argumentMap ){
}
}
(
void
)
fprintf
(
log
,
"parameter file=<%s>
\n
"
,
parameterFileName
.
c_str
()
);
(
void
)
fprintf
(
log
,
"parameter file=<%s>
\n
"
,
parameterFileName
.
c_str
()
);
(
void
)
fprintf
(
log
,
"Argument map: %u
\n
"
,
inputArgumentMap
.
size
()
);
(
void
)
fprintf
(
log
,
"Argument map: %u
\n
"
,
static_cast
<
unsigned
int
>
(
inputArgumentMap
.
size
()
)
);
for
(
MapStringStringCI
ii
=
inputArgumentMap
.
begin
();
ii
!=
inputArgumentMap
.
end
();
ii
++
){
for
(
MapStringStringCI
ii
=
inputArgumentMap
.
begin
();
ii
!=
inputArgumentMap
.
end
();
ii
++
){
(
void
)
fprintf
(
log
,
"Map %s %s
\n
"
,
(
*
ii
).
first
.
c_str
(),
(
*
ii
).
second
.
c_str
()
);
(
void
)
fprintf
(
log
,
"Map %s %s
\n
"
,
(
*
ii
).
first
.
c_str
(),
(
*
ii
).
second
.
c_str
()
);
}
}
...
...
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