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
9f206616
Commit
9f206616
authored
Sep 03, 2013
by
peastman
Browse files
Merge pull request #126 from peastman/master
Minor enhancements and bug fixes
parents
e76fe9c2
808504df
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
platforms/cuda/src/CudaKernels.cpp
platforms/cuda/src/CudaKernels.cpp
+1
-1
platforms/opencl/src/OpenCLKernels.cpp
platforms/opencl/src/OpenCLKernels.cpp
+1
-1
wrappers/python/simtk/openmm/app/pdbfile.py
wrappers/python/simtk/openmm/app/pdbfile.py
+6
-2
No files found.
platforms/cuda/src/CudaKernels.cpp
View file @
9f206616
...
@@ -5752,7 +5752,7 @@ void CudaRemoveCMMotionKernel::initialize(const System& system, const CMMotionRe
...
@@ -5752,7 +5752,7 @@ void CudaRemoveCMMotionKernel::initialize(const System& system, const CMMotionRe
for
(
int
i
=
0
;
i
<
numAtoms
;
i
++
)
for
(
int
i
=
0
;
i
<
numAtoms
;
i
++
)
totalMass
+=
system
.
getParticleMass
(
i
);
totalMass
+=
system
.
getParticleMass
(
i
);
map
<
string
,
string
>
defines
;
map
<
string
,
string
>
defines
;
defines
[
"INVERSE_TOTAL_MASS"
]
=
cu
.
doubleToString
(
1.0
/
totalMass
);
defines
[
"INVERSE_TOTAL_MASS"
]
=
cu
.
doubleToString
(
totalMass
==
0
?
0.0
:
1.0
/
totalMass
);
CUmodule
module
=
cu
.
createModule
(
CudaKernelSources
::
removeCM
,
defines
);
CUmodule
module
=
cu
.
createModule
(
CudaKernelSources
::
removeCM
,
defines
);
kernel1
=
cu
.
getKernel
(
module
,
"calcCenterOfMassMomentum"
);
kernel1
=
cu
.
getKernel
(
module
,
"calcCenterOfMassMomentum"
);
kernel2
=
cu
.
getKernel
(
module
,
"removeCenterOfMassMomentum"
);
kernel2
=
cu
.
getKernel
(
module
,
"removeCenterOfMassMomentum"
);
...
...
platforms/opencl/src/OpenCLKernels.cpp
View file @
9f206616
...
@@ -5978,7 +5978,7 @@ void OpenCLRemoveCMMotionKernel::initialize(const System& system, const CMMotion
...
@@ -5978,7 +5978,7 @@ void OpenCLRemoveCMMotionKernel::initialize(const System& system, const CMMotion
for
(
int
i
=
0
;
i
<
numAtoms
;
i
++
)
for
(
int
i
=
0
;
i
<
numAtoms
;
i
++
)
totalMass
+=
system
.
getParticleMass
(
i
);
totalMass
+=
system
.
getParticleMass
(
i
);
map
<
string
,
string
>
defines
;
map
<
string
,
string
>
defines
;
defines
[
"INVERSE_TOTAL_MASS"
]
=
cl
.
doubleToString
(
1.0
/
totalMass
);
defines
[
"INVERSE_TOTAL_MASS"
]
=
cl
.
doubleToString
(
totalMass
==
0
?
0.0
:
1.0
/
totalMass
);
cl
::
Program
program
=
cl
.
createProgram
(
OpenCLKernelSources
::
removeCM
,
defines
);
cl
::
Program
program
=
cl
.
createProgram
(
OpenCLKernelSources
::
removeCM
,
defines
);
kernel1
=
cl
::
Kernel
(
program
,
"calcCenterOfMassMomentum"
);
kernel1
=
cl
::
Kernel
(
program
,
"calcCenterOfMassMomentum"
);
kernel1
.
setArg
<
cl_int
>
(
0
,
numAtoms
);
kernel1
.
setArg
<
cl_int
>
(
0
,
numAtoms
);
...
...
wrappers/python/simtk/openmm/app/pdbfile.py
View file @
9f206616
...
@@ -70,7 +70,10 @@ class PDBFile(object):
...
@@ -70,7 +70,10 @@ class PDBFile(object):
# Load the PDB file
# Load the PDB file
pdb
=
PdbStructure
(
open
(
file
),
load_all_models
=
True
)
inputfile
=
file
if
isinstance
(
file
,
str
):
inputfile
=
open
(
file
)
pdb
=
PdbStructure
(
inputfile
,
load_all_models
=
True
)
PDBFile
.
_loadNameReplacementTables
()
PDBFile
.
_loadNameReplacementTables
()
# Build the topology
# Build the topology
...
@@ -140,7 +143,8 @@ class PDBFile(object):
...
@@ -140,7 +143,8 @@ class PDBFile(object):
for
connect
in
pdb
.
models
[
0
].
connects
:
for
connect
in
pdb
.
models
[
0
].
connects
:
i
=
connect
[
0
]
i
=
connect
[
0
]
for
j
in
connect
[
1
:]:
for
j
in
connect
[
1
:]:
connectBonds
.
append
((
atomByNumber
[
i
],
atomByNumber
[
j
]))
if
i
in
atomByNumber
and
j
in
atomByNumber
:
connectBonds
.
append
((
atomByNumber
[
i
],
atomByNumber
[
j
]))
if
len
(
connectBonds
)
>
0
:
if
len
(
connectBonds
)
>
0
:
# Only add bonds that don't already exist.
# Only add bonds that don't already exist.
existingBonds
=
set
(
top
.
bonds
())
existingBonds
=
set
(
top
.
bonds
())
...
...
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