more edits to C library chapter

This commit is contained in:
Steve Plimpton
2020-10-01 10:50:33 -06:00
parent 9efcaf2d61
commit 343b24dd5e
6 changed files with 43 additions and 35 deletions

View File

@ -2,11 +2,11 @@ Adding code to the Library interface
==================================== ====================================
The functionality of the LAMMPS library interface has historically The functionality of the LAMMPS library interface has historically
always been motivated by the needs of its users and functions were been motivated by the needs of its users. Functions have been added
added or expanded as they were needed and used. Contributions to or expanded as they were needed and used. Contributions to the
the interface are always welcome. However with a refactoring of interface are always welcome. However with a refactoring of the
the library interface and its documentation that started in 2020, library interface and its documentation that started in 2020, there
there are now a few requirements for inclusion of changes. are now a few requirements for including new changes or extensions.
- New functions should be orthogonal to existing ones and not - New functions should be orthogonal to existing ones and not
implement functionality that can already be achieved with the implement functionality that can already be achieved with the
@ -17,17 +17,18 @@ there are now a few requirements for inclusion of changes.
``doc/src`` folder. ``doc/src`` folder.
- If possible, new unit tests to test those new features should - If possible, new unit tests to test those new features should
be added. be added.
- The new feature should also be implemented and documented for - The new feature should also be implemented and documented not
the Python and Fortran modules. just for the C interface, but also the Python and Fortran interfaces.
- All additions should work and be compatible with ``-DLAMMPS_BIGBIG``, - All additions should work and be compatible with ``-DLAMMPS_BIGBIG``,
``-DLAMMPS_SMALLBIG``, ``-DLAMMPS_SMALLSMALL`` and compiling ``-DLAMMPS_SMALLBIG``, ``-DLAMMPS_SMALLSMALL`` and when compiling
with and without MPI support. with and without MPI support.
- The ``library.h`` file should be kept compatible to C code at - The ``library.h`` file should be kept compatible to C code at
a level similar to C89. Its interfaces may not reference any a level similar to C89. Its interfaces may not reference any
custom data types (e.g. ``bigint``, ``tagint``, and so on) only custom data types (e.g. ``bigint``, ``tagint``, and so on) that
known inside of LAMMPS. are only known inside of LAMMPS.
- only C style comments, not C++ style - only use C style comments, not C++ style
Please note that these are *not* *strict* requirements, but the LAMMPS
developers appreciate if they are followed and can assist with
implementing what is missing.
Please note, that these are *not* *strict* requirements, but the
LAMMPS developers appreciate if they are followed closely and will
assist with implementing what is missing.

View File

@ -18,18 +18,18 @@ This section documents the following functions:
-------------------- --------------------
The following library functions can be used to query the LAMMPS library These library functions can be used to query the LAMMPS library for
about compile time settings and included packages and styles. This compile time settings and included packages and styles. This enables
enables programs that use the library interface to run LAMMPS programs that use the library interface to determine whether the
simulations to determine, whether the linked LAMMPS library is compatible linked LAMMPS library is compatible with the requirements of the
with the requirements of the application without crashing during the application without crashing during the LAMMPS functions (e.g. due to
LAMMPS functions (e.g. due to missing pair styles from packages) or to missing pair styles from packages) or to choose between different
choose between different options (e.g. whether to use ``lj/cut``, options (e.g. whether to use ``lj/cut``, ``lj/cut/opt``,
``lj/cut/opt``, ``lj/cut/omp`` or ``lj/cut/intel``). Most of the ``lj/cut/omp`` or ``lj/cut/intel``). Most of the functions can be
functions can be called directly without first creating a LAMMPS called directly without first creating a LAMMPS instance. While
instance. While crashes within LAMMPS may be recovered from through crashes within LAMMPS may be recovered from by enabling
enabling :ref:`exceptions <exceptions>`, avoiding them proactively is :ref:`exceptions <exceptions>`, avoiding them proactively is a safer
a safer approach. approach.
.. code-block:: C .. code-block:: C
:caption: Example for using configuration settings functions :caption: Example for using configuration settings functions

View File

@ -1,8 +1,8 @@
Accessing LAMMPS Neighbor lists Accessing LAMMPS Neighbor lists
=============================== ===============================
The following functions allow to access neighbor lists The following functions enable access to neighbor lists generated by
generated by LAMMPS or query their properties: LAMMPS or querying of their properties:
- :cpp:func:`lammps_find_compute_neighlist` - :cpp:func:`lammps_find_compute_neighlist`
- :cpp:func:`lammps_find_fix_neighlist` - :cpp:func:`lammps_find_fix_neighlist`

View File

@ -1,8 +1,8 @@
Retrieving or setting properties of LAMMPS objects Retrieving or setting properties of LAMMPS objects
================================================== ==================================================
This section documents accessing or modifying data from objects like This section documents accessing or modifying data stored by computes,
computes, fixes, or variables in LAMMPS using following functions: fixes, or variables in LAMMPS using the following functions:
- :cpp:func:`lammps_extract_compute` - :cpp:func:`lammps_extract_compute`
- :cpp:func:`lammps_extract_fix` - :cpp:func:`lammps_extract_fix`

View File

@ -1,7 +1,16 @@
Library functions for scatter/gather operations Library functions for scatter/gather operations
================================================ ================================================
This section documents the following functions: This section has functions which gather per-atom data from one or more
processors into a contiguous global list ordered by atom ID. The same
list is returned to all calling processors. It also contains
functions which scatter per-atom data from a contiguous global list
across the processors that own those atom IDs. It also has a
create_atoms() function which can create a new simulation by
scattering atms appropriately to owning processors in the LAMMPS
spatial decomposition.
It documents the following functions:
- :cpp:func:`lammps_gather_atoms` - :cpp:func:`lammps_gather_atoms`
- :cpp:func:`lammps_gather_atoms_concat` - :cpp:func:`lammps_gather_atoms_concat`
@ -14,8 +23,6 @@ This section documents the following functions:
- :cpp:func:`lammps_scatter` - :cpp:func:`lammps_scatter`
- :cpp:func:`lammps_scatter_subset` - :cpp:func:`lammps_scatter_subset`
.. TODO add description
----------------------- -----------------------
.. doxygenfunction:: lammps_gather_atoms .. doxygenfunction:: lammps_gather_atoms

View File

@ -1,8 +1,8 @@
Library interface utility functions Library interface utility functions
=================================== ===================================
To simplify some of the tasks, the library interface contains To simplify some tasks, the library interface contains these utility
some utility functions that are not directly calling LAMMPS: functions. They do not directly call the LAMMPS library.
- :cpp:func:`lammps_encode_image_flags` - :cpp:func:`lammps_encode_image_flags`
- :cpp:func:`lammps_decode_image_flags` - :cpp:func:`lammps_decode_image_flags`