Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91647891
trivial.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
Wed, Nov 13, 01:48
Size
605 B
Mime Type
text/x-python
Expires
Fri, Nov 15, 01:48 (2 d)
Engine
blob
Format
Raw Data
Handle
22276252
Attached To
rLAMMPS lammps
trivial.py
View Options
#!/usr/bin/env python -i
# preceding line should have path for Python on your machine
# trivial.py
# Purpose: run a LAMMPS input script via Python
# Syntax: trivial.py in.lammps
# in.lammps = LAMMPS input script
from
__future__
import
print_function
import
sys
# parse command line
argv
=
sys
.
argv
if
len
(
argv
)
!=
2
:
print
(
"Syntax: trivial.py in.lammps"
)
sys
.
exit
()
infile
=
sys
.
argv
[
1
]
from
lammps
import
lammps
lmp
=
lammps
()
# run infile all at once
lmp
.
file
(
infile
)
# or run infile one line at a time
#lines = open(infile,'r').readlines()
#for line in lines: lmp.command(line)
Event Timeline
Log In to Comment