Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F63957614
dumpsort.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
Thu, May 23, 15:05
Size
695 B
Mime Type
text/x-python
Expires
Sat, May 25, 15:05 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
16690182
Attached To
rLAMMPS lammps
dumpsort.py
View Options
#!/usr/bin/env python
# Script: dumpsort.py
# Purpose: sort the snapshots in a LAMMPS dump file by atom ID
# Syntax: dumpsort.py oldfile N newfile
# oldfile = old LAMMPS dump file in native LAMMPS format
# N = column # for atom ID (usually 1)
# newfile = new sorted LAMMPS dump file
# Author: Steve Plimpton (Sandia), sjplimp at sandia.gov
import
sys
,
os
path
=
os
.
environ
[
"LAMMPS_PYTHON_TOOLS"
]
sys
.
path
.
append
(
path
)
from
dump
import
dump
if
len
(
sys
.
argv
)
!=
4
:
raise
StandardError
,
"Syntax: dumpsort.py oldfile N newfile"
oldfile
=
sys
.
argv
[
1
]
ncolumn
=
int
(
sys
.
argv
[
2
])
newfile
=
sys
.
argv
[
3
]
d
=
dump
(
oldfile
)
d
.
map
(
ncolumn
,
"id"
)
d
.
sort
()
d
.
write
(
newfile
)
Event Timeline
Log In to Comment