Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F88490112
amberparm_bond_to_lt.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Oct 19, 02:27
Size
1 KB
Mime Type
text/x-python
Expires
Mon, Oct 21, 02:27 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
21780665
Attached To
rLAMMPS lammps
amberparm_bond_to_lt.py
View Options
#!/usr/bin/env python
import
sys
lines_gaff
=
sys
.
stdin
.
readlines
()
bond_style_name
=
'harmonic'
sys
.
stdout
.
write
(
' write_once("In Settings") {
\n
'
)
for
i
in
range
(
0
,
len
(
lines_gaff
)):
line
=
lines_gaff
[
i
]
tokens
=
line
.
split
()
atypes
=
line
[:
6
]
.
split
(
'-'
)
atype1
=
atypes
[
0
]
.
strip
()
atype2
=
atypes
[
1
]
.
strip
()
at1
=
atype1
.
replace
(
'X'
,
'*'
)
at2
=
atype2
.
replace
(
'X'
,
'*'
)
bondtype
=
'@bond:'
+
atype1
+
'-'
+
atype2
tokens
=
line
[
5
:]
.
split
()
keq
=
tokens
[
0
]
req
=
tokens
[
1
]
comments
=
' '
.
join
(
tokens
[
2
:])
sys
.
stdout
.
write
(
' bond_coeff '
+
bondtype
+
' '
+
bond_style_name
+
' '
+
keq
+
' '
+
req
+
' # '
+
comments
+
'
\n
'
)
sys
.
stdout
.
write
(
' } # (end of bond_coeffs)
\n
'
)
sys
.
stdout
.
write
(
'
\n
'
)
sys
.
stdout
.
write
(
' write_once("Data Bonds By Type") {
\n
'
)
for
i
in
range
(
0
,
len
(
lines_gaff
)):
line
=
lines_gaff
[
i
]
atypes
=
line
[:
6
]
.
split
(
'-'
)
atype1
=
atypes
[
0
]
.
strip
()
atype2
=
atypes
[
1
]
.
strip
()
at1
=
atype1
.
replace
(
'X'
,
'*'
)
at2
=
atype2
.
replace
(
'X'
,
'*'
)
bondtype
=
'@bond:'
+
atype1
+
'-'
+
atype2
#tokens= line[5:].split()
#keq = tokens[0]
#req = tokens[1]
#comments=' '.join(tokens[2:])
sys
.
stdout
.
write
(
' '
+
bondtype
+
' @atom:'
+
at1
+
' @atom:'
+
at2
+
'
\n
'
)
sys
.
stdout
.
write
(
' } # (end of Bonds By Type)
\n
'
)
sys
.
stdout
.
write
(
'
\n
'
)
Event Timeline
Log In to Comment