Commit Graph

38 Commits

Author SHA1 Message Date
Richard Berger 084626e60b Fixes coverity issue CID 179426 2017-05-22 17:36:16 -04:00
Richard Berger a7d790a827 Fixes coverity issue CID 179439 2017-05-22 17:33:47 -04:00
Richard Berger 8a630ff4ec Fixes coverity issue CID 179440 2017-05-22 17:32:07 -04:00
Richard Berger 617ca4e0c8 Fixes coverity issue CID 179436 2017-05-22 17:30:46 -04:00
Richard Berger 65eacb6b90 Fix compilation warnings in fix_python 2017-05-18 12:20:39 -04:00
Axel Kohlmeyer 67962b15fc a bunch refactoring changes in the python pair style and the examples
- make all python potential classes derived from LAMMPSPairPotential
  which contains shared functionality. We currently don't check
  for supported atom types. may want to add that again later.
- keep track of skipped atom types in the C++ code.
- add test against units setting. must set self.units='...' in constructor
- make compute_force method consistent with Pair::single() in LAMMPS and return force/r instead of force.
- rename potentials.py to py_pot.py
- update test runs. some small tweaks.
2017-05-17 20:55:48 -04:00
Axel Kohlmeyer 43efe9e417 adding Pair::single() support to python pair style and examples
with the single function, python pair styles can be massively
sped up and made compatible to accelerators, as one can translate
the analytic force and energy functions through LAMMPS into suitable
tables and then simply use the on-the-fly tables for production runs
2017-05-17 17:20:56 -04:00
Axel Kohlmeyer 45becfb235 correct author attributions 2017-05-17 09:59:01 -04:00
Richard Berger 7caf6cf459 Change how a Python pair style is loaded
Implements a class loader which takes a fully qualified Python class
name, loads the module and creates an object instance.

To add flexibility, the current working directory and the
directory specified by the LAMMPS_POTENTIALS environment variable are
added to the module search path.
2017-05-16 23:29:48 -04:00
Richard Berger a6f0d700f1 Merge branch 'add-pair-python' of github.com:akohlmey/lammps into add-pair-python 2017-05-15 18:44:52 -04:00
Axel Kohlmeyer d66a696a84 avoid preprocessor warnings, by placing Python.h include file on the top, as suggested by python docs 2017-05-15 18:02:02 -04:00
Richard Berger 69ccbd1562 Extract common wrappers to Python compatibility header 2017-05-15 17:46:57 -04:00
Axel Kohlmeyer d662f5d429 whitspace cleanup and gitignore update 2017-05-15 00:22:22 -04:00
Axel Kohlmeyer 6e113c1eaf basic feature complete version of lj melt example with python interaction function 2017-05-15 00:15:41 -04:00
Axel Kohlmeyer 34cc3946b8 first few pieces of pair style python 2017-05-14 18:29:06 -04:00
Richard Berger c4d0f07093 Allow fix python to only execute every N steps 2017-05-12 00:29:58 -04:00
Richard Berger 110bb79b14 Implement fix python mentioned in issue #454
Allows to call a python function at defined points in the integration loop
2017-05-11 23:50:30 -04:00
Axel Kohlmeyer d84f8898b7 implement functions to execute arbitrary python code from strings or files and recast the python source keyword through using them. 2017-05-11 22:39:08 -04:00
Axel Kohlmeyer 27a6371f9b implement a `python source` command as suggested in issue #454 2017-05-11 19:18:09 -04:00
Axel Kohlmeyer d3187b22c4 restore lost change to PYTHON/Install.sh 2017-04-13 18:11:57 -04:00
Richard Berger e6f30ebc9c Merge remote-tracking branch 'origin/master' into python_refactoring 2017-04-12 20:26:57 -04:00
Richard Berger 961096f9df Prevent segfault if Python was never initialized 2017-04-12 11:17:15 -04:00
Richard Berger 05d7bc556f Initialize Python interpreter in PythonImpl constructor 2017-04-11 21:46:33 -04:00
Richard Berger 2d8bce78a6 Refactor PYTHON package and wrapper classes 2017-04-11 21:22:30 -04:00
Richard Berger 9a027a01da Add Python 3 compatibility to PYTHON package 2017-04-11 20:24:42 -04:00
sjplimp ccc9367de7 Merge pull request #442 from akohlmey/small-updates-and-bugfixes
collected small updates and bugfixes
2017-04-11 08:24:32 -06:00
Axel Kohlmeyer d6357420ae propagate global package installation bugfix to explicit package scripts 2017-04-07 15:29:56 -04:00
Richard Berger 1544b51dcb Support mixed Python use by honoring Python GIL
This enables support to both drive LAMMPS with a Python interpreter and
evaluating Python expressions inside of LAMMPS using that same interpreter.
Previously this has been avoided through an error message because the
binding code did not ensure that the necessary GIL (global interpreter lock)
structures exist (see issue #438).

All code paths which call Python C API functions must first acquire the
GIL through a call PyGILState_Ensure and release it with PyGILState_Release.
2017-03-29 01:49:15 -04:00
Richard Berger 3a054d1a82 Fix more typos in src files 2017-03-07 00:55:01 -05:00
Richard Berger e261bef7bb Spelling fixes in source files 2017-03-05 18:30:39 -05:00
Steve Plimpton e364b80724 added length keyword to python command 2016-12-16 10:24:25 -07:00
sjplimp 236241b100 sync with Git
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15518 f3b2605a-c512-4ea7-a41b-209d697bcdaa
2016-08-27 23:09:15 +00:00
sjplimp 354e20f431 git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14220 f3b2605a-c512-4ea7-a41b-209d697bcdaa 2015-10-30 20:04:06 +00:00
sjplimp cee848f948 git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14164 f3b2605a-c512-4ea7-a41b-209d697bcdaa 2015-10-22 22:06:49 +00:00
sjplimp 25b928b276 git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13282 f3b2605a-c512-4ea7-a41b-209d697bcdaa 2015-03-24 15:34:07 +00:00
sjplimp ac0b1d1ac3 git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13280 f3b2605a-c512-4ea7-a41b-209d697bcdaa 2015-03-23 23:51:04 +00:00
sjplimp 84a5ec39ec git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13278 f3b2605a-c512-4ea7-a41b-209d697bcdaa 2015-03-23 23:30:50 +00:00
sjplimp 46fd9013a5 git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13235 f3b2605a-c512-4ea7-a41b-209d697bcdaa 2015-03-17 16:01:48 +00:00