Commit Graph

161 Commits

Author SHA1 Message Date
Richard Berger 17ec3a4fe8
Fix typo 2020-08-28 15:15:01 -04:00
Richard Berger 9412d6f6fc
Add missing argtypes declarations in lammps.py 2020-08-28 15:12:36 -04:00
Richard Berger 6bcc263b41
Ensure LAMMPS pointer is of type c_void_p
Fixes segfaults caused by API change. The API change in
lammps_open and lammps_open_no_mpi makes them return the LAMMPS pointer
via their return value. However due to how ctypes operates, even
if restype is specified to be c_void_p, the function returns an integer.

Without the proper type of the pointer, calling functions without arglists would default
to using 32bit integers to pass an argument, which cuts away parts of the 64bit pointer.
Subsequently, resolving the truncated pointer in the library causes segfaults.

This commit fixes the root cause. But it also highlights the need of specifying
the arglists of all library functions.
2020-08-28 14:21:03 -04:00
Richard Berger caeb0af0d1
Add missing argtypes for lammps_extract_global 2020-08-28 13:54:06 -04:00
Richard Berger 9c84fe8830
Add missing lammps_extract_compute.argtypes 2020-08-27 17:47:49 -04:00
Richard Berger 0b8136a38b
Add extract_compute, extract_fix, and extract_variable to lammps.numpy 2020-08-27 17:47:49 -04:00
Richard Berger 26d09ea648
Use datatype constants instead of magic numbers 2020-08-27 17:47:49 -04:00
Richard Berger 0d8baff7a9
Rename LAMMPS_DBLE2D to LAMMPS_DOUBLE2D 2020-08-27 14:03:17 -04:00
Axel Kohlmeyer 977a89e537
add separators 2020-08-27 12:33:03 -04:00
Axel Kohlmeyer 48d2a48a1f
import updated python module from progguide branch 2020-08-26 09:01:59 -04:00
Axel Kohlmeyer 6f775f6592
fix typo 2020-07-11 13:06:43 -04:00
Axel Kohlmeyer 40e59b27a7
add prototypes for exception handling functions 2020-07-11 13:06:05 -04:00
Richard Berger 758c812306 Allow query of available styles from lib interface
Adds the following new library functions:
- lammps_has_style()
- lammps_style_count()
- lammps_stlye_name()

The Info class now also has the following member functions:

- Info::has_style()
- Info::get_available_styles()
2020-03-26 22:45:18 -04:00
Eisuke Kawashima ca1e1e2dff
Convert British spelling to American 2020-03-18 23:09:23 +09:00
Eisuke Kawashima 649a8cc01a
Fix typo 2020-03-14 13:57:48 +09:00
Axel Kohlmeyer 475b7dc4f4
provide access to number of local data rows for fixes 2020-03-07 10:58:35 -05:00
Axel Kohlmeyer 943540b015
bugfix for extracting length of local data through python interface 2020-03-07 10:19:03 -05:00
Axel Kohlmeyer 33c846cd5e
guard converting thermo output from other output to the screen and do not crash
fixes #1844
2020-01-17 09:48:07 -05:00
Richard Berger 28a9dc40cb Add docstring to new lammps.py methods 2019-11-13 15:53:25 -05:00
Richard Berger 78d5bc3d12 Merge branch 'master' into library_interface_update 2019-11-12 15:17:32 -05:00
Axel Kohlmeyer 9a7caebf57
fix c-syntax in python error. 2019-10-26 05:14:55 -04:00
Axel Kohlmeyer f21b059cd4
fix another bug in extract_compute() method of LAMMPS python module 2019-10-25 16:16:39 -04:00
Aidan Thompson 8f8bcf5f7b Fixes bug in extract_compute() python method 2019-10-24 16:17:32 -06:00
Richard Berger 8bc54c96b0 Add missing default 2019-09-12 14:44:56 -04:00
Richard Berger fb58eb5f23 Add __len__ implementation for NeighList 2019-09-12 14:37:18 -04:00
Richard Berger fec9817086 Add __getitem__ implementation for NeighList 2019-09-12 14:14:06 -04:00
Richard Berger 69854eab42 Expose Neighbor lists via library interface 2019-09-12 13:46:05 -04:00
Richard Berger 3353bffb72 Remove magic numbers and additional data types in extract_global 2019-09-12 13:38:04 -04:00
Richard Berger 5d7ce839a1 Fix memory leak 2019-09-12 13:37:53 -04:00
Richard Berger 2b42428d28 Extend lib interface to set fix external callback
This allows creating a callback in Python and attaching it to
a fix external instance.
2019-08-20 14:04:49 -06:00
Axel Kohlmeyer 77e323d28c
prefix option in install.py not needed 2019-03-26 21:55:07 -04:00
Axel Kohlmeyer 0edb82eb5e
update format 2019-03-25 17:14:58 -04:00
Axel Kohlmeyer b0a741fc58
add support for --prefix to python module installer 2019-03-25 16:51:35 -04:00
Axel Kohlmeyer f69173f410
partial documentation update 2019-03-22 17:25:03 -04:00
Axel Kohlmeyer 0f030acc59
refactoring python module installer script to be (more) platform neutral and compatible with conventional make and CMake builds 2019-03-22 11:59:15 -04:00
Jan Janßen e582c0d4e5
Update lammps.py 2019-02-12 08:20:54 +01:00
Jan Janßen f5e3c53880
Update install.py 2019-02-12 08:08:22 +01:00
Jan Janßen e7c1ca1fca
Revert changes 2019-02-12 08:07:28 +01:00
Jan Janßen 277f8356b1
Update lammps.py 2019-02-09 08:46:22 +01:00
Jan Janßen 0fade44b43
Update install.py 2019-02-09 08:45:03 +01:00
Jan Janßen b9d8b5f501 lib extension for Mac Os X 2019-02-04 09:23:29 +01:00
Jan Janßen 7c2a61ad4c
Define lib_ext 2019-02-02 17:55:09 +01:00
Jan Janßen 562bc4e584
Update install.py 2019-02-02 13:05:26 +01:00
Axel Kohlmeyer 1927659fb1 fix cut-n-paste bug in extract_setting() method 2019-01-24 17:55:37 +01:00
Axel Kohlmeyer 49da946398 fix bug reported in https://github.com/lammps/lammps/issues/1294 2019-01-21 05:52:28 -05:00
Richard Berger 4b0382cadd Fixes issue #1069 2018-08-21 14:45:01 -04:00
Richard Berger d00eaef070 Allow 'set' command to change atom velocities 2018-07-13 23:05:44 -04:00
Axel Kohlmeyer 43ffee980d fix typo in python module 2018-06-29 19:07:14 -04:00
Richard Berger 19f81e0802 Add library functions for accessing LAMMPS configuration 2018-06-25 23:56:18 -04:00
Axel Kohlmeyer 5bf8e1bc5b add ability to retrieve the number of local rows for computes returning local data
this is done supporting the combination of type == 2 with style == 0,
i.e. a local scalar, which is not available in C++ (but there one can
access the compute style data member directly. for the python interface,
the pointer is automatically dereferenced and returned as a c_int.
2018-04-19 18:37:15 -04:00