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
8f8aa247
Unverified
Commit
8f8aa247
authored
Jul 06, 2018
by
peastman
Committed by
GitHub
Jul 06, 2018
Browse files
Merge pull request #2112 from peastman/cleanup
Code cleanup
parents
0d13f9cd
c0e862f6
Changes
63
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
21 deletions
+12
-21
platforms/reference/src/SimTKReference/ReferenceRbDihedralBond.cpp
.../reference/src/SimTKReference/ReferenceRbDihedralBond.cpp
+2
-2
plugins/cudacompiler/src/CudaCompilerKernels.cpp
plugins/cudacompiler/src/CudaCompilerKernels.cpp
+1
-11
serialization/src/SystemProxy.cpp
serialization/src/SystemProxy.cpp
+9
-8
No files found.
platforms/reference/src/SimTKReference/ReferenceRbDihedralBond.cpp
View file @
8f8aa247
...
...
@@ -69,9 +69,9 @@ void ReferenceRbDihedralBond::setPeriodic(OpenMM::Vec3* vectors) {
--------------------------------------------------------------------------------------- */
void
ReferenceRbDihedralBond
::
calculateBondIxn
(
int
*
atomIndices
,
void
ReferenceRbDihedralBond
::
calculateBondIxn
(
vector
<
int
>&
atomIndices
,
vector
<
Vec3
>&
atomCoordinates
,
double
*
parameters
,
vector
<
double
>&
parameters
,
vector
<
Vec3
>&
forces
,
double
*
totalEnergy
,
double
*
energyParamDerivs
)
{
// number of parameters
...
...
plugins/cudacompiler/src/CudaCompilerKernels.cpp
View file @
8f8aa247
...
...
@@ -45,17 +45,7 @@ using namespace std;
}
static
string
getErrorString
(
nvrtcResult
result
)
{
switch
(
result
)
{
case
NVRTC_SUCCESS
:
return
"NVRTC_SUCCESS"
;
case
NVRTC_ERROR_OUT_OF_MEMORY
:
return
"NVRTC_ERROR_OUT_OF_MEMORY"
;
case
NVRTC_ERROR_PROGRAM_CREATION_FAILURE
:
return
"NVRTC_ERROR_PROGRAM_CREATION_FAILURE"
;
case
NVRTC_ERROR_INVALID_INPUT
:
return
"NVRTC_ERROR_INVALID_INPUT"
;
case
NVRTC_ERROR_INVALID_PROGRAM
:
return
"NVRTC_ERROR_INVALID_PROGRAM"
;
case
NVRTC_ERROR_INVALID_OPTION
:
return
"NVRTC_ERROR_INVALID_OPTION"
;
case
NVRTC_ERROR_COMPILATION
:
return
"NVRTC_ERROR_COMPILATION"
;
case
NVRTC_ERROR_BUILTIN_OPERATION_FAILURE
:
return
"NVRTC_ERROR_BUILTIN_OPERATION_FAILURE"
;
}
return
"NVRTC error"
;
return
nvrtcGetErrorString
(
result
);
}
string
CudaRuntimeCompilerKernel
::
createModule
(
const
string
&
source
,
const
string
&
flags
,
CudaContext
&
cu
)
{
...
...
serialization/src/SystemProxy.cpp
View file @
8f8aa247
...
...
@@ -57,20 +57,21 @@ void SystemProxy::serialize(const void* object, SerializationNode& node) const {
for
(
int
i
=
0
;
i
<
system
.
getNumParticles
();
i
++
)
{
SerializationNode
&
particle
=
particles
.
createChildNode
(
"Particle"
).
setDoubleProperty
(
"mass"
,
system
.
getParticleMass
(
i
));
if
(
system
.
isVirtualSite
(
i
))
{
if
(
typeid
(
system
.
getVirtualSite
(
i
))
==
typeid
(
TwoParticleAverageSite
))
{
const
TwoParticleAverageSite
&
site
=
dynamic_cast
<
const
TwoParticleAverageSite
&>
(
system
.
getVirtualSite
(
i
));
const
VirtualSite
&
vsite
=
system
.
getVirtualSite
(
i
);
if
(
typeid
(
vsite
)
==
typeid
(
TwoParticleAverageSite
))
{
const
TwoParticleAverageSite
&
site
=
dynamic_cast
<
const
TwoParticleAverageSite
&>
(
vsite
);
particle
.
createChildNode
(
"TwoParticleAverageSite"
).
setIntProperty
(
"p1"
,
site
.
getParticle
(
0
)).
setIntProperty
(
"p2"
,
site
.
getParticle
(
1
)).
setDoubleProperty
(
"w1"
,
site
.
getWeight
(
0
)).
setDoubleProperty
(
"w2"
,
site
.
getWeight
(
1
));
}
else
if
(
typeid
(
system
.
getVirtualSite
(
i
)
)
==
typeid
(
ThreeParticleAverageSite
))
{
const
ThreeParticleAverageSite
&
site
=
dynamic_cast
<
const
ThreeParticleAverageSite
&>
(
system
.
getVirtualSite
(
i
)
);
else
if
(
typeid
(
vsite
)
==
typeid
(
ThreeParticleAverageSite
))
{
const
ThreeParticleAverageSite
&
site
=
dynamic_cast
<
const
ThreeParticleAverageSite
&>
(
vsite
);
particle
.
createChildNode
(
"ThreeParticleAverageSite"
).
setIntProperty
(
"p1"
,
site
.
getParticle
(
0
)).
setIntProperty
(
"p2"
,
site
.
getParticle
(
1
)).
setIntProperty
(
"p3"
,
site
.
getParticle
(
2
)).
setDoubleProperty
(
"w1"
,
site
.
getWeight
(
0
)).
setDoubleProperty
(
"w2"
,
site
.
getWeight
(
1
)).
setDoubleProperty
(
"w3"
,
site
.
getWeight
(
2
));
}
else
if
(
typeid
(
system
.
getVirtualSite
(
i
)
)
==
typeid
(
OutOfPlaneSite
))
{
const
OutOfPlaneSite
&
site
=
dynamic_cast
<
const
OutOfPlaneSite
&>
(
system
.
getVirtualSite
(
i
)
);
else
if
(
typeid
(
vsite
)
==
typeid
(
OutOfPlaneSite
))
{
const
OutOfPlaneSite
&
site
=
dynamic_cast
<
const
OutOfPlaneSite
&>
(
vsite
);
particle
.
createChildNode
(
"OutOfPlaneSite"
).
setIntProperty
(
"p1"
,
site
.
getParticle
(
0
)).
setIntProperty
(
"p2"
,
site
.
getParticle
(
1
)).
setIntProperty
(
"p3"
,
site
.
getParticle
(
2
)).
setDoubleProperty
(
"w12"
,
site
.
getWeight12
()).
setDoubleProperty
(
"w13"
,
site
.
getWeight13
()).
setDoubleProperty
(
"wc"
,
site
.
getWeightCross
());
}
else
if
(
typeid
(
system
.
getVirtualSite
(
i
)
)
==
typeid
(
LocalCoordinatesSite
))
{
const
LocalCoordinatesSite
&
site
=
dynamic_cast
<
const
LocalCoordinatesSite
&>
(
system
.
getVirtualSite
(
i
)
);
else
if
(
typeid
(
vsite
)
==
typeid
(
LocalCoordinatesSite
))
{
const
LocalCoordinatesSite
&
site
=
dynamic_cast
<
const
LocalCoordinatesSite
&>
(
vsite
);
int
numParticles
=
site
.
getNumParticles
();
vector
<
double
>
wo
,
wx
,
wy
;
site
.
getOriginWeights
(
wo
);
...
...
Prev
1
2
3
4
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