Merge branch 'improved_python_interface' of https://github.com/rbberger/lammps into merge-pull-116

This commit is contained in:
Axel Kohlmeyer
2016-07-18 16:08:10 -04:00

View File

@ -34,6 +34,32 @@ using the same interface described here for wrapping LAMMPS.
-------------------------------------------------------------------
Alternative Python wrapper for LAMMPS
In addition to the original wrapper, you can use the PyLammps or IPyLammps
wrappers to create simpler Python scripts and IPython notebooks.
>>> from lammps import lammps, PyLammps, IPyLammps
>>> lmp = lammps()
>>> L = PyLammps(lmp)
Using these higher-level wrappers translates any function call into their
corresponding LAMMPS command. Arguments are either passed as one
string or individual parameters. Parameter lists are automatically
joined to one command string. E.g.,
>>> L.velocity("all create", 1.44, 87287, "loop geom")
is translated into the following call in the original interface:
>>> lmp.command("velocity all create 1.44 87287 loop geom")
It also gives you an easier way to query the system state, evaluate variable
expressions and access atom data. See examples/ipython/interface_usage.ipynb
for more details.
-------------------------------------------------------------------
Once you have successfully wrapped LAMMPS, you can run the Python
scripts in the examples sub-directory: