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
418987b4
"platforms/cpu/src/CpuCustomNonbondedForce.cpp" did not exist on "a17524632a35e22cd96deac605d2ad237f959933"
Commit
418987b4
authored
Apr 19, 2014
by
Jason Swails
Browse files
Coordinates and velocities have to be natom-length iterators of Vec3's
parent
539c1f1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
wrappers/python/simtk/openmm/app/charmmcrdfiles.py
wrappers/python/simtk/openmm/app/charmmcrdfiles.py
+11
-12
No files found.
wrappers/python/simtk/openmm/app/charmmcrdfiles.py
View file @
418987b4
...
...
@@ -36,8 +36,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
from
simtk.openmm.app.internal.charmm.exceptions
import
CharmmFileError
import
simtk.unit
as
u
from
simtk.openmm.vec3
import
Vec3
charmlen
=
22
CHARMMLEN
=
22
TIMESCALE
=
4.888821E-14
*
1e12
# AKMA time units to picoseconds
ONE_TIMESCALE
=
1
/
TIMESCALE
...
...
@@ -103,23 +104,21 @@ class CharmmCrdFile(object):
self
.
resno
.
append
(
int
(
line
[
1
]))
self
.
resname
.
append
(
line
[
2
])
self
.
attype
.
append
(
line
[
3
])
self
.
positions
.
append
(
float
(
line
[
4
]))
self
.
positions
.
append
(
float
(
line
[
5
]))
self
.
positions
.
append
(
float
(
line
[
6
]))
pos
=
Vec3
(
float
(
line
[
4
]),
float
(
line
[
5
]),
float
(
line
[
6
]))
self
.
positions
.
append
(
pos
*
u
.
angstroms
)
self
.
segid
.
append
(
line
[
7
])
self
.
resid
.
append
(
int
(
line
[
8
]))
self
.
weighting
.
append
(
float
(
line
[
9
]))
if
3
*
self
.
natom
!=
len
(
self
.
positions
):
if
self
.
natom
!=
len
(
self
.
positions
):
raise
CharmmFileError
(
"Error parsing CHARMM .crd file: %d "
"atoms requires %d positions (not %d)"
%
(
self
.
natom
,
3
*
self
.
natom
,
(
self
.
natom
,
self
.
natom
,
len
(
self
.
positions
))
)
except
(
ValueError
,
IndexError
),
e
:
raise
CharmmFileError
(
'Error parsing CHARMM coordinate file'
)
self
.
positions
*=
u
.
angstrom
class
CharmmRstFile
(
object
):
"""
...
...
@@ -235,18 +234,18 @@ class CharmmRstFile(object):
if
not
line
:
raise
CharmmFileError
(
'Premature end of file'
)
if
len
(
line
)
<
3
*
charmlen
:
if
len
(
line
)
<
3
*
CHARMMLEN
:
raise
CharmmFileError
(
"Less than 3 coordinates present in "
"coordinate row or positions may be "
"truncated."
)
line
=
line
.
replace
(
'D'
,
'E'
)
# CHARMM uses 'D' for exponentials
# CHARMM uses fixed format (len =
charmlen
= 22) for crds in .rst's
# CHARMM uses fixed format (len =
CHARMMLEN
= 22) for crds in .rst's
c
rds
.
append
(
float
(
line
[
0
:
charmlen
]))
crds
.
append
(
float
(
line
[
charmlen
:
2
*
charmlen
]))
crds
.
append
(
float
(
line
[
2
*
charmlen
:
3
*
charmlen
])
)
c
=
Vec3
(
float
(
line
[
0
:
CHARMMLEN
]),
float
(
line
[
CHARMMLEN
:
2
*
CHARMMLEN
]),
float
(
line
[
2
*
CHARMMLEN
:
3
*
CHARMMLEN
]))
crds
.
append
(
c
)
def
printcoords
(
self
,
crds
):
...
...
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