git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13236 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
This directory contains Python code which wraps LAMMPS as a library
|
This directory contains Python code which wraps LAMMPS as a library
|
||||||
and allows the LAMMPS library interface to be invoked from Python,
|
and allows the LAMMPS library interface to be invoked from Python,
|
||||||
either from a script or interactively.
|
either from a Python script or using Python interactively.
|
||||||
|
|
||||||
Details on the Python interface to LAMMPS and how to build LAMMPS as a
|
Details on the Python interface to LAMMPS and how to build LAMMPS as a
|
||||||
shared library, for use with Python, are given in
|
shared library, for use with Python, are given in
|
||||||
@ -16,16 +16,22 @@ variables in your shell script. Or you can run the python/install.py
|
|||||||
script directly to give you more control over where the two relevant
|
script directly to give you more control over where the two relevant
|
||||||
files are installed. See doc/Section_python.html for details.
|
files are installed. See doc/Section_python.html for details.
|
||||||
|
|
||||||
You can then launch Python and instantiate an instance of LAMMPS:
|
You should then be able to launch Python and instantiate an instance
|
||||||
|
of LAMMPS:
|
||||||
|
|
||||||
% python
|
% python
|
||||||
>>> from lammps import lammps
|
>>> from lammps import lammps
|
||||||
>>> lmp = lammps()
|
>>> lmp = lammps()
|
||||||
|
|
||||||
If that gives no errors, you have succesfully wrapped LAMMPS with
|
If that gives no errors, you have succesfully wrapped LAMMPS with
|
||||||
Python. See doc/Section_python.html#py_5 for tests you can then use
|
Python. See doc/Section_python.html#py_7 for tests you can then use
|
||||||
to run LAMMPS both in serial or parallel thru Python.
|
to run LAMMPS both in serial or parallel thru Python.
|
||||||
|
|
||||||
|
Note that you can also invoke Python code from within a LAMMPS input
|
||||||
|
script, using the "python" command. See the doc/python.html doc page
|
||||||
|
for details. The Python code you invoke can also call back to LAMMPS
|
||||||
|
using the same interface described here for wrapping LAMMPS.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
Once you have successfully wrapped LAMMPS, you can run the Python
|
Once you have successfully wrapped LAMMPS, you can run the Python
|
||||||
|
|||||||
Reference in New Issue
Block a user