Merge branch 'develop' into next_release
@ -12,6 +12,11 @@ endif()
|
|||||||
if(POLICY CMP0075)
|
if(POLICY CMP0075)
|
||||||
cmake_policy(SET CMP0075 NEW)
|
cmake_policy(SET CMP0075 NEW)
|
||||||
endif()
|
endif()
|
||||||
|
# set policy to silence warnings about requiring execute permission for find_program
|
||||||
|
# we use OLD because the python-config script for the Fedora MinGW cross-compiler requires it currently
|
||||||
|
if(POLICY CMP0109)
|
||||||
|
cmake_policy(SET CMP0109 OLD)
|
||||||
|
endif()
|
||||||
# set policy to silence warnings about timestamps of downloaded files. review occasionally if it may be set to NEW
|
# set policy to silence warnings about timestamps of downloaded files. review occasionally if it may be set to NEW
|
||||||
if(POLICY CMP0135)
|
if(POLICY CMP0135)
|
||||||
cmake_policy(SET CMP0135 OLD)
|
cmake_policy(SET CMP0135 OLD)
|
||||||
|
|||||||
@ -1,5 +1,11 @@
|
|||||||
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2023.11.25.fix.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
# PACE library support for ML-PACE package
|
||||||
|
|
||||||
|
# set policy to silence warnings about timestamps of downloaded files. review occasionally if it may be set to NEW
|
||||||
|
if(POLICY CMP0135)
|
||||||
|
cmake_policy(SET CMP0135 OLD)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(PACELIB_URL "https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2023.11.25.fix.tar.gz" CACHE STRING "URL for PACE evaluator library sources")
|
||||||
set(PACELIB_MD5 "b45de9a633f42ed65422567e3ce56f9f" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
set(PACELIB_MD5 "b45de9a633f42ed65422567e3ce56f9f" CACHE STRING "MD5 checksum of PACE evaluator library tarball")
|
||||||
mark_as_advanced(PACELIB_URL)
|
mark_as_advanced(PACELIB_URL)
|
||||||
mark_as_advanced(PACELIB_MD5)
|
mark_as_advanced(PACELIB_MD5)
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
# Plumed2 support for PLUMED package
|
# Plumed2 support for PLUMED package
|
||||||
|
|
||||||
|
# set policy to silence warnings about timestamps of downloaded files. review occasionally if it may be set to NEW
|
||||||
|
if(POLICY CMP0135)
|
||||||
|
cmake_policy(SET CMP0135 OLD)
|
||||||
|
endif()
|
||||||
|
|
||||||
# for supporting multiple concurrent plumed2 installations for debugging and testing
|
# for supporting multiple concurrent plumed2 installations for debugging and testing
|
||||||
set(PLUMED_SUFFIX "" CACHE STRING "Suffix for Plumed2 library")
|
set(PLUMED_SUFFIX "" CACHE STRING "Suffix for Plumed2 library")
|
||||||
mark_as_advanced(PLUMED_SUFFIX)
|
mark_as_advanced(PLUMED_SUFFIX)
|
||||||
@ -81,6 +86,9 @@ if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND (CMAKE_CROSSCOMPILING))
|
|||||||
DEPENDS plumed_build
|
DEPENDS plumed_build
|
||||||
COMMENT "Copying Plumed files"
|
COMMENT "Copying Plumed files"
|
||||||
)
|
)
|
||||||
|
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
|
||||||
|
target_link_libraries(lammps INTERFACE LAMMPS::PLUMED)
|
||||||
|
endif()
|
||||||
|
|
||||||
else()
|
else()
|
||||||
|
|
||||||
@ -155,6 +163,9 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include)
|
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${INSTALL_DIR}/include)
|
||||||
file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
|
file(MAKE_DIRECTORY ${INSTALL_DIR}/include)
|
||||||
|
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
|
||||||
|
target_link_libraries(lammps PRIVATE LAMMPS::PLUMED)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
find_package(PkgConfig REQUIRED)
|
find_package(PkgConfig REQUIRED)
|
||||||
pkg_check_modules(PLUMED REQUIRED plumed${PLUMED_SUFFIX})
|
pkg_check_modules(PLUMED REQUIRED plumed${PLUMED_SUFFIX})
|
||||||
@ -169,7 +180,9 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_LINK_LIBRARIES "${PLUMED_LOAD}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_LINK_LIBRARIES "${PLUMED_LOAD}")
|
||||||
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${PLUMED_INCLUDE_DIRS}")
|
set_target_properties(LAMMPS::PLUMED PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${PLUMED_INCLUDE_DIRS}")
|
||||||
|
if(CMAKE_PROJECT_NAME STREQUAL "lammps")
|
||||||
|
target_link_libraries(lammps PUBLIC LAMMPS::PLUMED)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(lammps PRIVATE LAMMPS::PLUMED)
|
|
||||||
|
|||||||
BIN
cmake/packaging/LAMMPS_DMG_Background.xcf
Normal file
@ -1517,6 +1517,11 @@ in lib/pace or somewhere else, which must be done before building
|
|||||||
LAMMPS with this package. The code for the library can be found
|
LAMMPS with this package. The code for the library can be found
|
||||||
at: `https://github.com/ICAMS/lammps-user-pace/ <https://github.com/ICAMS/lammps-user-pace/>`_
|
at: `https://github.com/ICAMS/lammps-user-pace/ <https://github.com/ICAMS/lammps-user-pace/>`_
|
||||||
|
|
||||||
|
Instead of including the ML-PACE package directly into LAMMPS, it
|
||||||
|
is also possible to skip this step and build the ML-PACE package as
|
||||||
|
a plugin using the CMake script files in the ``examples/PACKAGE/pace/plugin``
|
||||||
|
folder and then load this plugin at runtime with the :doc:`plugin command <plugin>`.
|
||||||
|
|
||||||
.. tabs::
|
.. tabs::
|
||||||
|
|
||||||
.. tab:: CMake build
|
.. tab:: CMake build
|
||||||
@ -1701,6 +1706,11 @@ try a different one, switch to a different build system, consider a
|
|||||||
global PLUMED installation or consider downloading PLUMED during the
|
global PLUMED installation or consider downloading PLUMED during the
|
||||||
LAMMPS build.
|
LAMMPS build.
|
||||||
|
|
||||||
|
Instead of including the PLUMED package directly into LAMMPS, it
|
||||||
|
is also possible to skip this step and build the PLUMED package as
|
||||||
|
a plugin using the CMake script files in the ``examples/PACKAGE/plumed/plugin``
|
||||||
|
folder and then load this plugin at runtime with the :doc:`plugin command <plugin>`.
|
||||||
|
|
||||||
.. tabs::
|
.. tabs::
|
||||||
|
|
||||||
.. tab:: CMake build
|
.. tab:: CMake build
|
||||||
|
|||||||
@ -283,7 +283,7 @@ in the ``examples/kim/plugin`` folder. No changes to the sources of the
|
|||||||
KIM package themselves are needed; only the plugin interface and loader
|
KIM package themselves are needed; only the plugin interface and loader
|
||||||
code needs to be added. This example only supports building with CMake,
|
code needs to be added. This example only supports building with CMake,
|
||||||
but is probably a more typical example. To compile you need to run CMake
|
but is probably a more typical example. To compile you need to run CMake
|
||||||
with -DLAMMPS_SOURCE_DIR=<path/to/lammps/src/folder>. Other
|
with ``-DLAMMPS_SOURCE_DIR=<path/to/lammps/src/folder>``. Other
|
||||||
configuration setting are identical to those for compiling LAMMPS.
|
configuration setting are identical to those for compiling LAMMPS.
|
||||||
|
|
||||||
A second example for a plugin from a package is in the
|
A second example for a plugin from a package is in the
|
||||||
|
|||||||
@ -19,9 +19,9 @@ to the online LAMMPS documentation for known LAMMPS commands and styles.
|
|||||||
Pre-compiled, ready-to-use LAMMPS-GUI executables for Linux x86\_64
|
Pre-compiled, ready-to-use LAMMPS-GUI executables for Linux x86\_64
|
||||||
(Ubuntu 20.04LTS or later and compatible), macOS (version 11 aka Big
|
(Ubuntu 20.04LTS or later and compatible), macOS (version 11 aka Big
|
||||||
Sur or later), and Windows (version 10 or later) :ref:`are available
|
Sur or later), and Windows (version 10 or later) :ref:`are available
|
||||||
<lammps_gui_install>` for download. None-MPI LAMMPS executables for
|
<lammps_gui_install>` for download. Non-MPI LAMMPS executables (as
|
||||||
running LAMMPS from the command line and :doc:`some LAMMPS tools <Tools>`
|
``lmp``) for running LAMMPS from the command line and :doc:`some
|
||||||
are also included.
|
LAMMPS tools <Tools>` compiled executables are also included.
|
||||||
|
|
||||||
The source code for LAMMPS-GUI is included in the LAMMPS source code
|
The source code for LAMMPS-GUI is included in the LAMMPS source code
|
||||||
distribution and can be found in the ``tools/lammps-gui`` folder. It
|
distribution and can be found in the ``tools/lammps-gui`` folder. It
|
||||||
@ -29,40 +29,50 @@ to the online LAMMPS documentation for known LAMMPS commands and styles.
|
|||||||
<Build_cmake>`.
|
<Build_cmake>`.
|
||||||
|
|
||||||
LAMMPS-GUI tries to provide an experience similar to what people
|
LAMMPS-GUI tries to provide an experience similar to what people
|
||||||
traditionally would have running LAMMPS using a command line window
|
traditionally would have running LAMMPS using a command line window and
|
||||||
and the console LAMMPS executable but just rolled into a single executable:
|
the console LAMMPS executable but just rolled into a single executable:
|
||||||
|
|
||||||
- writing & editing LAMMPS input files with a text editor
|
- writing & editing LAMMPS input files with a text editor
|
||||||
- run LAMMPS on those input file with selected command line flags
|
- run LAMMPS on those input file with selected command line flags
|
||||||
- use or extract data from the created files and visualize it with
|
- extract data from the created files and visualize it with and
|
||||||
either a molecular visualization program or a plotting program
|
external software
|
||||||
|
|
||||||
That procedure is quite effective for people proficient in using the
|
That procedure is quite effective for people proficient in using the
|
||||||
command line, as that allows them to use tools for the individual steps
|
command line, as that allows them to use tools for the individual steps
|
||||||
that they are most comfortable with. It is often *required* to adopt
|
that they are most comfortable with. In fact, it is often *required* to
|
||||||
this workflow when running LAMMPS simulations on high-performance
|
adopt this workflow when running LAMMPS simulations on high-performance
|
||||||
computing facilities.
|
computing facilities.
|
||||||
|
|
||||||
The main benefit of using LAMMPS-GUI is that many basic tasks can be
|
The main benefit of using LAMMPS-GUI is that many basic tasks can be
|
||||||
done directly from the GUI without switching to a text console window or
|
done directly from the GUI **without** switching to a text console
|
||||||
using external programs, let alone writing scripts to extract data from
|
window or using external programs, let alone writing scripts to extract
|
||||||
the generated output. It also integrates well with graphical desktop
|
data from the generated output. It also integrates well with graphical
|
||||||
environments where the `.lmp` filename extension can be registered with
|
desktop environments where the `.lmp` filename extension can be
|
||||||
LAMMPS-GUI as the executable to launch when double clicking on such
|
registered with LAMMPS-GUI as the executable to launch when double
|
||||||
files. Also, LAMMPS-GUI has support for drag-n-drop, i.e. an input
|
clicking on such files. Also, LAMMPS-GUI has support for drag-n-drop,
|
||||||
file can be selected and then moved and dropped on the LAMMPS-GUI
|
i.e. an input file can be selected and then moved and dropped on the
|
||||||
executable, and LAMMPS-GUI will launch and read the file into its
|
LAMMPS-GUI executable, and LAMMPS-GUI will launch and read the file into
|
||||||
buffer.
|
its buffer. In many cases LAMMPS-GUI will be integrated into the
|
||||||
|
graphical desktop environment and can be launched like other
|
||||||
|
applications.
|
||||||
|
|
||||||
LAMMPS-GUI thus makes it easier for beginners to get started running
|
LAMMPS-GUI thus makes it easier for beginners to get started running
|
||||||
simple LAMMPS simulations. It is very suitable for tutorials on LAMMPS
|
simple LAMMPS simulations. It is very suitable for tutorials on LAMMPS
|
||||||
since you only need to learn how to use a single program for most tasks
|
since you only need to learn how to use a single program for most tasks
|
||||||
and thus time can be saved and people can focus on learning LAMMPS.
|
and thus time can be saved and people can focus on learning LAMMPS.
|
||||||
The tutorials at https://lammpstutorials.github.io/ were specifically
|
The tutorials at https://lammpstutorials.github.io/ are specifically
|
||||||
updated for use with LAMMPS-GUI.
|
updated for use with LAMMPS-GUI.
|
||||||
|
|
||||||
Another design goal is to keep the barrier low when replacing part of
|
Another design goal is to keep the barrier low when replacing part of
|
||||||
the functionality of LAMMPS-GUI with external tools.
|
the functionality of LAMMPS-GUI with external tools. That said, LAMMPS-GUI
|
||||||
|
has some unique functionality that is not found elsewhere:
|
||||||
|
|
||||||
|
- auto-adapting to features available in the integrated LAMMPS library
|
||||||
|
- interactive visualization using the :doc:`dump image <dump_image>`
|
||||||
|
command with the option to copy-paste the resulting settings
|
||||||
|
- automatic slide show generation from dump image out at runtime
|
||||||
|
- automatic plotting of thermodynamics data at runtime
|
||||||
|
- inspection of binary restart files
|
||||||
|
|
||||||
The following text provides a detailed tour of the features and
|
The following text provides a detailed tour of the features and
|
||||||
functionality of LAMMPS-GUI. Suggestions for new features and
|
functionality of LAMMPS-GUI. Suggestions for new features and
|
||||||
@ -134,9 +144,13 @@ When LAMMPS-GUI starts, it shows the main window, labeled *Editor*, with
|
|||||||
either an empty buffer or the contents of the file used as argument. In
|
either an empty buffer or the contents of the file used as argument. In
|
||||||
the latter case it may look like the following:
|
the latter case it may look like the following:
|
||||||
|
|
||||||
.. image:: JPG/lammps-gui-main.png
|
.. |gui-main1| image:: JPG/lammps-gui-main.png
|
||||||
:align: center
|
:width: 48%
|
||||||
:scale: 50%
|
|
||||||
|
.. |gui-main2| image:: JPG/lammps-gui-dark.png
|
||||||
|
:width: 48%
|
||||||
|
|
||||||
|
|gui-main1| |gui-main2|
|
||||||
|
|
||||||
There is the typical menu bar at the top, then the main editor buffer,
|
There is the typical menu bar at the top, then the main editor buffer,
|
||||||
and a status bar at the bottom. The input file contents are shown
|
and a status bar at the bottom. The input file contents are shown
|
||||||
@ -276,8 +290,6 @@ right mouse button into the *Output* window text area.
|
|||||||
:align: center
|
:align: center
|
||||||
:scale: 50%
|
:scale: 50%
|
||||||
|
|
||||||
.. versionadded:: 1.6
|
|
||||||
|
|
||||||
Should the *Output* window contain embedded YAML format text (see above for a
|
Should the *Output* window contain embedded YAML format text (see above for a
|
||||||
demonstration), for example from using :doc:`thermo_style yaml
|
demonstration), for example from using :doc:`thermo_style yaml
|
||||||
<thermo_style>` or :doc:`thermo_modify line yaml <thermo_modify>`, the
|
<thermo_style>` or :doc:`thermo_modify line yaml <thermo_modify>`, the
|
||||||
@ -289,10 +301,6 @@ text area.
|
|||||||
Charts Window
|
Charts Window
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
.. versionadded:: 1.6
|
|
||||||
|
|
||||||
Plot smoothing support
|
|
||||||
|
|
||||||
By default, when starting a run, a *Charts* window opens that displays a
|
By default, when starting a run, a *Charts* window opens that displays a
|
||||||
plot of thermodynamic output of the LAMMPS calculation as shown below.
|
plot of thermodynamic output of the LAMMPS calculation as shown below.
|
||||||
|
|
||||||
@ -327,10 +335,6 @@ corresponds to. Same as for the *Output* window, the chart window is
|
|||||||
replaced on each new run, but the behavior can be changed in the
|
replaced on each new run, but the behavior can be changed in the
|
||||||
*Preferences* dialog.
|
*Preferences* dialog.
|
||||||
|
|
||||||
.. versionadded:: 1.6
|
|
||||||
|
|
||||||
Support for YAML export added
|
|
||||||
|
|
||||||
From the *File* menu on the top left, it is possible to save an image
|
From the *File* menu on the top left, it is possible to save an image
|
||||||
of the currently displayed plot or export the data in either plain text
|
of the currently displayed plot or export the data in either plain text
|
||||||
columns (for use by plotting tools like `gnuplot
|
columns (for use by plotting tools like `gnuplot
|
||||||
@ -371,8 +375,6 @@ zoom in or zoom out of the displayed images. The button on the very
|
|||||||
left triggers an export of the slide show animation to a movie file,
|
left triggers an export of the slide show animation to a movie file,
|
||||||
provided the `FFmpeg program <https://ffmpeg.org/>`_ is installed.
|
provided the `FFmpeg program <https://ffmpeg.org/>`_ is installed.
|
||||||
|
|
||||||
.. versionadded:: 1.6
|
|
||||||
|
|
||||||
When clicking on the "garbage can" icon, all image files of the slide
|
When clicking on the "garbage can" icon, all image files of the slide
|
||||||
show will be deleted. Since their number can be large for long
|
show will be deleted. Since their number can be large for long
|
||||||
simulations, this option enables to safely and quickly clean up the
|
simulations, this option enables to safely and quickly clean up the
|
||||||
@ -391,7 +393,7 @@ below.
|
|||||||
|
|
||||||
.. image:: JPG/lammps-gui-variable-info.png
|
.. image:: JPG/lammps-gui-variable-info.png
|
||||||
:align: center
|
:align: center
|
||||||
:scale: 75%
|
:scale: 50%
|
||||||
|
|
||||||
Like for the *Output* and *Charts* windows, its content is continuously
|
Like for the *Output* and *Charts* windows, its content is continuously
|
||||||
updated during a run. It will show "(none)" if there are no variables
|
updated during a run. It will show "(none)" if there are no variables
|
||||||
@ -435,20 +437,21 @@ instance when using reduced (= 'lj') :doc:`units <units>`, then
|
|||||||
LAMMPS-GUI will check the current pair style and if it is a
|
LAMMPS-GUI will check the current pair style and if it is a
|
||||||
Lennard-Jones type potential, it will extract the *sigma* parameter
|
Lennard-Jones type potential, it will extract the *sigma* parameter
|
||||||
for each atom type and assign atom diameters from those numbers.
|
for each atom type and assign atom diameters from those numbers.
|
||||||
|
For cases where atom diameters are not auto-detected, the *Atom size* field
|
||||||
|
can be edited and a suitable value set manually. The default value
|
||||||
|
is inferred from the x-direction lattice spacing.
|
||||||
|
|
||||||
Otherwise the default sequence of colors of the :doc:`dump image
|
If elements cannot be detected the default sequence of colors of the
|
||||||
<dump_image>` command is assigned to the different atom types and the
|
:doc:`dump image <dump_image>` command is assigned to the different atom
|
||||||
diameters are all the same.
|
types.
|
||||||
|
|
||||||
.. figure:: JPG/lammps-gui-image.png
|
.. |gui-image1| image:: JPG/lammps-gui-image.png
|
||||||
:align: center
|
:width: 48%
|
||||||
:scale: 50%
|
|
||||||
|
|
||||||
Visualization of LAMMPS "peptide" example
|
.. |gui-image2| image:: JPG/lammps-gui-funnel.png
|
||||||
|
:width: 48%
|
||||||
|
|
||||||
.. versionchanged:: 1.6
|
|gui-image1| |gui-image2|
|
||||||
|
|
||||||
Buttons for toggling shininess and re-centering were added.
|
|
||||||
|
|
||||||
The default image size, some default image quality settings, the view
|
The default image size, some default image quality settings, the view
|
||||||
style and some colors can be changed in the *Preferences* dialog
|
style and some colors can be changed in the *Preferences* dialog
|
||||||
@ -468,8 +471,6 @@ current image can be saved to a file (keyboard shortcut `Ctrl-S`) or
|
|||||||
copied to the clipboard (keyboard shortcut `Ctrl-C`) for pasting the
|
copied to the clipboard (keyboard shortcut `Ctrl-C`) for pasting the
|
||||||
image into another application.
|
image into another application.
|
||||||
|
|
||||||
.. versionadded:: 1.6
|
|
||||||
|
|
||||||
From the *File* menu it is also possible to copy the current
|
From the *File* menu it is also possible to copy the current
|
||||||
:doc:`dump image <dump_image>` and :doc:`dump_modify <dump_image>`
|
:doc:`dump image <dump_image>` and :doc:`dump_modify <dump_image>`
|
||||||
commands to the clipboard so they can be pasted into a LAMMPS input file
|
commands to the clipboard so they can be pasted into a LAMMPS input file
|
||||||
@ -488,8 +489,6 @@ Paste (`Ctrl-V`), Undo (`Ctrl-Z`), Redo (`Ctrl-Shift-Z`), Select All
|
|||||||
dialog will pop up asking whether to cancel the exit operation, or to
|
dialog will pop up asking whether to cancel the exit operation, or to
|
||||||
save or not save the buffer contents to a file.
|
save or not save the buffer contents to a file.
|
||||||
|
|
||||||
.. versionadded:: 1.6
|
|
||||||
|
|
||||||
The editor has an auto-save mode that can be enabled or disabled in the
|
The editor has an auto-save mode that can be enabled or disabled in the
|
||||||
*Preferences* dialog. In auto-save mode, the editor buffer is
|
*Preferences* dialog. In auto-save mode, the editor buffer is
|
||||||
automatically saved before running LAMMPS or before exiting LAMMPS-GUI.
|
automatically saved before running LAMMPS or before exiting LAMMPS-GUI.
|
||||||
@ -553,8 +552,6 @@ context menu that open the corresponding documentation page in the
|
|||||||
online LAMMPS documentation in a web browser window. When using the
|
online LAMMPS documentation in a web browser window. When using the
|
||||||
keyboard, the first of those entries is chosen.
|
keyboard, the first of those entries is chosen.
|
||||||
|
|
||||||
.. versionadded:: 1.6
|
|
||||||
|
|
||||||
If the word under the cursor is a file, then additionally the context
|
If the word under the cursor is a file, then additionally the context
|
||||||
menu has an entry to open the file in a read-only text viewer window.
|
menu has an entry to open the file in a read-only text viewer window.
|
||||||
If the file is a LAMMPS restart file, instead the menu entry offers to
|
If the file is a LAMMPS restart file, instead the menu entry offers to
|
||||||
@ -572,8 +569,6 @@ will contain a corresponding message.
|
|||||||
Inspecting a Restart file
|
Inspecting a Restart file
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
.. versionadded:: 1.6
|
|
||||||
|
|
||||||
When LAMMPS-GUI is asked to "Inspect a Restart", it will read the
|
When LAMMPS-GUI is asked to "Inspect a Restart", it will read the
|
||||||
restart file into a LAMMPS instance and then open three different
|
restart file into a LAMMPS instance and then open three different
|
||||||
windows. The first window is a text viewer with the output of an
|
windows. The first window is a text viewer with the output of an
|
||||||
@ -629,9 +624,10 @@ Edit
|
|||||||
^^^^
|
^^^^
|
||||||
|
|
||||||
The *Edit* menu offers the usual editor functions like *Undo*, *Redo*,
|
The *Edit* menu offers the usual editor functions like *Undo*, *Redo*,
|
||||||
*Cut*, *Copy*, *Paste*. It can also open a *Preferences* dialog
|
*Cut*, *Copy*, *Paste*, and a *Find and Replace* dialog (keyboard
|
||||||
(keyboard shortcut `Ctrl-P`) and allows deleting all stored preferences
|
shortcut `Ctrl-F`). It can also open a *Preferences* dialog (keyboard
|
||||||
and settings, so they are reset to their default values.
|
shortcut `Ctrl-P`) and allows deleting all stored preferences and
|
||||||
|
settings, so they are reset to their default values.
|
||||||
|
|
||||||
Run
|
Run
|
||||||
^^^
|
^^^
|
||||||
@ -667,7 +663,7 @@ set *before* a run is started.
|
|||||||
|
|
||||||
.. image:: JPG/lammps-gui-variables.png
|
.. image:: JPG/lammps-gui-variables.png
|
||||||
:align: center
|
:align: center
|
||||||
:scale: 75%
|
:scale: 50%
|
||||||
|
|
||||||
The *Set Variables* dialog will be pre-populated with entries that
|
The *Set Variables* dialog will be pre-populated with entries that
|
||||||
are set as index variables in the input and any variables that are
|
are set as index variables in the input and any variables that are
|
||||||
@ -716,6 +712,43 @@ https://lammpstutorials.github.io/ in a web browser window.
|
|||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
Find and Replace
|
||||||
|
----------------
|
||||||
|
|
||||||
|
.. image:: JPG/lammps-gui-find.png
|
||||||
|
:align: center
|
||||||
|
:scale: 33%
|
||||||
|
|
||||||
|
The *Find and Replace* dialog allows searching for and replacing
|
||||||
|
text in the *Editor* window.
|
||||||
|
|
||||||
|
The dialog can be opened either from the *Edit* menu or with the
|
||||||
|
keyboard shortcut `Ctrl-F`. You can enter the text to search for.
|
||||||
|
Through three check-boxes the search behavior can be adjusted:
|
||||||
|
|
||||||
|
- If checked, "Match case" does a case sensitive search; otherwise
|
||||||
|
the search is case insensitive.
|
||||||
|
|
||||||
|
- If checked, "Wrap around" starts searching from the start of the
|
||||||
|
document, if there is no match found from the current cursor position
|
||||||
|
until the end of the document; otherwise the search will stop.
|
||||||
|
|
||||||
|
- If checked, the "Whole word" setting only finds full word matches
|
||||||
|
(white space and special characters are word boundaries).
|
||||||
|
|
||||||
|
Clicking on the *Next* button will search for the next occurrence of the
|
||||||
|
search text and select / highlight it. Clicking on the *Replace* button
|
||||||
|
will replace an already highlighted search text and find the next one.
|
||||||
|
If no text is selected, or the selected text does not match the
|
||||||
|
selection string, then the first click on the *Replace* button will
|
||||||
|
only search and highlight the next occurrence of the search string.
|
||||||
|
Clicking on the *Replace All* button will replace all occurrences from
|
||||||
|
the cursor position to the end of the file; if the *Wrap around* box is
|
||||||
|
checked, then it will replace **all** occurrences in the **entire**
|
||||||
|
document. Clicking on the *Done* button will dismiss the dialog.
|
||||||
|
|
||||||
|
------
|
||||||
|
|
||||||
Preferences
|
Preferences
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
@ -848,7 +881,7 @@ available (On macOS use the Command key instead of Ctrl/Control).
|
|||||||
|
|
||||||
.. list-table::
|
.. list-table::
|
||||||
:header-rows: 1
|
:header-rows: 1
|
||||||
:widths: auto
|
:widths: 16 19 13 16 13 22
|
||||||
|
|
||||||
* - Shortcut
|
* - Shortcut
|
||||||
- Function
|
- Function
|
||||||
@ -890,32 +923,32 @@ available (On macOS use the Command key instead of Ctrl/Control).
|
|||||||
- Quit Application
|
- Quit Application
|
||||||
- Ctrl+A
|
- Ctrl+A
|
||||||
- Select All
|
- Select All
|
||||||
- Ctrl+P
|
- Ctrl+F
|
||||||
- Preferences
|
- Find and Replace
|
||||||
* - Ctrl+W
|
* - Ctrl+W
|
||||||
- Close Window
|
- Close Window
|
||||||
- Ctrl+Shift+H
|
|
||||||
- Quick Help
|
|
||||||
- Ctrl+Shift+G
|
|
||||||
- LAMMPS-GUI Howto
|
|
||||||
* - Ctrl+Shift+A
|
|
||||||
- About LAMMPS
|
|
||||||
- Ctrl+?
|
|
||||||
- Context Help
|
|
||||||
- Ctrl+Shift+W
|
|
||||||
- Show Variables
|
|
||||||
* - Ctrl+Shift+M
|
|
||||||
- LAMMPS Manual
|
|
||||||
- TAB
|
- TAB
|
||||||
- Reformat line
|
- Reformat line
|
||||||
- Shift+TAB
|
- Shift+TAB
|
||||||
- Show Completions
|
- Show Completions
|
||||||
* - Ctrl+Shift+T
|
* - Ctrl+Shift+Enter
|
||||||
- LAMMPS Tutorial
|
|
||||||
- Ctrl+Shift+Enter
|
|
||||||
- Run File
|
- Run File
|
||||||
-
|
- Ctrl+Shift+W
|
||||||
-
|
- Show Variables
|
||||||
|
- Ctrl+P
|
||||||
|
- Preferences
|
||||||
|
* - Ctrl+Shift+A
|
||||||
|
- About LAMMPS
|
||||||
|
- Ctrl+Shift+H
|
||||||
|
- Quick Help
|
||||||
|
- Ctrl+Shift+G
|
||||||
|
- LAMMPS-GUI Howto
|
||||||
|
* - Ctrl+Shift+M
|
||||||
|
- LAMMPS Manual
|
||||||
|
- Ctrl+?
|
||||||
|
- Context Help
|
||||||
|
- Ctrl+Shift+T
|
||||||
|
- LAMMPS Tutorial
|
||||||
|
|
||||||
Further editing keybindings `are documented with the Qt documentation
|
Further editing keybindings `are documented with the Qt documentation
|
||||||
<https://doc.qt.io/qt-5/qplaintextedit.html#editing-key-bindings>`_. In
|
<https://doc.qt.io/qt-5/qplaintextedit.html#editing-key-bindings>`_. In
|
||||||
|
|||||||
BIN
doc/src/JPG/lammps-gui-dark.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
doc/src/JPG/lammps-gui-find.png
Normal file
|
After Width: | Height: | Size: 113 KiB |
BIN
doc/src/JPG/lammps-gui-funnel.png
Normal file
|
After Width: | Height: | Size: 325 KiB |
|
Before Width: | Height: | Size: 115 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 77 KiB |
@ -1823,7 +1823,8 @@ Aidan Thompson^3, Gabor Csanyi^2, Christoph Ortner^4, Ralf Drautz^1.
|
|||||||
**Install:**
|
**Install:**
|
||||||
|
|
||||||
This package has :ref:`specific installation instructions <ml-pace>` on the
|
This package has :ref:`specific installation instructions <ml-pace>` on the
|
||||||
:doc:`Build extras <Build_extras>` page.
|
:doc:`Build extras <Build_extras>` page. This package may also be compiled
|
||||||
|
as a plugin to avoid licensing conflicts when distributing binaries.
|
||||||
|
|
||||||
**Supporting info:**
|
**Supporting info:**
|
||||||
|
|
||||||
@ -2344,7 +2345,9 @@ and Gareth Tribello.
|
|||||||
|
|
||||||
**Install:**
|
**Install:**
|
||||||
|
|
||||||
This package has :ref:`specific installation instructions <plumed>` on the :doc:`Build extras <Build_extras>` page.
|
This package has :ref:`specific installation instructions <plumed>` on the
|
||||||
|
:doc:`Build extras <Build_extras>` page. This package may also be compiled
|
||||||
|
as a plugin to avoid licensing conflicts when distributing binaries.
|
||||||
|
|
||||||
**Supporting info:**
|
**Supporting info:**
|
||||||
|
|
||||||
|
|||||||
@ -590,20 +590,31 @@ and the LAMMPS library, via ``-D LAMMPS_SOURCE_DIR=/path/to/lammps/src``.
|
|||||||
CMake will try to guess a build folder with the LAMMPS library from that
|
CMake will try to guess a build folder with the LAMMPS library from that
|
||||||
path, but it can also be set with ``-D LAMMPS_LIB_DIR=/path/to/lammps/lib``.
|
path, but it can also be set with ``-D LAMMPS_LIB_DIR=/path/to/lammps/lib``.
|
||||||
|
|
||||||
|
Plugin version
|
||||||
|
""""""""""""""
|
||||||
|
|
||||||
Rather than linking to the LAMMPS library during compilation, it is also
|
Rather than linking to the LAMMPS library during compilation, it is also
|
||||||
possible to compile the GUI with a plugin loader that will load
|
possible to compile the GUI with a plugin loader that will load the
|
||||||
the LAMMPS library dynamically at runtime during the start of the GUI
|
LAMMPS library dynamically at runtime during the start of the GUI from a
|
||||||
from a shared library; e.g. ``liblammps.so`` or ``liblammps.dylib`` or
|
shared library; e.g. ``liblammps.so`` or ``liblammps.dylib`` or
|
||||||
``liblammps.dll`` (depending on the operating system). This has the
|
``liblammps.dll`` (depending on the operating system). This has the
|
||||||
advantage that the LAMMPS library can be built from updated or modified
|
advantage that the LAMMPS library can be built from updated or modified
|
||||||
LAMMPS source without having to recompile the GUI. The ABI of the
|
LAMMPS source without having to recompile the GUI. The ABI of the
|
||||||
LAMMPS C-library interface is very stable and generally backward
|
LAMMPS C-library interface is very stable and generally backward
|
||||||
compatible. This feature is enabled by setting
|
compatible. This feature is enabled by setting ``-D
|
||||||
``-D LAMMPS_GUI_USE_PLUGIN=on`` and then ``-D
|
LAMMPS_GUI_USE_PLUGIN=on`` and then ``-D
|
||||||
LAMMPS_PLUGINLIB_DIR=/path/to/lammps/plugin/loader``. Typically, this
|
LAMMPS_PLUGINLIB_DIR=/path/to/lammps/plugin/loader``. Typically, this
|
||||||
would be the ``examples/COUPLE/plugin`` folder of the LAMMPS
|
would be the ``examples/COUPLE/plugin`` folder of the LAMMPS
|
||||||
distribution.
|
distribution.
|
||||||
|
|
||||||
|
When compiling LAMMPS-GUI with plugin support, there is an additional
|
||||||
|
command line flag (``-p <path>`` or ``--pluginpath <path>``) which
|
||||||
|
allows to override the path to LAMMPS shared library used by the GUI.
|
||||||
|
This is usually auto-detected on the first run and can be changed in the
|
||||||
|
LAMMPS-GUI *Preferences* dialog. The command line flag allows to reset
|
||||||
|
this path to a valid value in case the original setting has become
|
||||||
|
invalid. An empty path ("") as argument restores the default setting.
|
||||||
|
|
||||||
Platform notes
|
Platform notes
|
||||||
^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
@ -671,6 +682,15 @@ folder> --target tgz`` or ``make tgz`` to build a
|
|||||||
``LAMMPS-Linux-amd64.tar.gz`` file with the executables and their
|
``LAMMPS-Linux-amd64.tar.gz`` file with the executables and their
|
||||||
support libraries.
|
support libraries.
|
||||||
|
|
||||||
|
It is also possible to build a `flatpak bundle
|
||||||
|
<https://docs.flatpak.org/en/latest/single-file-bundles.html>`_ which is
|
||||||
|
a way to distribute applications in a way that is compatible with most
|
||||||
|
Linux distributions. Use the "flatpak" target to trigger a compile
|
||||||
|
(``cmake --build <build folder> --target flatpak`` or ``make flatpak``).
|
||||||
|
Please note that this will not build from the local sources but from the
|
||||||
|
repository and branch listed in the ``org.lammps.lammps-gui.yml``
|
||||||
|
LAMMPS-GUI source folder.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
.. _arc:
|
.. _arc:
|
||||||
|
|||||||
@ -59,11 +59,12 @@ may also contribute to the virial term.
|
|||||||
|
|
||||||
A symmetric pressure tensor, stored as a 6-element vector, is also
|
A symmetric pressure tensor, stored as a 6-element vector, is also
|
||||||
calculated by this compute. The six components of the vector are
|
calculated by this compute. The six components of the vector are
|
||||||
ordered :math:`xx,` :math:`yy,` :math:`zz,` :math:`xy,` :math:`xz,` :math:`yz.`
|
ordered :math:`xx,` :math:`yy,` :math:`zz,` :math:`xy,` :math:`xz,`
|
||||||
The equation for the :math:`(I,J)` components (where :math:`I` and :math:`J`
|
:math:`yz.` The equation for the :math:`(I,J)` components (where
|
||||||
are :math:`x`, :math:`y`, or :math:`z`) is similar to the above formula,
|
:math:`I` and :math:`J` are :math:`x`, :math:`y`, or :math:`z`) is
|
||||||
except that the first term uses components of the kinetic energy tensor and the
|
similar to the above formula, except that the first term uses
|
||||||
second term uses components of the virial tensor:
|
components related to the kinetic energy tensor and the second term
|
||||||
|
uses components of the virial tensor:
|
||||||
|
|
||||||
.. math::
|
.. math::
|
||||||
|
|
||||||
@ -75,8 +76,8 @@ calculated. This includes a kinetic energy (temperature) term and the
|
|||||||
virial as the sum of pair, bond, angle, dihedral, improper, kspace
|
virial as the sum of pair, bond, angle, dihedral, improper, kspace
|
||||||
(long-range), and fix contributions to the force on each atom. If any
|
(long-range), and fix contributions to the force on each atom. If any
|
||||||
extra keywords are listed, then only those components are summed to
|
extra keywords are listed, then only those components are summed to
|
||||||
compute temperature or ke and/or the virial. The *virial* keyword
|
compute temperature or ke and/or the virial. The *virial* keyword means
|
||||||
means include all terms except the kinetic energy *ke*\ .
|
include all terms except the kinetic energy *ke*\ .
|
||||||
|
|
||||||
The *pair/hybrid* keyword means to only include contribution
|
The *pair/hybrid* keyword means to only include contribution
|
||||||
from a sub-style in a *hybrid* or *hybrid/overlay* pair style.
|
from a sub-style in a *hybrid* or *hybrid/overlay* pair style.
|
||||||
@ -86,26 +87,31 @@ system, including for many-body potentials and accounting for the
|
|||||||
effects of periodic boundary conditions are discussed in
|
effects of periodic boundary conditions are discussed in
|
||||||
:ref:`(Thompson) <Thompson1>`.
|
:ref:`(Thompson) <Thompson1>`.
|
||||||
|
|
||||||
The temperature and kinetic energy tensor is not calculated by this
|
The temperature and kinetic energy tensor are not calculated by this
|
||||||
compute, but rather by the temperature compute specified with the
|
compute, but rather by the temperature compute specified with the
|
||||||
command. If the kinetic energy is not included in the pressure, than
|
command. See the doc pages for individual compute temp variants for an
|
||||||
the temperature compute is not used and can be specified as NULL.
|
explanation of how they calculate temperature and a symmetric tensor
|
||||||
Normally the temperature compute used by compute pressure should
|
(6-element vector) whose components are twice that of the traditional KE
|
||||||
calculate the temperature of all atoms for consistency with the virial
|
tensor. That tensor is what appears in the pressure tensor formula
|
||||||
term, but any compute style that calculates temperature can be used
|
above.
|
||||||
(e.g., one that excludes frozen atoms or other degrees of freedom).
|
|
||||||
|
If the kinetic energy is not included in the pressure, than the
|
||||||
|
temperature compute is not used and can be specified as NULL. Normally
|
||||||
|
the temperature compute used by compute pressure should calculate the
|
||||||
|
temperature of all atoms for consistency with the virial term, but any
|
||||||
|
compute style that calculates temperature can be used (e.g., one that
|
||||||
|
excludes frozen atoms or other degrees of freedom).
|
||||||
|
|
||||||
Note that if desired the specified temperature compute can be one that
|
Note that if desired the specified temperature compute can be one that
|
||||||
subtracts off a bias to calculate a temperature using only the thermal
|
subtracts off a bias to calculate a temperature using only the thermal
|
||||||
velocity of the atoms (e.g., by subtracting a background streaming
|
velocity of the atoms (e.g., by subtracting a background streaming
|
||||||
velocity).
|
velocity). See the doc pages for individual :doc:`compute commands
|
||||||
See the doc pages for individual :doc:`compute commands <compute>` to determine
|
<compute>` to determine which ones include a bias.
|
||||||
which ones include a bias.
|
|
||||||
|
|
||||||
Also note that the :math:`N` in the first formula above is really
|
Also note that the :math:`N` in the first formula above is really
|
||||||
degrees-of-freedom divided by :math:`d` = dimensionality, where the DOF value
|
degrees-of-freedom divided by :math:`d` = dimensionality, where the
|
||||||
is calculated by the temperature compute.
|
DOF value is calculated by the temperature compute. See the various
|
||||||
See the various :doc:`compute temperature <compute>` styles for details.
|
:doc:`compute temperature <compute>` styles for details.
|
||||||
|
|
||||||
A compute of this style with the ID of thermo_press is created when
|
A compute of this style with the ID of thermo_press is created when
|
||||||
LAMMPS starts up, as if this command were in the input script:
|
LAMMPS starts up, as if this command were in the input script:
|
||||||
@ -136,9 +142,8 @@ The ordering of values in the symmetric pressure tensor is as follows:
|
|||||||
:math:`p_{xx},` :math:`p_{yy},` :math:`p_{zz},` :math:`p_{xy},`
|
:math:`p_{xx},` :math:`p_{yy},` :math:`p_{zz},` :math:`p_{xy},`
|
||||||
:math:`p_{xz},` :math:`p_{yz}.`
|
:math:`p_{xz},` :math:`p_{yz}.`
|
||||||
|
|
||||||
The scalar and vector values calculated by this compute are
|
The scalar and vector values calculated by this compute are "intensive".
|
||||||
"intensive". The scalar and vector values will be in pressure
|
The scalar and vector values will be in pressure :doc:`units <units>`.
|
||||||
:doc:`units <units>`.
|
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -48,13 +48,17 @@ the group, :math:`N_\mathrm{fix DOFs}` is the number of degrees of
|
|||||||
freedom removed by fix commands (see below), :math:`k_B` is the
|
freedom removed by fix commands (see below), :math:`k_B` is the
|
||||||
Boltzmann constant, and :math:`T` is the resulting computed temperature.
|
Boltzmann constant, and :math:`T` is the resulting computed temperature.
|
||||||
|
|
||||||
A kinetic energy tensor, stored as a six-element vector, is also
|
A symmetric tensor, stored as a six-element vector, is also calculated
|
||||||
calculated by this compute for use in the computation of a pressure
|
by this compute for use in the computation of a pressure tensor by the
|
||||||
tensor. The formula for the components of the tensor is the same as the
|
:doc:`compute pressue <compute_pressure>` command. The formula for
|
||||||
above expression for :math:`E_\mathrm{kin}`, except that :math:`v_i^2` is
|
the components of the tensor is the same as the above expression for
|
||||||
replaced by :math:`v_{i,x} v_{i,y}` for the :math:`xy` component, and so on.
|
:math:`E_\mathrm{kin}`, except that the 1/2 factor is NOT included and
|
||||||
The six components of the vector are ordered :math:`xx`, :math:`yy`,
|
the :math:`v_i^2` is replaced by :math:`v_{i,x} v_{i,y}` for the
|
||||||
:math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
|
:math:`xy` component, and so on. Note that because it lacks the 1/2
|
||||||
|
factor, these tensor components are twice those of the traditional
|
||||||
|
kinetic energy tensor. The six components of the vector are ordered
|
||||||
|
:math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`,
|
||||||
|
:math:`yz`.
|
||||||
|
|
||||||
The number of atoms contributing to the temperature is assumed to be
|
The number of atoms contributing to the temperature is assumed to be
|
||||||
constant for the duration of the run; use the *dynamic* option of the
|
constant for the duration of the run; use the *dynamic* option of the
|
||||||
@ -94,16 +98,17 @@ Output info
|
|||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
This compute calculates a global scalar (the temperature) and a global
|
This compute calculates a global scalar (the temperature) and a global
|
||||||
vector of length six (KE tensor), which can be accessed by indices
|
vector of length six (symmetric tensor), which can be accessed by
|
||||||
1--6. These values can be used by any command that uses global scalar
|
indices 1--6. These values can be used by any command that uses
|
||||||
or vector values from a compute as input. See the :doc:`Howto output
|
global scalar or vector values from a compute as input. See the
|
||||||
<Howto_output>` page for an overview of LAMMPS output options.
|
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS
|
||||||
|
output options.
|
||||||
|
|
||||||
The scalar value calculated by this compute is "intensive". The
|
The scalar value calculated by this compute is "intensive". The
|
||||||
vector values are "extensive".
|
vector values are "extensive".
|
||||||
|
|
||||||
The scalar value will be in temperature :doc:`units <units>`. The
|
The scalar value is in temperature :doc:`units <units>`. The vector
|
||||||
vector values will be in energy :doc:`units <units>`.
|
values are in energy :doc:`units <units>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -41,8 +41,8 @@ translational and rotational kinetic energy. This differs from the
|
|||||||
usual :doc:`compute temp <compute_temp>` command, which assumes point
|
usual :doc:`compute temp <compute_temp>` command, which assumes point
|
||||||
particles with only translational kinetic energy.
|
particles with only translational kinetic energy.
|
||||||
|
|
||||||
Only finite-size particles (aspherical or spherical) can be included
|
Only finite-size particles (aspherical or spherical) can be included in
|
||||||
in the group. For 3d finite-size particles, each has six degrees of
|
the group. For 3d finite-size particles, each has six degrees of
|
||||||
freedom (three translational, three rotational). For 2d finite-size
|
freedom (three translational, three rotational). For 2d finite-size
|
||||||
particles, each has three degrees of freedom (two translational, one
|
particles, each has three degrees of freedom (two translational, one
|
||||||
rotational).
|
rotational).
|
||||||
@ -70,25 +70,39 @@ axis. It will also be the case for biaxial ellipsoids when exactly two
|
|||||||
of the semiaxes have the same length and the corresponding relative well
|
of the semiaxes have the same length and the corresponding relative well
|
||||||
depths are equal.
|
depths are equal.
|
||||||
|
|
||||||
The translational kinetic energy is computed the same as is described
|
The translational kinetic energy is computed the same as is described by
|
||||||
by the :doc:`compute temp <compute_temp>` command. The rotational
|
the :doc:`compute temp <compute_temp>` command. The rotational kinetic
|
||||||
kinetic energy is computed as :math:`\frac12 I \omega^2`, where :math:`I` is
|
energy is computed as :math:`\frac12 I \omega^2`, where :math:`I` is the
|
||||||
the inertia tensor for the aspherical particle and :math:`\omega` is its
|
inertia tensor for the aspherical particle and :math:`\omega` is its
|
||||||
angular velocity, which is computed from its angular momentum.
|
angular velocity, which is computed from its angular momentum.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
For :doc:`2d models <dimension>`, particles are treated as
|
For :doc:`2d models <dimension>`, particles are treated as
|
||||||
ellipsoids, not ellipses, meaning their moments of inertia will be the
|
ellipsoids, not ellipses, meaning their moments of inertia will be
|
||||||
same as in 3d.
|
the same as in 3d.
|
||||||
|
|
||||||
A kinetic energy tensor, stored as a six-element vector, is also
|
A kinetic energy tensor, stored as a six-element vector, is also
|
||||||
calculated by this compute. The formula for the components of the
|
calculated by this compute. The formula for the components of the
|
||||||
tensor is the same as the above formula, except that :math:`v^2` and
|
tensor is the same as the above formula, except that :math:`v^2` and
|
||||||
:math:`\omega^2` are replaced by :math:`v_x v_y` and :math:`\omega_x \omega_y`
|
:math:`\omega^2` are replaced by :math:`v_x v_y` and :math:`\omega_x
|
||||||
for the :math:`xy` component, and the appropriate elements of the moment of
|
\omega_y` for the :math:`xy` component, and the appropriate elements of
|
||||||
inertia tensor are used. The six components of the vector are ordered
|
the moment of inertia tensor are used. The six components of the vector
|
||||||
:math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
|
are ordered :math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`,
|
||||||
|
:math:`yz`.
|
||||||
|
|
||||||
|
A symmetric tensor, stored as a six-element vector, is also calculated
|
||||||
|
by this compute for use in the computation of a pressure tensor by the
|
||||||
|
:doc:`compute pressue <compute_pressure>` command. The formula for the
|
||||||
|
components of the tensor is the same as the above expression for
|
||||||
|
:math:`E_\mathrm{kin}`, except that the 1/2 factor is NOT included and
|
||||||
|
the :math:`v_i^2` and :math:`\omega^2` are replaced by :math:`v_x v_y`
|
||||||
|
and :math:`\omega_x \omega_y` for the :math:`xy` component, and so on.
|
||||||
|
And the appropriate elements of the moment of inertia tensor are used.
|
||||||
|
Note that because it lacks the 1/2 factor, these tensor components are
|
||||||
|
twice those of the traditional kinetic energy tensor. The six
|
||||||
|
components of the vector are ordered :math:`xx`, :math:`yy`, :math:`zz`,
|
||||||
|
:math:`xy`, :math:`xz`, :math:`yz`.
|
||||||
|
|
||||||
The number of atoms contributing to the temperature is assumed to be
|
The number of atoms contributing to the temperature is assumed to be
|
||||||
constant for the duration of the run; use the *dynamic/dof* option of
|
constant for the duration of the run; use the *dynamic/dof* option of
|
||||||
@ -131,27 +145,26 @@ Output info
|
|||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
This compute calculates a global scalar (the temperature) and a global
|
This compute calculates a global scalar (the temperature) and a global
|
||||||
vector of length 6 (KE tensor), which can be accessed by indices 1--6.
|
vector of length 6 (symmetric tensor), which can be accessed by indices
|
||||||
These values can be used by any command that uses global scalar or
|
1--6. These values can be used by any command that uses global scalar
|
||||||
vector values from a compute as input.
|
or vector values from a compute as input. See the :doc:`Howto output
|
||||||
See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS
|
<Howto_output>` page for an overview of LAMMPS output options.
|
||||||
output options.
|
|
||||||
|
|
||||||
The scalar value calculated by this compute is "intensive". The
|
The scalar value calculated by this compute is "intensive". The vector
|
||||||
vector values are "extensive".
|
values are "extensive".
|
||||||
|
|
||||||
The scalar value will be in temperature :doc:`units <units>`. The
|
The scalar value is in temperature :doc:`units <units>`. The vector
|
||||||
vector values will be in energy :doc:`units <units>`.
|
values are in energy :doc:`units <units>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|
||||||
This compute is part of the ASPHERE package. It is only enabled if
|
This compute is part of the ASPHERE package. It is only enabled if
|
||||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info.
|
LAMMPS was built with that package. See the :doc:`Build package
|
||||||
|
<Build_package>` page for more info.
|
||||||
|
|
||||||
This compute requires that atoms store angular momentum and a
|
This compute requires that atoms store angular momentum and a quaternion
|
||||||
quaternion as defined by the :doc:`atom_style ellipsoid <atom_style>`
|
as defined by the :doc:`atom_style ellipsoid <atom_style>` command.
|
||||||
command.
|
|
||||||
|
|
||||||
All particles in the group must be finite-size. They cannot be point
|
All particles in the group must be finite-size. They cannot be point
|
||||||
particles, but they can be aspherical or spherical as defined by their
|
particles, but they can be aspherical or spherical as defined by their
|
||||||
|
|||||||
@ -62,12 +62,17 @@ kinetic energy is computed as :math:`\frac12 I \omega^2`, where :math:`I`
|
|||||||
is the moment of inertia tensor for the aspherical particle and :math:`\omega`
|
is the moment of inertia tensor for the aspherical particle and :math:`\omega`
|
||||||
is its angular velocity, which is computed from its angular momentum.
|
is its angular velocity, which is computed from its angular momentum.
|
||||||
|
|
||||||
A kinetic energy tensor, stored as a 6-element vector, is also calculated by
|
A symmetric tensor, stored as a six-element vector, is also calculated
|
||||||
this compute. The formula for the components of the tensor is the same as the
|
by this compute for use in the computation of a pressure tensor by the
|
||||||
above formula, except that :math:`v^2` and :math:`\omega^2` are
|
:doc:`compute pressue <compute_pressure>` command. The formula for
|
||||||
replaced by :math:`v_x v_y` and :math:`\omega_x \omega_y` for the
|
the components of the tensor is the same as the above expression for
|
||||||
math:`xy` component, and the appropriate elements of the inertia tensor are
|
:math:`E_\mathrm{kin}`, except that the 1/2 factor is NOT included and
|
||||||
used. The six components of the vector are ordered :math:`xx`, :math:`yy`,
|
the :math:`v_i^2` and :math:`\omega^2` are replaced by :math:`v_x v_y`
|
||||||
|
and :math:`\omega_x \omega_y` for the :math:`xy` component, and so on.
|
||||||
|
And the appropriate elements of the moment of inertia tensor are used.
|
||||||
|
Note that because it lacks the 1/2 factor, these tensor components are
|
||||||
|
twice those of the traditional kinetic energy tensor. The six
|
||||||
|
components of the vector are ordered :math:`xx`, :math:`yy`,
|
||||||
:math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
|
:math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
|
||||||
|
|
||||||
The number of atoms contributing to the temperature is assumed to be
|
The number of atoms contributing to the temperature is assumed to be
|
||||||
@ -111,17 +116,17 @@ Output info
|
|||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
This compute calculates a global scalar (the temperature) and a global
|
This compute calculates a global scalar (the temperature) and a global
|
||||||
vector of length 6 (KE tensor), which can be accessed by indices 1--6.
|
vector of length 6 (symmetric tensor), which can be accessed by
|
||||||
These values can be used by any command that uses global scalar or
|
indices 1--6. These values can be used by any command that uses
|
||||||
vector values from a compute as input.
|
global scalar or vector values from a compute as input. See the
|
||||||
See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS
|
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS
|
||||||
output options.
|
output options.
|
||||||
|
|
||||||
The scalar value calculated by this compute is "intensive". The
|
The scalar value calculated by this compute is "intensive". The
|
||||||
vector values are "extensive".
|
vector values are "extensive".
|
||||||
|
|
||||||
The scalar value will be in temperature :doc:`units <units>`.
|
The scalar value is in temperature :doc:`units <units>`. The vector
|
||||||
The vector values will be in energy :doc:`units <units>`.
|
values are in energy :doc:`units <units>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -85,12 +85,14 @@ By default, *adof* = 2 or 3 = dimensionality of system, as set via the
|
|||||||
:doc:`dimension <dimension>` command, and *cdof* = 0.0.
|
:doc:`dimension <dimension>` command, and *cdof* = 0.0.
|
||||||
This gives the usual formula for temperature.
|
This gives the usual formula for temperature.
|
||||||
|
|
||||||
A kinetic energy tensor, stored as a six-element vector, is also
|
A symmetric tensor, stored as a six-element vector, is also calculated
|
||||||
calculated by this compute for use in the computation of a pressure
|
by this compute. The formula for the components of the tensor is the
|
||||||
tensor. The formula for the components of the tensor is the same as
|
same as the above expression for :math:`E_\mathrm{kin}`, except that
|
||||||
the above formula, except that :math:`v^2` is replaced by
|
the 1/2 factor is NOT included and the :math:`v_i^2` is replaced by
|
||||||
:math:`v_x v_y` for the :math:`xy` component, and so on.
|
:math:`v_{i,x} v_{i,y}` for the :math:`xy` component, and so on. Note
|
||||||
The six components of the vector are ordered :math:`xx`, :math:`yy`,
|
that because it lacks the 1/2 factor, these tensor components are
|
||||||
|
twice those of the traditional kinetic energy tensor. The six
|
||||||
|
components of the vector are ordered :math:`xx`, :math:`yy`,
|
||||||
:math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
|
:math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
|
||||||
|
|
||||||
Note that the number of atoms contributing to the temperature is
|
Note that the number of atoms contributing to the temperature is
|
||||||
@ -227,10 +229,10 @@ Output info
|
|||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
This compute calculates a global scalar (the temperature) and a global
|
This compute calculates a global scalar (the temperature) and a global
|
||||||
vector of length 6 (KE tensor), which can be accessed by indices 1--6.
|
vector of length 6 (symmetric tensor), which can be accessed by
|
||||||
These values can be used by any command that uses global scalar or
|
indices 1--6. These values can be used by any command that uses
|
||||||
vector values from a compute as input.
|
global scalar or vector values from a compute as input. See the
|
||||||
See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS
|
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS
|
||||||
output options.
|
output options.
|
||||||
|
|
||||||
This compute also optionally calculates a global array, if one or more
|
This compute also optionally calculates a global array, if one or more
|
||||||
@ -245,9 +247,9 @@ page for an overview of LAMMPS output options.
|
|||||||
The scalar value calculated by this compute is "intensive". The
|
The scalar value calculated by this compute is "intensive". The
|
||||||
vector values are "extensive". The array values are "intensive".
|
vector values are "extensive". The array values are "intensive".
|
||||||
|
|
||||||
The scalar value will be in temperature :doc:`units <units>`. The
|
The scalar value is in temperature :doc:`units <units>`. The vector
|
||||||
vector values will be in energy :doc:`units <units>`. The array values
|
values are in energy :doc:`units <units>`. The array values will be
|
||||||
will be in temperature :doc:`units <units>` for the *temp* value, and in
|
in temperature :doc:`units <units>` for the *temp* value, and in
|
||||||
energy :doc:`units <units>` for the *kecom* and *internal* values.
|
energy :doc:`units <units>` for the *kecom* and *internal* values.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
|
|||||||
@ -44,12 +44,17 @@ where KE is the total kinetic energy of the group of atoms (sum of
|
|||||||
simulation, :math:`N` is number of atoms in the group, :math:`k_B` is
|
simulation, :math:`N` is number of atoms in the group, :math:`k_B` is
|
||||||
the Boltzmann constant, and :math:`T` is the absolute temperature.
|
the Boltzmann constant, and :math:`T` is the absolute temperature.
|
||||||
|
|
||||||
A kinetic energy tensor, stored as a six-element vector, is also
|
A symmetric tensor, stored as a six-element vector, is also calculated
|
||||||
calculated by this compute for use in the computation of a pressure
|
by this compute for use in the computation of a pressure tensor by the
|
||||||
tensor. The formula for the components of the tensor is the same as
|
:doc:`compute pressue <compute_pressure>` command. The formula for
|
||||||
the above formula, except that :math:`v^2` is replaced by :math:`v_x v_y`
|
the components of the tensor is the same as the above expression for
|
||||||
for the :math:`xy` component, and so on. The six components of the vector are
|
:math:`E_\mathrm{kin}`, except that the 1/2 factor is NOT included and
|
||||||
ordered :math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
|
the :math:`v_i^2` is replaced by :math:`v_{i,x} v_{i,y}` for the
|
||||||
|
:math:`xy` component, and so on. Note that because it lacks the 1/2
|
||||||
|
factor, these tensor components are twice those of the traditional
|
||||||
|
kinetic energy tensor. The six components of the vector are ordered
|
||||||
|
:math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`,
|
||||||
|
:math:`yz`.
|
||||||
|
|
||||||
The number of atoms contributing to the temperature is assumed to be
|
The number of atoms contributing to the temperature is assumed to be
|
||||||
constant for the duration of the run; use the *dynamic* option of the
|
constant for the duration of the run; use the *dynamic* option of the
|
||||||
@ -81,17 +86,17 @@ Output info
|
|||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
This compute calculates a global scalar (the temperature) and a global
|
This compute calculates a global scalar (the temperature) and a global
|
||||||
vector of length 6 (KE tensor), which can be accessed by indices 1--6.
|
vector of length 6 (symmetric tensor), which can be accessed by
|
||||||
These values can be used by any command that uses global scalar or
|
indices 1--6. These values can be used by any command that uses
|
||||||
vector values from a compute as input. See the
|
global scalar or vector values from a compute as input. See the
|
||||||
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
|
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS
|
||||||
options.
|
output options.
|
||||||
|
|
||||||
The scalar value calculated by this compute is "intensive". The
|
The scalar value calculated by this compute is "intensive". The
|
||||||
vector values are "extensive".
|
vector values are "extensive".
|
||||||
|
|
||||||
The scalar value will be in temperature :doc:`units <units>`.
|
The scalar value is in temperature :doc:`units <units>`. The vector
|
||||||
The vector values will be in energy :doc:`units <units>`.
|
values is in energy :doc:`units <units>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -31,27 +31,27 @@ on the center-of-mass velocity of atom pairs that are bonded to each
|
|||||||
other. This compute is designed to be used with the adiabatic
|
other. This compute is designed to be used with the adiabatic
|
||||||
core/shell model of :ref:`(Mitchell and Fincham) <MitchellFincham1>`.
|
core/shell model of :ref:`(Mitchell and Fincham) <MitchellFincham1>`.
|
||||||
See the :doc:`Howto coreshell <Howto_coreshell>` page for an overview of
|
See the :doc:`Howto coreshell <Howto_coreshell>` page for an overview of
|
||||||
the model as implemented in LAMMPS. Specifically, this compute
|
the model as implemented in LAMMPS. Specifically, this compute enables
|
||||||
enables correct temperature calculation and thermostatting of
|
correct temperature calculation and thermostatting of core/shell pairs
|
||||||
core/shell pairs where it is desirable for the internal degrees of
|
where it is desirable for the internal degrees of freedom of the
|
||||||
freedom of the core/shell pairs to not be influenced by a thermostat.
|
core/shell pairs to not be influenced by a thermostat. A compute of
|
||||||
A compute of this style can be used by any command that computes a
|
this style can be used by any command that computes a temperature via
|
||||||
temperature via :doc:`fix_modify <fix_modify>`
|
:doc:`fix_modify <fix_modify>` (e.g., :doc:`fix temp/rescale
|
||||||
(e.g., :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix npt <fix_nh>`).
|
<fix_temp_rescale>`, :doc:`fix npt <fix_nh>`).
|
||||||
|
|
||||||
Note that this compute does not require all ions to be polarized,
|
Note that this compute does not require all ions to be polarized, hence
|
||||||
hence defined as core/shell pairs. One can mix core/shell pairs and
|
defined as core/shell pairs. One can mix core/shell pairs and ions
|
||||||
ions without a satellite particle if desired. The compute will
|
without a satellite particle if desired. The compute will consider the
|
||||||
consider the non-polarized ions according to the physical system.
|
non-polarized ions according to the physical system.
|
||||||
|
|
||||||
For this compute, core and shell particles are specified by two
|
For this compute, core and shell particles are specified by two
|
||||||
respective group IDs, which can be defined using the
|
respective group IDs, which can be defined using the :doc:`group
|
||||||
:doc:`group <group>` command. The number of atoms in the two groups
|
<group>` command. The number of atoms in the two groups must be the
|
||||||
must be the same and there should be one bond defined between a pair
|
same and there should be one bond defined between a pair of atoms in the
|
||||||
of atoms in the two groups. Non-polarized ions which might also be
|
two groups. Non-polarized ions which might also be included in the
|
||||||
included in the treated system should not be included into either of
|
treated system should not be included into either of these groups, they
|
||||||
these groups, they are taken into account by the *group-ID* (second
|
are taken into account by the *group-ID* (second argument) of the
|
||||||
argument) of the compute.
|
compute.
|
||||||
|
|
||||||
The temperature is calculated by the formula
|
The temperature is calculated by the formula
|
||||||
|
|
||||||
@ -60,52 +60,56 @@ The temperature is calculated by the formula
|
|||||||
\text{KE} = \frac{\text{dim}}{2} N k_B T,
|
\text{KE} = \frac{\text{dim}}{2} N k_B T,
|
||||||
|
|
||||||
where KE is the total kinetic energy of the group of atoms (sum of
|
where KE is the total kinetic energy of the group of atoms (sum of
|
||||||
:math:`\frac12 m v^2`), dim = 2 or 3 is the dimensionality of the simulation,
|
:math:`\frac12 m v^2`), dim = 2 or 3 is the dimensionality of the
|
||||||
:math:`N` is the number of atoms in the group, :math:`k_B` is the Boltzmann
|
simulation, :math:`N` is the number of atoms in the group, :math:`k_B`
|
||||||
constant, and :math:`T` is the absolute temperature. Note that
|
is the Boltzmann constant, and :math:`T` is the absolute temperature.
|
||||||
the velocity of each core or shell atom used in the KE calculation is
|
Note that the velocity of each core or shell atom used in the KE
|
||||||
the velocity of the center-of-mass (COM) of the core/shell pair the
|
calculation is the velocity of the center-of-mass (COM) of the
|
||||||
atom is part of.
|
core/shell pair the atom is part of.
|
||||||
|
|
||||||
A kinetic energy tensor, stored as a six-element vector, is also calculated by
|
A symmetric tensor, stored as a six-element vector, is also calculated
|
||||||
this compute for use in the computation of a pressure tensor. The formula for
|
by this compute for use in the computation of a pressure tensor by the
|
||||||
the components of the tensor is the same as the above formula, except that
|
:doc:`compute pressue <compute_pressure>` command. The formula for the
|
||||||
:math:`v^2` is replaced by :math:`v_x v_y` for the :math:`xy` component, and so
|
components of the tensor is the same as the above expression for
|
||||||
on. The six components of the vector are ordered :math:`xx`, :math:`yy`,
|
:math:`E_\mathrm{kin}`, except that the 1/2 factor is NOT included and
|
||||||
:math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`. In contrast to the temperature,
|
the :math:`v_i^2` is replaced by :math:`v_{i,x} v_{i,y}` for the
|
||||||
the velocity of each core or shell atom is taken individually.
|
:math:`xy` component, and so on. Note that because it lacks the 1/2
|
||||||
|
factor, these tensor components are twice those of the traditional
|
||||||
|
kinetic energy tensor. The six components of the vector are ordered
|
||||||
|
:math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
|
||||||
|
|
||||||
The change this fix makes to core/shell atom velocities is essentially
|
The change this fix makes to core/shell atom velocities is essentially
|
||||||
computing the temperature after a "bias" has been removed from the velocity of
|
computing the temperature after a "bias" has been removed from the
|
||||||
the atoms. This "bias" is the velocity of the atom relative to the
|
velocity of the atoms. This "bias" is the velocity of the atom relative
|
||||||
center-of-mass velocity of the core/shell pair. If this compute is used with a
|
to the center-of-mass velocity of the core/shell pair. If this compute
|
||||||
fix command that performs thermostatting then this bias will be subtracted from
|
is used with a fix command that performs thermostatting then this bias
|
||||||
each atom, thermostatting of the remaining center-of-mass velocity will be
|
will be subtracted from each atom, thermostatting of the remaining
|
||||||
performed, and the bias will be added back in. This means the thermostatting
|
center-of-mass velocity will be performed, and the bias will be added
|
||||||
will effectively be performed on the core/shell pairs, instead of on the
|
back in. This means the thermostatting will effectively be performed on
|
||||||
individual core and shell atoms. Thermostatting fixes that work in this way
|
the core/shell pairs, instead of on the individual core and shell atoms.
|
||||||
include :doc:`fix nvt <fix_nh>`, :doc:`fix temp/rescale <fix_temp_rescale>`,
|
Thermostatting fixes that work in this way include :doc:`fix nvt
|
||||||
:doc:`fix temp/berendsen <fix_temp_berendsen>`, and
|
<fix_nh>`, :doc:`fix temp/rescale <fix_temp_rescale>`, :doc:`fix
|
||||||
:doc:`fix langevin <fix_langevin>`.
|
temp/berendsen <fix_temp_berendsen>`, and :doc:`fix langevin
|
||||||
|
<fix_langevin>`.
|
||||||
|
|
||||||
The internal energy of core/shell pairs can be calculated by the
|
The internal energy of core/shell pairs can be calculated by the
|
||||||
:doc:`compute temp/chunk <compute_temp_chunk>` command, if chunks are defined
|
:doc:`compute temp/chunk <compute_temp_chunk>` command, if chunks are
|
||||||
as core/shell pairs. See the :doc:`Howto coreshell <Howto_coreshell>` doc
|
defined as core/shell pairs. See the :doc:`Howto coreshell
|
||||||
page for more discussion on how to do this.
|
<Howto_coreshell>` doc page for more discussion on how to do this.
|
||||||
|
|
||||||
Output info
|
Output info
|
||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
This compute calculates a global scalar (the temperature) and a global
|
This compute calculates a global scalar (the temperature) and a global
|
||||||
vector of length 6 (KE tensor), which can be accessed by indices 1--6.
|
vector of length 6 (symmetric tensor), which can be accessed by indices
|
||||||
These values can be used by any command that uses global scalar or
|
1--6. These values can be used by any command that uses global scalar
|
||||||
vector values from a compute as input.
|
or vector values from a compute as input.
|
||||||
|
|
||||||
The scalar value calculated by this compute is "intensive". The
|
The scalar value calculated by this compute is "intensive". The vector
|
||||||
vector values are "extensive".
|
values are "extensive".
|
||||||
|
|
||||||
The scalar value will be in temperature :doc:`units <units>`. The
|
The scalar value is in temperature :doc:`units <units>`. The vector
|
||||||
vector values will be in energy :doc:`units <units>`.
|
values are in energy :doc:`units <units>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -73,12 +73,16 @@ simulation, :math:`N` is the number of atoms in the group, :math:`k_B`
|
|||||||
is the Boltzmann constant, and :math:`T` is the temperature. Note that
|
is the Boltzmann constant, and :math:`T` is the temperature. Note that
|
||||||
:math:`v` in the kinetic energy formula is the atom's velocity.
|
:math:`v` in the kinetic energy formula is the atom's velocity.
|
||||||
|
|
||||||
A kinetic energy tensor, stored as a six-element vector, is also
|
A symmetric tensor, stored as a six-element vector, is also calculated
|
||||||
calculated by this compute for use in the computation of a pressure
|
by this compute for use in the computation of a pressure tensor by the
|
||||||
tensor. The formula for the components of the tensor is the same as
|
:doc:`compute pressue <compute_pressure>` command. The formula for
|
||||||
the above formula, except that :math:`v^2` is replaced by :math:`v_x v_y` for
|
the components of the tensor is the same as the above expression for
|
||||||
the :math:`xy` component, and so on. The six components of the vector are
|
:math:`E_\mathrm{kin}`, except that the 1/2 factor is NOT included and
|
||||||
ordered :math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`,
|
the :math:`v_i^2` is replaced by :math:`v_{i,x} v_{i,y}` for the
|
||||||
|
:math:`xy` component, and so on. Note that because it lacks the 1/2
|
||||||
|
factor, these tensor components are twice those of the traditional
|
||||||
|
kinetic energy tensor. The six components of the vector are ordered
|
||||||
|
:math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`,
|
||||||
:math:`yz`.
|
:math:`yz`.
|
||||||
|
|
||||||
The number of atoms contributing to the temperature is assumed to be
|
The number of atoms contributing to the temperature is assumed to be
|
||||||
@ -128,17 +132,17 @@ Output info
|
|||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
This compute calculates a global scalar (the temperature) and a global
|
This compute calculates a global scalar (the temperature) and a global
|
||||||
vector of length 6 (KE tensor), which can be accessed by indices 1--6.
|
vector of length 6 (symmetric tensor), which can be accessed by
|
||||||
These values can be used by any command that uses global scalar or
|
indices 1--6. These values can be used by any command that uses
|
||||||
vector values from a compute as input. See the
|
global scalar or vector values from a compute as input. See the
|
||||||
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
|
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS
|
||||||
options.
|
output options.
|
||||||
|
|
||||||
The scalar value calculated by this compute is "intensive". The
|
The scalar value calculated by this compute is "intensive". The
|
||||||
vector values are "extensive".
|
vector values are "extensive".
|
||||||
|
|
||||||
The scalar value will be in temperature :doc:`units <units>`.
|
The scalar value is in temperature :doc:`units <units>`. The vector
|
||||||
The vector values will be in energy :doc:`units <units>`.
|
values are in energy :doc:`units <units>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -29,17 +29,20 @@ model, after subtracting out a streaming velocity induced by the
|
|||||||
simulation box changing size and/or shape, for example in a
|
simulation box changing size and/or shape, for example in a
|
||||||
non-equilibrium MD (NEMD) simulation. The size/shape change is
|
non-equilibrium MD (NEMD) simulation. The size/shape change is
|
||||||
induced by use of the :doc:`fix deform <fix_deform>` command. A
|
induced by use of the :doc:`fix deform <fix_deform>` command. A
|
||||||
compute of this style is created by the
|
compute of this style is created by the :doc:`fix nvt/sllod/eff
|
||||||
:doc:`fix nvt/sllod/eff <fix_nvt_sllod_eff>` command to compute the thermal
|
<fix_nvt_sllod_eff>` command to compute the thermal temperature of
|
||||||
temperature of atoms for thermostatting purposes. A compute of this
|
atoms for thermostatting purposes. A compute of this style can also
|
||||||
style can also be used by any command that computes a temperature
|
be used by any command that computes a temperature (e.g.,
|
||||||
(e.g., :doc:`thermo_modify <thermo_modify>`, :doc:`fix npt/eff <fix_nh_eff>`).
|
:doc:`thermo_modify <thermo_modify>`, :doc:`fix npt/eff
|
||||||
|
<fix_nh_eff>`).
|
||||||
|
|
||||||
The calculation performed by this compute is exactly like that
|
The calculation performed by this compute is exactly like that
|
||||||
described by the :doc:`compute temp/deform <compute_temp_deform>`
|
described by the :doc:`compute temp/deform <compute_temp_deform>`
|
||||||
command, except that the formula for the temperature includes the
|
command, except that the formulas for the temperature (scalar) and
|
||||||
radial electron velocity contributions, as discussed by the :doc:`compute temp/eff <compute_temp_eff>` command. Note that only the
|
diagonal components of the symmetric tensor (vector) include the
|
||||||
translational degrees of freedom for each nuclei or electron are
|
radial electron velocity contributions, as discussed by the
|
||||||
|
:doc:`compute temp/eff <compute_temp_eff>` command. Note that only
|
||||||
|
the translational degrees of freedom for each nuclei or electron are
|
||||||
affected by the streaming velocity adjustment. The radial velocity
|
affected by the streaming velocity adjustment. The radial velocity
|
||||||
component of the electrons is not affected.
|
component of the electrons is not affected.
|
||||||
|
|
||||||
@ -47,17 +50,17 @@ Output info
|
|||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
This compute calculates a global scalar (the temperature) and a global
|
This compute calculates a global scalar (the temperature) and a global
|
||||||
vector of length 6 (KE tensor), which can be accessed by indices 1--6.
|
vector of length 6 (symmetric tensor), which can be accessed by
|
||||||
These values can be used by any command that uses global scalar or
|
indices 1--6. These values can be used by any command that uses
|
||||||
vector values from a compute as input. See the
|
global scalar or vector values from a compute as input. See the
|
||||||
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
|
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS
|
||||||
options.
|
output options.
|
||||||
|
|
||||||
The scalar value calculated by this compute is "intensive". The
|
The scalar value calculated by this compute is "intensive". The
|
||||||
vector values are "extensive".
|
vector values are "extensive".
|
||||||
|
|
||||||
The scalar value will be in temperature :doc:`units <units>`. The
|
The scalar value is in temperature :doc:`units <units>`. The vector
|
||||||
vector values will be in energy :doc:`units <units>`.
|
values are in energy :doc:`units <units>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -44,12 +44,16 @@ constant, and :math:`T` = temperature. The calculation of KE excludes the
|
|||||||
is 0. The dim parameter is adjusted to give the correct number of
|
is 0. The dim parameter is adjusted to give the correct number of
|
||||||
degrees of freedom.
|
degrees of freedom.
|
||||||
|
|
||||||
A kinetic energy tensor, stored as a six-element vector, is also
|
A symmetric tensor, stored as a six-element vector, is also calculated
|
||||||
calculated by this compute for use in the calculation of a pressure
|
by this compute for use in the computation of a pressure tensor by the
|
||||||
tensor. The formula for the components of the tensor is the same as
|
:doc:`compute pressue <compute_pressure>` command. The formula for
|
||||||
the above formula, except that :math:`v^2` is replaced by :math:`v_x v_y` for
|
the components of the tensor is the same as the above expression for
|
||||||
the :math:`xy` component, and so on. The six components of the vector are
|
:math:`E_\mathrm{kin}`, except that the 1/2 factor is NOT included and
|
||||||
ordered :math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`,
|
the :math:`v_i^2` is replaced by :math:`v_{i,x} v_{i,y}` for the
|
||||||
|
:math:`xy` component, and so on. Note that because it lacks the 1/2
|
||||||
|
factor, these tensor components are twice those of the traditional
|
||||||
|
kinetic energy tensor. The six components of the vector are ordered
|
||||||
|
:math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`,
|
||||||
:math:`yz`.
|
:math:`yz`.
|
||||||
|
|
||||||
The number of atoms contributing to the temperature is assumed to be
|
The number of atoms contributing to the temperature is assumed to be
|
||||||
@ -88,17 +92,17 @@ Output info
|
|||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
This compute calculates a global scalar (the temperature) and a global
|
This compute calculates a global scalar (the temperature) and a global
|
||||||
vector of length 6 (KE tensor), which can be accessed by indices 1--6.
|
vector of length 6 (symmetric tensor), which can be accessed by
|
||||||
These values can be used by any command that uses global scalar or
|
indices 1--6. These values can be used by any command that uses
|
||||||
vector values from a compute as input.
|
global scalar or vector values from a compute as input. See the
|
||||||
See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS
|
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS
|
||||||
output options.
|
output options.
|
||||||
|
|
||||||
The scalar value calculated by this compute is "intensive". The
|
The scalar value calculated by this compute is "intensive". The
|
||||||
vector values are "extensive".
|
vector values are "extensive".
|
||||||
|
|
||||||
The scalar value will be in temperature :doc:`units <units>`. The
|
The scalar value is in temperature :doc:`units <units>`. The vector
|
||||||
vector values will be in energy :doc:`units <units>`.
|
values are in energy :doc:`units <units>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -97,21 +97,27 @@ center-of-mass velocity across the group in directions where streaming velocity
|
|||||||
is *not* subtracted. This can be altered using the *extra* option of the
|
is *not* subtracted. This can be altered using the *extra* option of the
|
||||||
:doc:`compute_modify <compute_modify>` command.
|
:doc:`compute_modify <compute_modify>` command.
|
||||||
|
|
||||||
If the *out* keyword is used with a *tensor* value, which is the default,
|
If the *out* keyword is used with a *tensor* value, which is the
|
||||||
a kinetic energy tensor, stored as a six-element vector, is also calculated by
|
default, then a symmetric tensor, stored as a six-element vector, is
|
||||||
this compute for use in the computation of a pressure tensor. The formula for
|
also calculated by this compute for use in the computation of a
|
||||||
the components of the tensor is the same as the above formula, except that
|
pressure tensor by the :doc:`compute pressue <compute_pressure>`
|
||||||
:math:`v^2` is replaced by :math:`v_x v_y` for the :math:`xy` component, and
|
command. The formula for the components of the tensor is the same as
|
||||||
so on. The six components of the vector are ordered :math:`xx`, :math:`yy`,
|
the above expression for :math:`E_\mathrm{kin}`, except that the 1/2
|
||||||
|
factor is NOT included and the :math:`v_i^2` is replaced by
|
||||||
|
:math:`v_{i,x} v_{i,y}` for the :math:`xy` component, and so on. Note
|
||||||
|
that because it lacks the 1/2 factor, these tensor components are
|
||||||
|
twice those of the traditional kinetic energy tensor. The six
|
||||||
|
components of the vector are ordered :math:`xx`, :math:`yy`,
|
||||||
:math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
|
:math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
|
||||||
|
|
||||||
If the *out* keyword is used with a *bin* value, the count of atoms and
|
If the *out* keyword is used with a *bin* value, the count of atoms
|
||||||
computed temperature for each bin are stored for output, as an array of values,
|
and computed temperature for each bin are stored for output, as an
|
||||||
as described below. The temperature of each bin is calculated as described
|
array of values, as described below. The temperature of each bin is
|
||||||
above, where the bias velocity is subtracted and only the remaining thermal
|
calculated as described above, where the bias velocity is subtracted
|
||||||
velocity of atoms in the bin contributes to the temperature. See the note
|
and only the remaining thermal velocity of atoms in the bin
|
||||||
below for how the temperature is normalized by the degrees-of-freedom of atoms
|
contributes to the temperature. See the note below for how the
|
||||||
in the bin.
|
temperature is normalized by the degrees-of-freedom of atoms in the
|
||||||
|
bin.
|
||||||
|
|
||||||
The number of atoms contributing to the temperature is assumed to be
|
The number of atoms contributing to the temperature is assumed to be
|
||||||
constant for the duration of the run; use the *dynamic* option of the
|
constant for the duration of the run; use the *dynamic* option of the
|
||||||
@ -166,16 +172,17 @@ Output info
|
|||||||
This compute calculates a global scalar (the temperature). Depending
|
This compute calculates a global scalar (the temperature). Depending
|
||||||
on the setting of the *out* keyword, it also calculates a global
|
on the setting of the *out* keyword, it also calculates a global
|
||||||
vector or array. For *out* = *tensor*, it calculates a vector of
|
vector or array. For *out* = *tensor*, it calculates a vector of
|
||||||
length 6 (KE tensor), which can be accessed by indices 1--6. For *out*
|
length 6 (symmetric tensor), which can be accessed by indices 1--6.
|
||||||
= *bin* it calculates a global array which has 2 columns and :math:`N` rows,
|
For *out* = *bin* it calculates a global array which has 2 columns and
|
||||||
where :math:`N` is the number of bins. The first column contains the number
|
:math:`N` rows, where :math:`N` is the number of bins. The first
|
||||||
of atoms in that bin. The second contains the temperature of that
|
column contains the number of atoms in that bin. The second contains
|
||||||
bin, calculated as described above. The ordering of rows in the array
|
the temperature of that bin, calculated as described above. The
|
||||||
is as follows. Bins in :math:`x` vary fastest, then :math:`y`, then
|
ordering of rows in the array is as follows. Bins in :math:`x` vary
|
||||||
:math:`z`. Thus for a :math:`10\times 10\times 10` 3d array of bins, there
|
fastest, then :math:`y`, then :math:`z`. Thus for a :math:`10\times
|
||||||
will be 1000 rows. The bin with indices :math:`(i_x,i_y,i_z) = (2,3,4)` would
|
10\times 10` 3d array of bins, there will be 1000 rows. The bin with
|
||||||
map to row :math:`M = 10^2(i_z-1) + 10(i_y-1) + i_x = 322`, where the rows are
|
indices :math:`(i_x,i_y,i_z) = (2,3,4)` would map to row :math:`M =
|
||||||
numbered from 1 to 1000 and the bin indices are numbered from 1 to 10 in each
|
10^2(i_z-1) + 10(i_y-1) + i_x = 322`, where the rows are numbered from
|
||||||
|
1 to 1000 and the bin indices are numbered from 1 to 10 in each
|
||||||
dimension.
|
dimension.
|
||||||
|
|
||||||
These values can be used by any command that uses global scalar or
|
These values can be used by any command that uses global scalar or
|
||||||
@ -186,9 +193,9 @@ options.
|
|||||||
The scalar value calculated by this compute is "intensive". The
|
The scalar value calculated by this compute is "intensive". The
|
||||||
vector values are "extensive". The array values are "intensive".
|
vector values are "extensive". The array values are "intensive".
|
||||||
|
|
||||||
The scalar value will be in temperature :doc:`units <units>`. The
|
The scalar value us in temperature :doc:`units <units>`. The vector
|
||||||
vector values will be in energy :doc:`units <units>`. The first column
|
values are in energy :doc:`units <units>`. The first column of array
|
||||||
of array values are counts; the values in the second column will be in
|
values are counts; the values in the second column will be in
|
||||||
temperature :doc:`units <units>`.
|
temperature :doc:`units <units>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
@ -203,7 +210,10 @@ will be for most thermostats.
|
|||||||
Related commands
|
Related commands
|
||||||
""""""""""""""""
|
""""""""""""""""
|
||||||
|
|
||||||
:doc:`compute temp <compute_temp>`, :doc:`compute temp/ramp <compute_temp_ramp>`, :doc:`compute temp/deform <compute_temp_deform>`, :doc:`compute pressure <compute_pressure>`
|
:doc:`compute temp <compute_temp>`,
|
||||||
|
:doc:`compute temp/ramp <compute_temp_ramp>`,
|
||||||
|
:doc:`compute temp/deform <compute_temp_deform>`,
|
||||||
|
:doc:`compute pressure <compute_pressure>`
|
||||||
|
|
||||||
Default
|
Default
|
||||||
"""""""
|
"""""""
|
||||||
|
|||||||
@ -63,12 +63,17 @@ command (e.g., :math:`\AA` for units = real or metal). A
|
|||||||
velocity in lattice spacings per unit time). The :doc:`lattice <lattice>`
|
velocity in lattice spacings per unit time). The :doc:`lattice <lattice>`
|
||||||
command must have been previously used to define the lattice spacing.
|
command must have been previously used to define the lattice spacing.
|
||||||
|
|
||||||
A kinetic energy tensor, stored as a six-element vector, is also calculated by
|
A symmetric tensor, stored as a six-element vector, is also calculated
|
||||||
this compute for use in the computation of a pressure tensor. The formula for
|
by this compute for use in the computation of a pressure tensor by the
|
||||||
the components of the tensor is the same as the above formula, except that
|
:doc:`compute pressue <compute_pressure>` command. The formula for
|
||||||
:math:`v^2` is replaced by :math:`v_x v_y` for the :math:`xy` component, and
|
the components of the tensor is the same as the above expression for
|
||||||
so on. The six components of the vector are ordered :math:`xx`, :math:`yy`,
|
:math:`E_\mathrm{kin}`, except that the 1/2 factor is NOT included and
|
||||||
:math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
|
the :math:`v_i^2` is replaced by :math:`v_{i,x} v_{i,y}` for the
|
||||||
|
:math:`xy` component, and so on. Note that because it lacks the 1/2
|
||||||
|
factor, these tensor components are twice those of the traditional
|
||||||
|
kinetic energy tensor. The six components of the vector are ordered
|
||||||
|
:math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`,
|
||||||
|
:math:`yz`.
|
||||||
|
|
||||||
The number of atoms contributing to the temperature is assumed to be constant
|
The number of atoms contributing to the temperature is assumed to be constant
|
||||||
for the duration of the run; use the *dynamic* option of the
|
for the duration of the run; use the *dynamic* option of the
|
||||||
@ -100,17 +105,17 @@ Output info
|
|||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
This compute calculates a global scalar (the temperature) and a global
|
This compute calculates a global scalar (the temperature) and a global
|
||||||
vector of length 6 (KE tensor), which can be accessed by indices 1--6.
|
vector of length 6 (symmetric tensor), which can be accessed by
|
||||||
These values can be used by any command that uses global scalar or
|
indices 1--6. These values can be used by any command that uses
|
||||||
vector values from a compute as input. See the
|
global scalar or vector values from a compute as input. See the
|
||||||
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
|
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS
|
||||||
options.
|
output options.
|
||||||
|
|
||||||
The scalar value calculated by this compute is "intensive". The
|
The scalar value calculated by this compute is "intensive". The
|
||||||
vector values are "extensive".
|
vector values are "extensive".
|
||||||
|
|
||||||
The scalar value will be in temperature :doc:`units <units>`. The
|
The scalar value is in temperature :doc:`units <units>`. The vector
|
||||||
vector values will be in energy :doc:`units <units>`.
|
values are in energy :doc:`units <units>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
@ -119,7 +124,10 @@ Restrictions
|
|||||||
Related commands
|
Related commands
|
||||||
""""""""""""""""
|
""""""""""""""""
|
||||||
|
|
||||||
:doc:`compute temp <compute_temp>`, :doc:`compute temp/profie <compute_temp_profile>`, :doc:`compute temp/deform <compute_temp_deform>`, :doc:`compute pressure <compute_pressure>`
|
:doc:`compute temp <compute_temp>`,
|
||||||
|
:doc:`compute temp/profile <compute_temp_profile>`,
|
||||||
|
:doc:`compute temp/deform <compute_temp_deform>`,
|
||||||
|
:doc:`compute pressure <compute_pressure>`
|
||||||
|
|
||||||
Default
|
Default
|
||||||
"""""""
|
"""""""
|
||||||
|
|||||||
@ -49,12 +49,17 @@ where KE = is the total kinetic energy of the group of atoms (sum of
|
|||||||
:math:`N` is the number of atoms in both the group and region, :math:`k_B` is
|
:math:`N` is the number of atoms in both the group and region, :math:`k_B` is
|
||||||
the Boltzmann constant, and :math:`T` temperature.
|
the Boltzmann constant, and :math:`T` temperature.
|
||||||
|
|
||||||
A kinetic energy tensor, stored as a six-element vector, is also
|
A symmetric tensor, stored as a six-element vector, is also calculated
|
||||||
calculated by this compute for use in the computation of a pressure
|
by this compute for use in the computation of a pressure tensor by the
|
||||||
tensor. The formula for the components of the tensor is the same as
|
:doc:`compute pressue <compute_pressure>` command. The formula for
|
||||||
the above formula, except that :math:`v^2` is replaced by :math:`v_x v_y`
|
the components of the tensor is the same as the above expression for
|
||||||
for the :math:`xy` component, and so on. The six components of the vector are
|
:math:`E_\mathrm{kin}`, except that the 1/2 factor is NOT included and
|
||||||
ordered :math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
|
the :math:`v_i^2` is replaced by :math:`v_{i,x} v_{i,y}` for the
|
||||||
|
:math:`xy` component, and so on. Note that because it lacks the 1/2
|
||||||
|
factor, these tensor components are twice those of the traditional
|
||||||
|
kinetic energy tensor. The six components of the vector are ordered
|
||||||
|
:math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`,
|
||||||
|
:math:`yz`.
|
||||||
|
|
||||||
The number of atoms contributing to the temperature is calculated each
|
The number of atoms contributing to the temperature is calculated each
|
||||||
time the temperature is evaluated since it is assumed atoms can
|
time the temperature is evaluated since it is assumed atoms can
|
||||||
@ -78,12 +83,13 @@ will operate only on atoms that are currently in the geometric region.
|
|||||||
|
|
||||||
Unlike other compute styles that calculate temperature, this compute
|
Unlike other compute styles that calculate temperature, this compute
|
||||||
does not subtract out degrees-of-freedom due to fixes that constrain
|
does not subtract out degrees-of-freedom due to fixes that constrain
|
||||||
motion, such as :doc:`fix shake <fix_shake>` and :doc:`fix rigid <fix_rigid>`. This is because those degrees of freedom
|
motion, such as :doc:`fix shake <fix_shake>` and :doc:`fix rigid
|
||||||
(e.g., a constrained bond) could apply to sets of atoms that straddle
|
<fix_rigid>`. This is because those degrees of freedom (e.g., a
|
||||||
the region boundary, and hence the concept is somewhat ill-defined.
|
constrained bond) could apply to sets of atoms that straddle the
|
||||||
If needed the number of subtracted degrees of freedom can be set
|
region boundary, and hence the concept is somewhat ill-defined. If
|
||||||
explicitly using the *extra* option of the
|
needed the number of subtracted degrees of freedom can be set
|
||||||
:doc:`compute_modify <compute_modify>` command.
|
explicitly using the *extra* option of the :doc:`compute_modify
|
||||||
|
<compute_modify>` command.
|
||||||
|
|
||||||
See the :doc:`Howto thermostat <Howto_thermostat>` page for a
|
See the :doc:`Howto thermostat <Howto_thermostat>` page for a
|
||||||
discussion of different ways to compute temperature and perform
|
discussion of different ways to compute temperature and perform
|
||||||
@ -93,17 +99,17 @@ Output info
|
|||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
This compute calculates a global scalar (the temperature) and a global
|
This compute calculates a global scalar (the temperature) and a global
|
||||||
vector of length 6 (KE tensor), which can be accessed by indices 1--6.
|
vector of length 6 (symmetric tensor), which can be accessed by
|
||||||
These values can be used by any command that uses global scalar or
|
indices 1--6. These values can be used by any command that uses
|
||||||
vector values from a compute as input. See the
|
global scalar or vector values from a compute as input. See the
|
||||||
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
|
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS
|
||||||
options.
|
output options.
|
||||||
|
|
||||||
The scalar value calculated by this compute is "intensive". The
|
The scalar value calculated by this compute is "intensive". The
|
||||||
vector values are "extensive".
|
vector values are "extensive".
|
||||||
|
|
||||||
The scalar value will be in temperature :doc:`units <units>`.
|
The scalar value is in temperature :doc:`units <units>`. The vector
|
||||||
The vector values will be in energy :doc:`units <units>`.
|
values are in energy :doc:`units <units>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -32,32 +32,33 @@ temperature (e.g., :doc:`thermo_modify <thermo_modify>`).
|
|||||||
|
|
||||||
The operation of this compute is exactly like that described by the
|
The operation of this compute is exactly like that described by the
|
||||||
:doc:`compute temp/region <compute_temp_region>` command, except that
|
:doc:`compute temp/region <compute_temp_region>` command, except that
|
||||||
the formula for the temperature itself includes the radial electron
|
the formulas for the temperature (scalar) and diagonal components of
|
||||||
velocity contributions, as discussed by the
|
the symmetric tensor (vector) include the radial electron velocity
|
||||||
:doc:`compute temp/eff <compute_temp_eff>` command.
|
contributions, as discussed by the :doc:`compute temp/eff
|
||||||
|
<compute_temp_eff>` command.
|
||||||
|
|
||||||
Output info
|
Output info
|
||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
This compute calculates a global scalar (the temperature) and a global
|
This compute calculates a global scalar (the temperature) and a global
|
||||||
vector of length 6 (KE tensor), which can be accessed by indices 1--6.
|
vector of length 6 (symmetric tensor), which can be accessed by
|
||||||
These values can be used by any command that uses global scalar or
|
indices 1--6. These values can be used by any command that uses
|
||||||
vector values from a compute as input. See the
|
global scalar or vector values from a compute as input. See the
|
||||||
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
|
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS
|
||||||
options.
|
output options.
|
||||||
|
|
||||||
The scalar value calculated by this compute is "intensive". The
|
The scalar value calculated by this compute is "intensive". The
|
||||||
vector values are "extensive".
|
vector values are "extensive".
|
||||||
|
|
||||||
The scalar value will be in temperature :doc:`units <units>`. The
|
The scalar value is in temperature :doc:`units <units>`. The vector
|
||||||
vector values will be in energy :doc:`units <units>`.
|
values are in energy :doc:`units <units>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|
||||||
This compute is part of the EFF package. It is only enabled if
|
This compute is part of the EFF package. It is only enabled if LAMMPS
|
||||||
LAMMPS was built with that package.
|
was built with that package. See the :doc:`Build package
|
||||||
See the :doc:`Build package <Build_package>` page for more info.
|
<Build_package>` page for more info.
|
||||||
|
|
||||||
Related commands
|
Related commands
|
||||||
""""""""""""""""
|
""""""""""""""""
|
||||||
|
|||||||
@ -43,12 +43,17 @@ where KE is the total kinetic energy of the group of atoms (sum of
|
|||||||
:math:`N` is the number of atoms in the group, :math:`k_B` is the Boltzmann
|
:math:`N` is the number of atoms in the group, :math:`k_B` is the Boltzmann
|
||||||
constant, and :math:`T` is the absolute temperature.
|
constant, and :math:`T` is the absolute temperature.
|
||||||
|
|
||||||
A kinetic energy tensor, stored as a six-element vector, is also calculated by
|
A symmetric tensor, stored as a six-element vector, is also calculated
|
||||||
this compute for use in the computation of a pressure tensor. The formula for
|
by this compute for use in the computation of a pressure tensor by the
|
||||||
the components of the tensor is the same as the above formula, except that
|
:doc:`compute pressue <compute_pressure>` command. The formula for
|
||||||
:math:`v^2` is replaced by :math:`v_x v_y` for the :math:`xy` component, and
|
the components of the tensor is the same as the above expression for
|
||||||
so on. The six components of the vector are ordered :math:`xx`, :math:`yy`,
|
:math:`E_\mathrm{kin}`, except that the 1/2 factor is NOT included and
|
||||||
:math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
|
the :math:`v_i^2` is replaced by :math:`v_{i,x} v_{i,y}` for the
|
||||||
|
:math:`xy` component, and so on. Note that because it lacks the 1/2
|
||||||
|
factor, these tensor components are twice those of the traditional
|
||||||
|
kinetic energy tensor. The six components of the vector are ordered
|
||||||
|
:math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`,
|
||||||
|
:math:`yz`.
|
||||||
|
|
||||||
The number of atoms contributing to the temperature is assumed to be
|
The number of atoms contributing to the temperature is assumed to be
|
||||||
constant for the duration of the run; use the *dynamic* option of the
|
constant for the duration of the run; use the *dynamic* option of the
|
||||||
@ -80,17 +85,16 @@ Output info
|
|||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
This compute calculates a global scalar (the temperature) and a global
|
This compute calculates a global scalar (the temperature) and a global
|
||||||
vector of length 6 (KE tensor), which can be accessed by indices 1-6.
|
vector of length 6 (symmetric tensor), which can be accessed by
|
||||||
These values can be used by any command that uses global scalar or
|
indices 1-6. These values can be used by any command that uses global
|
||||||
vector values from a compute as input. See the
|
scalar or vector values from a compute as input. See the :doc:`Howto
|
||||||
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS output
|
output <Howto_output>` page for an overview of LAMMPS output options.
|
||||||
options.
|
|
||||||
|
|
||||||
The scalar value calculated by this compute is "intensive". The
|
The scalar value calculated by this compute is "intensive". The
|
||||||
vector values are "extensive".
|
vector values are "extensive".
|
||||||
|
|
||||||
The scalar value will be in temperature :doc:`units <units>`. The
|
The scalar value is in temperature :doc:`units <units>`. The vector
|
||||||
vector values will be in energy :doc:`units <units>`.
|
values are in energy :doc:`units <units>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -77,6 +77,18 @@ tensor is the same as the above formulas, except that :math:`v^2` and
|
|||||||
vector are ordered :math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`,
|
vector are ordered :math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`,
|
||||||
:math:`xz`, :math:`yz`.
|
:math:`xz`, :math:`yz`.
|
||||||
|
|
||||||
|
A symmetric tensor, stored as a six-element vector, is also calculated
|
||||||
|
by this compute for use in the computation of a pressure tensor by the
|
||||||
|
:doc:`compute pressue <compute_pressure>` command. The formula for
|
||||||
|
the components of the tensor is the same as the above expression for
|
||||||
|
:math:`E_\mathrm{kin}`, except that the 1/2 factor is NOT included and
|
||||||
|
the :math:`v_i^2` and :math:`\omega^2` are replaced by :math:`v_x v_y`
|
||||||
|
and :math:`\omega_x \omega_y` for the :math:`xy` component, and so on.
|
||||||
|
Note that because it lacks the 1/2 factor, these tensor components are
|
||||||
|
twice those of the traditional kinetic energy tensor. The six
|
||||||
|
components of the vector are ordered :math:`xx`, :math:`yy`,
|
||||||
|
:math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
|
||||||
|
|
||||||
The number of atoms contributing to the temperature is assumed to be
|
The number of atoms contributing to the temperature is assumed to be
|
||||||
constant for the duration of the run; use the *dynamic* option of the
|
constant for the duration of the run; use the *dynamic* option of the
|
||||||
:doc:`compute_modify <compute_modify>` command if this is not the case.
|
:doc:`compute_modify <compute_modify>` command if this is not the case.
|
||||||
@ -117,17 +129,17 @@ Output info
|
|||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
This compute calculates a global scalar (the temperature) and a global
|
This compute calculates a global scalar (the temperature) and a global
|
||||||
vector of length 6 (KE tensor), which can be accessed by indices 1--6.
|
vector of length 6 (symmetric tensor), which can be accessed by
|
||||||
These values can be used by any command that uses global scalar or
|
indices 1--6. These values can be used by any command that uses
|
||||||
vector values from a compute as input.
|
global scalar or vector values from a compute as input. See the
|
||||||
See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS
|
:doc:`Howto output <Howto_output>` page for an overview of LAMMPS
|
||||||
output options.
|
output options.
|
||||||
|
|
||||||
The scalar value calculated by this compute is "intensive". The
|
The scalar value calculated by this compute is "intensive". The
|
||||||
vector values are "extensive".
|
vector values are "extensive".
|
||||||
|
|
||||||
The scalar value will be in temperature :doc:`units <units>`. The
|
The scalar value is in temperature :doc:`units <units>`. The vector
|
||||||
vector values will be in energy :doc:`units <units>`.
|
values are in energy :doc:`units <units>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -86,12 +86,17 @@ where KE is the total kinetic energy of the group of atoms (sum of
|
|||||||
:math:`N` is the number of atoms in the group, :math:`k_B` is the Boltzmann
|
:math:`N` is the number of atoms in the group, :math:`k_B` is the Boltzmann
|
||||||
constant, and :math:`T` is the absolute temperature.
|
constant, and :math:`T` is the absolute temperature.
|
||||||
|
|
||||||
A kinetic energy tensor, stored as a six-element vector, is also
|
A symmetric tensor, stored as a six-element vector, is also calculated
|
||||||
calculated by this compute for use in the computation of a pressure
|
by this compute for use in the computation of a pressure tensor by the
|
||||||
tensor. The formula for the components of the tensor is the same as
|
:doc:`compute pressue <compute_pressure>` command. The formula for
|
||||||
the above formula, except that :math:`v^2` is replaced by :math:`v_x v_y` for
|
the components of the tensor is the same as the above expression for
|
||||||
the :math:`xy` component, and so on. The six components of the vector are
|
:math:`E_\mathrm{kin}`, except that the 1/2 factor is NOT included and
|
||||||
ordered :math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`, :math:`yz`.
|
the :math:`v_i^2` is replaced by :math:`v_{i,x} v_{i,y}` for the
|
||||||
|
:math:`xy` component, and so on. Note that because it lacks the 1/2
|
||||||
|
factor, these tensor components are twice those of the traditional
|
||||||
|
kinetic energy tensor. The six components of the vector are ordered
|
||||||
|
:math:`xx`, :math:`yy`, :math:`zz`, :math:`xy`, :math:`xz`,
|
||||||
|
:math:`yz`.
|
||||||
|
|
||||||
The number of atoms contributing to the temperature is assumed to be
|
The number of atoms contributing to the temperature is assumed to be
|
||||||
constant for the duration of the run; use the *dynamic* option of the
|
constant for the duration of the run; use the *dynamic* option of the
|
||||||
@ -126,21 +131,21 @@ Output info
|
|||||||
"""""""""""
|
"""""""""""
|
||||||
|
|
||||||
This compute calculates a global scalar (the temperature) and a global
|
This compute calculates a global scalar (the temperature) and a global
|
||||||
vector of length 7, which can be accessed by indices 1--7.
|
vector of length 7, which can be accessed by indices 1--7. The first
|
||||||
The first six elements of the vector are the KE tensor,
|
six elements of the vector are those of the symmetric tensor discussed
|
||||||
and the seventh is the cosine-shaped velocity amplitude :math:`V`,
|
above. The seventh is the cosine-shaped velocity amplitude :math:`V`,
|
||||||
which can be used to calculate the reciprocal viscosity, as shown in the example.
|
which can be used to calculate the reciprocal viscosity, as shown in
|
||||||
These values can be used by any command that uses global scalar or
|
the example. These values can be used by any command that uses global
|
||||||
vector values from a compute as input.
|
scalar or vector values from a compute as input. See the :doc:`Howto
|
||||||
See the :doc:`Howto output <Howto_output>` page for an overview of LAMMPS output options.
|
output <Howto_output>` page for an overview of LAMMPS output options.
|
||||||
|
|
||||||
The scalar value calculated by this compute is "intensive". The
|
The scalar value calculated by this compute is "intensive". The
|
||||||
first six elements of vector values are "extensive",
|
first six elements of vector values are "extensive",
|
||||||
and the seventh element of vector values is "intensive".
|
and the seventh element of vector values is "intensive".
|
||||||
|
|
||||||
The scalar value will be in temperature :doc:`units <units>`.
|
The scalar value is in temperature :doc:`units <units>`. The first
|
||||||
The first six elements of vector values will be in energy :doc:`units <units>`.
|
six elements of vector values are in energy :doc:`units <units>`. The
|
||||||
The seventh element of vector value will be in velocity :doc:`units <units>`.
|
seventh element of vector value us in velocity :doc:`units <units>`.
|
||||||
|
|
||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|||||||
@ -785,3 +785,7 @@ reset_mol_ids = yes, custom_charges = no, molecule = off, modify_create = *fit a
|
|||||||
.. _Gissinger2020:
|
.. _Gissinger2020:
|
||||||
|
|
||||||
**(Gissinger2020)** Gissinger, Jensen and Wise, Macromolecules, 53, 22, 9953-9961 (2020).
|
**(Gissinger2020)** Gissinger, Jensen and Wise, Macromolecules, 53, 22, 9953-9961 (2020).
|
||||||
|
|
||||||
|
.. _Gissinger2024:
|
||||||
|
|
||||||
|
**(Gissinger2024)** Gissinger, Jensen and Wise, Computer Physics Communications, 304, 109287 (2024).
|
||||||
|
|||||||
@ -4130,6 +4130,7 @@ Xiaowang
|
|||||||
Xie
|
Xie
|
||||||
xk
|
xk
|
||||||
xlat
|
xlat
|
||||||
|
xlattice
|
||||||
xlo
|
xlo
|
||||||
xmax
|
xmax
|
||||||
Xmax
|
Xmax
|
||||||
@ -4181,6 +4182,7 @@ yflag
|
|||||||
yhi
|
yhi
|
||||||
yi
|
yi
|
||||||
ylat
|
ylat
|
||||||
|
ylattice
|
||||||
ylo
|
ylo
|
||||||
ylz
|
ylz
|
||||||
ymax
|
ymax
|
||||||
@ -4229,6 +4231,7 @@ Ziegenhain
|
|||||||
zincblende
|
zincblende
|
||||||
zj
|
zj
|
||||||
Zj
|
Zj
|
||||||
|
zlattice
|
||||||
zlim
|
zlim
|
||||||
zlo
|
zlo
|
||||||
Zm
|
Zm
|
||||||
|
|||||||
@ -41,7 +41,6 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
liblammpsplugin_t *liblammpsplugin_load(const char *lib)
|
liblammpsplugin_t *liblammpsplugin_load(const char *lib)
|
||||||
{
|
{
|
||||||
liblammpsplugin_t *lmp;
|
liblammpsplugin_t *lmp;
|
||||||
@ -191,6 +190,9 @@ liblammpsplugin_t *liblammpsplugin_load(const char *lib)
|
|||||||
ADDSYM(is_running);
|
ADDSYM(is_running);
|
||||||
ADDSYM(force_timeout);
|
ADDSYM(force_timeout);
|
||||||
|
|
||||||
|
// symbol not present
|
||||||
|
if (!lmp->config_has_exceptions) return NULL;
|
||||||
|
|
||||||
lmp->has_exceptions = lmp->config_has_exceptions();
|
lmp->has_exceptions = lmp->config_has_exceptions();
|
||||||
if (lmp->has_exceptions) {
|
if (lmp->has_exceptions) {
|
||||||
ADDSYM(has_error);
|
ADDSYM(has_error);
|
||||||
|
|||||||
@ -39,7 +39,7 @@ InstallDir "$LOCALAPPDATA\${PACEPLUGIN}"
|
|||||||
|
|
||||||
ShowInstDetails show
|
ShowInstDetails show
|
||||||
ShowUninstDetails show
|
ShowUninstDetails show
|
||||||
SetCompressor lzma
|
SetCompressor zlib
|
||||||
|
|
||||||
!define MUI_ABORTWARNING
|
!define MUI_ABORTWARNING
|
||||||
|
|
||||||
|
|||||||
59
examples/PACKAGES/plumed/plugin/CMakeLists.txt
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
# -*- CMake -*- build system for plugin examples.
|
||||||
|
# The is meant to be used as a template for plugins that are
|
||||||
|
# distributed independent from the LAMMPS package.
|
||||||
|
##########################################
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
|
project(plumedplugin VERSION 1.0 LANGUAGES CXX)
|
||||||
|
|
||||||
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
include(CheckIncludeFileCXX)
|
||||||
|
include(LAMMPSInterfacePlugin)
|
||||||
|
include(PLUMED)
|
||||||
|
|
||||||
|
##########################
|
||||||
|
# building the plugins
|
||||||
|
|
||||||
|
add_library(plumedplugin MODULE plumedplugin.cpp ${LAMMPS_SOURCE_DIR}/PLUMED/fix_plumed.cpp)
|
||||||
|
target_link_libraries(plumedplugin PRIVATE LAMMPS::PLUMED)
|
||||||
|
target_link_libraries(plumedplugin PRIVATE lammps)
|
||||||
|
target_include_directories(plumedplugin PRIVATE ${LAMMPS_SOURCE_DIR}/PLUMED)
|
||||||
|
set_target_properties(plumedplugin PROPERTIES PREFIX "" SUFFIX ".so")
|
||||||
|
|
||||||
|
# MacOS seems to need this
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
|
||||||
|
set_target_properties(plumedplugin PROPERTIES LINK_FLAGS "-Wl,-undefined,dynamic_lookup")
|
||||||
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
# tell CMake to export all symbols to a .dll on Windows with special case for MinGW cross-compilers
|
||||||
|
set_target_properties(plumedplugin PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
||||||
|
if(CMAKE_CROSSCOMPILING)
|
||||||
|
set_target_properties(plumedplugin PROPERTIES LINK_FLAGS "-Wl,--export-all-symbols")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
get_lammps_version(${LAMMPS_SOURCE_DIR}/version.h LAMMPS_VERSION)
|
||||||
|
find_program(MAKENSIS_PATH makensis)
|
||||||
|
if(MAKENSIS_PATH)
|
||||||
|
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/lammps.ico
|
||||||
|
${CMAKE_SOURCE_DIR}/lammps-text-logo-wide.bmp ${CMAKE_SOURCE_DIR}/plumedplugin.nsis
|
||||||
|
${CMAKE_BINARY_DIR})
|
||||||
|
if(BUILD_MPI)
|
||||||
|
if(USE_MSMPI)
|
||||||
|
add_custom_target(package ${MAKENSIS_PATH} -V1 -DVERSION=${LAMMPS_VERSION}-MSMPI plumedplugin.nsis
|
||||||
|
DEPENDS plumedplugin plumed_copy lammps.ico lammps-text-logo-wide.bmp plumedplugin.nsis
|
||||||
|
BYPRODUCTS LAMMPS-PLUMED-plugin-${LAMMPS_VERSION}-MSMPI.exe)
|
||||||
|
else()
|
||||||
|
add_custom_target(package ${MAKENSIS_PATH} -V1 -DVERSION=${LAMMPS_VERSION}-MPI plumedplugin.nsis
|
||||||
|
DEPENDS plumedplugin plumed_copy lammps.ico lammps-text-logo-wide.bmp plumedplugin.nsis
|
||||||
|
BYPRODUCTS LAMMPS-PLUMED-plugin-${LAMMPS_VERSION}-MPI.exe)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
add_custom_target(package ${MAKENSIS_PATH} -V1 -DVERSION=${LAMMPS_VERSION} plumedplugin.nsis
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E echo ${PWD}
|
||||||
|
DEPENDS plumedplugin plumed_copy lammps.ico lammps-text-logo-wide.bmp plumedplugin.nsis
|
||||||
|
BYPRODUCTS LAMMPS-PLUMED-plugin-${LAMMPS_VERSION}.exe)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
set_target_properties(plumedplugin PROPERTIES LINK_FLAGS "-rdynamic")
|
||||||
|
endif()
|
||||||
1
examples/PACKAGES/plumed/plugin/LAMMPSInterfacePlugin.cmake
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../cmake/Modules/LAMMPSInterfacePlugin.cmake
|
||||||
1
examples/PACKAGES/plumed/plugin/PLUMED.cmake
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../../../cmake/Modules/Packages/PLUMED.cmake
|
||||||
2
examples/PACKAGES/plumed/plugin/README.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
This folder contains a loader and support files to build the PLUMED package as plugin.
|
||||||
|
For more information please see: https://docs.lammps.org/Developer_plugins.html
|
||||||
BIN
examples/PACKAGES/plumed/plugin/lammps-text-logo-wide.bmp
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
examples/PACKAGES/plumed/plugin/lammps.ico
Normal file
|
After Width: | Height: | Size: 204 KiB |
28
examples/PACKAGES/plumed/plugin/plumedplugin.cpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
#include "lammpsplugin.h"
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
|
#include "fix_plumed.h"
|
||||||
|
|
||||||
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
|
static Fix *fix_plumed_creator(LAMMPS *lmp, int argc, char **argv)
|
||||||
|
{
|
||||||
|
return new FixPlumed(lmp, argc, argv);
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" void lammpsplugin_init(void *lmp, void *handle, void *regfunc)
|
||||||
|
{
|
||||||
|
lammpsplugin_t plugin;
|
||||||
|
lammpsplugin_regfunc register_plugin = (lammpsplugin_regfunc) regfunc;
|
||||||
|
|
||||||
|
// register plumed fix style
|
||||||
|
plugin.version = LAMMPS_VERSION;
|
||||||
|
plugin.style = "fix";
|
||||||
|
plugin.name = "plumed";
|
||||||
|
plugin.info = "Plumed2 plugin fix style v1.0";
|
||||||
|
plugin.author = "Axel Kohlmeyer (akohlmey@gmail.com)";
|
||||||
|
plugin.creator.v1 = (lammpsplugin_factory1 *) &fix_plumed_creator;
|
||||||
|
plugin.handle = handle;
|
||||||
|
(*register_plugin)(&plugin, lmp);
|
||||||
|
}
|
||||||
172
examples/PACKAGES/plumed/plugin/plumedplugin.nsis
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
#!Nsis Installer Command Script
|
||||||
|
#
|
||||||
|
# The following external defines are recognized:
|
||||||
|
# ${VERSION} = YYYYMMDD
|
||||||
|
|
||||||
|
!include "MUI2.nsh"
|
||||||
|
!include "FileFunc.nsh"
|
||||||
|
|
||||||
|
!define MUI_ICON "lammps.ico"
|
||||||
|
!define MUI_UNICON "lammps.ico"
|
||||||
|
!define MUI_HEADERIMAGE
|
||||||
|
!define MUI_HEADERIMAGE_BITMAP "lammps-text-logo-wide.bmp"
|
||||||
|
!define MUI_HEADERIMAGE_RIGHT
|
||||||
|
|
||||||
|
Unicode true
|
||||||
|
XPStyle on
|
||||||
|
|
||||||
|
!include "LogicLib.nsh"
|
||||||
|
!addplugindir "envvar/Plugins/x86-unicode"
|
||||||
|
!include "x64.nsh"
|
||||||
|
|
||||||
|
RequestExecutionLevel user
|
||||||
|
|
||||||
|
!macro VerifyUserIsAdmin
|
||||||
|
UserInfo::GetAccountType
|
||||||
|
pop $0
|
||||||
|
${If} $0 != "admin"
|
||||||
|
messageBox mb_iconstop "Administrator rights required!"
|
||||||
|
setErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
|
||||||
|
quit
|
||||||
|
${EndIf}
|
||||||
|
!macroend
|
||||||
|
|
||||||
|
!define PLUMEDPLUGIN "LAMMPS PLUMED Plugin ${VERSION}"
|
||||||
|
OutFile "LAMMPS-PLUMED-plugin-${VERSION}.exe"
|
||||||
|
|
||||||
|
Name "${PLUMEDPLUGIN}"
|
||||||
|
InstallDir "$LOCALAPPDATA\${PLUMEDPLUGIN}"
|
||||||
|
|
||||||
|
ShowInstDetails show
|
||||||
|
ShowUninstDetails show
|
||||||
|
SetCompressor zlib
|
||||||
|
|
||||||
|
!define MUI_ABORTWARNING
|
||||||
|
|
||||||
|
!insertmacro MUI_PAGE_DIRECTORY
|
||||||
|
!insertmacro MUI_PAGE_INSTFILES
|
||||||
|
|
||||||
|
!insertmacro MUI_UNPAGE_CONFIRM
|
||||||
|
!insertmacro MUI_UNPAGE_INSTFILES
|
||||||
|
|
||||||
|
!insertmacro MUI_LANGUAGE "English"
|
||||||
|
|
||||||
|
function .onInit
|
||||||
|
# Determine if LAMMPS was already installed and check whether it was in 32-bit
|
||||||
|
# or 64-bit. Then look up path to uninstaller and offer to uninstall or quit
|
||||||
|
SetRegView 32
|
||||||
|
ReadRegDWORD $0 HKCU "Software\LAMMPS-PLUMED" "Bits"
|
||||||
|
SetRegView LastUsed
|
||||||
|
${If} $0 == "32"
|
||||||
|
SetRegView 32
|
||||||
|
${ElseIf} $0 == "64"
|
||||||
|
SetRegView 64
|
||||||
|
${Else}
|
||||||
|
SetRegView 64
|
||||||
|
${EndIf}
|
||||||
|
ClearErrors
|
||||||
|
ReadRegStr $R0 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" "UninstallString"
|
||||||
|
SetRegView LastUsed
|
||||||
|
${If} ${Errors}
|
||||||
|
DetailPrint "LAMMPS PLUMED plugin not (yet) installed"
|
||||||
|
${Else}
|
||||||
|
MessageBox MB_YESNO "LAMMPS PLUMED plugin ($0 bit) is already installed. Uninstall existing version?" /SD IDYES IDNO Quit
|
||||||
|
Pop $R1
|
||||||
|
StrCmp $R1 2 Quit +1
|
||||||
|
Exec $R0
|
||||||
|
Quit:
|
||||||
|
Quit
|
||||||
|
${EndIf}
|
||||||
|
setShellVarContext all
|
||||||
|
functionEnd
|
||||||
|
|
||||||
|
Section "${PLUMEDPLUGIN}" SecPlumedplugin
|
||||||
|
SectionIn RO
|
||||||
|
# Write LAMMPS installation bitness marker. Always use 32-bit registry view
|
||||||
|
SetRegView 32
|
||||||
|
IntFmt $0 "0x%08X" 64
|
||||||
|
WriteRegDWORD HKCU "Software\LAMMPS-PLUMED" "Bits" $0
|
||||||
|
|
||||||
|
# Switch to "native" registry view
|
||||||
|
SetRegView 64
|
||||||
|
SetShellVarContext current
|
||||||
|
|
||||||
|
SetOutPath "$INSTDIR"
|
||||||
|
CreateDirectory "$INSTDIR\patches"
|
||||||
|
CreateDirectory "$INSTDIR\bin"
|
||||||
|
File lammps.ico
|
||||||
|
File plumedplugin.so
|
||||||
|
|
||||||
|
SetOutPath "$INSTDIR\bin"
|
||||||
|
File plumed.exe
|
||||||
|
|
||||||
|
# Register Application and its uninstaller
|
||||||
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||||
|
"DisplayName" "${PLUMEDPLUGIN}"
|
||||||
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||||
|
"Publisher" "The LAMMPS and PLUMED Developers"
|
||||||
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||||
|
"URLInfoAbout" "lammps.org"
|
||||||
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||||
|
"DisplayIcon" "$INSTDIR\lammps.ico"
|
||||||
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||||
|
"DisplayVersion" "${VERSION}"
|
||||||
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||||
|
"InstallLocation" "$INSTDIR"
|
||||||
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||||
|
"UninstallString" "$\"$INSTDIR\uninstall.exe$\""
|
||||||
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||||
|
"QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
|
||||||
|
|
||||||
|
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
|
||||||
|
IntFmt $0 "0x%08X" $0
|
||||||
|
WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED" \
|
||||||
|
"EstimatedSize" "$0"
|
||||||
|
|
||||||
|
# update path variables
|
||||||
|
EnVar::SetHKCU
|
||||||
|
# add plumed executable path
|
||||||
|
EnVar::AddValue "PATH" "$INSTDIR\bin"
|
||||||
|
# add to LAMMPS plugin search path
|
||||||
|
EnVar::AddValue "LAMMPS_PLUGIN_PATH" "$INSTDIR"
|
||||||
|
# add plumed2 patch files
|
||||||
|
EnVar::AddValue "PLUMED_ROOT" "$INSTDIR"
|
||||||
|
|
||||||
|
WriteUninstaller "$INSTDIR\Uninstall.exe"
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
function un.onInit
|
||||||
|
SetShellVarContext current
|
||||||
|
functionEnd
|
||||||
|
|
||||||
|
Section "Uninstall"
|
||||||
|
# remove LAMMPS bitness/installation indicator always in 32-bit registry view
|
||||||
|
SetRegView 32
|
||||||
|
DeleteRegKey HKCU "Software\LAMMPS-PLUMED"
|
||||||
|
|
||||||
|
# unregister extension, and uninstall info
|
||||||
|
SetRegView 64
|
||||||
|
SetShellVarContext current
|
||||||
|
# unregister installation
|
||||||
|
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\LAMMPS-PLUMED"
|
||||||
|
|
||||||
|
# update path variables
|
||||||
|
EnVar::SetHKCU
|
||||||
|
# remove plumed executable path
|
||||||
|
EnVar::DeleteValue "PATH" "$INSTDIR\bin"
|
||||||
|
# remove entry from LAMMPS plugin search path
|
||||||
|
EnVar::DeleteValue "LAMMPS_PLUGIN_PATH" "$INSTDIR"
|
||||||
|
# remove plumed patch environment
|
||||||
|
EnVar::Delete "PLUMED_ROOT"
|
||||||
|
|
||||||
|
RMDir /r /REBOOTOK "$INSTDIR\patches"
|
||||||
|
RMDir /r /REBOOTOK "$INSTDIR\bin"
|
||||||
|
Delete /REBOOTOK "$INSTDIR\plumedplugin.so"
|
||||||
|
Delete /REBOOTOK "$INSTDIR\Uninstall.exe"
|
||||||
|
Delete /REBOOTOK "$INSTDIR\lammps.ico"
|
||||||
|
RMDir /REBOOTOK "$INSTDIR"
|
||||||
|
SectionEnd
|
||||||
|
|
||||||
|
# Local Variables:
|
||||||
|
# mode: sh
|
||||||
|
# End:
|
||||||
@ -44,6 +44,7 @@ thermo 50
|
|||||||
fix myrxns all bond/react stabilization yes statted_grp .03 &
|
fix myrxns all bond/react stabilization yes statted_grp .03 &
|
||||||
react rxn1 all 1 0.0 2.9 mol1 mol2 rxn1_stp1_map &
|
react rxn1 all 1 0.0 2.9 mol1 mol2 rxn1_stp1_map &
|
||||||
react rxn2 all 1 0.0 5.0 mol3 mol4 rxn1_stp2_map
|
react rxn2 all 1 0.0 5.0 mol3 mol4 rxn1_stp2_map
|
||||||
|
react rxn2 all 1 0.0 5.0 mol3 mol4 rxn1_stp2_map rescale_charges yes
|
||||||
|
|
||||||
fix 1 statted_grp_REACT nvt temp 300 300 100
|
fix 1 statted_grp_REACT nvt temp 300 300 100
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ thermo 50
|
|||||||
|
|
||||||
fix myrxns all bond/react stabilization yes statted_grp .03 &
|
fix myrxns all bond/react stabilization yes statted_grp .03 &
|
||||||
react rxn1 all 1 0.0 5.0 mol1 mol2 rxn1_stp1_map prob v_prob1 1234 &
|
react rxn1 all 1 0.0 5.0 mol1 mol2 rxn1_stp1_map prob v_prob1 1234 &
|
||||||
react rxn2 all 1 0.0 5.0 mol3 mol4 rxn1_stp2_map prob v_prob2 1234
|
react rxn2 all 1 0.0 5.0 mol3 mol4 rxn1_stp2_map prob v_prob2 1234 rescale_charges yes
|
||||||
|
|
||||||
fix 1 statted_grp_REACT nvt temp 300 300 100
|
fix 1 statted_grp_REACT nvt temp 300 300 100
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,7 @@ thermo 50
|
|||||||
|
|
||||||
fix myrxns all bond/react stabilization no &
|
fix myrxns all bond/react stabilization no &
|
||||||
react rxn1 all 1 0.0 2.9 mol1 mol2 rxn1_stp1_map &
|
react rxn1 all 1 0.0 2.9 mol1 mol2 rxn1_stp1_map &
|
||||||
react rxn2 all 1 0.0 5.0 mol3 mol4 rxn1_stp2_map
|
react rxn2 all 1 0.0 5.0 mol3 mol4 rxn1_stp2_map rescale_charges yes
|
||||||
|
|
||||||
fix 1 all nve/limit .03
|
fix 1 all nve/limit .03
|
||||||
|
|
||||||
|
|||||||
@ -48,27 +48,6 @@ Types
|
|||||||
17 hc
|
17 hc
|
||||||
18 hc
|
18 hc
|
||||||
|
|
||||||
Charges
|
|
||||||
|
|
||||||
1 -0.300000
|
|
||||||
2 0.000000
|
|
||||||
3 0.000000
|
|
||||||
4 0.000000
|
|
||||||
5 0.000000
|
|
||||||
6 0.000000
|
|
||||||
7 0.000000
|
|
||||||
8 0.000000
|
|
||||||
9 0.000000
|
|
||||||
10 0.300000
|
|
||||||
11 0.000000
|
|
||||||
12 0.000000
|
|
||||||
13 0.000000
|
|
||||||
14 0.000000
|
|
||||||
15 0.000000
|
|
||||||
16 0.000000
|
|
||||||
17 0.000000
|
|
||||||
18 0.000000
|
|
||||||
|
|
||||||
Molecules
|
Molecules
|
||||||
|
|
||||||
1 1
|
1 1
|
||||||
|
|||||||
@ -44,21 +44,21 @@ Types
|
|||||||
|
|
||||||
Charges
|
Charges
|
||||||
|
|
||||||
1 -0.300000
|
1 -0.60533
|
||||||
2 0.000000
|
2 -0.01149
|
||||||
3 0.000000
|
3 -0.76306
|
||||||
4 0.410000
|
4 0.38
|
||||||
5 0.000000
|
5 0.29346
|
||||||
6 0.000000
|
6 0.18360
|
||||||
7 0.000000
|
7 0.15396
|
||||||
8 0.000000
|
8 -0.72636
|
||||||
9 0.000000
|
9 -0.27437
|
||||||
10 0.300000
|
10 0.40603
|
||||||
11 0.000000
|
11 -0.65530
|
||||||
12 -0.820000
|
12 -0.76
|
||||||
13 0.000000
|
13 0.21423
|
||||||
14 0.000000
|
14 0.18949
|
||||||
15 0.410000
|
15 0.38
|
||||||
|
|
||||||
Molecules
|
Molecules
|
||||||
|
|
||||||
|
|||||||
@ -18,17 +18,17 @@
|
|||||||
|
|
||||||
#include "angle_class2.h"
|
#include "angle_class2.h"
|
||||||
|
|
||||||
#include <cmath>
|
|
||||||
#include <cstring>
|
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "neighbor.h"
|
|
||||||
#include "domain.h"
|
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
|
#include "domain.h"
|
||||||
|
#include "error.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "math_const.h"
|
#include "math_const.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "error.h"
|
#include "neighbor.h"
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
using namespace MathConst;
|
using namespace MathConst;
|
||||||
|
|||||||
@ -43,7 +43,6 @@ FFT3dKokkos<DeviceType>::FFT3dKokkos(LAMMPS *lmp, MPI_Comm comm, int nfast, int
|
|||||||
#if defined(LMP_KOKKOS_GPU)
|
#if defined(LMP_KOKKOS_GPU)
|
||||||
int ngpus = lmp->kokkos->ngpus;
|
int ngpus = lmp->kokkos->ngpus;
|
||||||
ExecutionSpace execution_space = ExecutionSpaceFromDevice<DeviceType>::space;
|
ExecutionSpace execution_space = ExecutionSpaceFromDevice<DeviceType>::space;
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(FFT_KOKKOS_MKL)
|
#if defined(FFT_KOKKOS_MKL)
|
||||||
if (ngpus > 0 && execution_space == Device)
|
if (ngpus > 0 && execution_space == Device)
|
||||||
@ -69,6 +68,8 @@ FFT3dKokkos<DeviceType>::FFT3dKokkos(LAMMPS *lmp, MPI_Comm comm, int nfast, int
|
|||||||
if (stack_size < 2048)
|
if (stack_size < 2048)
|
||||||
cudaDeviceSetLimit(cudaLimitStackSize,2048);
|
cudaDeviceSetLimit(cudaLimitStackSize,2048);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
plan = fft_3d_create_plan_kokkos(comm,nfast,nmid,nslow,
|
plan = fft_3d_create_plan_kokkos(comm,nfast,nmid,nslow,
|
||||||
|
|||||||
@ -1655,7 +1655,7 @@ double PairUF3Kokkos<DeviceType>::single(int /*i*/, int /*j*/, int itype, int jt
|
|||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
template class PairUF3Kokkos<LMPDeviceType>;
|
template class PairUF3Kokkos<LMPDeviceType>;
|
||||||
#ifdef KOKKOS_ENABLE_GPU
|
#ifdef LMP_KOKKOS_GPU
|
||||||
template class PairUF3Kokkos<LMPHostType>;
|
template class PairUF3Kokkos<LMPHostType>;
|
||||||
#endif
|
#endif
|
||||||
} // namespace LAMMPS_NS
|
} // namespace LAMMPS_NS
|
||||||
|
|||||||
@ -58,7 +58,7 @@ using namespace MathConst;
|
|||||||
|
|
||||||
static const char cite_fix_bond_react[] =
|
static const char cite_fix_bond_react[] =
|
||||||
"fix bond/react: reacter.org doi:10.1016/j.polymer.2017.09.038, "
|
"fix bond/react: reacter.org doi:10.1016/j.polymer.2017.09.038, "
|
||||||
"doi:10.1021/acs.macromol.0c02012\n\n"
|
"doi:10.1021/acs.macromol.0c02012, doi:10.1016/j.cpc.2024.109287\n\n"
|
||||||
"@Article{Gissinger17,\n"
|
"@Article{Gissinger17,\n"
|
||||||
" author = {J. R. Gissinger and B. D. Jensen and K. E. Wise},\n"
|
" author = {J. R. Gissinger and B. D. Jensen and K. E. Wise},\n"
|
||||||
" title = {Modeling Chemical Reactions in Classical Molecular Dynamics Simulations},\n"
|
" title = {Modeling Chemical Reactions in Classical Molecular Dynamics Simulations},\n"
|
||||||
@ -75,6 +75,14 @@ static const char cite_fix_bond_react[] =
|
|||||||
" volume = 53,\n"
|
" volume = 53,\n"
|
||||||
" number = 22,\n"
|
" number = 22,\n"
|
||||||
" pages = {9953--9961}\n"
|
" pages = {9953--9961}\n"
|
||||||
|
"}\n\n"
|
||||||
|
"@Article{Gissinger24,\n"
|
||||||
|
" author = {J. R. Gissinger, B. D. Jensen, K. E. Wise},\n"
|
||||||
|
" title = {Molecular Modeling of Reactive Systems with REACTER},\n"
|
||||||
|
" journal = {Computer Physics Communications},\n"
|
||||||
|
" year = 2024,\n"
|
||||||
|
" volume = 304,\n"
|
||||||
|
" number = 109287\n"
|
||||||
"}\n\n";
|
"}\n\n";
|
||||||
|
|
||||||
static constexpr double BIG = 1.0e20;
|
static constexpr double BIG = 1.0e20;
|
||||||
@ -225,8 +233,8 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
memory->create(reacted_mol,nreacts,"bond/react:reacted_mol");
|
memory->create(reacted_mol,nreacts,"bond/react:reacted_mol");
|
||||||
memory->create(fraction,nreacts,"bond/react:fraction");
|
memory->create(fraction,nreacts,"bond/react:fraction");
|
||||||
memory->create(max_rxn,nreacts,"bond/react:max_rxn");
|
memory->create(max_rxn,nreacts,"bond/react:max_rxn");
|
||||||
memory->create(nlocalskips,nreacts,"bond/react:nlocalskips");
|
memory->create(nlocalkeep,nreacts,"bond/react:nlocalkeep");
|
||||||
memory->create(nghostlyskips,nreacts,"bond/react:nghostlyskips");
|
memory->create(nghostlykeep,nreacts,"bond/react:nghostlykeep");
|
||||||
memory->create(seed,nreacts,"bond/react:seed");
|
memory->create(seed,nreacts,"bond/react:seed");
|
||||||
memory->create(limit_duration,nreacts,"bond/react:limit_duration");
|
memory->create(limit_duration,nreacts,"bond/react:limit_duration");
|
||||||
memory->create(rate_limit,3,nreacts,"bond/react:rate_limit");
|
memory->create(rate_limit,3,nreacts,"bond/react:rate_limit");
|
||||||
@ -486,10 +494,6 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
get_molxspecials();
|
get_molxspecials();
|
||||||
read_map_file(i);
|
read_map_file(i);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
if (ncreate == 0 && onemol->natoms != twomol->natoms)
|
|
||||||
error->all(FLERR,"Fix bond/react: Reaction templates must contain the same number of atoms");
|
|
||||||
else if (ncreate > 0 && onemol->natoms + ncreate != twomol->natoms)
|
|
||||||
error->all(FLERR,"Fix bond/react: Incorrect number of created atoms");
|
|
||||||
iatomtype[i] = onemol->type[ibonding[i]-1];
|
iatomtype[i] = onemol->type[ibonding[i]-1];
|
||||||
jatomtype[i] = onemol->type[jbonding[i]-1];
|
jatomtype[i] = onemol->type[jbonding[i]-1];
|
||||||
find_landlocked_atoms(i);
|
find_landlocked_atoms(i);
|
||||||
@ -644,8 +648,8 @@ FixBondReact::~FixBondReact()
|
|||||||
memory->destroy(fraction);
|
memory->destroy(fraction);
|
||||||
memory->destroy(seed);
|
memory->destroy(seed);
|
||||||
memory->destroy(max_rxn);
|
memory->destroy(max_rxn);
|
||||||
memory->destroy(nlocalskips);
|
memory->destroy(nlocalkeep);
|
||||||
memory->destroy(nghostlyskips);
|
memory->destroy(nghostlykeep);
|
||||||
memory->destroy(limit_duration);
|
memory->destroy(limit_duration);
|
||||||
memory->destroy(var_flag);
|
memory->destroy(var_flag);
|
||||||
memory->destroy(var_id);
|
memory->destroy(var_id);
|
||||||
@ -716,6 +720,7 @@ int FixBondReact::setmask()
|
|||||||
int mask = 0;
|
int mask = 0;
|
||||||
mask |= POST_INTEGRATE;
|
mask |= POST_INTEGRATE;
|
||||||
mask |= POST_INTEGRATE_RESPA;
|
mask |= POST_INTEGRATE_RESPA;
|
||||||
|
mask |= POST_FORCE;
|
||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -872,8 +877,8 @@ void FixBondReact::post_integrate()
|
|||||||
reaction_count[i] = 0;
|
reaction_count[i] = 0;
|
||||||
local_rxn_count[i] = 0;
|
local_rxn_count[i] = 0;
|
||||||
ghostly_rxn_count[i] = 0;
|
ghostly_rxn_count[i] = 0;
|
||||||
nlocalskips[i] = 0;
|
nlocalkeep[i] = INT_MAX;
|
||||||
nghostlyskips[i] = 0;
|
nghostlykeep[i] = INT_MAX;
|
||||||
// update reaction probability
|
// update reaction probability
|
||||||
if (var_flag[PROB][i])
|
if (var_flag[PROB][i])
|
||||||
fraction[i] = input->variable->compute_equal(var_id[PROB][i]);
|
fraction[i] = input->variable->compute_equal(var_id[PROB][i]);
|
||||||
@ -1424,10 +1429,13 @@ void FixBondReact::superimpose_algorithm()
|
|||||||
MPI_Allreduce(&local_rxn_count[0],&reaction_count[0],nreacts,MPI_INT,MPI_SUM,world);
|
MPI_Allreduce(&local_rxn_count[0],&reaction_count[0],nreacts,MPI_INT,MPI_SUM,world);
|
||||||
|
|
||||||
int rxnflag = 0;
|
int rxnflag = 0;
|
||||||
|
int *delta_rxn;
|
||||||
|
memory->create(delta_rxn,nreacts,"bond/react:delta_rxn");
|
||||||
if (comm->me == 0)
|
if (comm->me == 0)
|
||||||
for (int i = 0; i < nreacts; i++) {
|
for (int i = 0; i < nreacts; i++) {
|
||||||
reaction_count_total[i] += reaction_count[i] + ghostly_rxn_count[i];
|
delta_rxn[i] = reaction_count[i] + ghostly_rxn_count[i];
|
||||||
rxnflag += reaction_count[i] + ghostly_rxn_count[i];
|
reaction_count_total[i] += delta_rxn[i];
|
||||||
|
rxnflag += delta_rxn[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
MPI_Bcast(&reaction_count_total[0], nreacts, MPI_INT, 0, world);
|
MPI_Bcast(&reaction_count_total[0], nreacts, MPI_INT, 0, world);
|
||||||
@ -1460,42 +1468,43 @@ void FixBondReact::superimpose_algorithm()
|
|||||||
if (overstep > 0) {
|
if (overstep > 0) {
|
||||||
// let's randomly choose rxns to skip, unbiasedly from local and ghostly
|
// let's randomly choose rxns to skip, unbiasedly from local and ghostly
|
||||||
int *local_rxncounts;
|
int *local_rxncounts;
|
||||||
int *all_localskips;
|
int *all_localkeep;
|
||||||
memory->create(local_rxncounts,nprocs,"bond/react:local_rxncounts");
|
memory->create(local_rxncounts,nprocs,"bond/react:local_rxncounts");
|
||||||
memory->create(all_localskips,nprocs,"bond/react:all_localskips");
|
memory->create(all_localkeep,nprocs,"bond/react:all_localkeep");
|
||||||
MPI_Gather(&local_rxn_count[i],1,MPI_INT,local_rxncounts,1,MPI_INT,0,world);
|
MPI_Gather(&local_rxn_count[i],1,MPI_INT,local_rxncounts,1,MPI_INT,0,world);
|
||||||
if (comm->me == 0) {
|
if (comm->me == 0) {
|
||||||
int delta_rxn = reaction_count[i] + ghostly_rxn_count[i];
|
|
||||||
// when using variable input for rate_limit, rate_limit_overstep could be > delta_rxn (below)
|
// when using variable input for rate_limit, rate_limit_overstep could be > delta_rxn (below)
|
||||||
// we need to limit overstep to the number of reactions on this timestep
|
// we need to limit overstep to the number of reactions on this timestep
|
||||||
// essentially skipping all reactions, would be more efficient to use a skip_all flag
|
// essentially skipping all reactions, would be more efficient to use a skip_all flag
|
||||||
if (overstep > delta_rxn) overstep = delta_rxn;
|
if (overstep > delta_rxn[i]) overstep = delta_rxn[i];
|
||||||
|
int nkeep = delta_rxn[i] - overstep;
|
||||||
int *rxn_by_proc;
|
int *rxn_by_proc;
|
||||||
memory->create(rxn_by_proc,delta_rxn,"bond/react:rxn_by_proc");
|
memory->create(rxn_by_proc,delta_rxn[i],"bond/react:rxn_by_proc");
|
||||||
for (int j = 0; j < delta_rxn; j++)
|
for (int j = 0; j < delta_rxn[i]; j++)
|
||||||
rxn_by_proc[j] = -1; // corresponds to ghostly
|
rxn_by_proc[j] = -1; // corresponds to ghostly
|
||||||
int itemp = 0;
|
int itemp = 0;
|
||||||
for (int j = 0; j < nprocs; j++)
|
for (int j = 0; j < nprocs; j++)
|
||||||
for (int k = 0; k < local_rxncounts[j]; k++)
|
for (int k = 0; k < local_rxncounts[j]; k++)
|
||||||
rxn_by_proc[itemp++] = j;
|
rxn_by_proc[itemp++] = j;
|
||||||
std::shuffle(&rxn_by_proc[0],&rxn_by_proc[delta_rxn], park_rng);
|
std::shuffle(&rxn_by_proc[0],&rxn_by_proc[delta_rxn[i]], park_rng);
|
||||||
for (int j = 0; j < nprocs; j++)
|
for (int j = 0; j < nprocs; j++)
|
||||||
all_localskips[j] = 0;
|
all_localkeep[j] = 0;
|
||||||
nghostlyskips[i] = 0;
|
nghostlykeep[i] = 0;
|
||||||
for (int j = 0; j < overstep; j++) {
|
for (int j = 0; j < nkeep; j++) {
|
||||||
if (rxn_by_proc[j] == -1) nghostlyskips[i]++;
|
if (rxn_by_proc[j] == -1) nghostlykeep[i]++;
|
||||||
else all_localskips[rxn_by_proc[j]]++;
|
else all_localkeep[rxn_by_proc[j]]++;
|
||||||
}
|
}
|
||||||
memory->destroy(rxn_by_proc);
|
memory->destroy(rxn_by_proc);
|
||||||
reaction_count_total[i] -= overstep;
|
reaction_count_total[i] -= overstep;
|
||||||
}
|
}
|
||||||
MPI_Scatter(&all_localskips[0],1,MPI_INT,&nlocalskips[i],1,MPI_INT,0,world);
|
MPI_Scatter(&all_localkeep[0],1,MPI_INT,&nlocalkeep[i],1,MPI_INT,0,world);
|
||||||
MPI_Bcast(&nghostlyskips[i],1,MPI_INT,0,world);
|
MPI_Bcast(&nghostlykeep[i],1,MPI_INT,0,world);
|
||||||
memory->destroy(local_rxncounts);
|
memory->destroy(local_rxncounts);
|
||||||
memory->destroy(all_localskips);
|
memory->destroy(all_localkeep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MPI_Bcast(&reaction_count_total[0], nreacts, MPI_INT, 0, world);
|
MPI_Bcast(&reaction_count_total[0], nreacts, MPI_INT, 0, world);
|
||||||
|
memory->destroy(delta_rxn);
|
||||||
|
|
||||||
// this updates topology next step
|
// this updates topology next step
|
||||||
next_reneighbor = update->ntimestep;
|
next_reneighbor = update->ntimestep;
|
||||||
@ -2965,6 +2974,8 @@ void FixBondReact::update_everything()
|
|||||||
int *type = atom->type;
|
int *type = atom->type;
|
||||||
int **nspecial = atom->nspecial;
|
int **nspecial = atom->nspecial;
|
||||||
tagint **special = atom->special;
|
tagint **special = atom->special;
|
||||||
|
tagint *tag = atom->tag;
|
||||||
|
AtomVec *avec = atom->avec;
|
||||||
|
|
||||||
int **bond_type = atom->bond_type;
|
int **bond_type = atom->bond_type;
|
||||||
tagint **bond_atom = atom->bond_atom;
|
tagint **bond_atom = atom->bond_atom;
|
||||||
@ -2977,13 +2988,16 @@ void FixBondReact::update_everything()
|
|||||||
memory->create(mark,nmark,"bond/react:mark");
|
memory->create(mark,nmark,"bond/react:mark");
|
||||||
for (int i = 0; i < nmark; i++) mark[i] = 0;
|
for (int i = 0; i < nmark; i++) mark[i] = 0;
|
||||||
|
|
||||||
|
// used when creating atoms
|
||||||
|
addatomtag = 0;
|
||||||
|
for (int i = 0; i < nlocal; i++) addatomtag = MAX(addatomtag,tag[i]);
|
||||||
|
MPI_Allreduce(MPI_IN_PLACE,&addatomtag,1,MPI_LMP_TAGINT,MPI_MAX,world);
|
||||||
|
addatoms.clear();
|
||||||
|
|
||||||
// flag used to delete special interactions
|
// flag used to delete special interactions
|
||||||
int *delflag;
|
int *delflag;
|
||||||
memory->create(delflag,atom->maxspecial,"bond/react:delflag");
|
memory->create(delflag,atom->maxspecial,"bond/react:delflag");
|
||||||
|
|
||||||
tagint *tag = atom->tag;
|
|
||||||
AtomVec *avec = atom->avec;
|
|
||||||
|
|
||||||
// used when creating atoms
|
// used when creating atoms
|
||||||
int inserted_atoms_flag = 0;
|
int inserted_atoms_flag = 0;
|
||||||
|
|
||||||
@ -3026,13 +3040,14 @@ void FixBondReact::update_everything()
|
|||||||
|
|
||||||
for (int pass = 0; pass < 2; pass++) {
|
for (int pass = 0; pass < 2; pass++) {
|
||||||
update_num_mega = 0;
|
update_num_mega = 0;
|
||||||
int *iskip = new int[nreacts];
|
int *noccur = new int[nreacts];
|
||||||
for (int i = 0; i < nreacts; i++) iskip[i] = 0;
|
for (int i = 0; i < nreacts; i++) noccur[i] = 0;
|
||||||
if (pass == 0) {
|
if (pass == 0) {
|
||||||
for (int i = 0; i < local_num_mega; i++) {
|
for (int i = 0; i < local_num_mega; i++) {
|
||||||
rxnID = (int) local_mega_glove[0][i];
|
rxnID = (int) local_mega_glove[0][i];
|
||||||
// reactions already shuffled from dedup procedure, so can skip first N
|
// reactions already shuffled from dedup procedure, so can skip first N
|
||||||
if (iskip[rxnID]++ < nlocalskips[rxnID]) continue;
|
// wait, this check needs to be after add atoms, because they can also be 'skipped' due to overlap
|
||||||
|
if (noccur[rxnID] >= nlocalkeep[rxnID]) continue;
|
||||||
|
|
||||||
// this will be overwritten if reaction skipped by create_atoms below
|
// this will be overwritten if reaction skipped by create_atoms below
|
||||||
update_mega_glove[0][update_num_mega] = (tagint) local_mega_glove[0][i];
|
update_mega_glove[0][update_num_mega] = (tagint) local_mega_glove[0][i];
|
||||||
@ -3043,13 +3058,14 @@ void FixBondReact::update_everything()
|
|||||||
if (create_atoms_flag[rxnID] == 1) {
|
if (create_atoms_flag[rxnID] == 1) {
|
||||||
onemol = atom->molecules[unreacted_mol[rxnID]];
|
onemol = atom->molecules[unreacted_mol[rxnID]];
|
||||||
twomol = atom->molecules[reacted_mol[rxnID]];
|
twomol = atom->molecules[reacted_mol[rxnID]];
|
||||||
if (insert_atoms(update_mega_glove,update_num_mega)) {
|
if (insert_atoms_setup(update_mega_glove,update_num_mega)) {
|
||||||
inserted_atoms_flag = 1;
|
inserted_atoms_flag = 1;
|
||||||
} else { // create aborted
|
} else { // create aborted
|
||||||
reaction_count_total[rxnID]--;
|
reaction_count_total[rxnID]--;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
noccur[rxnID]++;
|
||||||
|
|
||||||
if (rescale_charges_flag[rxnID]) sim_total_charges[update_num_mega] = local_mega_glove[1][i];
|
if (rescale_charges_flag[rxnID]) sim_total_charges[update_num_mega] = local_mega_glove[1][i];
|
||||||
update_num_mega++;
|
update_num_mega++;
|
||||||
@ -3058,7 +3074,7 @@ void FixBondReact::update_everything()
|
|||||||
for (int i = 0; i < global_megasize; i++) {
|
for (int i = 0; i < global_megasize; i++) {
|
||||||
rxnID = (int) global_mega_glove[0][i];
|
rxnID = (int) global_mega_glove[0][i];
|
||||||
// reactions already shuffled from dedup procedure, so can skip first N
|
// reactions already shuffled from dedup procedure, so can skip first N
|
||||||
if (iskip[rxnID]++ < nghostlyskips[rxnID]) continue;
|
if (noccur[rxnID] >= nghostlykeep[rxnID]) continue;
|
||||||
|
|
||||||
// this will be overwritten if reaction skipped by create_atoms below
|
// this will be overwritten if reaction skipped by create_atoms below
|
||||||
update_mega_glove[0][update_num_mega] = (tagint) global_mega_glove[0][i];
|
update_mega_glove[0][update_num_mega] = (tagint) global_mega_glove[0][i];
|
||||||
@ -3071,29 +3087,48 @@ void FixBondReact::update_everything()
|
|||||||
if (create_atoms_flag[rxnID] == 1) {
|
if (create_atoms_flag[rxnID] == 1) {
|
||||||
onemol = atom->molecules[unreacted_mol[rxnID]];
|
onemol = atom->molecules[unreacted_mol[rxnID]];
|
||||||
twomol = atom->molecules[reacted_mol[rxnID]];
|
twomol = atom->molecules[reacted_mol[rxnID]];
|
||||||
if (insert_atoms(update_mega_glove,update_num_mega)) {
|
if (insert_atoms_setup(update_mega_glove,update_num_mega)) {
|
||||||
inserted_atoms_flag = 1;
|
inserted_atoms_flag = 1;
|
||||||
} else { // create aborted
|
} else { // create aborted
|
||||||
reaction_count_total[rxnID]--;
|
reaction_count_total[rxnID]--;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
noccur[rxnID]++;
|
||||||
|
|
||||||
if (rescale_charges_flag[rxnID]) sim_total_charges[update_num_mega] = global_mega_glove[1][i];
|
if (rescale_charges_flag[rxnID]) sim_total_charges[update_num_mega] = global_mega_glove[1][i];
|
||||||
update_num_mega++;
|
update_num_mega++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delete [] iskip;
|
delete [] noccur;
|
||||||
|
|
||||||
if (update_num_mega == 0) continue;
|
if (update_num_mega == 0) continue;
|
||||||
|
|
||||||
// if inserted atoms and global map exists, reset map now instead
|
// insert all atoms for all rxns here
|
||||||
// of waiting for comm since other pre-exchange fixes may use it
|
if (inserted_atoms_flag == 1) {
|
||||||
// invoke map_init() b/c atom count has grown
|
// clear to-be-overwritten ghost info
|
||||||
// do this once after all atom insertions
|
atom->nghost = 0;
|
||||||
if (inserted_atoms_flag == 1 && atom->map_style != Atom::MAP_NONE) {
|
atom->avec->clear_bonus();
|
||||||
atom->map_init();
|
|
||||||
atom->map_set();
|
for (auto & myaddatom : addatoms) {
|
||||||
|
atom->avec->create_atom(myaddatom.type,myaddatom.x);
|
||||||
|
int n = atom->nlocal - 1;
|
||||||
|
atom->tag[n] = myaddatom.tag;
|
||||||
|
atom->molecule[n] = myaddatom.molecule;
|
||||||
|
atom->mask[n] = myaddatom.mask;
|
||||||
|
atom->image[n] = myaddatom.image;
|
||||||
|
atom->v[n][0] = myaddatom.v[0];
|
||||||
|
atom->v[n][1] = myaddatom.v[1];
|
||||||
|
atom->v[n][2] = myaddatom.v[2];
|
||||||
|
if (atom->rmass) atom->rmass[n]= myaddatom.rmass;
|
||||||
|
modify->create_attribute(n);
|
||||||
|
}
|
||||||
|
|
||||||
|
// reset atom->map
|
||||||
|
if (atom->map_style != Atom::MAP_NONE) {
|
||||||
|
atom->map_init();
|
||||||
|
atom->map_set();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// mark to-delete atoms
|
// mark to-delete atoms
|
||||||
@ -3620,10 +3655,6 @@ void FixBondReact::update_everything()
|
|||||||
|
|
||||||
atom->natoms -= ndel;
|
atom->natoms -= ndel;
|
||||||
// done deleting atoms
|
// done deleting atoms
|
||||||
|
|
||||||
// reset mol ids
|
|
||||||
if (reset_mol_ids_flag) reset_mol_ids->reset();
|
|
||||||
|
|
||||||
// something to think about: this could done much more concisely if
|
// something to think about: this could done much more concisely if
|
||||||
// all atom-level info (bond,angles, etc...) were kinda inherited from a common data struct --JG
|
// all atom-level info (bond,angles, etc...) were kinda inherited from a common data struct --JG
|
||||||
|
|
||||||
@ -3651,17 +3682,17 @@ void FixBondReact::update_everything()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
insert created atoms
|
setup for inserting created atoms
|
||||||
|
atoms for all rxns are actually created all at once in update_everything
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
int FixBondReact::insert_atoms(tagint **my_update_mega_glove, int iupdate)
|
int FixBondReact::insert_atoms_setup(tagint **my_update_mega_glove, int iupdate)
|
||||||
{
|
{
|
||||||
// inserting atoms based off fix_deposit->pre_exchange
|
// inserting atoms based off fix_deposit->pre_exchange
|
||||||
int flag;
|
int flag;
|
||||||
imageint *imageflags;
|
imageint *imageflags;
|
||||||
double **coords,lamda[3],rotmat[3][3];
|
double **coords,lamda[3],rotmat[3][3];
|
||||||
double *newcoord;
|
double *newcoord;
|
||||||
double **v = atom->v;
|
|
||||||
double t,delx,dely,delz,rsq;
|
double t,delx,dely,delz,rsq;
|
||||||
|
|
||||||
memory->create(coords,twomol->natoms,3,"bond/react:coords");
|
memory->create(coords,twomol->natoms,3,"bond/react:coords");
|
||||||
@ -3677,19 +3708,13 @@ int FixBondReact::insert_atoms(tagint **my_update_mega_glove, int iupdate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// find current max atom and molecule IDs
|
// find current max atom and molecule IDs
|
||||||
tagint *tag = atom->tag;
|
|
||||||
double **x = atom->x;
|
double **x = atom->x;
|
||||||
tagint *molecule = atom->molecule;
|
tagint *molecule = atom->molecule;
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
|
|
||||||
tagint maxtag_all,maxmol_all;
|
tagint maxmol_all = 0;;
|
||||||
tagint max = 0;
|
for (int i = 0; i < nlocal; i++) maxmol_all = MAX(maxmol_all,molecule[i]);
|
||||||
for (int i = 0; i < nlocal; i++) max = MAX(max,tag[i]);
|
MPI_Allreduce(MPI_IN_PLACE,&maxmol_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
|
||||||
MPI_Allreduce(&max,&maxtag_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
|
|
||||||
|
|
||||||
max = 0;
|
|
||||||
for (int i = 0; i < nlocal; i++) max = MAX(max,molecule[i]);
|
|
||||||
MPI_Allreduce(&max,&maxmol_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
|
|
||||||
|
|
||||||
int dimension = domain->dimension;
|
int dimension = domain->dimension;
|
||||||
|
|
||||||
@ -3786,6 +3811,26 @@ int FixBondReact::insert_atoms(tagint **my_update_mega_glove, int iupdate)
|
|||||||
if (abortflag) break;
|
if (abortflag) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// also check against previous to-be-added atoms
|
||||||
|
if (!abortflag) {
|
||||||
|
for (auto & myaddatom : addatoms) {
|
||||||
|
for (int m = 0; m < twomol->natoms; m++) {
|
||||||
|
if (create_atoms[m][rxnID] == 1) {
|
||||||
|
delx = coords[m][0] - myaddatom.x[0];
|
||||||
|
dely = coords[m][1] - myaddatom.x[1];
|
||||||
|
delz = coords[m][2] - myaddatom.x[2];
|
||||||
|
domain->minimum_image(delx,dely,delz);
|
||||||
|
rsq = delx*delx + dely*dely + delz*delz;
|
||||||
|
if (rsq < overlapsq[rxnID]) {
|
||||||
|
abortflag = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (abortflag) break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MPI_Allreduce(MPI_IN_PLACE,&abortflag,1,MPI_INT,MPI_MAX,world);
|
MPI_Allreduce(MPI_IN_PLACE,&abortflag,1,MPI_INT,MPI_MAX,world);
|
||||||
if (abortflag) {
|
if (abortflag) {
|
||||||
memory->destroy(coords);
|
memory->destroy(coords);
|
||||||
@ -3794,12 +3839,6 @@ int FixBondReact::insert_atoms(tagint **my_update_mega_glove, int iupdate)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear ghost count and any ghost bonus data internal to AtomVec
|
|
||||||
// same logic as beginning of Comm::exchange()
|
|
||||||
// do it now b/c inserting atoms will overwrite ghost atoms
|
|
||||||
atom->nghost = 0;
|
|
||||||
atom->avec->clear_bonus();
|
|
||||||
|
|
||||||
// check if new atoms are in my sub-box or above it if I am highest proc
|
// check if new atoms are in my sub-box or above it if I am highest proc
|
||||||
// if so, add atom to my list via create_atom()
|
// if so, add atom to my list via create_atom()
|
||||||
// initialize additional info about the atoms
|
// initialize additional info about the atoms
|
||||||
@ -3842,40 +3881,46 @@ int FixBondReact::insert_atoms(tagint **my_update_mega_glove, int iupdate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int root = 0;
|
int root = 0;
|
||||||
|
addatomtag++;
|
||||||
if (flag) {
|
if (flag) {
|
||||||
|
struct AddAtom myaddatom;
|
||||||
root = comm->me;
|
root = comm->me;
|
||||||
|
|
||||||
atom->avec->create_atom(twomol->type[m],coords[m]);
|
myaddatom.type = twomol->type[m];
|
||||||
int n = atom->nlocal - 1;
|
myaddatom.x[0] = coords[m][0];
|
||||||
atom->tag[n] = maxtag_all + add_count;
|
myaddatom.x[1] = coords[m][1];
|
||||||
|
myaddatom.x[2] = coords[m][2];
|
||||||
|
myaddatom.tag = addatomtag;
|
||||||
|
|
||||||
// locally update mega_glove
|
// locally update mega_glove
|
||||||
my_update_mega_glove[preID][iupdate] = atom->tag[n];
|
my_update_mega_glove[preID][iupdate] = myaddatom.tag;
|
||||||
|
|
||||||
|
// !! could do better job choosing mol ID for added atoms
|
||||||
if (atom->molecule_flag) {
|
if (atom->molecule_flag) {
|
||||||
if (twomol->moleculeflag) {
|
if (twomol->moleculeflag) {
|
||||||
atom->molecule[n] = maxmol_all + twomol->molecule[m];
|
myaddatom.molecule = maxmol_all + twomol->molecule[m];
|
||||||
} else {
|
} else {
|
||||||
atom->molecule[n] = maxmol_all + 1;
|
myaddatom.molecule = maxmol_all + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
atom->mask[n] = 1 | groupbit;
|
myaddatom.mask = 1 | groupbit;
|
||||||
atom->image[n] = imageflags[m];
|
myaddatom.image = imageflags[m];
|
||||||
|
|
||||||
// guess a somewhat reasonable initial velocity based on reaction site
|
// guess a somewhat reasonable initial velocity based on reaction site
|
||||||
// further control is possible using bond_react_MASTER_group
|
// further control is possible using bond_react_MASTER_group
|
||||||
// compute |velocity| corresponding to a given temperature t, using specific atom's mass
|
// compute |velocity| corresponding to a given temperature t, using specific atom's mass
|
||||||
double mymass = atom->rmass ? atom->rmass[n] : atom->mass[twomol->type[m]];
|
myaddatom.rmass = atom->rmass ? twomol->rmass[m] : atom->mass[twomol->type[m]];
|
||||||
double vtnorm = sqrt(t / (force->mvv2e / (dimension * force->boltz)) / mymass);
|
double vtnorm = sqrt(t / (force->mvv2e / (dimension * force->boltz)) / myaddatom.rmass);
|
||||||
v[n][0] = random[rxnID]->uniform();
|
double myv[3];
|
||||||
v[n][1] = random[rxnID]->uniform();
|
myv[0] = random[rxnID]->uniform();
|
||||||
v[n][2] = random[rxnID]->uniform();
|
myv[1] = random[rxnID]->uniform();
|
||||||
double vnorm = sqrt(v[n][0]*v[n][0] + v[n][1]*v[n][1] + v[n][2]*v[n][2]);
|
myv[2] = random[rxnID]->uniform();
|
||||||
v[n][0] = v[n][0]/vnorm*vtnorm;
|
double vnorm = sqrt(myv[0]*myv[0] + myv[1]*myv[1] + myv[2]*myv[2]);
|
||||||
v[n][1] = v[n][1]/vnorm*vtnorm;
|
myaddatom.v[0] = myv[0]/vnorm*vtnorm;
|
||||||
v[n][2] = v[n][2]/vnorm*vtnorm;
|
myaddatom.v[1] = myv[1]/vnorm*vtnorm;
|
||||||
modify->create_attribute(n);
|
myaddatom.v[2] = myv[2]/vnorm*vtnorm;
|
||||||
|
addatoms.push_back(myaddatom);
|
||||||
}
|
}
|
||||||
// globally update mega_glove and equivalences
|
// globally update mega_glove and equivalences
|
||||||
MPI_Allreduce(MPI_IN_PLACE,&root,1,MPI_INT,MPI_SUM,world);
|
MPI_Allreduce(MPI_IN_PLACE,&root,1,MPI_INT,MPI_SUM,world);
|
||||||
@ -3888,12 +3933,11 @@ int FixBondReact::insert_atoms(tagint **my_update_mega_glove, int iupdate)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// reset global natoms here
|
// reset global natoms here
|
||||||
// reset atom map elsewhere, after all calls to 'insert_atoms'
|
// reset atom map elsewhere, after all calls to 'insert_atoms_setup'
|
||||||
atom->natoms += add_count;
|
atom->natoms += add_count;
|
||||||
if (atom->natoms < 0)
|
if (atom->natoms < 0)
|
||||||
error->all(FLERR,"Too many total atoms");
|
error->all(FLERR,"Too many total atoms");
|
||||||
maxtag_all += add_count;
|
if (addatomtag >= MAXTAGINT)
|
||||||
if (maxtag_all >= MAXTAGINT)
|
|
||||||
error->all(FLERR,"New atom IDs exceed maximum allowed ID");
|
error->all(FLERR,"New atom IDs exceed maximum allowed ID");
|
||||||
// atom creation successful
|
// atom creation successful
|
||||||
memory->destroy(coords);
|
memory->destroy(coords);
|
||||||
@ -3970,6 +4014,11 @@ void FixBondReact::read_map_file(int myrxn)
|
|||||||
} else break;
|
} else break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ncreate == 0 && onemol->natoms != twomol->natoms)
|
||||||
|
error->all(FLERR,"Fix bond/react: Reaction templates must contain the same number of atoms");
|
||||||
|
else if (ncreate > 0 && onemol->natoms + ncreate != twomol->natoms)
|
||||||
|
error->all(FLERR,"Fix bond/react: Incorrect number of created atoms");
|
||||||
|
|
||||||
// grab keyword and skip next line
|
// grab keyword and skip next line
|
||||||
|
|
||||||
parse_keyword(0,line,keyword);
|
parse_keyword(0,line,keyword);
|
||||||
@ -4012,6 +4061,13 @@ void FixBondReact::read_map_file(int myrxn)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// error check
|
||||||
|
for (int i = 0; i < onemol->natoms; i++) {
|
||||||
|
int my_equiv = reverse_equiv[i][1][myrxn];
|
||||||
|
if (create_atoms[my_equiv-1][myrxn] == 1)
|
||||||
|
error->all(FLERR,"Fix bond/react: Created atoms cannot also be listed in Equivalences section\n");
|
||||||
|
}
|
||||||
|
|
||||||
// error check
|
// error check
|
||||||
if (bondflag == 0 || equivflag == 0)
|
if (bondflag == 0 || equivflag == 0)
|
||||||
error->all(FLERR,"Fix bond/react: Map file missing InitiatorIDs or Equivalences section\n");
|
error->all(FLERR,"Fix bond/react: Map file missing InitiatorIDs or Equivalences section\n");
|
||||||
@ -4071,6 +4127,8 @@ void FixBondReact::CreateAtoms(char *line, int myrxn)
|
|||||||
readline(line);
|
readline(line);
|
||||||
rv = sscanf(line,"%d",&tmp);
|
rv = sscanf(line,"%d",&tmp);
|
||||||
if (rv != 1) error->one(FLERR, "CreateIDs section is incorrectly formatted");
|
if (rv != 1) error->one(FLERR, "CreateIDs section is incorrectly formatted");
|
||||||
|
if (tmp > twomol->natoms)
|
||||||
|
error->one(FLERR,"Fix bond/react: Invalid atom ID in CreateIDs section of map file");
|
||||||
create_atoms[tmp-1][myrxn] = 1;
|
create_atoms[tmp-1][myrxn] = 1;
|
||||||
}
|
}
|
||||||
if (twomol->xflag == 0)
|
if (twomol->xflag == 0)
|
||||||
@ -4331,6 +4389,13 @@ void FixBondReact::post_integrate_respa(int ilevel, int /*iloop*/)
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void FixBondReact::post_force(int /*vflag*/)
|
||||||
|
{
|
||||||
|
if (reset_mol_ids_flag) reset_mol_ids->reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
int FixBondReact::pack_forward_comm(int n, int *list, double *buf,
|
int FixBondReact::pack_forward_comm(int n, int *list, double *buf,
|
||||||
int /*pbc_flag*/, int * /*pbc*/)
|
int /*pbc_flag*/, int * /*pbc*/)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -46,6 +46,7 @@ class FixBondReact : public Fix {
|
|||||||
void init_list(int, class NeighList *) override;
|
void init_list(int, class NeighList *) override;
|
||||||
void post_integrate() override;
|
void post_integrate() override;
|
||||||
void post_integrate_respa(int, int) override;
|
void post_integrate_respa(int, int) override;
|
||||||
|
void post_force(int) override;
|
||||||
|
|
||||||
int pack_forward_comm(int, int *, double *, int, int *) override;
|
int pack_forward_comm(int, int *, double *, int, int *) override;
|
||||||
void unpack_forward_comm(int, int, double *) override;
|
void unpack_forward_comm(int, int, double *) override;
|
||||||
@ -62,7 +63,7 @@ class FixBondReact : public Fix {
|
|||||||
int *iatomtype, *jatomtype;
|
int *iatomtype, *jatomtype;
|
||||||
int *seed;
|
int *seed;
|
||||||
double **cutsq, *fraction;
|
double **cutsq, *fraction;
|
||||||
int *max_rxn, *nlocalskips, *nghostlyskips;
|
int *max_rxn, *nlocalkeep, *nghostlykeep;
|
||||||
tagint lastcheck;
|
tagint lastcheck;
|
||||||
int stabilization_flag;
|
int stabilization_flag;
|
||||||
int reset_mol_ids_flag;
|
int reset_mol_ids_flag;
|
||||||
@ -215,7 +216,7 @@ class FixBondReact : public Fix {
|
|||||||
void glove_ghostcheck();
|
void glove_ghostcheck();
|
||||||
void ghost_glovecast();
|
void ghost_glovecast();
|
||||||
void update_everything();
|
void update_everything();
|
||||||
int insert_atoms(tagint **, int);
|
int insert_atoms_setup(tagint **, int);
|
||||||
void unlimit_bond(); // removes atoms from stabilization, and other post-reaction every-step operations
|
void unlimit_bond(); // removes atoms from stabilization, and other post-reaction every-step operations
|
||||||
void dedup_mega_gloves(int); //dedup global mega_glove
|
void dedup_mega_gloves(int); //dedup global mega_glove
|
||||||
void write_restart(FILE *) override;
|
void write_restart(FILE *) override;
|
||||||
@ -245,6 +246,15 @@ class FixBondReact : public Fix {
|
|||||||
std::map<std::set<tagint>, int> atoms2bond; // maps atom pair to index of local bond array
|
std::map<std::set<tagint>, int> atoms2bond; // maps atom pair to index of local bond array
|
||||||
std::vector<std::vector<Constraint>> constraints;
|
std::vector<std::vector<Constraint>> constraints;
|
||||||
|
|
||||||
|
tagint addatomtag;
|
||||||
|
struct AddAtom {
|
||||||
|
tagint tag, molecule;
|
||||||
|
int type, mask;
|
||||||
|
imageint image;
|
||||||
|
double rmass, x[3], v[3];
|
||||||
|
};
|
||||||
|
std::vector<AddAtom> addatoms;
|
||||||
|
|
||||||
// DEBUG
|
// DEBUG
|
||||||
|
|
||||||
void print_bb();
|
void print_bb();
|
||||||
|
|||||||
@ -35,6 +35,7 @@
|
|||||||
#include "group.h"
|
#include "group.h"
|
||||||
#include "info.h"
|
#include "info.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
|
#include "lattice.h"
|
||||||
#include "lmppython.h"
|
#include "lmppython.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
@ -1414,6 +1415,9 @@ int lammps_extract_global_datatype(void * /*handle*/, const char *name)
|
|||||||
if (strcmp(name,"xy") == 0) return LAMMPS_DOUBLE;
|
if (strcmp(name,"xy") == 0) return LAMMPS_DOUBLE;
|
||||||
if (strcmp(name,"xz") == 0) return LAMMPS_DOUBLE;
|
if (strcmp(name,"xz") == 0) return LAMMPS_DOUBLE;
|
||||||
if (strcmp(name,"yz") == 0) return LAMMPS_DOUBLE;
|
if (strcmp(name,"yz") == 0) return LAMMPS_DOUBLE;
|
||||||
|
if (strcmp(name,"xlattice") == 0) return LAMMPS_DOUBLE;
|
||||||
|
if (strcmp(name,"ylattice") == 0) return LAMMPS_DOUBLE;
|
||||||
|
if (strcmp(name,"zlattice") == 0) return LAMMPS_DOUBLE;
|
||||||
if (strcmp(name,"procgrid") == 0) return LAMMPS_INT;
|
if (strcmp(name,"procgrid") == 0) return LAMMPS_INT;
|
||||||
|
|
||||||
if (strcmp(name,"natoms") == 0) return LAMMPS_BIGINT;
|
if (strcmp(name,"natoms") == 0) return LAMMPS_BIGINT;
|
||||||
@ -1510,9 +1514,9 @@ The function :cpp:func:`lammps_extract_global_datatype` will directly
|
|||||||
report the "native" data type. The following tables are provided:
|
report the "native" data type. The following tables are provided:
|
||||||
|
|
||||||
* :ref:`Timestep settings <extract_timestep_settings>`
|
* :ref:`Timestep settings <extract_timestep_settings>`
|
||||||
* :ref:`Git revision and version settings <extract_git_settings>`
|
|
||||||
* :ref:`Simulation box settings <extract_box_settings>`
|
* :ref:`Simulation box settings <extract_box_settings>`
|
||||||
* :ref:`System property settings <extract_system_settings>`
|
* :ref:`System property settings <extract_system_settings>`
|
||||||
|
* :ref:`Git revision and version settings <extract_git_settings>`
|
||||||
* :ref:`Unit settings <extract_unit_settings>`
|
* :ref:`Unit settings <extract_unit_settings>`
|
||||||
|
|
||||||
.. _extract_timestep_settings:
|
.. _extract_timestep_settings:
|
||||||
@ -1552,35 +1556,6 @@ report the "native" data type. The following tables are provided:
|
|||||||
- :math:`N_{respa}`
|
- :math:`N_{respa}`
|
||||||
- length of the time steps with r-RESPA. See :doc:`run_style`.
|
- length of the time steps with r-RESPA. See :doc:`run_style`.
|
||||||
|
|
||||||
.. _extract_git_settings:
|
|
||||||
|
|
||||||
**Git revision and version settings**
|
|
||||||
|
|
||||||
.. list-table::
|
|
||||||
:header-rows: 1
|
|
||||||
:widths: 16 14 10 60
|
|
||||||
|
|
||||||
* - Name
|
|
||||||
- Type
|
|
||||||
- Length
|
|
||||||
- Description
|
|
||||||
* - git_commit
|
|
||||||
- const char \*
|
|
||||||
- 1
|
|
||||||
- Git commit hash for the LAMMPS version.
|
|
||||||
* - git_branch
|
|
||||||
- const char \*
|
|
||||||
- 1
|
|
||||||
- Git branch for the LAMMPS version.
|
|
||||||
* - git_descriptor
|
|
||||||
- const char \*
|
|
||||||
- 1
|
|
||||||
- Combined descriptor for the git revision
|
|
||||||
* - lammps_version
|
|
||||||
- const char \*
|
|
||||||
- 1
|
|
||||||
- LAMMPS version string.
|
|
||||||
|
|
||||||
.. _extract_box_settings:
|
.. _extract_box_settings:
|
||||||
|
|
||||||
**Simulation box settings**
|
**Simulation box settings**
|
||||||
@ -1649,6 +1624,18 @@ report the "native" data type. The following tables are provided:
|
|||||||
- double
|
- double
|
||||||
- 1
|
- 1
|
||||||
- triclinic tilt factor; see :doc:`Howto_triclinic`.
|
- triclinic tilt factor; see :doc:`Howto_triclinic`.
|
||||||
|
* - xlattice
|
||||||
|
- double
|
||||||
|
- 1
|
||||||
|
- lattice spacing in x-direction; see :doc:`lattice command <lattice>`.
|
||||||
|
* - ylattice
|
||||||
|
- double
|
||||||
|
- 1
|
||||||
|
- lattice spacing in y-direction; see :doc:`lattice command <lattice>`.
|
||||||
|
* - zlattice
|
||||||
|
- double
|
||||||
|
- 1
|
||||||
|
- lattice spacing in z-direction; see :doc:`lattice command <lattice>`.
|
||||||
* - procgrid
|
* - procgrid
|
||||||
- int
|
- int
|
||||||
- 3
|
- 3
|
||||||
@ -1763,6 +1750,35 @@ report the "native" data type. The following tables are provided:
|
|||||||
- 1
|
- 1
|
||||||
- string with the current KSpace style.
|
- string with the current KSpace style.
|
||||||
|
|
||||||
|
.. _extract_git_settings:
|
||||||
|
|
||||||
|
**Git revision and version settings**
|
||||||
|
|
||||||
|
.. list-table::
|
||||||
|
:header-rows: 1
|
||||||
|
:widths: 16 14 10 60
|
||||||
|
|
||||||
|
* - Name
|
||||||
|
- Type
|
||||||
|
- Length
|
||||||
|
- Description
|
||||||
|
* - git_commit
|
||||||
|
- const char \*
|
||||||
|
- 1
|
||||||
|
- Git commit hash for the LAMMPS version.
|
||||||
|
* - git_branch
|
||||||
|
- const char \*
|
||||||
|
- 1
|
||||||
|
- Git branch for the LAMMPS version.
|
||||||
|
* - git_descriptor
|
||||||
|
- const char \*
|
||||||
|
- 1
|
||||||
|
- Combined descriptor for the git revision
|
||||||
|
* - lammps_version
|
||||||
|
- const char \*
|
||||||
|
- 1
|
||||||
|
- LAMMPS version string.
|
||||||
|
|
||||||
.. _extract_unit_settings:
|
.. _extract_unit_settings:
|
||||||
|
|
||||||
**Unit settings**
|
**Unit settings**
|
||||||
@ -1917,6 +1933,9 @@ void *lammps_extract_global(void *handle, const char *name)
|
|||||||
if (strcmp(name,"xy") == 0) return (void *) &lmp->domain->xy;
|
if (strcmp(name,"xy") == 0) return (void *) &lmp->domain->xy;
|
||||||
if (strcmp(name,"xz") == 0) return (void *) &lmp->domain->xz;
|
if (strcmp(name,"xz") == 0) return (void *) &lmp->domain->xz;
|
||||||
if (strcmp(name,"yz") == 0) return (void *) &lmp->domain->yz;
|
if (strcmp(name,"yz") == 0) return (void *) &lmp->domain->yz;
|
||||||
|
if (strcmp(name,"xlattice") == 0) return (void *) &lmp->domain->lattice->xlattice;
|
||||||
|
if (strcmp(name,"ylattice") == 0) return (void *) &lmp->domain->lattice->ylattice;
|
||||||
|
if (strcmp(name,"zlattice") == 0) return (void *) &lmp->domain->lattice->zlattice;
|
||||||
if (((lmp->comm->layout == Comm::LAYOUT_UNIFORM) ||
|
if (((lmp->comm->layout == Comm::LAYOUT_UNIFORM) ||
|
||||||
(lmp->comm->layout == Comm::LAYOUT_NONUNIFORM)) && (strcmp(name,"procgrid") == 0))
|
(lmp->comm->layout == Comm::LAYOUT_NONUNIFORM)) && (strcmp(name,"procgrid") == 0))
|
||||||
return (void *) &lmp->comm->procgrid;
|
return (void *) &lmp->comm->procgrid;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
project(lammps-gui VERSION 1.6.9 LANGUAGES CXX)
|
project(lammps-gui VERSION 1.6.10 LANGUAGES CXX)
|
||||||
|
|
||||||
set(CMAKE_AUTOUIC ON)
|
set(CMAKE_AUTOUIC ON)
|
||||||
set(CMAKE_AUTOMOC ON)
|
set(CMAKE_AUTOMOC ON)
|
||||||
@ -130,6 +130,8 @@ set(PROJECT_SOURCES
|
|||||||
chartviewer.h
|
chartviewer.h
|
||||||
codeeditor.cpp
|
codeeditor.cpp
|
||||||
codeeditor.h
|
codeeditor.h
|
||||||
|
findandreplace.cpp
|
||||||
|
findandreplace.h
|
||||||
helpers.cpp
|
helpers.cpp
|
||||||
highlighter.cpp
|
highlighter.cpp
|
||||||
highlighter.h
|
highlighter.h
|
||||||
|
|||||||
@ -2,12 +2,21 @@ LAMMPS-GUI TODO list:
|
|||||||
|
|
||||||
# Short term goals (v1.x)
|
# Short term goals (v1.x)
|
||||||
|
|
||||||
|
- implement a timed "Auto-Save" feature that saves after some idle time. set timeout in Editor preferences.
|
||||||
|
- add a "Filter data" checkbox to the "Charts" window to select whether data should be dropped.
|
||||||
|
- add a "Charts tab" to the preferences with the following (default) settings:
|
||||||
|
- default filter data yes/no
|
||||||
|
- default smooth parameters
|
||||||
|
- default plot colors
|
||||||
|
- enable "raw" or "smooth" or "both"
|
||||||
|
- add QLineEdit field to enter plot title
|
||||||
|
- add a "Colors" menu to the image viewer to adjust color settings for the
|
||||||
|
current image (unlike the defaults in the perferences) including assigning
|
||||||
|
colors to individual atom types.
|
||||||
|
- Support color by property (e.g. scan computes or fixes with per-atom data), define colormaps etc.
|
||||||
|
- Add a "Diameters" dialog where diamaters can by specified by atom type
|
||||||
- figure out how widgets can be resized to fraction of available screen size.
|
- figure out how widgets can be resized to fraction of available screen size.
|
||||||
- figure out stacking order of frames and whether it can be more flexible
|
- figure out stacking order of frames and whether it can be more flexible
|
||||||
- implement a timed "Auto-Save" feature that saves after some idle time. set timeout in Editor preferences.
|
|
||||||
- add a "Colors" menu to the image viewer to adjust color settings for the
|
|
||||||
current image (unlike the defaults in the perferences). Support color by
|
|
||||||
property (e.g. scan computes or fixes with per-atom data), define colormaps etc.
|
|
||||||
|
|
||||||
- implement indenting regions for (nested) loops?
|
- implement indenting regions for (nested) loops?
|
||||||
- implement data file manager GUI with the following features:
|
- implement data file manager GUI with the following features:
|
||||||
|
|||||||
@ -424,7 +424,7 @@ void ChartViewer::add_data(int step, double data)
|
|||||||
if (last_step < step) {
|
if (last_step < step) {
|
||||||
last_step = step;
|
last_step = step;
|
||||||
|
|
||||||
// do not add data that deviates by more than 5 sigma from the average
|
// do not add data that deviates by more than 4 sigma from the average
|
||||||
// over the last 5 to 20 data items. this is a hack to work around
|
// over the last 5 to 20 data items. this is a hack to work around
|
||||||
// getting corrupted data from lammps_get_last_thermo()
|
// getting corrupted data from lammps_get_last_thermo()
|
||||||
const auto &points = series->points();
|
const auto &points = series->points();
|
||||||
|
|||||||
@ -218,7 +218,10 @@ CodeEditor::CodeEditor(QWidget *parent) :
|
|||||||
help_index.close();
|
help_index.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setBackgroundRole(QPalette::Light);
|
||||||
lineNumberArea = new LineNumberArea(this);
|
lineNumberArea = new LineNumberArea(this);
|
||||||
|
lineNumberArea->setBackgroundRole(QPalette::Dark);
|
||||||
|
lineNumberArea->setAutoFillBackground(true);
|
||||||
connect(this, &CodeEditor::blockCountChanged, this, &CodeEditor::updateLineNumberAreaWidth);
|
connect(this, &CodeEditor::blockCountChanged, this, &CodeEditor::updateLineNumberAreaWidth);
|
||||||
connect(this, &CodeEditor::updateRequest, this, &CodeEditor::updateLineNumberArea);
|
connect(this, &CodeEditor::updateRequest, this, &CodeEditor::updateLineNumberArea);
|
||||||
updateLineNumberAreaWidth(0);
|
updateLineNumberAreaWidth(0);
|
||||||
@ -669,7 +672,7 @@ void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent *event)
|
|||||||
if (block.isVisible() && bottom >= event->rect().top()) {
|
if (block.isVisible() && bottom >= event->rect().top()) {
|
||||||
QString number = QString::number(blockNumber + 1) + " ";
|
QString number = QString::number(blockNumber + 1) + " ";
|
||||||
if ((highlight == NO_HIGHLIGHT) || (blockNumber != std::abs(highlight))) {
|
if ((highlight == NO_HIGHLIGHT) || (blockNumber != std::abs(highlight))) {
|
||||||
painter.setPen(Qt::black);
|
painter.setPen(palette().color(QPalette::WindowText));
|
||||||
} else {
|
} else {
|
||||||
number = QString(">") + QString::number(blockNumber + 1) + "<";
|
number = QString(">") + QString::number(blockNumber + 1) + "<";
|
||||||
if (highlight < 0)
|
if (highlight < 0)
|
||||||
|
|||||||
148
tools/lammps-gui/findandreplace.cpp
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
/* ----------------------------------------------------------------------
|
||||||
|
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||||
|
https://www.lammps.org/, Sandia National Laboratories
|
||||||
|
LAMMPS development team: developers@lammps.org
|
||||||
|
|
||||||
|
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||||
|
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||||
|
certain rights in this software. This software is distributed under
|
||||||
|
the GNU General Public License.
|
||||||
|
|
||||||
|
See the README file in the top-level LAMMPS directory.
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#include "findandreplace.h"
|
||||||
|
|
||||||
|
#include "codeeditor.h"
|
||||||
|
#include "lammpsgui.h"
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QCheckBox>
|
||||||
|
#include <QDialogButtonBox>
|
||||||
|
#include <QGridLayout>
|
||||||
|
#include <QHBoxLayout>
|
||||||
|
#include <QIcon>
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QLineEdit>
|
||||||
|
#include <QPushButton>
|
||||||
|
#include <QShortcut>
|
||||||
|
#include <QSizePolicy>
|
||||||
|
#include <QTextCursor>
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
FindAndReplace::FindAndReplace(CodeEditor *_editor, QWidget *parent) :
|
||||||
|
QDialog(parent), editor(_editor), search(nullptr), replace(nullptr), withcase(nullptr),
|
||||||
|
wrap(nullptr), whole(nullptr)
|
||||||
|
{
|
||||||
|
auto *layout = new QGridLayout;
|
||||||
|
search = new QLineEdit;
|
||||||
|
replace = new QLineEdit;
|
||||||
|
withcase = new QCheckBox("Match case");
|
||||||
|
wrap = new QCheckBox("Wrap around");
|
||||||
|
whole = new QCheckBox("Whole word");
|
||||||
|
auto *next = new QPushButton("&Next");
|
||||||
|
auto *replone = new QPushButton("&Replace");
|
||||||
|
auto *replall = new QPushButton("Replace &All");
|
||||||
|
auto *done = new QPushButton("&Done");
|
||||||
|
|
||||||
|
layout->addWidget(new QLabel("Find:"), 0, 0, Qt::AlignRight);
|
||||||
|
layout->addWidget(search, 0, 1, 1, 2, Qt::AlignLeft);
|
||||||
|
layout->addWidget(new QLabel("Replace with:"), 1, 0, Qt::AlignRight);
|
||||||
|
layout->addWidget(replace, 1, 1, 1, 2, Qt::AlignLeft);
|
||||||
|
layout->addWidget(withcase, 2, 0, Qt::AlignLeft);
|
||||||
|
layout->addWidget(wrap, 2, 1, Qt::AlignLeft);
|
||||||
|
layout->addWidget(whole, 2, 2, Qt::AlignLeft);
|
||||||
|
wrap->setChecked(true);
|
||||||
|
|
||||||
|
auto *buttons = new QHBoxLayout;
|
||||||
|
buttons->addWidget(next);
|
||||||
|
buttons->addWidget(replone);
|
||||||
|
buttons->addWidget(replall);
|
||||||
|
buttons->addWidget(done);
|
||||||
|
layout->addLayout(buttons, 3, 0, 1, 3, Qt::AlignHCenter);
|
||||||
|
|
||||||
|
connect(next, &QPushButton::released, this, &FindAndReplace::find_next);
|
||||||
|
connect(replone, &QPushButton::released, this, &FindAndReplace::replace_next);
|
||||||
|
connect(replall, &QPushButton::released, this, &FindAndReplace::replace_all);
|
||||||
|
connect(done, &QPushButton::released, this, &QDialog::accept);
|
||||||
|
|
||||||
|
auto action = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this);
|
||||||
|
connect(action, &QShortcut::activated, this, &FindAndReplace::quit);
|
||||||
|
|
||||||
|
setLayout(layout);
|
||||||
|
setWindowIcon(QIcon(":/icons/lammps-icon-128x128.png"));
|
||||||
|
setWindowTitle("LAMMPS-GUI - Find and Replace");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void FindAndReplace::find_next()
|
||||||
|
{
|
||||||
|
auto text = search->text();
|
||||||
|
|
||||||
|
int find_flags = 0;
|
||||||
|
if (withcase->isChecked()) find_flags |= QTextDocument::FindCaseSensitively;
|
||||||
|
if (whole->isChecked()) find_flags |= QTextDocument::FindWholeWords;
|
||||||
|
|
||||||
|
if (!text.isEmpty()) {
|
||||||
|
if (!editor->find(text, (QTextDocument::FindFlag)find_flags) && wrap->isChecked()) {
|
||||||
|
// nothing found from the current position to the end, reposition cursor and beginning
|
||||||
|
editor->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor);
|
||||||
|
editor->find(text, (QTextDocument::FindFlag)find_flags);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void FindAndReplace::replace_next()
|
||||||
|
{
|
||||||
|
auto text = search->text();
|
||||||
|
if (text.isEmpty()) return;
|
||||||
|
|
||||||
|
auto cursor = editor->textCursor();
|
||||||
|
auto flag = withcase->isChecked() ? Qt::CaseSensitive : Qt::CaseInsensitive;
|
||||||
|
|
||||||
|
// if selected text at cursor location matches search text, replace
|
||||||
|
if (QString::compare(cursor.selectedText(), search->text(), flag) == 0)
|
||||||
|
cursor.insertText(replace->text());
|
||||||
|
|
||||||
|
find_next();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void FindAndReplace::replace_all()
|
||||||
|
{
|
||||||
|
auto text = search->text();
|
||||||
|
if (text.isEmpty()) return;
|
||||||
|
|
||||||
|
// drop selection if we have one
|
||||||
|
auto cursor = editor->textCursor();
|
||||||
|
if (cursor.hasSelection()) cursor.movePosition(QTextCursor::Left);
|
||||||
|
|
||||||
|
find_next();
|
||||||
|
cursor = editor->textCursor();
|
||||||
|
|
||||||
|
// keep replacing until find_next() does not find anything anymore
|
||||||
|
while (cursor.hasSelection()) {
|
||||||
|
cursor.insertText(replace->text());
|
||||||
|
find_next();
|
||||||
|
cursor = editor->textCursor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
void FindAndReplace::quit()
|
||||||
|
{
|
||||||
|
LammpsGui *main = nullptr;
|
||||||
|
for (QWidget *widget : QApplication::topLevelWidgets())
|
||||||
|
if (widget->objectName() == "LammpsGui") main = dynamic_cast<LammpsGui *>(widget);
|
||||||
|
if (main) main->quit();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// c-basic-offset: 4
|
||||||
|
// End:
|
||||||
46
tools/lammps-gui/findandreplace.h
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/* -*- c++ -*- ----------------------------------------------------------
|
||||||
|
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||||
|
https://www.lammps.org/, Sandia National Laboratories
|
||||||
|
LAMMPS development team: developers@lammps.org
|
||||||
|
|
||||||
|
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||||
|
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||||
|
certain rights in this software. This software is distributed under
|
||||||
|
the GNU General Public License.
|
||||||
|
|
||||||
|
See the README file in the top-level LAMMPS directory.
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#ifndef FIND_AND_REPLACE_H
|
||||||
|
#define FIND_AND_REPLACE_H
|
||||||
|
|
||||||
|
#include "codeeditor.h"
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
class QLineEdit;
|
||||||
|
class QCheckBox;
|
||||||
|
|
||||||
|
class FindAndReplace : public QDialog {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit FindAndReplace(CodeEditor *_editor, QWidget *parent = nullptr);
|
||||||
|
~FindAndReplace() = default;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void find_next();
|
||||||
|
void replace_next();
|
||||||
|
void replace_all();
|
||||||
|
void quit();
|
||||||
|
|
||||||
|
private:
|
||||||
|
CodeEditor *editor;
|
||||||
|
QLineEdit *search, *replace;
|
||||||
|
QCheckBox *withcase, *wrap, *whole;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Local Variables:
|
||||||
|
// c-basic-offset: 4
|
||||||
|
// End:
|
||||||
@ -13,9 +13,12 @@
|
|||||||
|
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
||||||
|
#include <QBrush>
|
||||||
|
#include <QColor>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
#include <QPalette>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
@ -84,6 +87,16 @@ void purge_directory(const QString &dir)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// compare black level of foreground and background color
|
||||||
|
bool is_light_theme()
|
||||||
|
{
|
||||||
|
QPalette p;
|
||||||
|
int fg = p.brush(QPalette::Active, QPalette::WindowText).color().black();
|
||||||
|
int bg = p.brush(QPalette::Active, QPalette::Window).color().black();
|
||||||
|
|
||||||
|
return (fg > bg);
|
||||||
|
}
|
||||||
|
|
||||||
// Local Variables:
|
// Local Variables:
|
||||||
// c-basic-offset: 4
|
// c-basic-offset: 4
|
||||||
// End:
|
// End:
|
||||||
|
|||||||
@ -28,6 +28,9 @@ extern bool has_exe(const QString &exe);
|
|||||||
// recursively purge a directory
|
// recursively purge a directory
|
||||||
extern void purge_directory(const QString &dir);
|
extern void purge_directory(const QString &dir);
|
||||||
|
|
||||||
|
// flag if light or dark theme
|
||||||
|
extern bool is_light_theme();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// Local Variables:
|
// Local Variables:
|
||||||
// c-basic-offset: 4
|
// c-basic-offset: 4
|
||||||
|
|||||||
@ -12,6 +12,28 @@
|
|||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#include "highlighter.h"
|
#include "highlighter.h"
|
||||||
|
#include "helpers.h"
|
||||||
|
#include <QColor>
|
||||||
|
|
||||||
|
// workaround for Qt-5.12
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||||
|
namespace QColorConstants {
|
||||||
|
const QColor Red = QColor::fromRgb(0xff, 0x00, 0x00);
|
||||||
|
const QColor Green = QColor::fromRgb(0x00, 0xff, 0x00);
|
||||||
|
const QColor Blue = QColor::fromRgb(0x00, 0x00, 0xff);
|
||||||
|
const QColor Cyan = QColor::fromRgb(0x00, 0xff, 0xff);
|
||||||
|
const QColor Magenta = QColor::fromRgb(0xff, 0x00, 0xff);
|
||||||
|
const QColor Yellow = QColor::fromRgb(0xff, 0xff, 0x00);
|
||||||
|
namespace Svg {
|
||||||
|
const QColor dodgerblue = QColor::fromRgb(0x1e, 0x90, 0xff);
|
||||||
|
const QColor indianred = QColor::fromRgb(0xcd, 0x5c, 0x5c);
|
||||||
|
const QColor lightcoral = QColor::fromRgb(0xf0, 0x80, 0x80);
|
||||||
|
const QColor lightgray = QColor::fromRgb(0xd3, 0xd3, 0xd3);
|
||||||
|
const QColor lightgreen = QColor::fromRgb(0x90, 0xee, 0x90);
|
||||||
|
const QColor lightskyblue = QColor::fromRgb(0x87, 0xce, 0xfa);
|
||||||
|
} // namespace Svg
|
||||||
|
} // namespace QColorConstants
|
||||||
|
#endif
|
||||||
|
|
||||||
Highlighter::Highlighter(QTextDocument *parent) :
|
Highlighter::Highlighter(QTextDocument *parent) :
|
||||||
QSyntaxHighlighter(parent),
|
QSyntaxHighlighter(parent),
|
||||||
@ -54,27 +76,54 @@ Highlighter::Highlighter(QTextDocument *parent) :
|
|||||||
isTriple(QStringLiteral("[^\"]*\"\"\"[^\"]*")),
|
isTriple(QStringLiteral("[^\"]*\"\"\"[^\"]*")),
|
||||||
isString(QStringLiteral("(\".+?\"|'.+?'|\"\"\".*\"\"\")")), in_triple(false)
|
isString(QStringLiteral("(\".+?\"|'.+?'|\"\"\".*\"\"\")")), in_triple(false)
|
||||||
{
|
{
|
||||||
formatNumber.setForeground(Qt::blue);
|
if (is_light_theme()) {
|
||||||
formatString.setForeground(Qt::darkGreen);
|
// syntax colors for light themes
|
||||||
formatString.setFontWeight(QFont::Normal);
|
formatNumber.setForeground(Qt::blue);
|
||||||
formatComment.setForeground(Qt::red);
|
formatString.setForeground(Qt::darkGreen);
|
||||||
formatSpecial.setForeground(Qt::darkMagenta);
|
formatString.setFontWeight(QFont::Normal);
|
||||||
formatSpecial.setFontWeight(QFont::Bold);
|
formatComment.setForeground(Qt::red);
|
||||||
formatParticle.setForeground(Qt::darkRed);
|
formatSpecial.setForeground(Qt::darkMagenta);
|
||||||
formatParticle.setFontWeight(QFont::Bold);
|
formatSpecial.setFontWeight(QFont::Bold);
|
||||||
formatRun.setForeground(Qt::darkBlue);
|
formatParticle.setForeground(Qt::darkRed);
|
||||||
formatRun.setFontWeight(QFont::Bold);
|
formatParticle.setFontWeight(QFont::Bold);
|
||||||
formatVariable.setForeground(Qt::darkGray);
|
formatRun.setForeground(Qt::darkBlue);
|
||||||
formatVariable.setFontWeight(QFont::Bold);
|
formatRun.setFontWeight(QFont::Bold);
|
||||||
|
formatVariable.setForeground(Qt::darkGray);
|
||||||
|
formatVariable.setFontWeight(QFont::Bold);
|
||||||
|
|
||||||
formatOutput.setForeground(Qt::darkYellow);
|
formatOutput.setForeground(Qt::darkYellow);
|
||||||
formatOutput.setFontWeight(QFont::Bold);
|
formatOutput.setFontWeight(QFont::Bold);
|
||||||
formatRead.setForeground(Qt::magenta);
|
formatRead.setForeground(Qt::magenta);
|
||||||
formatRead.setFontWeight(QFont::Bold);
|
formatRead.setFontWeight(QFont::Bold);
|
||||||
formatLattice.setForeground(Qt::darkGreen);
|
formatLattice.setForeground(Qt::darkGreen);
|
||||||
formatLattice.setFontWeight(QFont::Bold);
|
formatLattice.setFontWeight(QFont::Bold);
|
||||||
formatSetup.setForeground(Qt::darkCyan);
|
formatSetup.setForeground(Qt::darkCyan);
|
||||||
formatSetup.setFontWeight(QFont::Bold);
|
formatSetup.setFontWeight(QFont::Bold);
|
||||||
|
} else {
|
||||||
|
// syntax colors for dark themes
|
||||||
|
formatNumber.setForeground(QColorConstants::Svg::dodgerblue);
|
||||||
|
formatString.setForeground(QColorConstants::Green);
|
||||||
|
formatString.setFontWeight(QFont::Normal);
|
||||||
|
formatComment.setForeground(QColorConstants::Red);
|
||||||
|
formatComment.setFontWeight(QFont::Bold);
|
||||||
|
formatSpecial.setForeground(QColorConstants::Magenta);
|
||||||
|
formatSpecial.setFontWeight(QFont::Bold);
|
||||||
|
formatParticle.setForeground(QColorConstants::Svg::indianred);
|
||||||
|
formatParticle.setFontWeight(QFont::Bold);
|
||||||
|
formatRun.setForeground(QColorConstants::Svg::lightskyblue);
|
||||||
|
formatRun.setFontWeight(QFont::Bold);
|
||||||
|
formatVariable.setForeground(QColorConstants::Svg::lightgray);
|
||||||
|
formatVariable.setFontWeight(QFont::Bold);
|
||||||
|
|
||||||
|
formatOutput.setForeground(QColorConstants::Yellow);
|
||||||
|
formatOutput.setFontWeight(QFont::Bold);
|
||||||
|
formatRead.setForeground(QColorConstants::Svg::lightcoral);
|
||||||
|
formatRead.setFontWeight(QFont::Bold);
|
||||||
|
formatLattice.setForeground(QColorConstants::Svg::lightgreen);
|
||||||
|
formatLattice.setFontWeight(QFont::Bold);
|
||||||
|
formatSetup.setForeground(QColorConstants::Cyan);
|
||||||
|
formatSetup.setFontWeight(QFont::Bold);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Highlighter::highlightBlock(const QString &text)
|
void Highlighter::highlightBlock(const QString &text)
|
||||||
|
|||||||
BIN
tools/lammps-gui/icons/search.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
@ -20,6 +20,7 @@
|
|||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QDoubleValidator>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
@ -31,6 +32,7 @@
|
|||||||
#include <QImageReader>
|
#include <QImageReader>
|
||||||
#include <QKeySequence>
|
#include <QKeySequence>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
|
#include <QLineEdit>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QMenuBar>
|
#include <QMenuBar>
|
||||||
#include <QPalette>
|
#include <QPalette>
|
||||||
@ -135,9 +137,10 @@ static const QString blank(" ");
|
|||||||
|
|
||||||
ImageViewer::ImageViewer(const QString &fileName, LammpsWrapper *_lammps, QWidget *parent) :
|
ImageViewer::ImageViewer(const QString &fileName, LammpsWrapper *_lammps, QWidget *parent) :
|
||||||
QDialog(parent), menuBar(new QMenuBar), imageLabel(new QLabel), scrollArea(new QScrollArea),
|
QDialog(parent), menuBar(new QMenuBar), imageLabel(new QLabel), scrollArea(new QScrollArea),
|
||||||
saveAsAct(nullptr), copyAct(nullptr), cmdAct(nullptr), zoomInAct(nullptr), zoomOutAct(nullptr),
|
buttonBox(nullptr), scaleFactor(1.0), atomSize(1.0), saveAsAct(nullptr), copyAct(nullptr),
|
||||||
normalSizeAct(nullptr), lammps(_lammps), group("all"), filename(fileName), useelements(false),
|
cmdAct(nullptr), zoomInAct(nullptr), zoomOutAct(nullptr), normalSizeAct(nullptr),
|
||||||
usediameter(false), usesigma(false)
|
lammps(_lammps), group("all"), filename(fileName), useelements(false), usediameter(false),
|
||||||
|
usesigma(false)
|
||||||
{
|
{
|
||||||
imageLabel->setBackgroundRole(QPalette::Base);
|
imageLabel->setBackgroundRole(QPalette::Base);
|
||||||
imageLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
|
imageLabel->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
|
||||||
@ -163,6 +166,13 @@ ImageViewer::ImageViewer(const QString &fileName, LammpsWrapper *_lammps, QWidge
|
|||||||
renderstatus->setEnabled(false);
|
renderstatus->setEnabled(false);
|
||||||
renderstatus->setToolTip("Render status");
|
renderstatus->setToolTip("Render status");
|
||||||
renderstatus->setObjectName("renderstatus");
|
renderstatus->setObjectName("renderstatus");
|
||||||
|
auto *asize = new QLineEdit(QString::number(atomSize));
|
||||||
|
auto *valid = new QDoubleValidator(1.0e-10, 1.0e10, 10, asize);
|
||||||
|
asize->setValidator(valid);
|
||||||
|
asize->setObjectName("atomSize");
|
||||||
|
asize->setToolTip("Set Atom size");
|
||||||
|
asize->setEnabled(false);
|
||||||
|
asize->hide();
|
||||||
settings.beginGroup("snapshot");
|
settings.beginGroup("snapshot");
|
||||||
auto *xval = new QSpinBox;
|
auto *xval = new QSpinBox;
|
||||||
xval->setRange(100, 10000);
|
xval->setRange(100, 10000);
|
||||||
@ -179,6 +189,7 @@ ImageViewer::ImageViewer(const QString &fileName, LammpsWrapper *_lammps, QWidge
|
|||||||
yval->setToolTip("Set rendered image height");
|
yval->setToolTip("Set rendered image height");
|
||||||
yval->setMinimumSize(bsize);
|
yval->setMinimumSize(bsize);
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
connect(asize, &QLineEdit::editingFinished, this, &ImageViewer::set_atom_size);
|
||||||
connect(xval, &QAbstractSpinBox::editingFinished, this, &ImageViewer::edit_size);
|
connect(xval, &QAbstractSpinBox::editingFinished, this, &ImageViewer::edit_size);
|
||||||
connect(yval, &QAbstractSpinBox::editingFinished, this, &ImageViewer::edit_size);
|
connect(yval, &QAbstractSpinBox::editingFinished, this, &ImageViewer::edit_size);
|
||||||
|
|
||||||
@ -249,6 +260,11 @@ ImageViewer::ImageViewer(const QString &fileName, LammpsWrapper *_lammps, QWidge
|
|||||||
|
|
||||||
menuLayout->addWidget(menuBar);
|
menuLayout->addWidget(menuBar);
|
||||||
menuLayout->addWidget(renderstatus);
|
menuLayout->addWidget(renderstatus);
|
||||||
|
menuLayout->addWidget(new QLabel(" Atom Size: "));
|
||||||
|
menuLayout->addWidget(asize);
|
||||||
|
// hide item initially
|
||||||
|
menuLayout->itemAt(2)->widget()->setObjectName("AtomLabel");
|
||||||
|
menuLayout->itemAt(2)->widget()->hide();
|
||||||
menuLayout->addWidget(new QLabel(" Width: "));
|
menuLayout->addWidget(new QLabel(" Width: "));
|
||||||
menuLayout->addWidget(xval);
|
menuLayout->addWidget(xval);
|
||||||
menuLayout->addWidget(new QLabel(" Height: "));
|
menuLayout->addWidget(new QLabel(" Height: "));
|
||||||
@ -307,7 +323,7 @@ ImageViewer::ImageViewer(const QString &fileName, LammpsWrapper *_lammps, QWidge
|
|||||||
doanti->setChecked(antialias);
|
doanti->setChecked(antialias);
|
||||||
|
|
||||||
scaleFactor = 1.0;
|
scaleFactor = 1.0;
|
||||||
resize(image.width() + 20, image.height() + 75);
|
resize(image.width() + 25, image.height() + 80);
|
||||||
|
|
||||||
scrollArea->setVisible(true);
|
scrollArea->setVisible(true);
|
||||||
updateActions();
|
updateActions();
|
||||||
@ -356,6 +372,13 @@ void ImageViewer::reset_view()
|
|||||||
createImage();
|
createImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ImageViewer::set_atom_size()
|
||||||
|
{
|
||||||
|
auto *field = qobject_cast<QLineEdit *>(sender());
|
||||||
|
atomSize = field->text().toDouble();
|
||||||
|
createImage();
|
||||||
|
}
|
||||||
|
|
||||||
void ImageViewer::edit_size()
|
void ImageViewer::edit_size()
|
||||||
{
|
{
|
||||||
auto *field = qobject_cast<QSpinBox *>(sender());
|
auto *field = qobject_cast<QSpinBox *>(sender());
|
||||||
@ -560,10 +583,43 @@ void ImageViewer::createImage()
|
|||||||
if (useelements || usediameter || usesigma) {
|
if (useelements || usediameter || usesigma) {
|
||||||
auto *button = findChild<QPushButton *>("vdw");
|
auto *button = findChild<QPushButton *>("vdw");
|
||||||
if (button) button->setEnabled(true);
|
if (button) button->setEnabled(true);
|
||||||
|
auto *edit = findChild<QLineEdit *>("atomSize");
|
||||||
|
if (edit) {
|
||||||
|
edit->setEnabled(false);
|
||||||
|
edit->hide();
|
||||||
|
}
|
||||||
|
auto *label = findChild<QLabel *>("AtomLabel");
|
||||||
|
if (label) {
|
||||||
|
label->setEnabled(false);
|
||||||
|
label->hide();
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
adiams.clear();
|
adiams.clear();
|
||||||
auto *button = findChild<QPushButton *>("vdw");
|
auto *button = findChild<QPushButton *>("vdw");
|
||||||
if (button) button->setEnabled(false);
|
if (button) button->setEnabled(false);
|
||||||
|
|
||||||
|
auto *label = findChild<QLabel *>("AtomLabel");
|
||||||
|
if (label) {
|
||||||
|
label->setEnabled(true);
|
||||||
|
label->show();
|
||||||
|
}
|
||||||
|
auto *edit = findChild<QLineEdit *>("atomSize");
|
||||||
|
if (edit) {
|
||||||
|
if (!edit->isEnabled()) {
|
||||||
|
edit->setEnabled(true);
|
||||||
|
edit->show();
|
||||||
|
// initialize with lattice spacing
|
||||||
|
auto *xlattice = (const double *)lammps->extract_global("xlattice");
|
||||||
|
if (xlattice) atomSize = *xlattice;
|
||||||
|
edit->setText(QString::number(atomSize));
|
||||||
|
}
|
||||||
|
atomSize = edit->text().toDouble();
|
||||||
|
}
|
||||||
|
if (atomSize != 1.0) {
|
||||||
|
for (int i = 1; i <= ntypes; ++i)
|
||||||
|
adiams += QString("adiam %1 %2 ").arg(i).arg(atomSize);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// color
|
// color
|
||||||
@ -607,6 +663,7 @@ void ImageViewer::createImage()
|
|||||||
dumpcmd += " backcolor " + settings.value("background", "black").toString();
|
dumpcmd += " backcolor " + settings.value("background", "black").toString();
|
||||||
if (useelements) dumpcmd += blank + elements + blank + adiams + blank;
|
if (useelements) dumpcmd += blank + elements + blank + adiams + blank;
|
||||||
if (usesigma) dumpcmd += blank + adiams + blank;
|
if (usesigma) dumpcmd += blank + adiams + blank;
|
||||||
|
if (!useelements && !usesigma && (atomSize != 1.0)) dumpcmd += blank + adiams + blank;
|
||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
|
|
||||||
last_dump_cmd = dumpcmd;
|
last_dump_cmd = dumpcmd;
|
||||||
@ -617,10 +674,10 @@ void ImageViewer::createImage()
|
|||||||
const QImage newImage = reader.read();
|
const QImage newImage = reader.read();
|
||||||
dumpfile.remove();
|
dumpfile.remove();
|
||||||
|
|
||||||
// read of new image failed. Don't try to scale and load it.
|
// read of new image failed. nothing left to do.
|
||||||
if (newImage.isNull()) return;
|
if (newImage.isNull()) return;
|
||||||
|
|
||||||
// scale back to achieve antialiasing
|
// show show image
|
||||||
image = newImage;
|
image = newImage;
|
||||||
imageLabel->setPixmap(QPixmap::fromImage(image));
|
imageLabel->setPixmap(QPixmap::fromImage(image));
|
||||||
imageLabel->adjustSize();
|
imageLabel->adjustSize();
|
||||||
|
|||||||
@ -34,13 +34,15 @@ class ImageViewer : public QDialog {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ImageViewer(const QString &fileName, LammpsWrapper *_lammps, QWidget *parent = nullptr);
|
explicit ImageViewer(const QString &fileName, LammpsWrapper *_lammps,
|
||||||
|
QWidget *parent = nullptr);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void saveAs();
|
void saveAs();
|
||||||
void copy();
|
void copy();
|
||||||
void quit();
|
void quit();
|
||||||
|
|
||||||
|
void set_atom_size();
|
||||||
void edit_size();
|
void edit_size();
|
||||||
void reset_view();
|
void reset_view();
|
||||||
void toggle_ssao();
|
void toggle_ssao();
|
||||||
@ -75,7 +77,8 @@ private:
|
|||||||
QLabel *imageLabel;
|
QLabel *imageLabel;
|
||||||
QScrollArea *scrollArea;
|
QScrollArea *scrollArea;
|
||||||
QDialogButtonBox *buttonBox;
|
QDialogButtonBox *buttonBox;
|
||||||
double scaleFactor = 1.0;
|
double scaleFactor;
|
||||||
|
double atomSize;
|
||||||
|
|
||||||
QAction *saveAsAct;
|
QAction *saveAsAct;
|
||||||
QAction *copyAct;
|
QAction *copyAct;
|
||||||
|
|||||||
@ -54,8 +54,17 @@
|
|||||||
</provides>
|
</provides>
|
||||||
|
|
||||||
<releases>
|
<releases>
|
||||||
|
<release version="1.6.10" timestamp="1724585189">
|
||||||
|
<description>
|
||||||
|
|
||||||
|
</description>
|
||||||
|
</release>
|
||||||
<release version="1.6.9" timestamp="1724308872">
|
<release version="1.6.9" timestamp="1724308872">
|
||||||
<description>
|
<description>
|
||||||
|
Added search and replace functionality
|
||||||
|
Converged command line argument parsing using Qt facilities
|
||||||
|
Added dark mode adjustments to syntax highlighting
|
||||||
|
Add field to enter Atom size, if not determined otherwise
|
||||||
</description>
|
</description>
|
||||||
</release>
|
</release>
|
||||||
<release version="1.6.8" timestamp="1723581926">
|
<release version="1.6.8" timestamp="1723581926">
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include "chartviewer.h"
|
#include "chartviewer.h"
|
||||||
#include "fileviewer.h"
|
#include "fileviewer.h"
|
||||||
|
#include "findandreplace.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "highlighter.h"
|
#include "highlighter.h"
|
||||||
#include "imageviewer.h"
|
#include "imageviewer.h"
|
||||||
@ -68,18 +69,13 @@
|
|||||||
static const QString blank(" ");
|
static const QString blank(" ");
|
||||||
static constexpr int BUFLEN = 256;
|
static constexpr int BUFLEN = 256;
|
||||||
|
|
||||||
LammpsGui::LammpsGui(QWidget *parent, const char *filename) :
|
LammpsGui::LammpsGui(QWidget *parent, const QString &filename) :
|
||||||
QMainWindow(parent), ui(new Ui::LammpsGui), highlighter(nullptr), capturer(nullptr),
|
QMainWindow(parent), ui(new Ui::LammpsGui), highlighter(nullptr), capturer(nullptr),
|
||||||
status(nullptr), logwindow(nullptr), imagewindow(nullptr), chartwindow(nullptr),
|
status(nullptr), logwindow(nullptr), imagewindow(nullptr), chartwindow(nullptr),
|
||||||
slideshow(nullptr), logupdater(nullptr), dirstatus(nullptr), progress(nullptr),
|
slideshow(nullptr), logupdater(nullptr), dirstatus(nullptr), progress(nullptr),
|
||||||
prefdialog(nullptr), lammpsstatus(nullptr), varwindow(nullptr), wizard(nullptr),
|
prefdialog(nullptr), lammpsstatus(nullptr), varwindow(nullptr), wizard(nullptr),
|
||||||
runner(nullptr), is_running(false), run_counter(0)
|
runner(nullptr), is_running(false), run_counter(0)
|
||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
// register QList<QString> only needed for Qt5
|
|
||||||
qRegisterMetaTypeStreamOperators<QList<QString>>("QList<QString>");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
docver = "";
|
docver = "";
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->setCentralWidget(ui->textEdit);
|
this->setCentralWidget(ui->textEdit);
|
||||||
@ -90,27 +86,34 @@ LammpsGui::LammpsGui(QWidget *parent, const char *filename) :
|
|||||||
// use $HOME if we get dropped to "/" like on macOS
|
// use $HOME if we get dropped to "/" like on macOS
|
||||||
if (current_dir == "/") current_dir = QDir::homePath();
|
if (current_dir == "/") current_dir = QDir::homePath();
|
||||||
inspectList.clear();
|
inspectList.clear();
|
||||||
|
setAutoFillBackground(true);
|
||||||
|
|
||||||
// restore and initialize settings
|
// restore and initialize settings
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
#if defined(LAMMPS_GUI_USE_PLUGIN)
|
#if defined(LAMMPS_GUI_USE_PLUGIN)
|
||||||
plugin_path.clear();
|
plugin_path =
|
||||||
std::string deffile = settings.value("plugin_path", "liblammps.so").toString().toStdString();
|
QFileInfo(settings.value("plugin_path", "liblammps.so").toString()).canonicalFilePath();
|
||||||
for (const char *libfile : {deffile.c_str(), "./liblammps.so", "liblammps.dylib",
|
if (!lammps.load_lib(plugin_path.toStdString().c_str())) {
|
||||||
"./liblammps.dylib", "liblammps.dll"}) {
|
// fall back to defaults
|
||||||
if (lammps.load_lib(libfile)) {
|
for (const char *libfile :
|
||||||
auto canonical = QFileInfo(libfile).canonicalFilePath();
|
{"./liblammps.so", "liblammps.dylib", "./liblammps.dylib", "liblammps.dll"}) {
|
||||||
plugin_path = canonical.toStdString();
|
if (lammps.load_lib(libfile)) {
|
||||||
settings.setValue("plugin_path", canonical);
|
plugin_path = QFileInfo(libfile).canonicalFilePath();
|
||||||
break;
|
settings.setValue("plugin_path", plugin_path);
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
plugin_path.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugin_path.empty()) {
|
if (plugin_path.isEmpty()) {
|
||||||
// none of the plugin paths could load, remove key
|
// none of the plugin paths could load, remove key
|
||||||
settings.remove("plugin_path");
|
settings.remove("plugin_path");
|
||||||
QMessageBox::critical(this, "Error", "Cannot open LAMMPS shared library file");
|
QMessageBox::critical(this, "Error",
|
||||||
|
"Cannot open LAMMPS shared library file.\n"
|
||||||
|
"Use -p command line flag to specify a path to the library.");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -205,6 +208,7 @@ LammpsGui::LammpsGui(QWidget *parent, const char *filename) :
|
|||||||
connect(ui->actionPaste, &QAction::triggered, this, &LammpsGui::paste);
|
connect(ui->actionPaste, &QAction::triggered, this, &LammpsGui::paste);
|
||||||
connect(ui->actionUndo, &QAction::triggered, this, &LammpsGui::undo);
|
connect(ui->actionUndo, &QAction::triggered, this, &LammpsGui::undo);
|
||||||
connect(ui->actionRedo, &QAction::triggered, this, &LammpsGui::redo);
|
connect(ui->actionRedo, &QAction::triggered, this, &LammpsGui::redo);
|
||||||
|
connect(ui->actionSearchAndReplace, &QAction::triggered, this, &LammpsGui::findandreplace);
|
||||||
connect(ui->actionRun_Buffer, &QAction::triggered, this, &LammpsGui::run_buffer);
|
connect(ui->actionRun_Buffer, &QAction::triggered, this, &LammpsGui::run_buffer);
|
||||||
connect(ui->actionRun_File, &QAction::triggered, this, &LammpsGui::run_file);
|
connect(ui->actionRun_File, &QAction::triggered, this, &LammpsGui::run_file);
|
||||||
connect(ui->actionStop_LAMMPS, &QAction::triggered, this, &LammpsGui::stop_run);
|
connect(ui->actionStop_LAMMPS, &QAction::triggered, this, &LammpsGui::stop_run);
|
||||||
@ -278,7 +282,7 @@ LammpsGui::LammpsGui(QWidget *parent, const char *filename) :
|
|||||||
dirstatus->show();
|
dirstatus->show();
|
||||||
ui->statusbar->addWidget(progress);
|
ui->statusbar->addWidget(progress);
|
||||||
|
|
||||||
if (filename) {
|
if (filename.size() > 0) {
|
||||||
open_file(filename);
|
open_file(filename);
|
||||||
} else {
|
} else {
|
||||||
setWindowTitle("LAMMPS-GUI - Editor - *unknown*");
|
setWindowTitle("LAMMPS-GUI - Editor - *unknown*");
|
||||||
@ -502,7 +506,7 @@ void LammpsGui::start_exe()
|
|||||||
void LammpsGui::update_recents(const QString &filename)
|
void LammpsGui::update_recents(const QString &filename)
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
recent = settings.value("recent").value<QList<QString>>();
|
if (settings.contains("recent")) recent = settings.value("recent").value<QList<QString>>();
|
||||||
|
|
||||||
for (int i = 0; i < recent.size(); ++i) {
|
for (int i = 0; i < recent.size(); ++i) {
|
||||||
QFileInfo fi(recent[i]);
|
QFileInfo fi(recent[i]);
|
||||||
@ -514,7 +518,10 @@ void LammpsGui::update_recents(const QString &filename)
|
|||||||
|
|
||||||
if (!filename.isEmpty() && !recent.contains(filename)) recent.prepend(filename);
|
if (!filename.isEmpty() && !recent.contains(filename)) recent.prepend(filename);
|
||||||
if (recent.size() > 5) recent.removeLast();
|
if (recent.size() > 5) recent.removeLast();
|
||||||
settings.setValue("recent", QVariant::fromValue(recent));
|
if (recent.size() > 0)
|
||||||
|
settings.setValue("recent", QVariant::fromValue(recent));
|
||||||
|
else
|
||||||
|
settings.remove("recent");
|
||||||
|
|
||||||
ui->action_1->setVisible(false);
|
ui->action_1->setVisible(false);
|
||||||
if ((recent.size() > 0) && !recent[0].isEmpty()) {
|
if ((recent.size() > 0) && !recent[0].isEmpty()) {
|
||||||
@ -1428,12 +1435,16 @@ void LammpsGui::setFont(const QFont &newfont)
|
|||||||
void LammpsGui::about()
|
void LammpsGui::about()
|
||||||
{
|
{
|
||||||
std::string version = "This is LAMMPS-GUI version " LAMMPS_GUI_VERSION;
|
std::string version = "This is LAMMPS-GUI version " LAMMPS_GUI_VERSION;
|
||||||
version += " using Qt version " QT_VERSION_STR "\n";
|
version += " using Qt version " QT_VERSION_STR;
|
||||||
|
if (is_light_theme())
|
||||||
|
version += " using light theme\n";
|
||||||
|
else
|
||||||
|
version += " using dark theme\n";
|
||||||
if (lammps.has_plugin()) {
|
if (lammps.has_plugin()) {
|
||||||
version += "LAMMPS library loaded as plugin";
|
version += "LAMMPS library loaded as plugin";
|
||||||
if (!plugin_path.empty()) {
|
if (!plugin_path.isEmpty()) {
|
||||||
version += " from file ";
|
version += " from file ";
|
||||||
version += plugin_path;
|
version += plugin_path.toStdString();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
version += "LAMMPS library linked to executable";
|
version += "LAMMPS library linked to executable";
|
||||||
@ -1862,6 +1873,14 @@ void LammpsGui::edit_variables()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LammpsGui::findandreplace()
|
||||||
|
{
|
||||||
|
FindAndReplace find(ui->textEdit, this);
|
||||||
|
find.setFont(font());
|
||||||
|
find.setObjectName("find");
|
||||||
|
find.exec();
|
||||||
|
}
|
||||||
|
|
||||||
void LammpsGui::preferences()
|
void LammpsGui::preferences()
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|||||||
@ -68,7 +68,7 @@ class LammpsGui : public QMainWindow {
|
|||||||
friend class Tutorial2Wizard;
|
friend class Tutorial2Wizard;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LammpsGui(QWidget *parent = nullptr, const char *filename = nullptr);
|
LammpsGui(QWidget *parent = nullptr, const QString &filename = QString());
|
||||||
~LammpsGui() override;
|
~LammpsGui() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -115,6 +115,7 @@ private slots:
|
|||||||
void paste();
|
void paste();
|
||||||
void undo();
|
void undo();
|
||||||
void redo();
|
void redo();
|
||||||
|
void findandreplace();
|
||||||
void run_buffer() { do_run(true); }
|
void run_buffer() { do_run(true); }
|
||||||
void run_file() { do_run(false); }
|
void run_file() { do_run(false); }
|
||||||
|
|
||||||
@ -171,7 +172,7 @@ private:
|
|||||||
LammpsWrapper lammps;
|
LammpsWrapper lammps;
|
||||||
LammpsRunner *runner;
|
LammpsRunner *runner;
|
||||||
QString docver;
|
QString docver;
|
||||||
std::string plugin_path;
|
QString plugin_path;
|
||||||
bool is_running;
|
bool is_running;
|
||||||
int run_counter;
|
int run_counter;
|
||||||
std::vector<char *> lammps_args;
|
std::vector<char *> lammps_args;
|
||||||
|
|||||||
@ -58,6 +58,7 @@
|
|||||||
<file>icons/preferences-desktop.png</file>
|
<file>icons/preferences-desktop.png</file>
|
||||||
<file>icons/process-stop.png</file>
|
<file>icons/process-stop.png</file>
|
||||||
<file>icons/run-file.png</file>
|
<file>icons/run-file.png</file>
|
||||||
|
<file>icons/search.png</file>
|
||||||
<file>icons/system-box.png</file>
|
<file>icons/system-box.png</file>
|
||||||
<file>icons/system-help.png</file>
|
<file>icons/system-help.png</file>
|
||||||
<file>icons/system-run.png</file>
|
<file>icons/system-run.png</file>
|
||||||
|
|||||||
@ -62,6 +62,8 @@
|
|||||||
<addaction name="actionCut"/>
|
<addaction name="actionCut"/>
|
||||||
<addaction name="actionPaste"/>
|
<addaction name="actionPaste"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionSearchAndReplace"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
<addaction name="actionPreferences"/>
|
<addaction name="actionPreferences"/>
|
||||||
<addaction name="actionDefaults"/>
|
<addaction name="actionDefaults"/>
|
||||||
</widget>
|
</widget>
|
||||||
@ -312,12 +314,23 @@
|
|||||||
<string>Ctrl+Shift+H</string>
|
<string>Ctrl+Shift+H</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actionSearchAndReplace">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme=":/icons/search.png"/>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>&Find and Replace...</string>
|
||||||
|
</property>
|
||||||
|
<property name="shortcut">
|
||||||
|
<string>Ctrl+F</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
<action name="actionPreferences">
|
<action name="actionPreferences">
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset theme=":/icons/preferences-desktop.png"/>
|
<iconset theme=":/icons/preferences-desktop.png"/>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Pre&ferences...</string>
|
<string>P&references...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="shortcut">
|
<property name="shortcut">
|
||||||
<string>Ctrl+P</string>
|
<string>Ctrl+P</string>
|
||||||
|
|||||||
@ -115,7 +115,7 @@ double LammpsWrapper::extract_variable(const char *keyword)
|
|||||||
}
|
}
|
||||||
double val = *((double *)ptr);
|
double val = *((double *)ptr);
|
||||||
#if defined(LAMMPS_GUI_USE_PLUGIN)
|
#if defined(LAMMPS_GUI_USE_PLUGIN)
|
||||||
ptr = ((liblammpsplugin_t *)plugin_handle)->free(ptr);
|
((liblammpsplugin_t *)plugin_handle)->free(ptr);
|
||||||
#else
|
#else
|
||||||
lammps_free(ptr);
|
lammps_free(ptr);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -17,6 +17,9 @@
|
|||||||
#include <QCommandLineOption>
|
#include <QCommandLineOption>
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
#include <QLocale>
|
#include <QLocale>
|
||||||
|
#include <QSettings>
|
||||||
|
#include <QString>
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
@ -27,6 +30,11 @@
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
Q_INIT_RESOURCE(lammpsgui);
|
Q_INIT_RESOURCE(lammpsgui);
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
// register QList<QString> only needed for Qt5
|
||||||
|
qRegisterMetaTypeStreamOperators<QList<QString>>("QList<QString>");
|
||||||
|
#endif
|
||||||
|
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
// enforce using the plain ASCII C locale within the GUI.
|
// enforce using the plain ASCII C locale within the GUI.
|
||||||
QLocale::setDefault(QLocale::c());
|
QLocale::setDefault(QLocale::c());
|
||||||
@ -40,13 +48,32 @@ int main(int argc, char *argv[])
|
|||||||
"\nA graphical editor for LAMMPS input files with syntax highlighting and\n"
|
"\nA graphical editor for LAMMPS input files with syntax highlighting and\n"
|
||||||
"auto-completion that can run LAMMPS directly. It has built-in capabilities\n"
|
"auto-completion that can run LAMMPS directly. It has built-in capabilities\n"
|
||||||
"for monitoring, visualization, plotting, and capturing console output.");
|
"for monitoring, visualization, plotting, and capturing console output.");
|
||||||
|
#if defined(LAMMPS_GUI_USE_PLUGIN)
|
||||||
|
QCommandLineOption plugindir(QStringList() << "p"
|
||||||
|
<< "pluginpath",
|
||||||
|
"Path to LAMMPS shared library", "path");
|
||||||
|
parser.addOption(plugindir);
|
||||||
|
#endif
|
||||||
|
|
||||||
parser.addHelpOption();
|
parser.addHelpOption();
|
||||||
parser.addVersionOption();
|
parser.addVersionOption();
|
||||||
parser.addPositionalArgument("file", "The LAMMPS input file to open (optional).");
|
parser.addPositionalArgument("file", "The LAMMPS input file to open (optional).");
|
||||||
parser.process(app); // this removes known arguments
|
parser.process(app);
|
||||||
|
|
||||||
const char *infile = nullptr;
|
#if defined(LAMMPS_GUI_USE_PLUGIN)
|
||||||
if (argc > 1) infile = argv[1];
|
if (parser.isSet(plugindir)) {
|
||||||
|
QStringList pluginpath = parser.values(plugindir);
|
||||||
|
if (pluginpath.length() > 0) {
|
||||||
|
QSettings settings;
|
||||||
|
settings.setValue("plugin_path", QString(pluginpath.at(0)));
|
||||||
|
settings.sync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
QString infile;
|
||||||
|
QStringList args = parser.positionalArguments();
|
||||||
|
if (args.size() > 0) infile = args[0];
|
||||||
LammpsGui w(nullptr, infile);
|
LammpsGui w(nullptr, infile);
|
||||||
w.show();
|
w.show();
|
||||||
return app.exec();
|
return app.exec();
|
||||||
|
|||||||
@ -466,6 +466,33 @@ TEST_F(LibraryProperties, global)
|
|||||||
if (!verbose) ::testing::internal::GetCapturedStdout();
|
if (!verbose) ::testing::internal::GetCapturedStdout();
|
||||||
map_style = *(int *)lammps_extract_global(lmp, "map_style");
|
map_style = *(int *)lammps_extract_global(lmp, "map_style");
|
||||||
EXPECT_EQ(map_style, Atom::MAP_ARRAY);
|
EXPECT_EQ(map_style, Atom::MAP_ARRAY);
|
||||||
|
|
||||||
|
EXPECT_EQ(lammps_extract_global_datatype(lmp, "xlattice"), LAMMPS_DOUBLE);
|
||||||
|
EXPECT_EQ(lammps_extract_global_datatype(lmp, "ylattice"), LAMMPS_DOUBLE);
|
||||||
|
EXPECT_EQ(lammps_extract_global_datatype(lmp, "zlattice"), LAMMPS_DOUBLE);
|
||||||
|
auto *xlattice = (double *)lammps_extract_global(lmp, "xlattice");
|
||||||
|
auto *ylattice = (double *)lammps_extract_global(lmp, "ylattice");
|
||||||
|
auto *zlattice = (double *)lammps_extract_global(lmp, "zlattice");
|
||||||
|
EXPECT_NE(xlattice, nullptr);
|
||||||
|
EXPECT_NE(ylattice, nullptr);
|
||||||
|
EXPECT_NE(zlattice, nullptr);
|
||||||
|
EXPECT_DOUBLE_EQ(*xlattice, 1.0);
|
||||||
|
EXPECT_DOUBLE_EQ(*ylattice, 1.0);
|
||||||
|
EXPECT_DOUBLE_EQ(*zlattice, 1.0);
|
||||||
|
if (!verbose) ::testing::internal::CaptureStdout();
|
||||||
|
lammps_command(lmp, "clear");
|
||||||
|
lammps_command(lmp, "units real");
|
||||||
|
lammps_command(lmp, "lattice fcc 2.0");
|
||||||
|
if (!verbose) ::testing::internal::GetCapturedStdout();
|
||||||
|
xlattice = (double *)lammps_extract_global(lmp, "xlattice");
|
||||||
|
ylattice = (double *)lammps_extract_global(lmp, "ylattice");
|
||||||
|
zlattice = (double *)lammps_extract_global(lmp, "zlattice");
|
||||||
|
EXPECT_NE(xlattice, nullptr);
|
||||||
|
EXPECT_NE(ylattice, nullptr);
|
||||||
|
EXPECT_NE(zlattice, nullptr);
|
||||||
|
EXPECT_DOUBLE_EQ(*xlattice, 2.0);
|
||||||
|
EXPECT_DOUBLE_EQ(*ylattice, 2.0);
|
||||||
|
EXPECT_DOUBLE_EQ(*zlattice, 2.0);
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_F(LibraryProperties, pair1)
|
TEST_F(LibraryProperties, pair1)
|
||||||
|
|||||||
@ -656,6 +656,9 @@ create_atoms 1 single &
|
|||||||
self.assertEqual(self.lmp.extract_global("map_tag_max"), -1)
|
self.assertEqual(self.lmp.extract_global("map_tag_max"), -1)
|
||||||
self.assertEqual(self.lmp.extract_global("sortfreq"), 1000)
|
self.assertEqual(self.lmp.extract_global("sortfreq"), 1000)
|
||||||
self.assertEqual(self.lmp.extract_global("nextsort"), 0)
|
self.assertEqual(self.lmp.extract_global("nextsort"), 0)
|
||||||
|
self.assertEqual(self.lmp.extract_global("xlattice"), 1.0)
|
||||||
|
self.assertEqual(self.lmp.extract_global("ylattice"), 1.0)
|
||||||
|
self.assertEqual(self.lmp.extract_global("zlattice"), 1.0)
|
||||||
|
|
||||||
# set and initialize r-RESPA
|
# set and initialize r-RESPA
|
||||||
self.lmp.command("run_style respa 3 5 2 pair 2 kspace 3")
|
self.lmp.command("run_style respa 3 5 2 pair 2 kspace 3")
|
||||||
|
|||||||