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
36762962
"vscode:/vscode.git/clone" did not exist on "31d761d56e10672fd1b9efd4e8c5110b554ad655"
Commit
36762962
authored
Nov 23, 2011
by
Mark Friedrichs
Browse files
Edits to remove some VC9 warnings
parent
d5a7dd89
Changes
37
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
90 additions
and
83 deletions
+90
-83
platforms/cuda/src/kernels/kCalculateGBVIBornSum.cu
platforms/cuda/src/kernels/kCalculateGBVIBornSum.cu
+3
-3
platforms/cuda/src/kernels/kCalculateObcGbsaBornSum.cu
platforms/cuda/src/kernels/kCalculateObcGbsaBornSum.cu
+1
-1
platforms/cuda/src/kernels/kForces.cu
platforms/cuda/src/kernels/kForces.cu
+1
-1
platforms/cuda/tests/TestCudaGBVIForce2.cpp
platforms/cuda/tests/TestCudaGBVIForce2.cpp
+19
-19
platforms/opencl/tests/TestOpenCLGBSAOBCForce2.cpp
platforms/opencl/tests/TestOpenCLGBSAOBCForce2.cpp
+28
-30
plugins/amoeba/platforms/cuda/src/kernels/amoebaCudaGpu.cpp
plugins/amoeba/platforms/cuda/src/kernels/amoebaCudaGpu.cpp
+21
-12
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaOutOfPlaneBendForce.cpp
...eference/tests/TestReferenceAmoebaOutOfPlaneBendForce.cpp
+2
-2
plugins/amoeba/serialization/src/AmoebaGeneralizedKirkwoodForceProxy.cpp
...serialization/src/AmoebaGeneralizedKirkwoodForceProxy.cpp
+1
-1
plugins/amoeba/serialization/src/AmoebaHarmonicAngleForceProxy.cpp
...moeba/serialization/src/AmoebaHarmonicAngleForceProxy.cpp
+1
-1
plugins/amoeba/serialization/src/AmoebaHarmonicBondForceProxy.cpp
...amoeba/serialization/src/AmoebaHarmonicBondForceProxy.cpp
+1
-1
plugins/amoeba/serialization/src/AmoebaHarmonicInPlaneAngleForceProxy.cpp
...erialization/src/AmoebaHarmonicInPlaneAngleForceProxy.cpp
+1
-1
plugins/amoeba/serialization/src/AmoebaMultipoleForceProxy.cpp
...ns/amoeba/serialization/src/AmoebaMultipoleForceProxy.cpp
+1
-1
plugins/amoeba/serialization/src/AmoebaOutOfPlaneBendForceProxy.cpp
...oeba/serialization/src/AmoebaOutOfPlaneBendForceProxy.cpp
+1
-1
plugins/amoeba/serialization/src/AmoebaPiTorsionForceProxy.cpp
...ns/amoeba/serialization/src/AmoebaPiTorsionForceProxy.cpp
+1
-1
plugins/amoeba/serialization/src/AmoebaStretchBendForceProxy.cpp
.../amoeba/serialization/src/AmoebaStretchBendForceProxy.cpp
+1
-1
plugins/amoeba/serialization/src/AmoebaTorsionForceProxy.cpp
plugins/amoeba/serialization/src/AmoebaTorsionForceProxy.cpp
+2
-2
plugins/amoeba/serialization/src/AmoebaTorsionTorsionForceProxy.cpp
...oeba/serialization/src/AmoebaTorsionTorsionForceProxy.cpp
+2
-2
plugins/amoeba/serialization/src/AmoebaUreyBradleyForceProxy.cpp
.../amoeba/serialization/src/AmoebaUreyBradleyForceProxy.cpp
+1
-1
plugins/amoeba/serialization/src/AmoebaVdwForceProxy.cpp
plugins/amoeba/serialization/src/AmoebaVdwForceProxy.cpp
+1
-1
plugins/amoeba/serialization/src/AmoebaWcaDispersionForceProxy.cpp
...moeba/serialization/src/AmoebaWcaDispersionForceProxy.cpp
+1
-1
No files found.
platforms/cuda/src/kernels/kCalculateGBVIBornSum.cu
View file @
36762962
...
...
@@ -259,7 +259,7 @@ void kPrintGBVI( gpuContext gpu, std::string callId, int call, FILE* log)
int
printOnlyOnNan
=
1
;
int
foundNan
=
0
;
if
(
printOnlyOnNan
){
for
(
int
ii
=
0
;
ii
<
gpu
->
sim
.
paddedNumberOfAtoms
&&
foundNan
==
0
;
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
gpu
->
sim
.
paddedNumberOfAtoms
&&
foundNan
==
0
;
ii
++
){
foundNan
+=
isNanOrInfinity
(
gpu
->
psBornRadii
->
_pSysData
[
ii
]
);
foundNan
+=
isNanOrInfinity
(
gpu
->
psBornForce
->
_pSysData
[
ii
]
);
foundNan
+=
isNanOrInfinity
(
gpu
->
psGBVISwitchDerivative
->
_pSysData
[
ii
]
);
...
...
@@ -267,7 +267,7 @@ void kPrintGBVI( gpuContext gpu, std::string callId, int call, FILE* log)
if
(
foundNan
){
log
=
stderr
;
(
void
)
fprintf
(
log
,
"kPrintGBVI found nan
\n
"
,
gpu
->
sim
.
paddedNumberOfAtoms
);
for
(
int
ii
=
0
;
ii
<
gpu
->
sim
.
paddedNumberOfAtoms
;
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
gpu
->
sim
.
paddedNumberOfAtoms
;
ii
++
){
(
void
)
fprintf
(
log
,
"%6d %15.7e %15.7e %15.7e
\n
"
,
ii
,
gpu
->
psPosq4
->
_pSysData
[
ii
].
x
,
gpu
->
psPosq4
->
_pSysData
[
ii
].
y
,
...
...
@@ -281,7 +281,7 @@ void kPrintGBVI( gpuContext gpu, std::string callId, int call, FILE* log)
gpu
->
sim
.
nonbond_blocks
,
gpu
->
sim
.
nonbond_threads_per_block
,
gpu
->
sim
.
workUnits
,
gpu
->
psWorkUnit
->
_pSysStream
[
0
][
0
],
sizeof
(
Atom
)
*
gpu
->
sim
.
nonbond_threads_per_block
);
(
void
)
fprintf
(
stderr
,
"bR bF swd r scR ...
\n
"
);
for
(
int
ii
=
0
;
ii
<
gpu
->
sim
.
paddedNumberOfAtoms
;
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
gpu
->
sim
.
paddedNumberOfAtoms
;
ii
++
){
(
void
)
fprintf
(
log
,
"%6d %15.7e %15.7e %15.7e %15.7e %15.7e %15.7e %15.7e %15.7e %15.7e
\n
"
,
ii
,
gpu
->
psBornRadii
->
_pSysData
[
ii
],
gpu
->
psBornForce
->
_pSysData
[
ii
],
...
...
platforms/cuda/src/kernels/kCalculateObcGbsaBornSum.cu
View file @
36762962
...
...
@@ -149,7 +149,7 @@ void kPrintObc( gpuContext gpu, std::string callId, int call, FILE* log)
(
void
)
fprintf
(
stderr
,
"bOutputWarp=%u blks=%u th/blk=%u wu=%u %u shrd=%u
\n
"
,
gpu
->
bOutputBufferPerWarp
,
gpu
->
sim
.
nonbond_blocks
,
gpu
->
sim
.
nonbond_threads_per_block
,
gpu
->
sim
.
workUnits
,
gpu
->
psWorkUnit
->
_pSysStream
[
0
][
0
],
sizeof
(
Atom
)
*
gpu
->
sim
.
nonbond_threads_per_block
);
for
(
int
ii
=
0
;
ii
<
gpu
->
sim
.
paddedNumberOfAtoms
;
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
gpu
->
sim
.
paddedNumberOfAtoms
;
ii
++
){
(
void
)
fprintf
(
log
,
"%6d %15.7e %15.7e %15.7e %15.7e %15.7e %15.7e %15.7e
\n
"
,
ii
,
gpu
->
psObcChain
->
_pSysData
[
ii
],
gpu
->
psBornRadii
->
_pSysData
[
ii
],
...
...
platforms/cuda/src/kernels/kForces.cu
View file @
36762962
...
...
@@ -291,7 +291,7 @@ double kReduceEnergy(gpuContext gpu)
//printf("kReduceEnergy\n");
gpu
->
psEnergy
->
Download
();
double
sum
=
0.0
;
for
(
int
i
=
0
;
i
<
gpu
->
sim
.
energyOutputBuffers
;
i
++
){
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
gpu
->
sim
.
energyOutputBuffers
)
;
i
++
){
sum
+=
(
*
gpu
->
psEnergy
)[
i
];
}
...
...
platforms/cuda/tests/TestCudaGBVIForce2.cpp
View file @
36762962
...
...
@@ -110,6 +110,7 @@ public:
int
_particle2
;
double
_distance
;
};
BondInfo_OpenMMTest
::
BondInfo_OpenMMTest
(
int
particle1
,
int
particle2
,
double
distance
){
_particle1
=
particle1
;
_particle2
=
particle2
;
...
...
@@ -279,13 +280,14 @@ public:
* @param boxDimensions box dimensions
* @param spacing spacing
* @param sfmt input random number generator
* @param bondDistance input bond distance
* @param array output vector of grid values
*
* @return -1 if particles will not fit on grid; 0 if they do
*/
int
setParticlesOnGrid
(
const
Vec3
&
origin
,
const
Vec3
&
boxDimensions
,
const
Vec3
&
spacing
,
OpenMM_SFMT
::
SFMT
&
sfmt
,
std
::
vector
<
Vec3
>&
array
)
const
;
OpenMM_SFMT
::
SFMT
&
sfmt
,
double
bondDistance
,
std
::
vector
<
Vec3
>&
array
)
const
;
/**
* Set bond distance
...
...
@@ -525,9 +527,9 @@ int PositionGenerator::setPositions( GenerationMethod method, OpenMM_SFMT::SFMT&
int
errorFlag
=
0
;
positions
.
resize
(
_numParticles
);
if
(
method
==
Random
){
for
(
unsigned
int
ii
=
0
;
ii
<
_numParticles
;
ii
+=
_numParticlesPerMolecule
){
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
_numParticles
)
;
ii
+=
_numParticlesPerMolecule
){
positions
[
ii
]
=
Vec3
(
_boxSize
*
genrand_real2
(
sfmt
),
_boxSize
*
genrand_real2
(
sfmt
),
_boxSize
*
genrand_real2
(
sfmt
));
for
(
unsigned
int
jj
=
1
;
jj
<
_numParticlesPerMolecule
;
jj
++
)
{
for
(
unsigned
int
jj
=
1
;
jj
<
static_cast
<
unsigned
int
>
(
_numParticlesPerMolecule
)
;
jj
++
)
{
positions
[
ii
+
jj
]
=
positions
[
ii
]
+
Vec3
(
_bondDistance
*
genrand_real2
(
sfmt
),
_bondDistance
*
genrand_real2
(
sfmt
),
_bondDistance
*
genrand_real2
(
sfmt
));
}
}
...
...
@@ -540,7 +542,7 @@ int PositionGenerator::setPositions( GenerationMethod method, OpenMM_SFMT::SFMT&
double
particlesPerDimension
=
pow
(
static_cast
<
double
>
(
_numMolecules
),
(
1.0
/
3.0
)
);
int
particlesPerDimensionI
=
static_cast
<
int
>
(
particlesPerDimension
+
0.999999
);
double
boxSize
=
_boxSize
;
double
spacingPerDimension
=
boxSize
/
(
particlesPerDimension
+
1.0
);
double
spacingPerDimension
=
(
boxSize
-
_bondDistance
)
/
(
particlesPerDimension
+
1.0
);
spacing
=
Vec3
(
spacingPerDimension
,
spacingPerDimension
,
spacingPerDimension
);
boxDimensions
=
Vec3
(
boxSize
,
boxSize
,
boxSize
);
...
...
@@ -561,7 +563,7 @@ int PositionGenerator::setPositions( GenerationMethod method, OpenMM_SFMT::SFMT&
(
void
)
fprintf
(
_log
,
"SimpleGrid %s
\n
"
,
msg
.
str
().
c_str
()
);
}
errorFlag
=
setParticlesOnGrid
(
origin
,
boxDimensions
,
spacing
,
sfmt
,
positions
);
errorFlag
=
setParticlesOnGrid
(
origin
,
boxDimensions
,
spacing
,
sfmt
,
_bondDistance
,
positions
);
}
return
errorFlag
;
...
...
@@ -579,7 +581,7 @@ int PositionGenerator::setPositions( GenerationMethod method, OpenMM_SFMT::SFMT&
*/
int
PositionGenerator
::
setParticlesOnGrid
(
const
Vec3
&
origin
,
const
Vec3
&
boxDimensions
,
const
Vec3
&
spacing
,
OpenMM_SFMT
::
SFMT
&
sfmt
,
std
::
vector
<
Vec3
>&
array
)
const
{
double
bondDistance
,
std
::
vector
<
Vec3
>&
array
)
const
{
const
double
pi
=
3.14159265358979323846
;
const
double
pi2
=
2.0
*
pi
;
...
...
@@ -595,12 +597,12 @@ int PositionGenerator::setParticlesOnGrid( const Vec3& origin, const Vec3& boxDi
// place molecule centers on grid
for
(
unsigned
int
ii
=
0
;
ii
<
_numParticles
;
ii
+=
_numParticlesPerMolecule
){
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
_numParticles
)
;
ii
+=
_numParticlesPerMolecule
){
array
[
ii
]
=
Vec3
(
start
);
bool
done
=
false
;
for
(
unsigned
int
jj
=
0
;
jj
<
3
&&
!
done
;
jj
++
){
start
[
jj
]
+=
spacing
[
jj
];
if
(
start
[
jj
]
>
boxDimensions
[
jj
]
){
if
(
(
start
[
jj
]
+
4.0
*
bondDistance
)
>
boxDimensions
[
jj
]
){
start
[
jj
]
=
origin
[
jj
];
}
else
{
done
=
true
;
...
...
@@ -615,9 +617,9 @@ int PositionGenerator::setParticlesOnGrid( const Vec3& origin, const Vec3& boxDi
// add molecule atoms
for
(
unsigned
int
ii
=
0
;
ii
<
_numMolecules
;
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
_numMolecules
)
;
ii
++
){
int
molecularIndex
=
ii
*
_numParticlesPerMolecule
;
for
(
unsigned
int
jj
=
1
;
jj
<
_numParticlesPerMolecule
;
jj
++
){
for
(
unsigned
int
jj
=
1
;
jj
<
static_cast
<
unsigned
int
>
(
_numParticlesPerMolecule
)
;
jj
++
){
double
theta
=
genrand_real2
(
sfmt
)
*
pi2
;
double
phi
=
genrand_real2
(
sfmt
)
*
pi
;
array
[
molecularIndex
+
jj
]
=
array
[
molecularIndex
]
+
Vec3
(
_bondDistance
*
cos
(
theta
)
*
cos
(
phi
),
_bondDistance
*
cos
(
theta
)
*
sin
(
phi
),
_bondDistance
*
sin
(
theta
)
);
...
...
@@ -688,12 +690,12 @@ void PositionGenerator::showMinMaxDistances( const std::vector<Vec3>& positions,
(
box
[
1
][
0
]
-
box
[
0
][
0
]),
(
box
[
1
][
1
]
-
box
[
0
][
1
]),
(
box
[
1
][
2
]
-
box
[
0
][
2
])
);
for
(
unsigned
int
ii
=
0
;
ii
<
positionIndexVector
.
size
();
ii
++
){
if
(
positionIndexVector
[
ii
]
<
positions
.
size
()
){
if
(
positionIndexVector
[
ii
]
<
static_cast
<
int
>
(
positions
.
size
()
)
){
int
positionIndex
=
positionIndexVector
[
ii
];
IntDoublePairVector
sortVector
;
getSortedDistances
(
periodicBoundaryConditions
,
positionIndex
,
positions
,
sortVector
);
(
void
)
fprintf
(
_log
,
"Min/max distance from %6d:
\n
"
,
positionIndex
);
for
(
unsigned
int
jj
=
0
;
jj
<
sortVector
.
size
()
&&
jj
<
showIndex
;
jj
++
){
for
(
unsigned
int
jj
=
0
;
jj
<
sortVector
.
size
()
&&
jj
<
static_cast
<
unsigned
int
>
(
showIndex
)
;
jj
++
){
IntDoublePair
pair
=
sortVector
[
jj
];
(
void
)
fprintf
(
_log
,
"[%6d %15.7e] "
,
pair
.
first
,
pair
.
second
);
}
...
...
@@ -748,7 +750,7 @@ void PositionGenerator::showMinMaxDistances( const std::vector<Vec3>& positions,
std
::
sort
(
hitVector
.
begin
(),
hitVector
.
end
(),
TestIntDoublePair
);
(
void
)
fprintf
(
_log
,
"Min distances pbc=%d
\n
"
,
periodicBoundaryConditions
);
for
(
unsigned
int
jj
=
0
;
jj
<
hitVector
.
size
()
&&
jj
<
showIndex
;
jj
++
){
for
(
unsigned
int
jj
=
0
;
jj
<
hitVector
.
size
()
&&
jj
<
static_cast
<
unsigned
int
>
(
showIndex
)
;
jj
++
){
IntDoublePair
pair
=
hitVector
[
jj
];
int
index
=
pair
.
first
;
int
iIndex
=
static_cast
<
int
>
(
index
/
positions
.
size
());
...
...
@@ -798,7 +800,7 @@ void PositionGenerator::showParticlesWithinDistance( const std::vector<Vec3>& po
void
PositionGenerator
::
showDistances
(
const
IntIntPairVector
&
pairs
,
const
std
::
vector
<
Vec3
>&
positions
)
const
{
for
(
IntIntPairVectorCI
ii
=
pairs
.
begin
();
ii
!=
pairs
.
end
();
ii
++
){
if
(
ii
->
first
<
positions
.
size
()
&&
ii
->
second
<
positions
.
size
()
){
if
(
ii
->
first
<
static_cast
<
int
>
(
positions
.
size
()
)
&&
ii
->
second
<
static_cast
<
int
>
(
positions
.
size
()
)
){
double
d
=
getDistance
(
ii
->
first
,
ii
->
second
,
positions
);
(
void
)
fprintf
(
_log
,
"Distance %6d %6d %15.7e d2=%15.7e
\n
"
,
ii
->
first
,
ii
->
second
,
d
,
d
*
d
);
}
...
...
@@ -976,7 +978,6 @@ static int setDoubleFromMapStringToDouble( MapStringToDouble& argumentMap, std::
return
0
;
}
/**---------------------------------------------------------------------------------------
*
* Get relative difference between two forces
...
...
@@ -2128,7 +2129,7 @@ static void copySystem( const System& inputSystem, System& systemCopy, FILE* log
// add particle/mass
for
(
unsigned
int
ii
=
0
;
ii
<
inputSystem
.
getNumParticles
();
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
inputSystem
.
getNumParticles
()
)
;
ii
++
){
systemCopy
.
addParticle
(
inputSystem
.
getParticleMass
(
static_cast
<
int
>
(
ii
)
)
);
}
...
...
@@ -2142,8 +2143,7 @@ static void copySystem( const System& inputSystem, System& systemCopy, FILE* log
// copy constraints
for
(
unsigned
int
ii
=
0
;
ii
<
inputSystem
.
getNumConstraints
();
ii
++
){
int
index
;
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
inputSystem
.
getNumConstraints
());
ii
++
){
int
particle1
,
particle2
;
double
distance
;
inputSystem
.
getConstraintParameters
(
ii
,
particle1
,
particle2
,
distance
);
...
...
@@ -2152,7 +2152,7 @@ static void copySystem( const System& inputSystem, System& systemCopy, FILE* log
// copy forces
for
(
unsigned
int
ii
=
0
;
ii
<
inputSystem
.
getNumForces
();
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
inputSystem
.
getNumForces
()
)
;
ii
++
){
systemCopy
.
addForce
(
copyForce
(
inputSystem
.
getForce
(
ii
),
log
)
);
}
...
...
platforms/opencl/tests/TestOpenCLGBSAOBCForce2.cpp
View file @
36762962
...
...
@@ -527,9 +527,9 @@ int PositionGenerator::setPositions( GenerationMethod method, OpenMM_SFMT::SFMT&
int
errorFlag
=
0
;
positions
.
resize
(
_numParticles
);
if
(
method
==
Random
){
for
(
unsigned
int
ii
=
0
;
ii
<
_numParticles
;
ii
+=
_numParticlesPerMolecule
){
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
_numParticles
)
;
ii
+=
_numParticlesPerMolecule
){
positions
[
ii
]
=
Vec3
(
_boxSize
*
genrand_real2
(
sfmt
),
_boxSize
*
genrand_real2
(
sfmt
),
_boxSize
*
genrand_real2
(
sfmt
));
for
(
unsigned
int
jj
=
1
;
jj
<
_numParticlesPerMolecule
;
jj
++
)
{
for
(
unsigned
int
jj
=
1
;
jj
<
static_cast
<
unsigned
int
>
(
_numParticlesPerMolecule
)
;
jj
++
)
{
positions
[
ii
+
jj
]
=
positions
[
ii
]
+
Vec3
(
_bondDistance
*
genrand_real2
(
sfmt
),
_bondDistance
*
genrand_real2
(
sfmt
),
_bondDistance
*
genrand_real2
(
sfmt
));
}
}
...
...
@@ -597,13 +597,12 @@ int PositionGenerator::setParticlesOnGrid( const Vec3& origin, const Vec3& boxDi
// place molecule centers on grid
for
(
unsigned
int
ii
=
0
;
ii
<
_numParticles
;
ii
+=
_numParticlesPerMolecule
){
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
_numParticles
)
;
ii
+=
_numParticlesPerMolecule
){
array
[
ii
]
=
Vec3
(
start
);
bool
done
=
false
;
for
(
unsigned
int
jj
=
0
;
jj
<
3
&&
!
done
;
jj
++
){
start
[
jj
]
+=
spacing
[
jj
];
if
(
(
start
[
jj
]
+
4.0
*
bondDistance
)
>
boxDimensions
[
jj
]
){
//fprintf( stderr, "setParticlesOnGrid %6u %2u %15.7e %15.7e %15.7e\n", ii, jj, start[0], start[1], start[2] );
start
[
jj
]
=
origin
[
jj
];
}
else
{
done
=
true
;
...
...
@@ -618,9 +617,9 @@ int PositionGenerator::setParticlesOnGrid( const Vec3& origin, const Vec3& boxDi
// add molecule atoms
for
(
unsigned
int
ii
=
0
;
ii
<
_numMolecules
;
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
_numMolecules
)
;
ii
++
){
int
molecularIndex
=
ii
*
_numParticlesPerMolecule
;
for
(
unsigned
int
jj
=
1
;
jj
<
_numParticlesPerMolecule
;
jj
++
){
for
(
unsigned
int
jj
=
1
;
jj
<
static_cast
<
unsigned
int
>
(
_numParticlesPerMolecule
)
;
jj
++
){
double
theta
=
genrand_real2
(
sfmt
)
*
pi2
;
double
phi
=
genrand_real2
(
sfmt
)
*
pi
;
array
[
molecularIndex
+
jj
]
=
array
[
molecularIndex
]
+
Vec3
(
_bondDistance
*
cos
(
theta
)
*
cos
(
phi
),
_bondDistance
*
cos
(
theta
)
*
sin
(
phi
),
_bondDistance
*
sin
(
theta
)
);
...
...
@@ -691,12 +690,12 @@ void PositionGenerator::showMinMaxDistances( const std::vector<Vec3>& positions,
(
box
[
1
][
0
]
-
box
[
0
][
0
]),
(
box
[
1
][
1
]
-
box
[
0
][
1
]),
(
box
[
1
][
2
]
-
box
[
0
][
2
])
);
for
(
unsigned
int
ii
=
0
;
ii
<
positionIndexVector
.
size
();
ii
++
){
if
(
positionIndexVector
[
ii
]
<
positions
.
size
()
){
if
(
positionIndexVector
[
ii
]
<
static_cast
<
int
>
(
positions
.
size
()
)
){
int
positionIndex
=
positionIndexVector
[
ii
];
IntDoublePairVector
sortVector
;
getSortedDistances
(
periodicBoundaryConditions
,
positionIndex
,
positions
,
sortVector
);
(
void
)
fprintf
(
_log
,
"Min/max distance from %6d:
\n
"
,
positionIndex
);
for
(
unsigned
int
jj
=
0
;
jj
<
sortVector
.
size
()
&&
jj
<
showIndex
;
jj
++
){
for
(
unsigned
int
jj
=
0
;
jj
<
sortVector
.
size
()
&&
jj
<
static_cast
<
unsigned
int
>
(
showIndex
)
;
jj
++
){
IntDoublePair
pair
=
sortVector
[
jj
];
(
void
)
fprintf
(
_log
,
"[%6d %15.7e] "
,
pair
.
first
,
pair
.
second
);
}
...
...
@@ -751,7 +750,7 @@ void PositionGenerator::showMinMaxDistances( const std::vector<Vec3>& positions,
std
::
sort
(
hitVector
.
begin
(),
hitVector
.
end
(),
TestIntDoublePair
);
(
void
)
fprintf
(
_log
,
"Min distances pbc=%d
\n
"
,
periodicBoundaryConditions
);
for
(
unsigned
int
jj
=
0
;
jj
<
hitVector
.
size
()
&&
jj
<
showIndex
;
jj
++
){
for
(
unsigned
int
jj
=
0
;
jj
<
hitVector
.
size
()
&&
jj
<
static_cast
<
unsigned
int
>
(
showIndex
)
;
jj
++
){
IntDoublePair
pair
=
hitVector
[
jj
];
int
index
=
pair
.
first
;
int
iIndex
=
static_cast
<
int
>
(
index
/
positions
.
size
());
...
...
@@ -801,7 +800,7 @@ void PositionGenerator::showParticlesWithinDistance( const std::vector<Vec3>& po
void
PositionGenerator
::
showDistances
(
const
IntIntPairVector
&
pairs
,
const
std
::
vector
<
Vec3
>&
positions
)
const
{
for
(
IntIntPairVectorCI
ii
=
pairs
.
begin
();
ii
!=
pairs
.
end
();
ii
++
){
if
(
ii
->
first
<
positions
.
size
()
&&
ii
->
second
<
positions
.
size
()
){
if
(
ii
->
first
<
static_cast
<
int
>
(
positions
.
size
()
)
&&
ii
->
second
<
static_cast
<
int
>
(
positions
.
size
()
)
){
double
d
=
getDistance
(
ii
->
first
,
ii
->
second
,
positions
);
(
void
)
fprintf
(
_log
,
"Distance %6d %6d %15.7e d2=%15.7e
\n
"
,
ii
->
first
,
ii
->
second
,
d
,
d
*
d
);
}
...
...
@@ -1982,7 +1981,7 @@ static Force* copyForce( const Force& force, FILE* log ){
#ifdef INCLUDE_AMOEBA_FORCES
if
(
forceCopy
!
=
NULL
){
if
(
forceCopy
=
=
NULL
){
try
{
const
AmoebaHarmonicBondForce
&
castForce
=
dynamic_cast
<
const
AmoebaHarmonicBondForce
&>
(
force
);
...
...
@@ -1991,7 +1990,7 @@ static Force* copyForce( const Force& force, FILE* log ){
}
}
if
(
forceCopy
!
=
NULL
){
if
(
forceCopy
=
=
NULL
){
try
{
const
AmoebaHarmonicAngleForce
&
castForce
=
dynamic_cast
<
const
AmoebaHarmonicAngleForce
&>
(
force
);
...
...
@@ -2000,7 +1999,7 @@ static Force* copyForce( const Force& force, FILE* log ){
}
}
if
(
forceCopy
!
=
NULL
){
if
(
forceCopy
=
=
NULL
){
try
{
const
AmoebaHarmonicInPlaneAngleForce
&
castForce
=
dynamic_cast
<
const
AmoebaHarmonicInPlaneAngleForce
&>
(
force
);
...
...
@@ -2009,7 +2008,7 @@ static Force* copyForce( const Force& force, FILE* log ){
}
}
if
(
forceCopy
!
=
NULL
){
if
(
forceCopy
=
=
NULL
){
try
{
const
AmoebaMultipoleForce
&
castForce
=
dynamic_cast
<
const
AmoebaMultipoleForce
&>
(
force
);
...
...
@@ -2018,7 +2017,7 @@ static Force* copyForce( const Force& force, FILE* log ){
}
}
if
(
forceCopy
!
=
NULL
){
if
(
forceCopy
=
=
NULL
){
try
{
const
AmoebaOutOfPlaneBendForce
&
castForce
=
dynamic_cast
<
const
AmoebaOutOfPlaneBendForce
&>
(
force
);
...
...
@@ -2027,7 +2026,7 @@ static Force* copyForce( const Force& force, FILE* log ){
}
}
if
(
forceCopy
!
=
NULL
){
if
(
forceCopy
=
=
NULL
){
try
{
const
AmoebaPiTorsionForce
&
castForce
=
dynamic_cast
<
const
AmoebaPiTorsionForce
&>
(
force
);
...
...
@@ -2036,7 +2035,7 @@ static Force* copyForce( const Force& force, FILE* log ){
}
}
if
(
forceCopy
!
=
NULL
){
if
(
forceCopy
=
=
NULL
){
try
{
const
AmoebaStretchBendForce
&
castForce
=
dynamic_cast
<
const
AmoebaStretchBendForce
&>
(
force
);
...
...
@@ -2045,7 +2044,7 @@ static Force* copyForce( const Force& force, FILE* log ){
}
}
if
(
forceCopy
!
=
NULL
){
if
(
forceCopy
=
=
NULL
){
try
{
const
AmoebaTorsionForce
&
castForce
=
dynamic_cast
<
const
AmoebaTorsionForce
&>
(
force
);
...
...
@@ -2054,7 +2053,7 @@ static Force* copyForce( const Force& force, FILE* log ){
}
}
if
(
forceCopy
!
=
NULL
){
if
(
forceCopy
=
=
NULL
){
try
{
const
AmoebaTorsionTorsionForce
&
castForce
=
dynamic_cast
<
const
AmoebaTorsionTorsionForce
&>
(
force
);
...
...
@@ -2063,7 +2062,7 @@ static Force* copyForce( const Force& force, FILE* log ){
}
}
if
(
forceCopy
!
=
NULL
){
if
(
forceCopy
=
=
NULL
){
try
{
const
AmoebaUreyBradleyForce
&
castForce
=
dynamic_cast
<
const
AmoebaUreyBradleyForce
&>
(
force
);
...
...
@@ -2072,7 +2071,7 @@ static Force* copyForce( const Force& force, FILE* log ){
}
}
if
(
forceCopy
!
=
NULL
){
if
(
forceCopy
=
=
NULL
){
try
{
const
AmoebaVdwForce
&
castForce
=
dynamic_cast
<
const
AmoebaVdwForce
&>
(
force
);
...
...
@@ -2081,7 +2080,7 @@ static Force* copyForce( const Force& force, FILE* log ){
}
}
if
(
forceCopy
!
=
NULL
){
if
(
forceCopy
=
=
NULL
){
try
{
const
AmoebaWcaDispersionForce
&
castForce
=
dynamic_cast
<
const
AmoebaWcaDispersionForce
&>
(
force
);
...
...
@@ -2090,7 +2089,7 @@ static Force* copyForce( const Force& force, FILE* log ){
}
}
if
(
forceCopy
!
=
NULL
){
if
(
forceCopy
=
=
NULL
){
try
{
const
AmoebaGeneralizedKirkwoodForce
&
castForce
=
dynamic_cast
<
const
AmoebaGeneralizedKirkwoodForce
&>
(
force
);
...
...
@@ -2099,7 +2098,7 @@ static Force* copyForce( const Force& force, FILE* log ){
}
}
if
(
forceCopy
!
=
NULL
){
if
(
forceCopy
=
=
NULL
){
try
{
const
AmoebaTorsionTorsionForce
&
castForce
=
dynamic_cast
<
const
AmoebaTorsionTorsionForce
&>
(
force
);
...
...
@@ -2130,7 +2129,7 @@ static void copySystem( const System& inputSystem, System& systemCopy, FILE* log
// add particle/mass
for
(
unsigned
int
ii
=
0
;
ii
<
inputSystem
.
getNumParticles
();
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
inputSystem
.
getNumParticles
()
)
;
ii
++
){
systemCopy
.
addParticle
(
inputSystem
.
getParticleMass
(
static_cast
<
int
>
(
ii
)
)
);
}
...
...
@@ -2144,8 +2143,7 @@ static void copySystem( const System& inputSystem, System& systemCopy, FILE* log
// copy constraints
for
(
unsigned
int
ii
=
0
;
ii
<
inputSystem
.
getNumConstraints
();
ii
++
){
int
index
;
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
inputSystem
.
getNumConstraints
());
ii
++
){
int
particle1
,
particle2
;
double
distance
;
inputSystem
.
getConstraintParameters
(
ii
,
particle1
,
particle2
,
distance
);
...
...
@@ -2154,7 +2152,7 @@ static void copySystem( const System& inputSystem, System& systemCopy, FILE* log
// copy forces
for
(
unsigned
int
ii
=
0
;
ii
<
inputSystem
.
getNumForces
();
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
inputSystem
.
getNumForces
()
)
;
ii
++
){
systemCopy
.
addForce
(
copyForce
(
inputSystem
.
getForce
(
ii
),
log
)
);
}
...
...
@@ -3361,8 +3359,8 @@ int main() {
#endif
DoubleVector
numberOfMolecules
;
//
numberOfMolecules.push_back( 10 );
//
numberOfMolecules.push_back( 100 );
numberOfMolecules
.
push_back
(
10
);
numberOfMolecules
.
push_back
(
100
);
numberOfMolecules
.
push_back
(
1000
);
numberOfMolecules
.
push_back
(
2000
);
numberOfMolecules
.
push_back
(
4000
);
...
...
plugins/amoeba/platforms/cuda/src/kernels/amoebaCudaGpu.cpp
View file @
36762962
...
...
@@ -1161,6 +1161,11 @@ static void testAmoebaTorsionTorsionGridLookup( amoebaGpuContext amoebaGpu, floa
values
[
i
++
]
=
grids
[
index
++
];
}
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable: 4297)
#endif
extern
"C"
void
gpuSetAmoebaTorsionTorsionGrids
(
amoebaGpuContext
amoebaGpu
,
const
std
::
vector
<
std
::
vector
<
std
::
vector
<
std
::
vector
<
float
>
>
>
>&
floatGrids
)
{
...
...
@@ -1176,7 +1181,6 @@ void gpuSetAmoebaTorsionTorsionGrids(amoebaGpuContext amoebaGpu, const std::vect
throw
OpenMM
::
OpenMMException
(
message
.
str
()
);
}
// 4 (grids) * (25 *25 grid)*(2 +4 a1, a2, f, f1,f2, f12) = 15000
// assumming uniform spacing of grid angle values, set offset in to memory, beginning angle, angle spacing (delta),
// and number of y-angles
...
...
@@ -1779,7 +1783,7 @@ void gpuSetAmoebaMultipoleParameters(amoebaGpuContext amoebaGpu, const std::vect
int
maxTorqueBufferIndex
=
0
;
int
chargeSize
=
static_cast
<
int
>
(
charges
.
size
());
for
(
int
ii
=
0
;
ii
<
chargeSize
;
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
chargeSize
)
;
ii
++
){
// axis type & multipole particles ids
...
...
@@ -2106,7 +2110,7 @@ void gpuSetAmoebaObcParameters( amoebaGpuContext amoebaGpu, float innerDielectri
}
// Dummy out extra particles data
for
(
unsigned
int
i
=
particles
;
i
<
paddedNumberOfAtoms
;
i
++
)
for
(
unsigned
int
i
=
particles
;
i
<
static_cast
<
unsigned
int
>
(
paddedNumberOfAtoms
)
;
i
++
)
{
(
*
gpu
->
psBornRadii
)[
i
]
=
0.2
f
;
(
*
gpu
->
psObcData
)[
i
].
x
=
0.01
f
;
...
...
@@ -2171,7 +2175,7 @@ void gpuSetAmoebaGrycukParameters( amoebaGpuContext amoebaGpu, float innerDielec
// Dummy out extra particles data
for
(
unsigned
int
i
=
particles
;
i
<
paddedNumberOfAtoms
;
i
++
)
for
(
unsigned
int
i
=
particles
;
i
<
static_cast
<
unsigned
int
>
(
paddedNumberOfAtoms
)
;
i
++
)
{
(
*
gpu
->
psBornRadii
)[
i
]
=
0.2
f
;
(
*
gpu
->
psObcData
)[
i
].
x
=
0.01
f
;
...
...
@@ -2398,7 +2402,7 @@ void gpuSetAmoebaVdwParameters( amoebaGpuContext amoebaGpu,
psAmoebaVdwReduction
->
Upload
();
amoebaGpu
->
vdwExclusions
.
resize
(
gpu
->
natoms
);
for
(
unsigned
int
ii
=
0
;
ii
<
gpu
->
natoms
;
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
gpu
->
natoms
)
;
ii
++
){
for
(
unsigned
int
jj
=
0
;
jj
<
allExclusions
[
ii
].
size
();
jj
++
){
amoebaGpu
->
vdwExclusions
[
ii
].
push_back
(
allExclusions
[
ii
][
jj
]
);
}
...
...
@@ -2411,7 +2415,7 @@ void gpuSetAmoebaVdwParameters( amoebaGpuContext amoebaGpu,
(
void
)
fprintf
(
amoebaGpu
->
log
,
"%s particles=%d numberOfNonReductions=%d numberOfReductionsi=%d
\n
"
,
methodName
,
particles
,
numberOfNonReductions
,
numberOfReductions
);
#ifdef PARAMETER_PRINT
for
(
unsigned
int
ii
=
0
;
ii
<
gpu
->
natoms
;
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
gpu
->
natoms
)
;
ii
++
){
(
void
)
fprintf
(
amoebaGpu
->
log
,
"%5u %15.7e %15.7e %15.7e Ex["
,
ii
,
sigmas
[
ii
],
epsilons
[
ii
],
reductionFactors
[
ii
]
);
for
(
unsigned
int
jj
=
0
;
jj
<
allExclusions
[
ii
].
size
();
jj
++
){
(
void
)
fprintf
(
amoebaGpu
->
log
,
"%6d "
,
allExclusions
[
ii
][
jj
]
);
...
...
@@ -2850,7 +2854,7 @@ void gpuSetAmoebaWcaDispersionParameters( amoebaGpuContext amoebaGpu,
// Dummy out extra particles data
for
(
unsigned
int
ii
=
particles
;
ii
<
paddedNumberOfAtoms
;
ii
++
)
for
(
unsigned
int
ii
=
particles
;
ii
<
static_cast
<
unsigned
int
>
(
paddedNumberOfAtoms
)
;
ii
++
)
{
amoebaGpu
->
psWcaDispersionRadiusEpsilon
->
_pSysData
[
ii
].
x
=
1.0
f
;
amoebaGpu
->
psWcaDispersionRadiusEpsilon
->
_pSysData
[
ii
].
y
=
0.0
f
;
...
...
@@ -2870,7 +2874,7 @@ void gpuSetAmoebaWcaDispersionParameters( amoebaGpuContext amoebaGpu,
(
void
)
fprintf
(
amoebaGpu
->
log
,
"%s particles=%u total max dispersion energy=%14.5e eps[%14.5e %14.5e] rmin[%14.5e %14.5e] awtr=%14.5e shctd=%14.5e dispoff=%14.5e
\n
"
,
methodName
,
static_cast
<
unsigned
int
>
(
radii
.
size
()),
totalMaxWcaDispersionEnergy
,
epso
,
epsh
,
rmino
,
rminh
,
awater
,
shctd
,
dispoff
);
#ifdef PARAMETER_PRINT
for
(
unsigned
int
ii
=
0
;
ii
<
gpu
->
natoms
;
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
gpu
->
natoms
)
;
ii
++
){
(
void
)
fprintf
(
amoebaGpu
->
log
,
"%5u %15.7e %15.7e
\n
"
,
ii
,
radii
[
ii
],
epsilons
[
ii
]
);
if
(
ii
==
maxPrint
&&
ii
<
(
paddedNumberOfAtoms
-
maxPrint
)
){
(
void
)
fprintf
(
amoebaGpu
->
log
,
"
\n
"
);
...
...
@@ -3089,7 +3093,7 @@ void amoebaGpuBuildOutputBuffers( amoebaGpuContext amoebaGpu, int hasAmoebaGener
// use the Cuda force output buffers for mapping torques onto forces, if max torque buffer count < number of buffers
amoebaGpu
->
amoebaSim
.
maxTorqueBufferIndex
++
;
if
(
amoebaGpu
->
amoebaSim
.
maxTorqueBufferIndex
>
outputBuffers
){
if
(
static_cast
<
unsigned
int
>
(
amoebaGpu
->
amoebaSim
.
maxTorqueBufferIndex
)
>
outputBuffers
){
amoebaGpu
->
psTorqueMapForce4
=
new
CUDAStream
<
float4
>
(
paddedNumberOfAtoms
,
amoebaGpu
->
amoebaSim
.
maxTorqueBufferIndex
,
"torqueMapForce"
);
amoebaGpu
->
torqueMapForce4Delete
=
1
;
}
else
{
...
...
@@ -4714,7 +4718,7 @@ void initializeCudaFloatArray( int numberOfParticles, int entriesPerParticle,
void
zeroCUDAStreamFloat4
(
CUDAStream
<
float4
>*
streamToCopy
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
streamToCopy
->
_stride
;
ii
++
){
for
(
int
jj
=
0
;
jj
<
streamToCopy
->
_subStreams
;
jj
++
){
for
(
unsigned
int
jj
=
0
;
jj
<
streamToCopy
->
_subStreams
;
jj
++
){
streamToCopy
->
_pSysStream
[
jj
][
ii
].
x
=
0.0
f
;
streamToCopy
->
_pSysStream
[
jj
][
ii
].
y
=
0.0
f
;
streamToCopy
->
_pSysStream
[
jj
][
ii
].
z
=
0.0
f
;
...
...
@@ -4743,7 +4747,7 @@ void reduceAndCopyCUDAStreamFloat4( CUDAStream<float4>* streamToCopy, CUDAStream
outputStream
->
_pSysData
[
indexOffset
]
=
streamToCopy
->
_pSysStream
[
0
][
ii
].
x
;
outputStream
->
_pSysData
[
indexOffset
+
1
]
=
streamToCopy
->
_pSysStream
[
0
][
ii
].
y
;
outputStream
->
_pSysData
[
indexOffset
+
2
]
=
streamToCopy
->
_pSysStream
[
0
][
ii
].
z
;
for
(
int
jj
=
1
;
jj
<
streamToCopy
->
_subStreams
;
jj
++
){
for
(
unsigned
int
jj
=
1
;
jj
<
streamToCopy
->
_subStreams
;
jj
++
){
if
(
streamToCopy
->
_pSysStream
[
jj
][
ii
].
x
!=
streamToCopy
->
_pSysStream
[
jj
][
ii
].
x
||
streamToCopy
->
_pSysStream
[
jj
][
ii
].
y
!=
streamToCopy
->
_pSysStream
[
jj
][
ii
].
y
||
streamToCopy
->
_pSysStream
[
jj
][
ii
].
z
!=
streamToCopy
->
_pSysStream
[
jj
][
ii
].
z
){
...
...
@@ -4779,7 +4783,7 @@ void reduceAndCopyCUDAStreamFloat( CUDAStream<float>* streamToCopy, CUDAStream<f
for
(
unsigned
int
ii
=
0
;
ii
<
streamToCopy
->
_stride
;
ii
++
){
outputStream
->
_pSysData
[
ii
]
=
streamToCopy
->
_pSysStream
[
0
][
ii
];
if
(
ii
==
0
)(
void
)
fprintf
(
stderr
,
"reduceAndCopyCUDAStreamFloat:%u %15.7e %u %u
\n
"
,
ii
,
streamToCopy
->
_pSysStream
[
0
][
ii
],
streamToCopy
->
_stride
,
streamToCopy
->
_subStreams
);
for
(
int
jj
=
1
;
jj
<
streamToCopy
->
_subStreams
;
jj
++
){
for
(
unsigned
int
jj
=
1
;
jj
<
streamToCopy
->
_subStreams
;
jj
++
){
if
(
streamToCopy
->
_pSysStream
[
jj
][
ii
]
!=
streamToCopy
->
_pSysStream
[
jj
][
ii
]
){
(
void
)
fprintf
(
stderr
,
"Nan at particle=%d stream=%d
\n
"
,
ii
,
jj
);
}
...
...
@@ -4828,3 +4832,8 @@ double getTimeOfDay( void ){
#endif
}
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
// 4 (grids) * (25 *25 grid)*(2 +4 a1, a2, f, f1,f2, f12) = 15000
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaOutOfPlaneBendForce.cpp
View file @
36762962
...
...
@@ -439,7 +439,7 @@ void testOneOutOfPlaneBend2( FILE* log, int setId ) {
Context
context
(
system
,
integrator
,
Platform
::
getPlatformByName
(
"Reference"
));
std
::
vector
<
Vec3
>
positions
(
numberOfParticles
);
for
(
unsigned
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
numberOfParticles
)
;
ii
++
){
if
(
coordinates
.
find
(
particleIndices
[
ii
]
)
==
coordinates
.
end
()
){
#ifdef AMOEBA_DEBUG
if
(
log
){
...
...
@@ -480,7 +480,7 @@ void testOneOutOfPlaneBend2( FILE* log, int setId ) {
computeAmoebaOutOfPlaneBendForce
(
0
,
positions
,
*
amoebaOutOfPlaneBendForce
,
forces
,
&
energy
,
log
);
totalEnergy
+=
energy
;
for
(
unsigned
int
ii
=
0
;
ii
<
numberOfParticles
;
ii
++
){
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
numberOfParticles
)
;
ii
++
){
for
(
unsigned
int
jj
=
0
;
jj
<
3
;
jj
++
){
totalForces
[
particleIndices
[
ii
]][
jj
]
+=
forces
[
ii
][
jj
];
}
...
...
plugins/amoeba/serialization/src/AmoebaGeneralizedKirkwoodForceProxy.cpp
View file @
36762962
...
...
@@ -53,7 +53,7 @@ void AmoebaGeneralizedKirkwoodForceProxy::serialize(const void* object, Serializ
node
.
setIntProperty
(
"GeneralizedKirkwoodIncludeCavityTerm"
,
force
.
getIncludeCavityTerm
()
);
SerializationNode
&
particles
=
node
.
createChildNode
(
"GeneralizedKirkwoodParticles"
).
setIntProperty
(
"size"
,
force
.
getNumParticles
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
force
.
getNumParticles
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumParticles
()
)
;
ii
++
)
{
double
radius
,
charge
,
scalingFactor
;
force
.
getParticleParameters
(
ii
,
charge
,
radius
,
scalingFactor
);
particles
.
createChildNode
(
"Particle"
).
setIntProperty
(
"index"
,
ii
).
setDoubleProperty
(
"charge"
,
charge
).
setDoubleProperty
(
"radius"
,
radius
).
setDoubleProperty
(
"scaleFactor"
,
scalingFactor
);
...
...
plugins/amoeba/serialization/src/AmoebaHarmonicAngleForceProxy.cpp
View file @
36762962
...
...
@@ -52,7 +52,7 @@ void AmoebaHarmonicAngleForceProxy::serialize(const void* object, SerializationN
node
.
setDoubleProperty
(
"HarmonicAngleSextic"
,
force
.
getAmoebaGlobalHarmonicAngleSextic
());
SerializationNode
&
bonds
=
node
.
createChildNode
(
"Angles"
).
setIntProperty
(
"size"
,
force
.
getNumAngles
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
force
.
getNumAngles
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumAngles
()
)
;
ii
++
)
{
int
particle1
,
particle2
,
particle3
;
double
distance
,
k
;
force
.
getAngleParameters
(
ii
,
particle1
,
particle2
,
particle3
,
distance
,
k
);
...
...
plugins/amoeba/serialization/src/AmoebaHarmonicBondForceProxy.cpp
View file @
36762962
...
...
@@ -49,7 +49,7 @@ void AmoebaHarmonicBondForceProxy::serialize(const void* object, SerializationNo
node
.
setDoubleProperty
(
"HarmonicBondQuartic"
,
force
.
getAmoebaGlobalHarmonicBondQuartic
());
SerializationNode
&
bonds
=
node
.
createChildNode
(
"Bonds"
).
setIntProperty
(
"size"
,
force
.
getNumBonds
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
force
.
getNumBonds
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumBonds
()
)
;
ii
++
)
{
int
particle1
,
particle2
;
double
distance
,
k
;
force
.
getBondParameters
(
ii
,
particle1
,
particle2
,
distance
,
k
);
...
...
plugins/amoeba/serialization/src/AmoebaHarmonicInPlaneAngleForceProxy.cpp
View file @
36762962
...
...
@@ -52,7 +52,7 @@ void AmoebaHarmonicInPlaneAngleForceProxy::serialize(const void* object, Seriali
node
.
setDoubleProperty
(
"HarmonicInPlaneAngleSextic"
,
force
.
getAmoebaGlobalHarmonicInPlaneAngleSextic
());
SerializationNode
&
bonds
=
node
.
createChildNode
(
"InPlaneAngles"
).
setIntProperty
(
"size"
,
force
.
getNumAngles
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
force
.
getNumAngles
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumAngles
()
)
;
ii
++
)
{
int
particle1
,
particle2
,
particle3
,
particle4
;
double
distance
,
k
;
force
.
getAngleParameters
(
ii
,
particle1
,
particle2
,
particle3
,
particle4
,
distance
,
k
);
...
...
plugins/amoeba/serialization/src/AmoebaMultipoleForceProxy.cpp
View file @
36762962
...
...
@@ -94,7 +94,7 @@ void AmoebaMultipoleForceProxy::serialize(const void* object, SerializationNode&
getCovalentTypes
(
covalentTypes
);
SerializationNode
&
particles
=
node
.
createChildNode
(
"MultipoleParticles"
).
setIntProperty
(
"size"
,
force
.
getNumMultipoles
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
force
.
getNumMultipoles
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumMultipoles
()
)
;
ii
++
)
{
int
axisType
,
multipoleAtomZ
,
multipoleAtomX
,
multipoleAtomY
;
double
charge
,
thole
,
dampingFactor
,
polarity
;
...
...
plugins/amoeba/serialization/src/AmoebaOutOfPlaneBendForceProxy.cpp
View file @
36762962
...
...
@@ -50,7 +50,7 @@ void AmoebaOutOfPlaneBendForceProxy::serialize(const void* object, Serialization
node
.
setDoubleProperty
(
"OutOfPlaneBendSextic"
,
force
.
getAmoebaGlobalOutOfPlaneBendSextic
());
SerializationNode
&
bonds
=
node
.
createChildNode
(
"OutOfPlaneBend"
).
setIntProperty
(
"size"
,
force
.
getNumOutOfPlaneBends
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
force
.
getNumOutOfPlaneBends
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumOutOfPlaneBends
()
)
;
ii
++
)
{
int
particle1
,
particle2
,
particle3
,
particle4
;
double
k
;
force
.
getOutOfPlaneBendParameters
(
ii
,
particle1
,
particle2
,
particle3
,
particle4
,
k
);
...
...
plugins/amoeba/serialization/src/AmoebaPiTorsionForceProxy.cpp
View file @
36762962
...
...
@@ -45,7 +45,7 @@ void AmoebaPiTorsionForceProxy::serialize(const void* object, SerializationNode&
node
.
setIntProperty
(
"version"
,
1
);
const
AmoebaPiTorsionForce
&
force
=
*
reinterpret_cast
<
const
AmoebaPiTorsionForce
*>
(
object
);
SerializationNode
&
bonds
=
node
.
createChildNode
(
"PiTorsion"
).
setIntProperty
(
"size"
,
force
.
getNumPiTorsions
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
force
.
getNumPiTorsions
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumPiTorsions
()
)
;
ii
++
)
{
int
particle1
,
particle2
,
particle3
,
particle4
,
particle5
,
particle6
;
double
k
;
force
.
getPiTorsionParameters
(
ii
,
particle1
,
particle2
,
particle3
,
particle4
,
particle5
,
particle6
,
k
);
...
...
plugins/amoeba/serialization/src/AmoebaStretchBendForceProxy.cpp
View file @
36762962
...
...
@@ -45,7 +45,7 @@ void AmoebaStretchBendForceProxy::serialize(const void* object, SerializationNod
node
.
setIntProperty
(
"version"
,
1
);
const
AmoebaStretchBendForce
&
force
=
*
reinterpret_cast
<
const
AmoebaStretchBendForce
*>
(
object
);
SerializationNode
&
bonds
=
node
.
createChildNode
(
"StretchBendAngles"
).
setIntProperty
(
"size"
,
force
.
getNumStretchBends
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
force
.
getNumStretchBends
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumStretchBends
()
)
;
ii
++
)
{
int
particle1
,
particle2
,
particle3
;
double
distanceAB
,
distanceCB
,
angle
,
k
;
force
.
getStretchBendParameters
(
ii
,
particle1
,
particle2
,
particle3
,
distanceAB
,
distanceCB
,
angle
,
k
);
...
...
plugins/amoeba/serialization/src/AmoebaTorsionForceProxy.cpp
View file @
36762962
...
...
@@ -50,7 +50,7 @@ static void addTorsionValues( SerializationNode& torsion, const std::vector<doub
static
void
loadTorsionValues
(
SerializationNode
&
torsion
,
std
::
vector
<
double
>&
torsionValues
){
int
size
=
torsion
.
getIntProperty
(
"size"
);
torsionValues
.
resize
(
size
);
for
(
unsigned
int
jj
=
0
;
jj
<
size
;
jj
++
)
{
for
(
unsigned
int
jj
=
0
;
jj
<
static_cast
<
unsigned
int
>
(
size
)
;
jj
++
)
{
torsionValues
[
jj
]
=
(
torsion
.
getChildren
()[
jj
].
getDoubleProperty
(
"v"
)
);
}
}
...
...
@@ -60,7 +60,7 @@ void AmoebaTorsionForceProxy::serialize(const void* object, SerializationNode& n
const
AmoebaTorsionForce
&
force
=
*
reinterpret_cast
<
const
AmoebaTorsionForce
*>
(
object
);
SerializationNode
&
bonds
=
node
.
createChildNode
(
"Torsion"
).
setIntProperty
(
"size"
,
force
.
getNumTorsions
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
force
.
getNumTorsions
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumTorsions
()
)
;
ii
++
)
{
int
particle1
,
particle2
,
particle3
,
particle4
;
std
::
vector
<
double
>
torsion1
;
...
...
plugins/amoeba/serialization/src/AmoebaTorsionTorsionForceProxy.cpp
View file @
36762962
...
...
@@ -77,7 +77,7 @@ void AmoebaTorsionTorsionForceProxy::serialize(const void* object, Serialization
SerializationNode
&
grids
=
node
.
createChildNode
(
"TorsionTorsionGrids"
);
grids
.
setIntProperty
(
"size"
,
static_cast
<
int
>
(
force
.
getNumTorsionTorsionGrids
()));
for
(
unsigned
int
kk
=
0
;
kk
<
force
.
getNumTorsionTorsionGrids
();
kk
++
)
{
for
(
unsigned
int
kk
=
0
;
kk
<
static_cast
<
unsigned
int
>
(
force
.
getNumTorsionTorsionGrids
()
)
;
kk
++
)
{
const
std
::
vector
<
std
::
vector
<
std
::
vector
<
double
>
>
>
grid
=
force
.
getTorsionTorsionGrid
(
kk
);
...
...
@@ -107,7 +107,7 @@ void AmoebaTorsionTorsionForceProxy::serialize(const void* object, Serialization
}
SerializationNode
&
bonds
=
node
.
createChildNode
(
"TorsionTorsion"
);
for
(
unsigned
int
ii
=
0
;
ii
<
force
.
getNumTorsionTorsions
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumTorsionTorsions
()
)
;
ii
++
)
{
int
particle1
,
particle2
,
particle3
,
particle4
,
particle5
;
int
chiralCheckAtomIndex
,
gridIndex
;
force
.
getTorsionTorsionParameters
(
ii
,
particle1
,
particle2
,
particle3
,
particle4
,
particle5
,
chiralCheckAtomIndex
,
gridIndex
);
...
...
plugins/amoeba/serialization/src/AmoebaUreyBradleyForceProxy.cpp
View file @
36762962
...
...
@@ -49,7 +49,7 @@ void AmoebaUreyBradleyForceProxy::serialize(const void* object, SerializationNod
node
.
setDoubleProperty
(
"UreyBradleyQuartic"
,
force
.
getAmoebaGlobalUreyBradleyQuartic
());
SerializationNode
&
bonds
=
node
.
createChildNode
(
"UreyBradley"
).
setIntProperty
(
"size"
,
force
.
getNumInteractions
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
force
.
getNumInteractions
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumInteractions
()
)
;
ii
++
)
{
int
particle1
,
particle2
;
double
distance
,
k
;
force
.
getUreyBradleyParameters
(
ii
,
particle1
,
particle2
,
distance
,
k
);
...
...
plugins/amoeba/serialization/src/AmoebaVdwForceProxy.cpp
View file @
36762962
...
...
@@ -53,7 +53,7 @@ void AmoebaVdwForceProxy::serialize(const void* object, SerializationNode& node)
node
.
setIntProperty
(
"VdwPBC"
,
force
.
getPBC
());
SerializationNode
&
particles
=
node
.
createChildNode
(
"VdwParticles"
).
setIntProperty
(
"size"
,
force
.
getNumParticles
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
force
.
getNumParticles
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumParticles
()
)
;
ii
++
)
{
int
ivIndex
,
classIndex
;
double
sigma
,
epsilon
,
reductionFactor
;
...
...
plugins/amoeba/serialization/src/AmoebaWcaDispersionForceProxy.cpp
View file @
36762962
...
...
@@ -54,7 +54,7 @@ void AmoebaWcaDispersionForceProxy::serialize(const void* object, SerializationN
node
.
setDoubleProperty
(
"Slevy"
,
force
.
getSlevy
());
SerializationNode
&
particles
=
node
.
createChildNode
(
"WcaDispersionParticles"
).
setIntProperty
(
"size"
,
force
.
getNumParticles
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
force
.
getNumParticles
();
ii
++
)
{
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumParticles
()
)
;
ii
++
)
{
double
radius
,
epsilon
;
force
.
getParticleParameters
(
ii
,
radius
,
epsilon
);
particles
.
createChildNode
(
"Particle"
).
setIntProperty
(
"index"
,
ii
).
setDoubleProperty
(
"radius"
,
radius
).
setDoubleProperty
(
"epsilon"
,
epsilon
);
...
...
Prev
1
2
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