7. Menus¶
The menu bar has entries File, Edit, Run, View, and About. Instead of using the mouse to click on them, the individual menus can also be activated by hitting the Alt key together with the corresponding underlined letter, that is Alt-F activates the File menu. For the corresponding activated sub-menus, the key corresponding to the underlined letters can be used to select entries instead of using the mouse.
7.1. File¶
The File menu offers the usual options:
New Input File clears the current buffer and resets the file name to
*unknown*Open Input File opens a dialog to select a new file for editing in the Editor
Save Input File saves the current file; if the file name is
*unknown*a dialog will open to select a new file nameSave Input File As opens a dialog to select a new file name (and folder, if desired) and saves the buffer to it. Writing the buffer to a different folder will also switch the current working directory to that folder.
View Text File opens a dialog to select a file for viewing in a separate window (read-only) with support for on-the-fly decompression as explained above. If the selected file appears to be an image or a binary file, a warning is shown instead; use View Image File(s)… for image files.
View Image File(s)… opens a dialog to select one or more image files and shows them together in a standalone snapshot viewer window. This is useful for reviewing images created by an external (e.g. large parallel) simulation, or for revisiting images from an earlier run without rerunning it. Image formats that Qt cannot read natively are converted on demand with ImageMagick if it is available.
Plot Data File… opens a dialog to select a file with column-oriented numeric data and plots it in a standalone Charts window without running a simulation. See the description below for details.
Inspect Restart File opens a dialog to select a file. If that file is a LAMMPS restart three windows with information about the file are opened.
Quit exits LAMMPS-GUI. If there are unsaved changes, a dialog will appear to either cancel the operation, or to save, or to not save the modified buffer.
In addition, up to 5 recent file names will be listed after the Open Input File entry that allows re-opening recently opened files. This list is stored when quitting and recovered when starting again.
Added in version 2.1: The View Image File(s)… and Plot Data File… entries were added. The View Text File entry now warns when given an image or binary file instead of trying to display it as text.
Plotting external data files. The Plot Data File… entry
(Ctrl-Shift-P) opens a dialog to select a file with column-oriented
numeric data and plots it in a standalone Charts window
without running a simulation. Supported formats are whitespace-separated
columns (.dat), comma-separated values (.csv), YAML (including the segmented thermo output that LAMMPS
itself writes), and JSON; the format is
recognized from the file name extension or, failing that, from the
content. After the file is read, a dialog lets you pick which column
provides the x axis and which columns to plot; column names can also be
edited at this point. Because there is no associated simulation, the
Units and Norm controls are hidden in such a standalone chart window.
All the post-processing and export features described for the
Charts window are available here as well.
7.2. Edit¶
The Edit menu offers the usual editor functions like Undo, Redo, Cut, Copy, Paste, and a Find and Replace dialog (keyboard shortcut Ctrl-F). It can also open a Preferences dialog (keyboard shortcut Ctrl-P) and allows deleting all stored preferences and settings, so they are reset to their default values.
7.3. Run¶
The Run menu has options to start and stop a LAMMPS process. Rather than calling the LAMMPS executable as a separate executable, the LAMMPS-GUI is linked to the LAMMPS library and thus can run LAMMPS internally through the LAMMPS C-library interface in a separate thread.
Specifically, a LAMMPS instance will be created by calling
lammps_open_no_mpi
(through the LammpsWrapper C++ adapter). The buffer contents are
then executed by calling lammps_commands_string.
Certain commands and features are only available after a LAMMPS instance
is created. Its presence is indicated by a small LAMMPS L logo in
the status bar at the bottom left of the main window. As an
alternative, it is also possible to run LAMMPS using the contents of the
edited file by reading the file. This is mainly provided as a fallback
option in case the input uses some feature that is not available when
running from a string buffer.
The LAMMPS calculations are run in a concurrent thread so that the GUI can stay responsive and be updated during the run. The GUI can retrieve data from the running LAMMPS instance and tell it to stop at the next timestep. The Stop LAMMPS entry will do this by calling the lammps_force_timeout library function, which is equivalent to a timer timeout 0 command.
The Relaunch LAMMPS Instance will destroy the current LAMMPS thread and free its data and then create a new thread with a new LAMMPS instance. This is usually not needed, since LAMMPS-GUI tries to detect when this is needed and does it automatically. This is available in case it missed something and LAMMPS behaves in unexpected ways.
The Set Variables… entry opens a dialog box where index style variables can be set. Those variables are passed to the LAMMPS instance when it is created and are thus set before a run is started.
The Set Variables dialog will be pre-populated with entries that are set as index variables in the input and any variables that are used but not defined, if the built-in parser can detect them. New rows for additional variables can be added through the Add Row button and existing rows can be deleted by clicking on the X icons on the right.
The Create Image entry will send a dump image command to the LAMMPS instance, read the resulting file, and show it in an Image Viewer window.
The View in OVITO entry will launch OVITO with a data file containing the current state of the system. This option is only available if LAMMPS-GUI can find the OVITO executable in the system path.
The View in VMD entry will launch VMD with a data file containing the current state of the system. This option is only available if LAMMPS-GUI can find the VMD executable in the system path.
7.4. View¶
The View menu offers to show or hide additional windows with log output, charts, slide show, variables, or snapshot images. The default settings for their visibility can be changed in the Preferences dialog.
7.5. Tutorials¶
The Tutorials menu supports several collections of LAMMPS tutorials for beginners and intermediate LAMMPS users. The menu has one submenu per collection, for example Soft Matter (the molecular tutorials documented in Gravelle1), Materials Science, and Granular / DEM. Each submenu lists its individual tutorial sessions; selecting one begins that session.
Collections are released incrementally. A collection that is not yet fully published is labeled in the menu with its status, e.g. (coming soon) or (planned). Within such a collection only the tutorials that are already available can be launched; the remaining entries are shown (so you can preview what is coming) but are disabled. A collection with no tutorials available yet appears as a single disabled submenu.
Selecting an available tutorial opens a ‘wizard’ dialog where you can
choose in which folder you want to work, whether you want that folder to
be wiped from any files, whether you want to download the solution
files (which can be large) to a solution sub-folder, and whether you
want the corresponding tutorial’s online version opened in your web
browser. The dialog will then start downloading the files requested
(download progress is reported in the status line) and load the first
input file for the selected session into LAMMPS-GUI.
7.6. About¶
The About menu finally offers a couple of dialog windows and an option to launch the LAMMPS online documentation in a web browser. The About LAMMPS-GUI entry displays a dialog with a summary of the configuration settings of the LAMMPS library in use and the version number of LAMMPS-GUI itself. The Quick Help displays a dialog with a minimal description of LAMMPS-GUI. The LAMMPS-GUI Documentation entry will open the LAMMPS-GUI online documentation website https://lammps-gui.lammps.org in a web browser window. The LAMMPS Manual entry will open the main page of the LAMMPS online documentation in a web browser window. The LAMMPS Tutorial entry will open the main page of the set of LAMMPS tutorials authored and maintained by Simon Gravelle at https://lammpstutorials.github.io/ in a web browser window.
(Gravelle1) Gravelle, Alvares, Gissinger, Kohlmeyer, Living Journal of Computational Molecular Science, 6(1), 3027. https://doi.org/10.33011/livecoms.6.1.3037 (2025)