implemented create_atoms and encode_image_flags and unit tests for them; added IMGMASK and friends to extract_setting and unit tests for them; wrote documentation for them

This commit is contained in:
Karl Hammond
2022-10-19 18:40:12 -05:00
parent 9a732ba513
commit b51c50294e
7 changed files with 578 additions and 53 deletions

View File

@ -953,6 +953,7 @@ not recognized, the function returns -1. The integer sizes functions may
be called without a valid LAMMPS object handle (it is ignored).
* :ref:`Integer sizes <extract_integer_sizes>`
* :ref:`Image masks <extract_image_masks>`
* :ref:`System status <extract_system_status>`
* :ref:`System sizes <extract_system_sizes>`
* :ref:`Atom style flags <extract_atom_flags>`
@ -977,6 +978,28 @@ be called without a valid LAMMPS object handle (it is ignored).
- size of the ``imageint`` integer type, 4 or 8 bytes.
Set at :ref:`compile time <size>`.
.. _extract_image_masks:
**Image masks**
These settings are related to how LAMMPS stores and interprets periodic images. The values are used
internally by the Fortran interface and are not likely to be useful to users.
.. list-table::
:header-rows: 1
:widths: auto
* - Keyword
- Description / Return value
* - IMGMASK
- Bit-mask used to convert image flags to a single integer
* - IMGMAX
- Maximum allowed image number for a particular atom
* - IMGBITS
- Bits used in image counts
* - IMG2BITS
- Second bitmask used in image counts
.. _extract_system_status:
**System status**
@ -1096,6 +1119,11 @@ int lammps_extract_setting(void *handle, const char *keyword)
if (strcmp(keyword,"tagint") == 0) return sizeof(tagint);
if (strcmp(keyword,"imageint") == 0) return sizeof(imageint);
if (strcmp(keyword,"IMGMASK") == 0) return IMGMASK;
if (strcmp(keyword,"IMGBITS") == 0) return IMGBITS;
if (strcmp(keyword,"IMG2BITS") == 0) return IMG2BITS;
if (strcmp(keyword,"IMGMAX") == 0) return IMGMAX;
if (strcmp(keyword,"dimension") == 0) return lmp->domain->dimension;
if (strcmp(keyword,"box_exist") == 0) return lmp->domain->box_exist;
if (strcmp(keyword,"newton_bond") == 0) return lmp->force->newton_bond;