2017-07-09 15:10:26 +08:00
|
|
|
This folder contains several LAMMPS input scripts and a python module
|
2017-12-16 02:17:12 +08:00
|
|
|
file py_nve.py to demonstrate the use of the fix style python/move
|
2017-12-02 14:04:46 +08:00
|
|
|
to reimplement NVE using Python.
|
2017-07-09 15:10:26 +08:00
|
|
|
|
2017-12-16 02:20:13 +08:00
|
|
|
in.fix_python_move_nve_melt:
|
2017-07-09 15:10:26 +08:00
|
|
|
This is a version of the melt example which replaces the default NVE integrator
|
2017-12-16 02:17:12 +08:00
|
|
|
with a Python implementation. Fix python/move is used to create an
|
2017-12-02 14:04:46 +08:00
|
|
|
instance of the py_nve.NVE class which implements the required interface.
|
2017-07-09 15:10:26 +08:00
|
|
|
It demonstrates how to access LAMMPS data as numpy arrays. This gives direct
|
|
|
|
access to memory owned by the C++ code, allows easy manipulation through numpy
|
|
|
|
operations and avoids unnecessary copies.
|
|
|
|
|
2017-12-16 02:20:13 +08:00
|
|
|
in.fix_python_move_nve_melt_opt:
|
2017-07-09 15:10:26 +08:00
|
|
|
This version of melt example uses NVE_Opt instead of NVE. While this Python
|
|
|
|
implementation is still much slower than the native version, it shows that
|
|
|
|
simple code transformations can lead to speedups.
|