Merge branch 'master' into progguide-axel

This commit is contained in:
Axel Kohlmeyer
2020-10-06 17:11:47 -04:00
31 changed files with 1252 additions and 67 deletions

View File

@ -542,7 +542,8 @@ using CMake or Make.
.. code-block:: bash
-D BUILD_TOOLS=value # yes or no (default)
-D BUILD_TOOLS=value # yes or no (default)
-D BUILD_LAMMPS_SHELL=value # yes or no (default)
The generated binaries will also become part of the LAMMPS installation
(see below).
@ -558,6 +559,9 @@ using CMake or Make.
make micelle2d # build only micelle2d tool
make thermo_extract # build only thermo_extract tool
cd lammps/tools/lammps-shell
make # build LAMMPS shell
----------
.. _install:

View File

@ -328,6 +328,8 @@ Some common LAMMPS specific variables
- build LAMMPS with OpenMP support (default: ``on`` if compiler supports OpenMP fully, else ``off``)
* - ``BUILD_TOOLS``
- compile some additional executables from the ``tools`` folder (default: ``off``)
* - ``BUILD_LAMMPS_SHELL``
- compile the LAMMPS shell from the ``tools/lammps-shell`` folder (default: ``off``)
* - ``BUILD_DOC``
- include building the HTML format documentation for packaging/installing (default: ``off``)
* - ``CMAKE_TUNE_FLAGS``

View File

@ -15,6 +15,9 @@ This section documents the following functions:
- :cpp:func:`lammps_has_style`
- :cpp:func:`lammps_style_count`
- :cpp:func:`lammps_style_name`
- :cpp:func:`lammps_has_id`
- :cpp:func:`lammps_id_count`
- :cpp:func:`lammps_id_name`
--------------------
@ -124,3 +127,18 @@ approach.
.. doxygenfunction:: lammps_style_name
:project: progguide
-----------------------
.. doxygenfunction:: lammps_has_id
:project: progguide
-----------------------
.. doxygenfunction:: lammps_id_count
:project: progguide
-----------------------
.. doxygenfunction:: lammps_id_name
:project: progguide

View File

@ -9,6 +9,8 @@ functions. They do not directly call the LAMMPS library.
- :cpp:func:`lammps_set_fix_external_callback`
- :cpp:func:`lammps_fix_external_set_energy_global`
- :cpp:func:`lammps_fix_external_set_virial_global`
- :cpp:func:`lammps_is_running`
- :cpp:func:`lammps_force_timeout`
- :cpp:func:`lammps_has_error`
- :cpp:func:`lammps_get_last_error_message`
@ -39,6 +41,16 @@ functions. They do not directly call the LAMMPS library.
-----------------------
.. doxygenfunction:: lammps_is_running
:project: progguide
-----------------------
.. doxygenfunction:: lammps_force_timeout
:project: progguide
-----------------------
.. doxygenfunction:: lammps_has_error
:project: progguide

View File

@ -92,6 +92,7 @@ Miscellaneous tools
* :ref:`emacs <emacs>`
* :ref:`i-pi <ipi>`
* :ref:`kate <kate>`
* :ref:`LAMMPS shell <lammps_shell>`
* :ref:`singularity <singularity_tool>`
* :ref:`vim <vim>`
@ -397,10 +398,131 @@ The file was provided by Alessandro Luigi Sellerio
----------
.. _lammps_shell:
LAMMPS shell
------------
Overview
========
The LAMMPS Shell, ``lammps-shell`` is a program that functions very
similar to the regular LAMMPS executable but has several modifications
and additions that make it more powerful for interactive sessions,
i.e. where you type LAMMPS commands from the prompt instead of reading
them from a file.
- It uses the readline and history libraries to provide command line
editing and context aware TAB-expansion (details on that below).
- When processing an input file with the '-in' or '-i' flag from the
command line, it does not exit at the end of that input file but
stops at a prompt, so that additional commands can be issued
- Errors will not abort the shell but return to the prompt.
- It has additional commands aimed at interactive use (details below).
- Interrupting a calculation with CTRL-C will not terminate the
session but rather enforce a timeout to cleanly stop an ongoing
run (more info on timeouts is in the timer command documentation).
These enhancements makes the LAMMPS shell an attractive choice for
interactive LAMMPS sessions in graphical user interfaces.
TAB-expansion
=============
When writing commands interactively at the shell prompt, you can hit
the TAB key at any time to try and complete the text. This completion
is context aware and will expand any first word only to commands
available in that executable.
- For style commands it will expand to available styles of the
corresponding category (e.g. pair styles after a
:doc:`pair_style <pair_style>` command).
- For :doc:`compute <compute>`, :doc:`fix <fix>`, or :doc:`dump <dump>`
it will also expand only to already defined groups for the group-ID
keyword.
- For commands like :doc:`compute_modify <compute_modify>`,
:doc:`fix_modify <fix_modify>`, or :doc:`dump_modify <dump_modify>`
it will expand to known compute/fix/dump IDs only.
- When typing references to computes, fixes, or variables with a
"c\_", "f\_", or "v\_" prefix, respectively, then the expansion will
to known compute/fix IDs and variable names. Variable name expansion
is also available for the ${name} variable syntax.
- In all other cases, expansion will be performed on filenames.
Command line editing and history
================================
When typing commands, command line editing similar to what BASH
provides is available. Thus it is possible to move around the
currently line and perform various cut and insert and edit operations.
Previous commands can be retrieved by scrolling up (and down)
or searching (e.g. with CTRL-r).
Also history expansion through using the exclamation mark '!'
can be performed. Examples: '!!' will be replaced with the previous
command, '!-2' will repeat the command before that, '!30' will be
replaced with event number 30 in the command history list, and
'!run' with the last command line that started with "run". Adding
a ":p" to such a history expansion will result that the expansion is
printed and added to the history list, but NOT executed.
On exit the LAMMPS shell will write the history list to a file
".lammps_history" in the current working directory. If such a
file exists when the LAMMPS shell is launched it will be read to
populate the history list.
This is realized via the readline library and can thus be customized
with an ``.inputrc`` file in the home directory. For application
specific customization, the LAMMPS shell uses the name "lammps-shell".
For more information about using and customizing an application using
readline, please see the available documentation at:
`http://www.gnu.org/s/readline/#Documentation
<http://www.gnu.org/s/readline/#Documentation>`_
Additional commands
===================
The following commands are added to the LAMMPS shell on top of the
regular LAMMPS commands:
.. parsed-literal::
help (or ?) print a brief help message
history display the current command history list
clear_history wipe out the current command history list
\|<command> execute <command> as a shell command and return to the command prompt
exit exit the LAMMPS shell cleanly (unlike the "quit" command)
Compilation
===========
Compilation of the LAMMPS shell can be enabled by setting the CMake
variable ``BUILD_LAMMPS_SHELL`` to "on" or using the makefile in the
``tools/lammps-shell`` folder to compile after building LAMMPS using
the conventional make procedure. The makefile will likely need
customization depending on the features and settings used for
compiling LAMMPS.
Limitations
===========
The LAMMPS shell was not designed for use with MPI parallelization
via ``mpirun`` or ``mpiexec`` or ``srun``.
----------
.. _arc:
lmp2arc tool
----------------------
------------
The lmp2arc sub-directory contains a tool for converting LAMMPS output
files to the format for Accelrys' Insight MD code (formerly

View File

@ -205,11 +205,11 @@ the following table:
+-------+----------------------------------------------------+----------------+
| 4 | Force :math:`f_z` exerted on the wall | force units |
+-------+----------------------------------------------------+----------------+
| 5 | :math:`\Delta x` between wall surface and particle | distance units |
| 5 | :math:`x`-coordinate of contact point on wall | distance units |
+-------+----------------------------------------------------+----------------+
| 6 | :math:`\Delta y` between wall surface and particle | distance units |
| 6 | :math:`y`-coordinate of contact point on wall | distance units |
+-------+----------------------------------------------------+----------------+
| 7 | :math:`\Delta z` between wall surface and particle | distance units |
| 7 | :math:`z`-coordinate of contact point on wall | distance units |
+-------+----------------------------------------------------+----------------+
| 8 | Radius :math:`r` of atom | distance units |
+-------+----------------------------------------------------+----------------+

View File

@ -246,11 +246,11 @@ the following table:
+-------+----------------------------------------------------+----------------+
| 4 | Force :math:`f_z` exerted on the wall | force units |
+-------+----------------------------------------------------+----------------+
| 5 | :math:`\Delta x` between wall surface and particle | distance units |
| 5 | :math:`x`-coordinate of contact point on wall | distance units |
+-------+----------------------------------------------------+----------------+
| 6 | :math:`\Delta y` between wall surface and particle | distance units |
| 6 | :math:`y`-coordinate of contact point on wall | distance units |
+-------+----------------------------------------------------+----------------+
| 7 | :math:`\Delta z` between wall surface and particle | distance units |
| 7 | :math:`z`-coordinate of contact point on wall | distance units |
+-------+----------------------------------------------------+----------------+
| 8 | Radius :math:`r` of atom | distance units |
+-------+----------------------------------------------------+----------------+