Merge branch 'develop' of github.com:lammps/lammps into kk_update_4.5.0

This commit is contained in:
Stan Moore
2025-01-07 10:04:43 -07:00
149 changed files with 1757 additions and 1057 deletions

View File

@ -1078,12 +1078,15 @@ if(BUILD_TOOLS)
message(STATUS "<<< Building Tools >>>")
endif()
if(BUILD_LAMMPS_GUI)
message(STATUS "<<< Building LAMMPS GUI >>>")
message(STATUS "<<< Building LAMMPS-GUI >>>")
if(LAMMPS_GUI_USE_PLUGIN)
message(STATUS "Loading LAMMPS library as plugin at run time")
else()
message(STATUS "Linking LAMMPS library at compile time")
endif()
if(BUILD_WHAM)
message(STATUS "<<< Building WHAM >>>")
endif()
endif()
if(ENABLE_TESTING)
message(STATUS "<<< Building Unit Tests >>>")

View File

@ -1,3 +1,5 @@
# FindVTK requires that C support is enabled when looking for MPI support
enable_language(C)
find_package(VTK REQUIRED NO_MODULE)
target_compile_definitions(lammps PRIVATE -DLAMMPS_VTK)
if (VTK_MAJOR_VERSION VERSION_LESS 9.0)

View File

@ -160,7 +160,7 @@ with the OpenMP 3.1 semantics used in LAMMPS for maximal compatibility
with compiler versions in use. If compilation with OpenMP enabled fails
because of your compiler requiring strict OpenMP 4.0 semantics, you can
change the behavior by adding ``-D LAMMPS_OMP_COMPAT=4`` to the
``LMP_INC`` variable in your makefile, or add it to the command line
``LMP_INC`` variable in your makefile, or add it to the command-line flags
while configuring with CMake. LAMMPS will auto-detect a suitable setting
for most GNU, Clang, and Intel compilers.
@ -502,6 +502,8 @@ using CMake or Make.
# chain.x, micelle2d.x, msi2lmp, phana,
# stl_bin2txt
-D BUILD_LAMMPS_GUI=value # yes or no (default). Build LAMMPS-GUI
-D BUILD_WHAM=value # yes (default). Download and build WHAM;
# only available for BUILD_LAMMPS_GUI=yes
The generated binaries will also become part of the LAMMPS installation
(see below).

View File

@ -8,7 +8,7 @@ packages. Links to those pages on the :doc:`Build overview <Build>`
page.
The following text assumes some familiarity with CMake and focuses on
using the command line tool ``cmake`` and what settings are supported
using the command-line tool ``cmake`` and what settings are supported
for building LAMMPS. A more detailed tutorial on how to use CMake
itself, the text mode or graphical user interface, to change the
generated output files for different build tools and development
@ -42,9 +42,9 @@ that want to modify or extend LAMMPS.
and adapt the LAMMPS default build configuration accordingly.
- CMake can generate files for different build tools and integrated
development environments (IDE).
- CMake supports customization of settings with a command line, text
- CMake supports customization of settings with a command-line, text
mode, or graphical user interface. No manual editing of files,
knowledge of file formats or complex command line syntax is required.
knowledge of file formats or complex command-line syntax is required.
- All enabled components are compiled in a single build operation.
- Automated dependency tracking for all files and configuration options.
- Support for true out-of-source compilation. Multiple configurations
@ -68,7 +68,7 @@ that purpose you can use either the command-line utility ``cmake`` (or
graphical utility ``cmake-gui``, or use them interchangeably. The
second step is then the compilation and linking of all objects,
libraries, and executables using the selected build tool. Here is a
minimal example using the command line version of CMake to build LAMMPS
minimal example using the command-line version of CMake to build LAMMPS
with no add-on packages enabled and no customization:
.. code-block:: bash
@ -131,7 +131,7 @@ file called ``CMakeLists.txt`` (for LAMMPS it is located in the
configuration step. The cache file contains all current CMake settings.
To modify settings, enable or disable features, you need to set
*variables* with either the ``-D`` command line flag (``-D
*variables* with either the ``-D`` command-line flag (``-D
VARIABLE1_NAME=value``) or change them in the text mode of the graphical
user interface. The ``-D`` flag can be used several times in one command.
@ -141,11 +141,11 @@ a different compiler tool chain. Those are loaded with the ``-C`` flag
(``-C ../cmake/presets/basic.cmake``). This step would only be needed
once, as the settings from the preset files are stored in the
``CMakeCache.txt`` file. It is also possible to customize the build
by adding one or more ``-D`` flags to the CMake command line.
by adding one or more ``-D`` flags to the CMake command.
Generating files for alternate build tools (e.g. Ninja) and project files
for IDEs like Eclipse, CodeBlocks, or Kate can be selected using the ``-G``
command line flag. A list of available generator settings for your
command-line flag. A list of available generator settings for your
specific CMake version is given when running ``cmake --help``.
.. _cmake_multiconfig:

View File

@ -263,9 +263,9 @@ will be skipped if prerequisite features are not available in LAMMPS.
time. Preference is given to parts of the code base that are easy to
test or commonly used.
Tests as shown by the ``ctest`` program are command lines defined in the
Tests as shown by the ``ctest`` program are commands defined in the
``CMakeLists.txt`` files in the ``unittest`` directory tree. A few
tests simply execute LAMMPS with specific command line flags and check
tests simply execute LAMMPS with specific command-line flags and check
the output to the screen for expected content. A large number of unit
tests are special tests programs using the `GoogleTest framework
<https://github.com/google/googletest/>`_ and linked to the LAMMPS
@ -420,7 +420,7 @@ during MD timestepping and manipulate per-atom properties like
positions, velocities, and forces. For those fix styles, testing can be
done in a very similar fashion as for force fields and thus there is a
test program `test_fix_timestep` that shares a lot of code, properties,
and command line flags with the force field style testers described in
and command-line flags with the force field style testers described in
the previous section.
This tester will set up a small molecular system run with verlet run
@ -642,10 +642,10 @@ The following target are available for both, GNU make and CMake:
.. _gh-cli:
GitHub command line interface
GitHub command-line interface
-----------------------------
GitHub has developed a `command line tool <https://cli.github.com>`_
GitHub has developed a `command-line tool <https://cli.github.com>`_
to interact with the GitHub website via a command called ``gh``.
This is extremely convenient when working with a Git repository hosted
on GitHub (like LAMMPS). It is thus highly recommended to install it

View File

@ -209,7 +209,7 @@ necessary for ``hipcc`` and the linker to work correctly.
Using the CHIP-SPV implementation of HIP is supported. It allows one to
run HIP code on Intel GPUs via the OpenCL or Level Zero back ends. To use
CHIP-SPV, you must set ``-DHIP_USE_DEVICE_SORT=OFF`` in your CMake
command line as CHIP-SPV does not yet support hipCUB. As of Summer 2022,
command-line as CHIP-SPV does not yet support hipCUB. As of Summer 2022,
the use of HIP for Intel GPUs is experimental. You should only use this
option in preparations to run on Aurora system at Argonne.
@ -232,7 +232,7 @@ option in preparations to run on Aurora system at Argonne.
.. code:: bash
# CUDA target (not recommended, use GPU_ARCH=cuda)
# CUDA target (not recommended, use GPU_API=cuda)
# !!! DO NOT set CMAKE_CXX_COMPILER !!!
export HIP_PLATFORM=nvcc
export HIP_PATH=/path/to/HIP/install
@ -421,9 +421,10 @@ minutes to hours) to build. Of course you only need to do that once.)
cmake build system. The ``lib/kim/Install.py`` script supports a
``CMAKE`` environment variable if the cmake executable is named other
than ``cmake`` on your system. Additional environment variables may be
provided on the command line for use by cmake. For example, to use the
``cmake3`` executable and tell it to use the gnu version 11 compilers
to build KIM, one could use the following command line.
set with the ``make`` command for use by cmake. For example, to use the
``cmake3`` executable and tell it to use the GNU version 11 compilers
called ``g++-11``, ``gcc-11`` and ``gfortran-11`` to build KIM, one
could use the following command.
.. code-block:: bash
@ -2203,7 +2204,7 @@ verified to work in February 2020 with Quantum Espresso versions 6.3 to
from the sources in the *lib* folder (including the essential
libqmmm.a) are not included in the static LAMMPS library and
(currently) not installed, while their code is included in the
shared LAMMPS library. Thus a typical command line to configure
shared LAMMPS library. Thus a typical command to configure
building LAMMPS for QMMM would be:
.. code-block:: bash

View File

@ -100,9 +100,9 @@ procedure.
It is possible to use both the integrated CMake support of the Visual
Studio IDE or use an external CMake installation (e.g. downloaded from
cmake.org) to create build files and compile LAMMPS from the command line.
cmake.org) to create build files and compile LAMMPS from the command-line.
Compilation via command line and unit tests are checked automatically
Compilation via command-line and unit tests are checked automatically
for the LAMMPS development branch through
`GitHub Actions <https://github.com/lammps/lammps/actions/workflows/compile-msvc.yml>`_.
@ -115,7 +115,7 @@ for the LAMMPS development branch through
Please note, that for either approach CMake will create a so-called
:ref:`"multi-configuration" build environment <cmake_multiconfig>`, and
the command lines for building and testing LAMMPS must be adjusted
the commands for building and testing LAMMPS must be adjusted
accordingly.
The LAMMPS cmake folder contains a ``CMakeSettings.json`` file with

View File

@ -4,7 +4,7 @@ LAMMPS Class
The LAMMPS class is encapsulating an MD simulation state and thus it is
the class that needs to be created when starting a new simulation system
state. The LAMMPS executable essentially creates one instance of this
class and passes the command line flags and tells it to process the
class and passes the command-line flags and tells it to process the
provided input (a file or ``stdin``). It shuts the class down when
control is returned to it and then exits. When using LAMMPS as a
library from another code it is required to create an instance of this

View File

@ -69,7 +69,7 @@ WARNING message is printed. The :doc:`Errors <Errors>` page gives
more information on what errors mean. The documentation for each
command lists restrictions on how the command can be used.
You can use the :ref:`-skiprun <skiprun>` command line flag
You can use the :ref:`-skiprun <skiprun>` command-line flag
to have LAMMPS skip the execution of any ``run``, ``minimize``, or similar
commands to check the entire input for correct syntax to avoid crashes
on typos or syntax errors in long runs.

View File

@ -18,7 +18,7 @@ LAMMPS executable directly instead of having a separate tool. A
combination of the commands :doc:`read_restart <read_restart>` and
:doc:`write_data <write_data>` can be used to the same effect. For
added convenience this conversion can also be triggered by
:doc:`command line flags <Run_options>`
:doc:`command-line flags <Run_options>`
Fix ave/spatial and fix ave/spatial/sphere
------------------------------------------

View File

@ -94,12 +94,12 @@ represents what is generally referred to as an "instance of LAMMPS". It
is a composite holding pointers to instances of other core classes
providing the core functionality of the MD engine in LAMMPS and through
them abstractions of the required operations. The constructor of the
LAMMPS class will instantiate those instances, process the command line
LAMMPS class will instantiate those instances, process the command-line
flags, initialize MPI (if not already done) and set up file pointers for
input and output. The destructor will shut everything down and free all
associated memory. Thus code for the standalone LAMMPS executable in
``main.cpp`` simply initializes MPI, instantiates a single instance of
LAMMPS while passing it the command line flags and input script. It
LAMMPS while passing it the command-line flags and input script. It
deletes the LAMMPS instance after the method reading the input returns
and shuts down the MPI environment before it exits the executable.

View File

@ -476,7 +476,7 @@ the tabulated coulomb, to test both code paths. The reference results in the YA
files then should be compared manually, if they agree well enough within the limits
of those two approximations.
The ``test_pair_style`` and equivalent programs have special command line options
The ``test_pair_style`` and equivalent programs have special command-line options
to update the YAML files. Running a command like
.. code-block:: bash
@ -609,7 +609,7 @@ and run the test with verbose output. For example,
env TEST_ARGS=-v ctest -R ^MolPairStyle:lj_cut_coul_long -V
``ctest`` with the ``-V`` flag also shows the exact command line
``ctest`` with the ``-V`` flag also shows the exact command
of the test. One can then use ``gdb --args`` to further debug and
catch exceptions with the test command, for example,

View File

@ -310,7 +310,7 @@ the constructor and the destructor.
Pair styles are different from most classes in LAMMPS that define a
"style", as their constructor only uses the LAMMPS class instance
pointer as an argument, but **not** the command line arguments of the
pointer as an argument, but **not** the arguments of the
:doc:`pair_style command <pair_style>`. Instead, those arguments are
processed in the ``Pair::settings()`` function (or rather the version in
the derived class). The constructor is the place where global defaults
@ -891,7 +891,7 @@ originally created from mixing or not).
These data file output functions are only useful for true pair-wise
additive potentials, where the potential parameters can be entered
through *multiple* :doc:`pair_coeff commands <pair_coeff>`. Pair styles
that require a single "pair_coeff \* \*" command line are not compatible
that require a single "pair_coeff \* \*" command are not compatible
with reading their parameters from data files. For pair styles like
*born/gauss* that do support writing to data files, the potential
parameters will be read from the data file, if present, and
@ -1122,7 +1122,7 @@ once. Thus, the ``coeff()`` function has to do three tasks, each of
which is delegated to a function in the ``PairTersoff`` class:
#. map elements to atom types. Those follow the potential file name in the
command line arguments and are processed by the ``map_element2type()`` function.
command arguments and are processed by the ``map_element2type()`` function.
#. read and parse the potential parameter file in the ``read_file()`` function.
#. Build data structures where the original and derived parameters are
indexed by all possible triples of atom types and thus can be looked
@ -1356,8 +1356,8 @@ either 0 or 1.
The ``morseflag`` variable defaults to 0 and is set to 1 in the
``PairAIREBOMorse::settings()`` function which is called by the
:doc:`pair_style <pair_style>` command. This function delegates
all command line processing and setting of other parameters to the
:doc:`pair_style <pair_style>` command. This function delegates all
command argument processing and setting of other parameters to the
``PairAIREBO::settings()`` function of the base class.
.. code-block:: c++

View File

@ -83,7 +83,7 @@ Run LAMMPS from within the debugger
Running LAMMPS under the control of the debugger as shown below only
works for a single MPI rank (for debugging a program running in parallel
you usually need a parallel debugger program). A simple way to launch
GDB is to prefix the LAMMPS command line with ``gdb --args`` and then
GDB is to prefix the LAMMPS command-line with ``gdb --args`` and then
type the command "run" at the GDB prompt. This will launch the
debugger, load the LAMMPS executable and its debug info, and then run
it. When it reaches the code causing the segmentation fault, it will
@ -180,7 +180,7 @@ inspect the behavior of a compiled program by essentially emulating a
CPU and instrumenting the program while running. This slows down
execution quite significantly, but can also report issues that are not
resulting in a crash. The default valgrind tool is a memory checker and
you can use it by prefixing the normal command line with ``valgrind``.
you can use it by prefixing the normal command-line with ``valgrind``.
Unlike GDB, this will also work for parallel execution, but it is
recommended to redirect the valgrind output to a file (e.g. with
``--log-file=crash-%p.txt``, the %p will be substituted with the

View File

@ -7774,7 +7774,7 @@ Doc page with :doc:`WARNING messages <Errors_warnings>`
*Too few values in body section of molecule file*
Self-explanatory.
*Too many -pk arguments in command line*
*Too many -pk arguments in command-line*
The string formed by concatenating the arguments is too long. Use a
package command in the input script instead.

View File

@ -16,7 +16,7 @@ compiled alongside the code using it from the source code in
``fortran/lammps.f90`` *and* with the same compiler used to build the
rest of the Fortran code that interfaces to LAMMPS. When linking, you
also need to :doc:`link to the LAMMPS library <Build_link>`. A typical
command line for a simple program using the Fortran interface would be:
command for a simple program using the Fortran interface would be:
.. code-block:: bash
@ -91,12 +91,12 @@ function and triggered with the optional logical argument set to
CALL lmp%close(.TRUE.)
END PROGRAM testlib
It is also possible to pass command line flags from Fortran to C/C++ and
It is also possible to pass command-line flags from Fortran to C/C++ and
thus make the resulting executable behave similarly to the standalone
executable (it will ignore the `-in/-i` flag, though). This allows
using the command line to configure accelerator and suffix settings,
using the command-line to configure accelerator and suffix settings,
configure screen and logfile output, or to set index style variables
from the command line and more. Here is a correspondingly adapted
from the command-line and more. Here is a correspondingly adapted
version of the previous example:
.. code-block:: fortran
@ -108,7 +108,7 @@ version of the previous example:
CHARACTER(LEN=128), ALLOCATABLE :: command_args(:)
INTEGER :: i, argc
! copy command line flags to `command_args()`
! copy command-line flags to `command_args()`
argc = COMMAND_ARGUMENT_COUNT()
ALLOCATE(command_args(0:argc))
DO i=0, argc
@ -448,7 +448,7 @@ of the contents of the :f:mod:`LIBLAMMPS` Fortran interface to LAMMPS.
compiled with MPI support, it will also initialize MPI, if it has
not already been initialized before.
The *args* argument with the list of command line parameters is
The *args* argument with the list of command-line parameters is
optional and so it the *comm* argument with the MPI communicator.
If *comm* is not provided, ``MPI_COMM_WORLD`` is assumed. For
more details please see the documentation of :cpp:func:`lammps_open`.

View File

@ -56,7 +56,7 @@ using a shell like Bash or Zsh.
Visual Studio IDE with the bundled CMake or from the Windows command prompt using
a separately installed CMake package, both using the native Microsoft Visual C++
compilers and (optionally) the Microsoft MPI SDK. This tutorial, however, only
covers unix-like command line interfaces.
covers unix-like command-line interfaces.
We also assume that you have downloaded and unpacked a recent LAMMPS source code package
or used Git to create a clone of the LAMMPS sources on your compilation machine.
@ -277,7 +277,7 @@ Setting options
---------------
Options that enable, disable or modify settings are modified by setting
the value of CMake variables. This is done on the command line with the
the value of CMake variables. This is done on the command-line with the
*-D* flag in the format ``-D VARIABLE=value``, e.g. ``-D
CMAKE_BUILD_TYPE=Release`` or ``-D BUILD_MPI=on``. There is one quirk:
when used before the CMake directory, there may be a space between the
@ -376,7 +376,7 @@ Using presets
-------------
Since LAMMPS has a lot of optional features and packages, specifying
them all on the command line can be tedious. Or when selecting a
them all on the command-line can be tedious. Or when selecting a
different compiler toolchain, multiple options have to be changed
consistently and that is rather error prone. Or when enabling certain
packages, they require consistent settings to be operated in a
@ -384,7 +384,7 @@ particular mode. For this purpose, we are providing a selection of
"preset files" for CMake in the folder ``cmake/presets``. They
represent a way to pre-load or override the CMake configuration cache by
setting or changing CMake variables. Preset files are loaded using the
*-C* command line flag. You can combine loading multiple preset files or
*-C* command-line flag. You can combine loading multiple preset files or
change some variables later with additional *-D* flags. A few examples:
.. code-block:: bash

View File

@ -163,7 +163,7 @@ After everything is done, add the files to the branch and commit them:
*git rm*, *git mv* for adding, removing, renaming individual files,
respectively, and then *git commit* to finalize the commit.
Carefully check all pending changes with *git status* before
committing them. If you find doing this on the command line too
committing them. If you find doing this on the command-line too
tedious, consider using a GUI, for example the one included in git
distributions written in Tk, i.e. use *git gui* (on some Linux
distributions it may be required to install an additional package to

View File

@ -20,8 +20,11 @@ to the online LAMMPS documentation for known LAMMPS commands and styles.
(Ubuntu 20.04LTS or later and compatible), macOS (version 11 aka Big
Sur or later), and Windows (version 10 or later) :ref:`are available
<lammps_gui_install>` for download. Non-MPI LAMMPS executables (as
``lmp``) for running LAMMPS from the command line and :doc:`some
``lmp``) for running LAMMPS from the command-line and :doc:`some
LAMMPS tools <Tools>` compiled executables are also included.
Also, the pre-compiled LAMMPS-GUI packages include the WHAM executables
from http://membrane.urmc.rochester.edu/content/wham/ for use with
LAMMPS tutorials.
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
@ -29,16 +32,16 @@ to the online LAMMPS documentation for known LAMMPS commands and styles.
<Build_cmake>`.
LAMMPS-GUI tries to provide an experience similar to what people
traditionally would have running LAMMPS using a command line window and
traditionally would have running LAMMPS using a command-line window and
the console LAMMPS executable but just rolled into a single executable:
- 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
- extract data from the created files and visualize it with and
external software
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. In fact, it is often *required* to
adopt this workflow when running LAMMPS simulations on high-performance
computing facilities.
@ -100,10 +103,11 @@ MacOS 11 and later
^^^^^^^^^^^^^^^^^^
After downloading the ``LAMMPS-macOS-multiarch-GUI-<version>.dmg``
installer package, you need to double-click it and then, in the window
that opens, drag the app bundle as indicated into the "Applications"
folder. The follow the instructions in the "README.txt" file to
get access to the other included executables.
application bundle disk image, you need to double-click it and then, in
the window that opens, drag the app bundle as indicated into the
"Applications" folder. Afterwards, the disk image can be unmounted.
Then follow the instructions in the "README.txt" file to get access to
the other included command-line executables.
Linux on x86\_64
^^^^^^^^^^^^^^^^
@ -117,15 +121,25 @@ into the "LAMMPS_GUI" folder and execute "./lammps-gui" directly.
The second variant uses `flatpak <https://www.flatpak.org>`_ and
requires the flatpak management and runtime software to be installed.
After downloading the ``LAMMPS-GUI-Linux-x86_64-GUI-<version>.tar.gz``
After downloading the ``LAMMPS-GUI-Linux-x86_64-GUI-<version>.flatpak``
flatpak bundle, you can install it with ``flatpak install --user
LAMMPS-GUI-Linux-x86_64-GUI-<version>.tar.gz``. After installation,
LAMMPS-GUI-Linux-x86_64-GUI-<version>.flatpak``. After installation,
LAMMPS-GUI should be integrated into your desktop environment under
"Applications > Science" but also can be launched from the console with
``flatpak run org.lammps.lammps-gui``. The flatpak bundle also includes
the console LAMMPS executable ``lmp`` which can be launched to run
simulations with, for example: ``flatpak run --command=lmp
org.lammps.lammps-gui -in in.melt``.
simulations with, for example with:
.. code-block:: sh
flatpak run --command=lmp org.lammps.lammps-gui -in in.melt
Other bundled command-line executables are run the same way and can be
listed with:
.. code-block:: sh
ls $(flatpak info --show-location org.lammps.lammps-gui )/files/bin
Compiling from Source
@ -165,9 +179,9 @@ window is stored when exiting and restored when starting again.
Opening Files
^^^^^^^^^^^^^
The LAMMPS-GUI application can be launched without command line arguments
The LAMMPS-GUI application can be launched without command-line arguments
and then starts with an empty buffer in the *Editor* window. If arguments
are given LAMMPS will use first command line argument as the file name for
are given LAMMPS will use first command-line argument as the file name for
the *Editor* buffer and reads its contents into the buffer, if the file
exists. All further arguments are ignored. Files can also be opened via
the *File* menu, the `Ctrl-O` (`Command-O` on macOS) keyboard shortcut
@ -261,14 +275,21 @@ Output Window
By default, when starting a run, an *Output* window opens that displays
the screen output of the running LAMMPS calculation, as shown below.
This text would normally be seen in the command line window.
This text would normally be seen in the command-line window.
.. image:: JPG/lammps-gui-log.png
:align: center
:scale: 50%
LAMMPS-GUI captures the screen output from LAMMPS as it is generated and
updates the *Output* window regularly during a run.
updates the *Output* window regularly during a run. If there are any
warnings or errors in the LAMMPS output, they are highlighted by using
bold text colored in red. There is a small panel at the bottom center
of the *Output* window showing how many warnings and errors were
detected and how many lines the entire output has. By clicking on the
button on the right with the warning symbol or by using the keyboard
shortcut `Ctrl-N` (`Command-N` on macOS), you can jump to the next
line with a warning or error.
By default, the *Output* window is replaced each time a run is started.
The runs are counted and the run number for the current run is displayed
@ -398,7 +419,7 @@ below.
Like for the *Output* and *Charts* windows, its content is continuously
updated during a run. It will show "(none)" if there are no variables
defined. Note that it is also possible to *set* :doc:`index style
variables <variable>`, that would normally be set via command line
variables <variable>`, that would normally be set via command-line
flags, via the "Set Variables..." dialog from the *Run* menu.
LAMMPS-GUI automatically defines the variable "gui_run" to the current
value of the run counter. That way it is possible to automatically
@ -775,11 +796,11 @@ General Settings:
- *Echo input to log:* when checked, all input commands, including
variable expansions, are echoed to the *Output* window. This is
equivalent to using `-echo screen` at the command line. There is no
equivalent to using `-echo screen` at the command-line. There is no
log *file* produced by default, since LAMMPS-GUI uses `-log none`.
- *Include citation details:* when checked full citation info will be
included to the log window. This is equivalent to using `-cite
screen` on the command line.
screen` on the command-line.
- *Show log window by default:* when checked, the screen output of a
LAMMPS run will be collected in a log window during the run
- *Show chart window by default:* when checked, the thermodynamic
@ -828,7 +849,7 @@ Accelerators:
This tab enables selection of an accelerator package for LAMMPS to use
and is equivalent to using the `-suffix` and `-package` flags on the
command line. Only settings supported by the LAMMPS library and local
command-line. Only settings supported by the LAMMPS library and local
hardware are available. The `Number of threads` field allows setting
the maximum number of threads for the accelerator packages that use
threads.

View File

@ -738,8 +738,8 @@ command.
This can be done, for example, by using the built-in visualizer of the
:doc:`dump image or dump movie <dump_image>` command to create snapshot
images or a movie. Below are example command lines for using dump image
with the :ref:`example listed below <periexample>` and a set of images
images or a movie. Below are example command for using dump image with
the :ref:`example listed below <periexample>` and a set of images
created for steps 300, 600, and 2000 this way.
.. code-block:: LAMMPS

View File

@ -260,7 +260,7 @@ Switch into the :code:`examples/melt` folder:
cd ../examples/melt
To run this example in serial, use the following command line:
To run this example in serial, use the following command:
.. code-block::

View File

@ -60,7 +60,7 @@ between them at any time using "git checkout <branch name>".)
files (mostly by accident). If you do not need access to the entire
commit history (most people don't), you can speed up the "cloning"
process and reduce local disk space requirements by using the
``--depth`` git command line flag. That will create a "shallow clone"
``--depth`` git command-line flag. That will create a "shallow clone"
of the repository, which contains only a subset of the git history.
Using a depth of 1000 is usually sufficient to include the head
commits of the *develop*, the *release*, and the *maintenance*

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 78 KiB

View File

@ -46,7 +46,7 @@ Include files (varied)
but instead should be initialized either in the initializer list of
the constructor or explicitly assigned in the body of the constructor.
If the member variable is relevant to the functionality of a class
(for example when it stores a value from a command line argument), the
(for example when it stores a value from a command-line argument), the
member variable declaration is followed by a brief comment explaining
its purpose and what its values can be. Class members that are
pointers should always be initialized to ``nullptr`` in the

View File

@ -2171,8 +2171,8 @@ the :doc:`Build extras <Build_extras>` page.
* ``src/OPENMP/README``
* :doc:`Accelerator packages <Speed_packages>`
* :doc:`OPENMP package <Speed_omp>`
* :doc:`Command line option -suffix/-sf omp <Run_options>`
* :doc:`Command line option -package/-pk omp <Run_options>`
* :doc:`Command-line option -suffix/-sf omp <Run_options>`
* :doc:`Command-line option -package/-pk omp <Run_options>`
* :doc:`package omp <package>`
* Search the :doc:`commands <Commands_all>` pages (:doc:`fix <Commands_fix>`, :doc:`compute <Commands_compute>`,
:doc:`pair <Commands_pair>`, :doc:`bond, angle, dihedral, improper <Commands_bond>`,

View File

@ -1,8 +1,8 @@
Basics of running LAMMPS
========================
LAMMPS is run from the command line, reading commands from a file via
the ``-in`` command line flag, or from standard input. Using the ``-in
LAMMPS is run from the command-line, reading commands from a file via
the ``-in`` command-line flag, or from standard input. Using the ``-in
in.file`` variant is recommended (see note below). The name of the
LAMMPS executable is either ``lmp`` or ``lmp_<machine>`` with
`<machine>` being the machine string used when compiling LAMMPS. This
@ -25,7 +25,7 @@ build LAMMPS:
You normally run the LAMMPS command in the directory where your input
script is located. That is also where output files are produced by
default, unless you provide specific other paths in your input script or
on the command line. As in some of the examples above, the LAMMPS
on the command-line. As in some of the examples above, the LAMMPS
executable itself can be placed elsewhere.
.. note::

View File

@ -632,7 +632,7 @@ the ``-package omp`` command-line switch or the :doc:`package omp <package>` com
The :doc:`suffix <suffix>` command can also be used within an input
script to set a suffix, or to turn off or back on any suffix setting
made via the command line.
made via the command-line.
----------

View File

@ -20,7 +20,7 @@ To run with 4 threads, you can type this:
lmp -in in.lj.lmp -k on t 4 -sf kk
Alternately, you can also install a package with LAMMPS-GUI included and
open the LAMMPS-GUI app (the package includes the command line version
open the LAMMPS-GUI app (the package includes the command-line version
of LAMMPS as well) and open the input file in the GUI and run it from
there. For details on LAMMPS-GUI, see :doc:`Howto_lammps_gui`.

View File

@ -31,7 +31,8 @@ Coulombics. It has the following general features:
(for Nvidia GPUs, AMD GPUs, Intel GPUs, and multicore CPUs).
so that the same functionality is supported on a variety of hardware.
**Required hardware/software:**
Required hardware/software
""""""""""""""""""""""""""
To compile and use this package in CUDA mode, you currently need
to have an NVIDIA GPU and install the corresponding NVIDIA CUDA
@ -69,12 +70,14 @@ To compile and use this package in HIP mode, you have to have the AMD ROCm
software installed. Versions of ROCm older than 3.5 are currently deprecated
by AMD.
**Building LAMMPS with the GPU package:**
Building LAMMPS with the GPU package
""""""""""""""""""""""""""""""""""""
See the :ref:`Build extras <gpu>` page for
instructions.
**Run with the GPU package from the command line:**
Run with the GPU package from the command-line
""""""""""""""""""""""""""""""""""""""""""""""
The ``mpirun`` or ``mpiexec`` command sets the total number of MPI tasks
used by LAMMPS (one or multiple per compute node) and the number of MPI
@ -133,7 +136,8 @@ affect the setting for bonded interactions (LAMMPS default is "on").
The "off" setting for pairwise interaction is currently required for
GPU package pair styles.
**Or run with the GPU package by editing an input script:**
Run with the GPU package by editing an input script
"""""""""""""""""""""""""""""""""""""""""""""""""""
The discussion above for the ``mpirun`` or ``mpiexec`` command, MPI
tasks/node, and use of multiple MPI tasks/GPU is the same.
@ -149,7 +153,8 @@ You must also use the :doc:`package gpu <package>` command to enable the
GPU package, unless the ``-sf gpu`` or ``-pk gpu`` :doc:`command-line switches <Run_options>` were used. It specifies the number of
GPUs/node to use, as well as other options.
**Speed-ups to expect:**
Speed-up to expect
""""""""""""""""""
The performance of a GPU versus a multicore CPU is a function of your
hardware, which pair style is used, the number of atoms/GPU, and the
@ -176,10 +181,13 @@ better with multiple OMP threads because the inter-process communication
is higher for these styles with the GPU package in order to allow
deterministic results.
**Guidelines for best performance:**
Guidelines for best performance
"""""""""""""""""""""""""""""""
* Using multiple MPI tasks per GPU will often give the best performance,
as allowed my most multicore CPU/GPU configurations.
* Using multiple MPI tasks (2-10) per GPU will often give the best
performance, as allowed my most multicore CPU/GPU configurations.
Using too many MPI tasks will result in worse performance due to
growing overhead with the growing number of MPI tasks.
* If the number of particles per MPI task is small (e.g. 100s of
particles), it can be more efficient to run with fewer MPI tasks per
GPU, even if you do not use all the cores on the compute node.
@ -199,12 +207,13 @@ deterministic results.
:doc:`angle <angle_style>`, :doc:`dihedral <dihedral_style>`,
:doc:`improper <improper_style>`, and :doc:`long-range <kspace_style>`
calculations will not be included in the "Pair" time.
* Since only part of the pppm kspace style is GPU accelerated, it
may be faster to only use GPU acceleration for Pair styles with
long-range electrostatics. See the "pair/only" keyword of the
package command for a shortcut to do that. The work between kspace
on the CPU and non-bonded interactions on the GPU can be balanced
through adjusting the coulomb cutoff without loss of accuracy.
* Since only part of the pppm kspace style is GPU accelerated, it may be
faster to only use GPU acceleration for Pair styles with long-range
electrostatics. See the "pair/only" keyword of the :doc:`package
command <package>` for a shortcut to do that. The distribution of
work between kspace on the CPU and non-bonded interactions on the GPU
can be balanced through adjusting the coulomb cutoff without loss of
accuracy.
* When the *mode* setting for the package gpu command is force/neigh,
the time for neighbor list calculations on the GPU will be added into
the "Pair" time, not the "Neigh" time. An additional breakdown of the
@ -220,4 +229,6 @@ deterministic results.
Restrictions
""""""""""""
None.
When using :doc:`hybrid pair styles <pair_hybrid>`, the neighbor list
must be generated on the host instead of the GPU and thus the potential
GPU acceleration is reduced.

View File

@ -1,5 +1,5 @@
INTEL package
==================
=============
The INTEL package is maintained by Mike Brown at Intel
Corporation. It provides two methods for accelerating simulations,
@ -13,18 +13,18 @@ twice, once on the CPU and once with an offload flag. This allows
LAMMPS to run on the CPU cores and co-processor cores simultaneously.
Currently Available INTEL Styles
"""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""
* Angle Styles: charmm, harmonic
* Bond Styles: fene, fourier, harmonic
* Bond Styles: fene, harmonic
* Dihedral Styles: charmm, fourier, harmonic, opls
* Fixes: nve, npt, nvt, nvt/sllod, nve/asphere
* Fixes: nve, npt, nvt, nvt/sllod, nve/asphere, electrode/conp, electrode/conq, electrode/thermo
* Improper Styles: cvff, harmonic
* Pair Styles: airebo, airebo/morse, buck/coul/cut, buck/coul/long,
buck, dpd, eam, eam/alloy, eam/fs, gayberne, lj/charmm/coul/charmm,
lj/charmm/coul/long, lj/cut, lj/cut/coul/long, lj/long/coul/long,
rebo, sw, tersoff
* K-Space Styles: pppm, pppm/disp
rebo, snap, sw, tersoff
* K-Space Styles: pppm, pppm/disp, pppm/electrode
.. warning::
@ -33,7 +33,7 @@ Currently Available INTEL Styles
input requires it, LAMMPS will abort with an error message.
Speed-up to expect
"""""""""""""""""""
""""""""""""""""""
The speedup will depend on your simulation, the hardware, which
styles are used, the number of atoms, and the floating-point
@ -312,21 +312,21 @@ almost all cases.
recommended, especially when running on a machine with Intel
Hyper-Threading technology disabled.
Run with the INTEL package from the command line
"""""""""""""""""""""""""""""""""""""""""""""""""""""
Run with the INTEL package from the command-line
""""""""""""""""""""""""""""""""""""""""""""""""
To enable INTEL optimizations for all available styles used in
the input script, the ``-sf intel`` :doc:`command-line switch <Run_options>` can be used without any requirement for
editing the input script. This switch will automatically append
"intel" to styles that support it. It also invokes a default command:
:doc:`package intel 1 <package>`. This package command is used to set
options for the INTEL package. The default package command will
specify that INTEL calculations are performed in mixed precision,
that the number of OpenMP threads is specified by the OMP_NUM_THREADS
environment variable, and that if co-processors are present and the
binary was built with offload support, that 1 co-processor per node
will be used with automatic balancing of work between the CPU and the
co-processor.
To enable INTEL optimizations for all available styles used in the input
script, the ``-sf intel`` :doc:`command-line switch <Run_options>` can
be used without any requirement for editing the input script. This
switch will automatically append "intel" to styles that support it. It
also invokes a default command: :doc:`package intel 1 <package>`. This
package command is used to set options for the INTEL package. The
default package command will specify that INTEL calculations are
performed in mixed precision, that the number of OpenMP threads is
specified by the OMP_NUM_THREADS environment variable, and that if
co-processors are present and the binary was built with offload support,
that 1 co-processor per node will be used with automatic balancing of
work between the CPU and the co-processor.
You can specify different options for the INTEL package by using
the ``-pk intel Nphi`` :doc:`command-line switch <Run_options>` with

View File

@ -77,7 +77,7 @@ version 23 November 2023 and Kokkos version 4.2.
rank. When running with multiple MPI ranks, you may see segmentation
faults without GPU-aware MPI support. These can be avoided by adding
the flags :doc:`-pk kokkos gpu/aware off <Run_options>` to the
LAMMPS command line or by using the command :doc:`package kokkos
LAMMPS command-line or by using the command :doc:`package kokkos
gpu/aware off <package>` in the input file.
.. admonition:: Intel Data Center GPU support
@ -423,7 +423,7 @@ in the ``kokkos-cuda.cmake`` CMake preset file.
cmake -DKokkos_ENABLE_CUDA=yes -DKokkos_ENABLE_OPENMP=yes ../cmake
The suffix "/kk" is equivalent to "/kk/device", and for Kokkos CUDA,
using the ``-sf kk`` in the command line gives the default CUDA version
using the ``-sf kk`` in the command-line gives the default CUDA version
everywhere. However, if the "/kk/host" suffix is added to a specific
style in the input script, the Kokkos OpenMP (CPU) version of that
specific style will be used instead. Set the number of OpenMP threads
@ -439,7 +439,7 @@ For example, the command to run with 1 GPU and 8 OpenMP threads is then:
mpiexec -np 1 lmp_kokkos_cuda_openmpi -in in.lj -k on g 1 t 8 -sf kk
Conversely, if the ``-sf kk/host`` is used in the command line and then
Conversely, if the ``-sf kk/host`` is used in the command-line and then
the "/kk" or "/kk/device" suffix is added to a specific style in your
input script, then only that specific style will run on the GPU while
everything else will run on the CPU in OpenMP mode. Note that the
@ -451,7 +451,7 @@ on the host CPU can overlap with a pair style running on the
GPU. First compile with ``--default-stream per-thread`` added to ``CCFLAGS``
in the Kokkos CUDA Makefile. Then explicitly use the "/kk/host"
suffix for kspace and bonds, angles, etc. in the input file and the
"kk" suffix (equal to "kk/device") on the command line. Also make
"kk" suffix (equal to "kk/device") on the command-line. Also make
sure the environment variable ``CUDA_LAUNCH_BLOCKING`` is not set to "1"
so CPU/GPU overlap can occur.

View File

@ -21,7 +21,7 @@ Building LAMMPS with the OPENMP package
See the :ref:`Build extras <openmp>` page for
instructions.
Run with the OPENMP package from the command line
Run with the OPENMP package from the command-line
"""""""""""""""""""""""""""""""""""""""""""""""""""
These examples assume one or more 16-core nodes.

View File

@ -17,7 +17,7 @@ Building LAMMPS with the OPT package
See the :ref:`Build extras <opt>` page for instructions.
Run with the OPT package from the command line
Run with the OPT package from the command-line
""""""""""""""""""""""""""""""""""""""""""""""
.. code-block:: bash

View File

@ -501,7 +501,7 @@ Here are a few highlights of LAMMPS-GUI
- Indicator for line that caused an error
- Visualization of current state in Image Viewer (via calling :doc:`write_dump image <dump_image>`)
- Capture of images created via :doc:`dump image <dump_image>` in Slide show window
- Dialog to set variables, similar to the LAMMPS command line flag '-v' / '-var'
- Dialog to set variables, similar to the LAMMPS command-line flag '-v' / '-var'
- Support for GPU, INTEL, KOKKOS/OpenMP, OPENMAP, and OPT and accelerator packages
Parallelization
@ -550,7 +550,7 @@ will be found automatically. 2) you can download the `Flatpak file
*flatpak* command: ``flatpak install --user
LAMMPS-Linux-x86_64-GUI-<version>.flatpak`` and run it with ``flatpak
run org.lammps.lammps-gui``. The flatpak bundle also includes the
command line version of LAMMPS and some LAMMPS tools like msi2lmp. The
command-line version of LAMMPS and some LAMMPS tools like msi2lmp. The
can be launched by using the ``--command`` flag. For example to run
LAMMPS directly on the ``in.lj`` benchmark input you would type in the
``bench`` folder: ``flatpak run --command=lmp -in in.lj`` The flatpak
@ -608,10 +608,10 @@ would be the ``examples/COUPLE/plugin`` folder of the LAMMPS
distribution.
When compiling LAMMPS-GUI with plugin support, there is an additional
command line flag (``-p <path>`` or ``--pluginpath <path>``) which
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
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.
@ -656,7 +656,7 @@ it will create a compressed ``LAMMPS-Win10-amd64.zip`` zip file with the
executables and required dependent .dll files. This zip file can be
uncompressed and ``lammps-gui.exe`` run directly from there. The
uncompressed folder can be added to the ``PATH`` environment and LAMMPS
and LAMMPS-GUI can be launched from anywhere from the command line.
and LAMMPS-GUI can be launched from anywhere from the command-line.
**MinGW64 Cross-compiler**
@ -876,7 +876,7 @@ the same ``LAMMPS_CACHING_DIR``. This script does the following:
#. Start a simple local HTTP server using Python to host files for CMake
Afterwards, it will print out instruction on how to modify the CMake
command line to make sure it uses the local HTTP server.
commands to make sure it uses the local HTTP server.
To undo the environment changes and shutdown the local HTTP server,
run the ``deactivate_caches`` command.
@ -1025,7 +1025,7 @@ with those in the provided log file with the same number of processors
in the same subdirectory. If the differences between the actual and
reference values are within specified tolerances, the test is considered
passed. For each test batch, that is, a set of example input scripts,
the mpirun command, the LAMMPS command line arguments, and the
the mpirun command, the LAMMPS command-line arguments, and the
tolerances for individual thermo quantities can be specified in a
configuration file in YAML format.

View File

@ -681,7 +681,7 @@ MPEG or other movie file you can use:
* c) Use FFmpeg
FFmpeg is a command line tool that is available on many platforms and
FFmpeg is a command-line tool that is available on many platforms and
allows extremely flexible encoding and decoding of movies.
.. code-block:: bash

View File

@ -97,7 +97,7 @@ adjustments.
To connect VMD to a listening LAMMPS simulation on the same machine
with fix imd enabled, one needs to start VMD and load a coordinate or
topology file that matches the fix group. When the VMD command
prompts appears, one types the command line:
prompts appears, one types the command:
.. parsed-literal::

View File

@ -135,7 +135,7 @@ directions for the forces. Only the direction of the vector is
important; its length is ignored (the entered vectors are
normalized).
Those styles can be combined within one single command line.
Those styles can be combined within one single command.
.. note::

View File

@ -1084,10 +1084,11 @@ the form of *key_name_key*-*key_name_value* pairs). For example,
kim property modify 1 key mass source-value 26.98154
kim property modify 1 key mass source-unit amu
where the special keyword "key" is followed by a *key_name* ("species" or
"mass" in the above) and one or more key-value pairs. These key-value pairs
may continue until either another "key" keyword is given or the end of the
command line is reached. Thus, the above could equivalently be written as
where the special keyword "key" is followed by a *key_name* ("species"
or "mass" in the above) and one or more key-value pairs. These
key-value pairs may continue until either another "key" keyword is given
or the end of the line is reached. Thus, the above could equivalently
be written as
.. code-block:: LAMMPS

View File

@ -24,12 +24,12 @@ Description
"""""""""""
Label this line of the input script with the chosen ID. Unless a jump
command was used previously, this does nothing. But if a
:doc:`jump <jump>` command was used with a label argument to begin
invoking this script file, then all command lines in the script prior
to this line will be ignored. I.e. execution of the script will begin
at this line. This is useful for looping over a section of the input
script as discussed in the :doc:`jump <jump>` command.
command was used previously, this does nothing. But if a :doc:`jump
<jump>` command was used with a label argument to begin invoking this
script file, then all commands in the script prior to this line will be
ignored. I.e. execution of the script will begin at this line. This is
useful for looping over a section of the input script as discussed in
the :doc:`jump <jump>` command.
Restrictions
""""""""""""

View File

@ -504,7 +504,7 @@ as it is for non-accelerated pair styles
The *binsize* keyword sets the size of bins used to bin atoms during
neighbor list builds. The same value can be set by the
:doc:`neigh_modify binsize <neigh_modify>` command. Making it an option
in the package kokkos command allows it to be set from the command line.
in the package kokkos command allows it to be set from the command-line.
The default value for CPUs is 0.0, which means the LAMMPS default will be
used, which is bins = 1/2 the size of the pairwise cutoff + neighbor skin
distance. This is fine when neighbor lists are built on the CPU. For GPU
@ -664,7 +664,7 @@ too.
Also note that if the :doc:`-sf hybrid intel omp command-line switch <Run_options>` is used, it invokes a "package intel" command, followed by a
"package omp" command, both with a setting of *Nthreads* = 0. Likewise
for a hybrid suffix for gpu and omp. Note that KOKKOS also supports
setting the number of OpenMP threads from the command line using the
setting the number of OpenMP threads from the command-line using the
"-k on" :doc:`command-line switch <Run_options>`. The default for
KOKKOS is 1 thread per MPI task, so any other number of threads should
be explicitly set using the "-k on" command-line switch (and this

View File

@ -111,8 +111,8 @@ routines. For x-86 machines, there is a provided Makefile.mgptfast
which enables the fast algebra routines, i.e. build LAMMPS with "make
mgptfast". The user will be informed in the output files of the
matrix kernels in use. To further improve speed, on x86 the option
precision single can be added to the :doc:`pair_coeff <pair_coeff>`
command line, which improves speed (up to a factor of two) at the cost
*precision single* can be added to the :doc:`pair_coeff <pair_coeff>`
command, which improves speed (up to a factor of two) at the cost
of doing matrix calculations with 7 digit precision instead of the
default 16. For consistency the default option can be specified
explicitly by the option precision double.

View File

@ -131,7 +131,7 @@ command.
* LJ cutoff (distance units)
The last two coefficients are optional and default to the global values from
the *pair_style* command line.
the *pair_style* command.
----------

View File

@ -48,9 +48,9 @@ meaning that the trajectories of a restarted run will precisely match
those produced by the original run had it continued on.
Some information about a restart file can be gathered directly from the
command line when using LAMMPS with the :ref:`-restart2info
<restart2info>` command line flag. On Unix-like operating systems (like
Linux or macOS), one can also :ref:`configure the "file" command line
command-line when using LAMMPS with the :ref:`-restart2info
<restart2info>` command-line flag. On Unix-like operating systems (like
Linux or macOS), one can also :ref:`configure the "file" command-line
program <magic>` to display basic information about a restart file
The binary restart file format was not designed with backward, forward,
@ -60,9 +60,9 @@ Changes to the architecture, compilation settings, or LAMMPS version can
render a restart file unreadable or it may read the data incorrectly.
If you want a more portable format, you can use the data file format as
created by the :doc:`write_data <write_data>` command. Binary restart
files can also be converted into a data file from the command line by
files can also be converted into a data file from the command-line by
the LAMMPS executable that wrote them using the :ref:`-restart2data
<restart2data>` command line flag.
<restart2data>` command-line flag.
Several things can prevent exact restarts due to round-off effects, in
which case the trajectories in the 2 runs will slowly diverge. These

View File

@ -30,7 +30,7 @@ Description
This command allows you to use variants of various styles if they
exist. In that respect it operates the same as the :doc:`-suffix command-line switch <Run_options>`. It also has options to turn
off or back on any suffix setting made via the command line.
off or back on any suffix setting made via the command-line.
The specified style can be *gpu*, *intel*, *kk*, *omp*, *opt* or
*hybrid*\ . These refer to optional packages that LAMMPS can be built

View File

@ -27,19 +27,14 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNHAsphere::FixNHAsphere(LAMMPS *lmp, int narg, char **arg) :
FixNH(lmp, narg, arg)
{
}
FixNHAsphere::FixNHAsphere(LAMMPS *lmp, int narg, char **arg) : FixNH(lmp, narg, arg) {}
/* ---------------------------------------------------------------------- */
void FixNHAsphere::init()
{
avec = dynamic_cast<AtomVecEllipsoid *>(atom->style_match("ellipsoid"));
if (!avec)
error->all(FLERR,
"Compute nvt/nph/npt asphere requires atom style ellipsoid");
if (!avec) error->all(FLERR, "Fix {} requires atom style ellipsoid", style);
// check that all particles are finite-size
// no point particles allowed, spherical is OK
@ -51,7 +46,7 @@ void FixNHAsphere::init()
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit)
if (ellipsoid[i] < 0)
error->one(FLERR,"Fix nvt/nph/npt asphere requires extended particles");
error->one(FLERR,"Fix {} requires all extended particles", style);
FixNH::init();
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -22,14 +21,13 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNPHAsphere::FixNPHAsphere(LAMMPS *lmp, int narg, char **arg) :
FixNHAsphere(lmp, narg, arg)
FixNPHAsphere::FixNPHAsphere(LAMMPS *lmp, int narg, char **arg) : FixNHAsphere(lmp, narg, arg)
{
if (tstat_flag)
error->all(FLERR,"Temperature control can not be used "
error->all(FLERR,
"Temperature control can not be used "
"with fix nph/asphere");
if (!pstat_flag)
error->all(FLERR,"Pressure control must be used with fix nph/asphere");
if (!pstat_flag) error->all(FLERR, "Pressure control must be used with fix nph/asphere");
// create a new compute temp style
// id = fix-ID + temp
@ -37,7 +35,7 @@ FixNPHAsphere::FixNPHAsphere(LAMMPS *lmp, int narg, char **arg) :
// and thus its KE/temperature contribution should use group all
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} all temp/asphere",id_temp));
modify->add_compute(fmt::format("{} all temp/asphere", id_temp));
tcomputeflag = 1;
// create a new compute pressure style
@ -45,6 +43,6 @@ FixNPHAsphere::FixNPHAsphere(LAMMPS *lmp, int narg, char **arg) :
// pass id_temp as 4th arg to pressure constructor
id_press = utils::strdup(std::string(id) + "_press");
modify->add_compute(fmt::format("{} all pressure {}",id_press, id_temp));
modify->add_compute(fmt::format("{} all pressure {}", id_press, id_temp));
pcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -22,13 +21,10 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNPTAsphere::FixNPTAsphere(LAMMPS *lmp, int narg, char **arg) :
FixNHAsphere(lmp, narg, arg)
FixNPTAsphere::FixNPTAsphere(LAMMPS *lmp, int narg, char **arg) : FixNHAsphere(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix npt/asphere");
if (!pstat_flag)
error->all(FLERR,"Pressure control must be used with fix npt/asphere");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix npt/asphere");
if (!pstat_flag) error->all(FLERR, "Pressure control must be used with fix npt/asphere");
// create a new compute temp style
// id = fix-ID + temp
@ -36,7 +32,7 @@ FixNPTAsphere::FixNPTAsphere(LAMMPS *lmp, int narg, char **arg) :
// and thus its KE/temperature contribution should use group all
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} all temp/asphere",id_temp));
modify->add_compute(fmt::format("{} all temp/asphere", id_temp));
tcomputeflag = 1;
// create a new compute pressure style
@ -44,6 +40,6 @@ FixNPTAsphere::FixNPTAsphere(LAMMPS *lmp, int narg, char **arg) :
// pass id_temp as 4th arg to pressure constructor
id_press = utils::strdup(std::string(id) + "_press");
modify->add_compute(fmt::format("{} all pressure {}",id_press, id_temp));
modify->add_compute(fmt::format("{} all pressure {}", id_press, id_temp));
pcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -23,19 +22,15 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNVTAsphere::FixNVTAsphere(LAMMPS *lmp, int narg, char **arg) :
FixNHAsphere(lmp, narg, arg)
FixNVTAsphere::FixNVTAsphere(LAMMPS *lmp, int narg, char **arg) : FixNHAsphere(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix nvt/asphere");
if (pstat_flag)
error->all(FLERR,"Pressure control can not be used with fix nvt/asphere");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix nvt/asphere");
if (pstat_flag) error->all(FLERR, "Pressure control can not be used with fix nvt/asphere");
// create a new compute temp style
// id = fix-ID + temp
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} {} temp/asphere",
id_temp,group->names[igroup]));
modify->add_compute(fmt::format("{} {} temp/asphere", id_temp, group->names[igroup]));
tcomputeflag = 1;
}

View File

@ -466,37 +466,33 @@ void FixBocs::init()
// set temperature and pressure ptrs
temperature = modify->get_compute_by_id(id_temp);
if (!temperature)
error->all(FLERR,"Temperature compute ID {} for fix bocs does not exist", id_temp);
if (temperature->tempbias) which = BIAS;
else which = NOBIAS;
if (!temperature) {
error->all(FLERR,"Temperature compute ID {} for fix {} does not exist", id_temp, style);
} else {
if (temperature->tempflag == 0)
error->all(FLERR, "Compute ID {} for fix {} does not compute a temperature", id_temp, style);
if (temperature->tempbias) which = BIAS;
else which = NOBIAS;
}
if (pstat_flag) {
pressure = modify->get_compute_by_id(id_press);
if (!pressure)
error->all(FLERR,"Pressure compute ID {} for fix bocs does not exist", id_press);
error->all(FLERR,"Pressure compute ID {} for fix {} does not exist", id_press, style);
if (pressure->pressflag == 0)
error->all(FLERR,"Compute ID {} for fix {} does not compute pressure", id_press, style);
}
if (pstat_flag)
{
if (p_match_flag) // MRD NJD
{
if (pstat_flag) {
if (p_match_flag) { // MRD NJD
auto pressure_bocs = dynamic_cast<ComputePressureBocs *>(pressure);
if (pressure_bocs)
{
if (p_basis_type == BASIS_ANALYTIC)
{
if (pressure_bocs) {
if (p_basis_type == BASIS_ANALYTIC) {
pressure_bocs->send_cg_info(p_basis_type, N_p_match, p_match_coeffs, N_mol, vavg);
}
else if (p_basis_type == BASIS_LINEAR_SPLINE || p_basis_type == BASIS_CUBIC_SPLINE)
{
} else if (p_basis_type == BASIS_LINEAR_SPLINE || p_basis_type == BASIS_CUBIC_SPLINE) {
pressure_bocs->send_cg_info(p_basis_type, splines, spline_length);
}
}
else
{
} else {
error->all(FLERR,"Unable to find compatible pressure compute");
}
}
@ -656,8 +652,7 @@ int FixBocs::read_F_table( char *filename, int p_basis_type )
if (numBadVolumeIntervals > 0 && comm->me == 0) {
error->message(FLERR, "INFO: total number bad volume intervals = {}", numBadVolumeIntervals);
}
}
else {
} else {
error->all(FLERR,"ERROR: Unable to open file: {}", filename);
}
@ -955,8 +950,9 @@ void FixBocs::final_integrate()
tdof = temperature->dof;
if (pstat_flag) {
if (pstyle == ISO) pressure->compute_scalar();
else {
if (pstyle == ISO) {
pressure->compute_scalar();
} else {
temperature->compute_vector();
pressure->compute_vector();
}

View File

@ -39,8 +39,7 @@ void FixNHBody::init()
{
avec = dynamic_cast<AtomVecBody *>(atom->style_match("body"));
if (!avec)
error->all(FLERR,
"Compute nvt/nph/npt body requires atom style body");
error->all(FLERR, "Compute nvt/nph/npt body requires atom style body");
// check that all particles are finite-size
// no point particles allowed, spherical is OK

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -26,13 +25,10 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNPHBody::FixNPHBody(LAMMPS *lmp, int narg, char **arg) :
FixNHBody(lmp, narg, arg)
FixNPHBody::FixNPHBody(LAMMPS *lmp, int narg, char **arg) : FixNHBody(lmp, narg, arg)
{
if (tstat_flag)
error->all(FLERR,"Temperature control can not be used with fix nph/body");
if (!pstat_flag)
error->all(FLERR,"Pressure control must be used with fix nph/body");
if (tstat_flag) error->all(FLERR, "Temperature control can not be used with fix nph/body");
if (!pstat_flag) error->all(FLERR, "Pressure control must be used with fix nph/body");
// create a new compute temp style
// id = fix-ID + temp
@ -40,7 +36,7 @@ FixNPHBody::FixNPHBody(LAMMPS *lmp, int narg, char **arg) :
// and thus its KE/temperature contribution should use group all
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} all temp/body",id_temp));
modify->add_compute(fmt::format("{} all temp/body", id_temp));
tcomputeflag = 1;
// create a new compute pressure style
@ -48,6 +44,6 @@ FixNPHBody::FixNPHBody(LAMMPS *lmp, int narg, char **arg) :
// pass id_temp as 4th arg to pressure constructor
id_press = utils::strdup(std::string(id) + "_press");
modify->add_compute(fmt::format("{} all pressure {}",id_press, id_temp));
modify->add_compute(fmt::format("{} all pressure {}", id_press, id_temp));
pcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -26,13 +25,10 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNPTBody::FixNPTBody(LAMMPS *lmp, int narg, char **arg) :
FixNHBody(lmp, narg, arg)
FixNPTBody::FixNPTBody(LAMMPS *lmp, int narg, char **arg) : FixNHBody(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix npt/body");
if (!pstat_flag)
error->all(FLERR,"Pressure control must be used with fix npt/body");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix npt/body");
if (!pstat_flag) error->all(FLERR, "Pressure control must be used with fix npt/body");
// create a new compute temp style
// id = fix-ID + temp
@ -40,7 +36,7 @@ FixNPTBody::FixNPTBody(LAMMPS *lmp, int narg, char **arg) :
// and thus its KE/temperature contribution should use group all
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} all temp/body",id_temp));
modify->add_compute(fmt::format("{} all temp/body", id_temp));
tcomputeflag = 1;
// create a new compute pressure style
@ -48,6 +44,6 @@ FixNPTBody::FixNPTBody(LAMMPS *lmp, int narg, char **arg) :
// pass id_temp as 4th arg to pressure constructor
id_press = utils::strdup(std::string(id) + "_press");
modify->add_compute(fmt::format("{} all pressure {}",id_press, id_temp));
modify->add_compute(fmt::format("{} all pressure {}", id_press, id_temp));
pcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -27,19 +26,15 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNVTBody::FixNVTBody(LAMMPS *lmp, int narg, char **arg) :
FixNHBody(lmp, narg, arg)
FixNVTBody::FixNVTBody(LAMMPS *lmp, int narg, char **arg) : FixNHBody(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix nvt/body");
if (pstat_flag)
error->all(FLERR,"Pressure control can not be used with fix nvt/body");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix nvt/body");
if (pstat_flag) error->all(FLERR, "Pressure control can not be used with fix nvt/body");
// create a new compute temp style
// id = fix-ID + temp
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} {} temp/body",
id_temp,group->names[igroup]));
modify->add_compute(fmt::format("{} {} temp/body", id_temp, group->names[igroup]));
tcomputeflag = 1;
}

View File

@ -129,7 +129,7 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) :
if (comm->me == 0) {
#ifdef LAMMPS_BIGBIG
utils::logmesg(lmp, "colvars: Warning: cannot handle atom ids > 2147483647\n");
error->warning(FLERR, "colvars: cannot handle atom ids > 2147483647\n");
#endif
proxy = new colvarproxy_lammps(lmp);
proxy->init();

View File

@ -108,9 +108,9 @@ FixLangevinDrude::FixLangevinDrude(LAMMPS *lmp, int narg, char **arg) :
FixLangevinDrude::~FixLangevinDrude()
{
delete random_core;
delete [] tstr_core;
delete[] tstr_core;
delete random_drude;
delete [] tstr_drude;
delete[] tstr_drude;
}
/* ---------------------------------------------------------------------- */
@ -144,22 +144,22 @@ void FixLangevinDrude::init()
else error->all(FLERR,"Variable for fix langevin/drude is invalid style");
}
int ifix;
for (ifix = 0; ifix < modify->nfix; ifix++)
if (strcmp(modify->fix[ifix]->style,"drude") == 0) break;
if (ifix == modify->nfix) error->all(FLERR, "fix langevin/drude requires fix drude");
fix_drude = dynamic_cast<FixDrude *>(modify->fix[ifix]);
auto fdrude = modify->get_fix_by_style("^drude$");
if (fdrude.size() < 1) error->all(FLERR, "Fix {} requires fix drude", style);
if (fdrude.size() > 1) error->all(FLERR, "There must be only one fix drude");
fix_drude = dynamic_cast<FixDrude *>(fdrude[0]);
if (!fix_drude) error->all(FLERR, "Fix {} requires fix drude", style);
if (!utils::strmatch(update->integrate_style,"^verlet"))
error->all(FLERR,"Run style respa is not compatible with fix langevin/drude");
if (!comm->ghost_velocity)
error->all(FLERR,"fix langevin/drude requires ghost velocities. Use comm_modify vel yes");
}
/* ---------------------------------------------------------------------- */
void FixLangevinDrude::setup(int /*vflag*/)
{
if (!utils::strmatch(update->integrate_style,"^verlet"))
error->all(FLERR,"RESPA style not compatible with fix langevin/drude");
if (!comm->ghost_velocity)
error->all(FLERR,"fix langevin/drude requires ghost velocities. Use comm_modify vel yes");
if (zero) {
int *mask = atom->mask;
int nlocal = atom->nlocal;

View File

@ -600,14 +600,23 @@ void FixTGNHDrude::init()
// set temperature and pressure ptrs
temperature = modify->get_compute_by_id(id_temp);
if (!temperature) error->all(FLERR,"Temperature ID for fix {} does not exist", style);
if (temperature->tempbias) which = BIAS;
else which = NOBIAS;
if (!temperature) {
error->all(FLERR,"Temperature compute ID {} for fix {} does not exist", id_temp, style);
} else {
if (temperature->tempflag == 0)
error->all(FLERR, "Compute ID {} for fix {} does not compute a temperature", id_temp, style);
if (temperature->tempbias) which = BIAS;
else which = NOBIAS;
}
if (pstat_flag) {
pressure = modify->get_compute_by_id(id_press);
if (!pressure) error->all(FLERR,"Pressure ID for fix {} does not exist", id_press);
if (!pressure) {
error->all(FLERR,"Pressure compute ID {} for fix {} does not exist", id_press, style);
} else {
if (pressure->pressflag == 0)
error->all(FLERR,"Compute ID {} for fix {} does not compute pressure", id_press, style);
}
}
// set timesteps and frequencies

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -22,13 +21,10 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixTGNPTDrude::FixTGNPTDrude(LAMMPS *lmp, int narg, char **arg) :
FixTGNHDrude(lmp, narg, arg)
FixTGNPTDrude::FixTGNPTDrude(LAMMPS *lmp, int narg, char **arg) : FixTGNHDrude(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix npt");
if (!pstat_flag)
error->all(FLERR,"Pressure control must be used with fix npt");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix npt");
if (!pstat_flag) error->all(FLERR, "Pressure control must be used with fix npt");
// create a new compute temp style
// id = fix-ID + temp
@ -36,7 +32,7 @@ FixTGNPTDrude::FixTGNPTDrude(LAMMPS *lmp, int narg, char **arg) :
// and thus its KE/temperature contribution should use group all
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} all temp",id_temp));
modify->add_compute(fmt::format("{} all temp", id_temp));
tcomputeflag = 1;
// create a new compute pressure style
@ -44,6 +40,6 @@ FixTGNPTDrude::FixTGNPTDrude(LAMMPS *lmp, int narg, char **arg) :
// pass id_temp as 4th arg to pressure constructor
id_press = utils::strdup(std::string(id) + "_press");
modify->add_compute(fmt::format("{} all pressure {}",id_press, id_temp));
modify->add_compute(fmt::format("{} all pressure {}", id_press, id_temp));
pcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -23,18 +22,15 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixTGNVTDrude::FixTGNVTDrude(LAMMPS *lmp, int narg, char **arg) :
FixTGNHDrude(lmp, narg, arg)
FixTGNVTDrude::FixTGNVTDrude(LAMMPS *lmp, int narg, char **arg) : FixTGNHDrude(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix nvt");
if (pstat_flag)
error->all(FLERR,"Pressure control can not be used with fix nvt");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix {}", style);
if (pstat_flag) error->all(FLERR, "Pressure control can not be used with fix {}", style);
// create a new compute temp style
// id = fix-ID + temp
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} {} temp",id_temp,group->names[igroup]));
modify->add_compute(fmt::format("{} {} temp", id_temp, group->names[igroup]));
tcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -22,13 +21,10 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNPHEff::FixNPHEff(LAMMPS *lmp, int narg, char **arg) :
FixNHEff(lmp, narg, arg)
FixNPHEff::FixNPHEff(LAMMPS *lmp, int narg, char **arg) : FixNHEff(lmp, narg, arg)
{
if (tstat_flag)
error->all(FLERR,"Temperature control can not be used with fix nph/eff");
if (!pstat_flag)
error->all(FLERR,"Pressure control must be used with fix nph/eff");
if (tstat_flag) error->all(FLERR, "Temperature control can not be used with fix nph/eff");
if (!pstat_flag) error->all(FLERR, "Pressure control must be used with fix nph/eff");
// create a new compute temp style
// id = fix-ID + temp
@ -36,7 +32,7 @@ FixNPHEff::FixNPHEff(LAMMPS *lmp, int narg, char **arg) :
// and thus its KE/temperature contribution should use group all
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} all temp/eff",id_temp));
modify->add_compute(fmt::format("{} all temp/eff", id_temp));
tcomputeflag = 1;
// create a new compute pressure style
@ -44,6 +40,6 @@ FixNPHEff::FixNPHEff(LAMMPS *lmp, int narg, char **arg) :
// pass id_temp as 4th arg to pressure constructor
id_press = utils::strdup(std::string(id) + "_press");
modify->add_compute(fmt::format("{} all pressure {}",id_press, id_temp));
modify->add_compute(fmt::format("{} all pressure {}", id_press, id_temp));
pcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -22,13 +21,10 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNPTEff::FixNPTEff(LAMMPS *lmp, int narg, char **arg) :
FixNHEff(lmp, narg, arg)
FixNPTEff::FixNPTEff(LAMMPS *lmp, int narg, char **arg) : FixNHEff(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix npt/eff");
if (!pstat_flag)
error->all(FLERR,"Pressure control must be used with fix npt/eff");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix npt/eff");
if (!pstat_flag) error->all(FLERR, "Pressure control must be used with fix npt/eff");
// create a new compute temp style
// id = fix-ID + temp
@ -36,7 +32,7 @@ FixNPTEff::FixNPTEff(LAMMPS *lmp, int narg, char **arg) :
// and thus its KE/temperature contribution should use group all
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} all temp/eff",id_temp));
modify->add_compute(fmt::format("{} all temp/eff", id_temp));
tcomputeflag = 1;
// create a new compute pressure style
@ -44,6 +40,6 @@ FixNPTEff::FixNPTEff(LAMMPS *lmp, int narg, char **arg) :
// pass id_temp as 4th arg to pressure constructor
id_press = utils::strdup(std::string(id) + "_press");
modify->add_compute(fmt::format("{} all pressure {}",id_press, id_temp));
modify->add_compute(fmt::format("{} all pressure {}", id_press, id_temp));
pcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -23,19 +22,15 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNVTEff::FixNVTEff(LAMMPS *lmp, int narg, char **arg) :
FixNHEff(lmp, narg, arg)
FixNVTEff::FixNVTEff(LAMMPS *lmp, int narg, char **arg) : FixNHEff(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix nvt/eff");
if (pstat_flag)
error->all(FLERR,"Pressure control can not be used with fix nvt/eff");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix nvt/eff");
if (pstat_flag) error->all(FLERR, "Pressure control can not be used with fix nvt/eff");
// create a new compute temp style
// id = fix-ID + temp
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} {} temp/eff",
id_temp,group->names[igroup]));
modify->add_compute(fmt::format("{} {} temp/eff", id_temp, group->names[igroup]));
tcomputeflag = 1;
}

View File

@ -81,16 +81,14 @@ void FixNVTSllodEff::init()
// check fix deform remap settings
int i;
for (i = 0; i < modify->nfix; i++)
if (strncmp(modify->fix[i]->style,"deform",6) == 0) {
if ((dynamic_cast<FixDeform *>(modify->fix[i]))->remapflag != Domain::V_REMAP)
error->all(FLERR,"Using fix nvt/sllod/eff with inconsistent fix deform "
"remap option");
break;
}
if (i == modify->nfix)
error->all(FLERR,"Using fix nvt/sllod/eff with no fix deform defined");
auto deform = modify->get_fix_by_style("^deform");
if (deform.size() < 1) error->all(FLERR,"Using fix {} with no fix deform defined", style);
for (auto &ifix : deform) {
auto f = dynamic_cast<FixDeform *>(ifix);
if (f && (f->remapflag != Domain::V_REMAP))
error->all(FLERR,"Using fix {} with inconsistent fix deform remap option", style);
}
}

View File

@ -89,13 +89,15 @@ int FixTempRescaleEff::setmask()
void FixTempRescaleEff::init()
{
int icompute = modify->find_compute(id_temp);
if (icompute < 0)
error->all(FLERR,"Temperature ID for fix temp/rescale/eff does not exist");
temperature = modify->compute[icompute];
if (temperature->tempbias) which = BIAS;
else which = NOBIAS;
temperature = modify->get_compute_by_id(id_temp);
if (!temperature) {
error->all(FLERR,"Temperature compute ID {} for fix {} does not exist", id_temp, style);
} else {
if (temperature->tempflag == 0)
error->all(FLERR, "Compute ID {} for fix {} does not compute a temperature", id_temp, style);
if (temperature->tempbias) which = BIAS;
else which = NOBIAS;
}
}
/* ---------------------------------------------------------------------- */

View File

@ -432,12 +432,18 @@ void FixDeformPressure::init()
if (pressure_flag) {
temperature = modify->get_compute_by_id(id_temp);
if (!temperature)
error->all(FLERR, "Temperature ID {} for fix deform/pressure does not exist", id_temp);
if (!temperature) {
error->all(FLERR, "Temperature compute ID {} for fix {} does not exist", id_temp, style);
} else {
if (temperature->tempflag == 0)
error->all(FLERR, "Compute ID {} for fix {} does not compute a temperature", id_temp, style);
}
pressure = modify->get_compute_by_id(id_press);
if (!pressure)
error->all(FLERR, "Pressure ID {} for fix deform/pressure does not exist", id_press);
error->all(FLERR,"Pressure compute ID {} for fix {} does not exist", id_press, style);
if (pressure->pressflag == 0)
error->all(FLERR,"Compute ID {} for fix {} does not compute pressure", id_press, style);
}
// if yz [3] changes and will cause box flip, then xy [5] cannot be changing

View File

@ -640,28 +640,38 @@ void FixNPTCauchy::init()
// ensure no conflict with fix deform
if (pstat_flag)
for (int i = 0; i < modify->nfix; i++)
if (strcmp(modify->fix[i]->style,"deform") == 0) {
int *dimflag = (dynamic_cast<FixDeform *>(modify->fix[i]))->dimflag;
for (auto &ifix : modify->get_fix_by_style("^deform")) {
auto deform = dynamic_cast<FixDeform *>(ifix);
if (deform) {
int *dimflag = deform->dimflag;
if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) ||
(p_flag[2] && dimflag[2]) || (p_flag[3] && dimflag[3]) ||
(p_flag[4] && dimflag[4]) || (p_flag[5] && dimflag[5]))
error->all(FLERR,"Cannot use fix npt/cauchy and fix deform "
"on same component of stress tensor");
error->all(FLERR,"Cannot use fix {} and fix deform on "
"same component of stress tensor", style);
}
}
// set temperature and pressure ptrs
temperature = modify->get_compute_by_id(id_temp);
if (!temperature)
error->all(FLERR,"Temperature ID {} for fix npt/cauchy does not exist", id_temp);
if (temperature->tempbias) which = BIAS;
else which = NOBIAS;
if (!temperature) {
error->all(FLERR,"Temperature compute ID {} for fix {} does not exist", id_temp, style);
} else {
if (temperature->tempflag == 0)
error->all(FLERR, "Compute ID {} for fix {} does not compute a temperature", id_temp, style);
if (temperature->tempbias) which = BIAS;
else which = NOBIAS;
}
if (pstat_flag) {
pressure = modify->get_compute_by_id(id_press);
if (!pressure) error->all(FLERR,"Pressure ID {} for fix npt/cauchy does not exist", id_press);
if (!pressure) {
error->all(FLERR,"Pressure ID {} for fix {} does not exist", id_press, style);
} else {
if (pressure->pressflag == 0)
error->all(FLERR,"Compute ID {} for fix {} does not compute pressure", id_press, style);
}
}
// set timesteps and frequencies

View File

@ -111,7 +111,12 @@ void FixNumDiff::init()
// check for PE compute
pe = modify->get_compute_by_id(id_pe);
if (!pe) error->all(FLERR, "PE compute ID for fix numdiff does not exist");
if (!pe) {
error->all(FLERR, "Potential energy compute ID {} for fix {} does not exist", id_pe, style);
} else {
if (pe->peflag == 0)
error->all(FLERR, "Compute ID {} for fix {} does not compute potential energy", id_pe, style);
}
if (force->pair && force->pair->compute_flag)
pair_compute_flag = 1;

View File

@ -120,7 +120,12 @@ void FixNumDiffVirial::init()
// check for PE compute
pe = modify->get_compute_by_id(id_pe);
if (!pe) error->all(FLERR, "PE compute ID for fix numdiff/virial does not exist");
if (!pe) {
error->all(FLERR, "Potential energy compute ID {} for fix {} does not exist", id_pe, style);
} else {
if (pe->peflag == 0)
error->all(FLERR, "Compute ID {} for fix {} does not compute potential energy", id_pe, style);
}
if (force->pair && force->pair->compute_flag)
pair_compute_flag = 1;

View File

@ -138,20 +138,23 @@ void FixTempCSLD::init()
if (tstr) {
tvar = input->variable->find(tstr);
if (tvar < 0)
error->all(FLERR,"Variable name {} for fix temp/csld does not exist", tstr);
error->all(FLERR,"Variable name {} for fix {} does not exist", tstr, style);
if (input->variable->equalstyle(tvar)) tstyle = EQUAL;
else error->all(FLERR,"Variable {} for fix temp/csld is invalid style", tstr);
else error->all(FLERR,"Variable {} for fix {} is invalid style", tstr, style);
}
temperature = modify->get_compute_by_id(id_temp);
if (!temperature)
error->all(FLERR,"Temperature ID {} for fix temp/csld does not exist", id_temp);
if (!temperature) {
error->all(FLERR,"Temperature compute ID {} for fix {} does not exist", id_temp, style);
} else {
if (temperature->tempflag == 0)
error->all(FLERR, "Compute ID {} for fix {} does not compute a temperature", id_temp, style);
if (temperature->tempbias) which = BIAS;
else which = NOBIAS;
}
if (modify->check_rigid_group_overlap(groupbit))
error->warning(FLERR,"Cannot thermostat atoms in rigid bodies");
if (temperature->tempbias) which = BIAS;
else which = NOBIAS;
if ((modify->check_rigid_group_overlap(groupbit)) && (comm->me == 0))
error->warning(FLERR,"Cannot thermostat atoms in rigid bodies with fix {}", style);
}
/* ---------------------------------------------------------------------- */
@ -170,7 +173,7 @@ void FixTempCSLD::end_of_step()
modify->clearstep_compute();
t_target = input->variable->compute_equal(tvar);
if (t_target < 0.0)
error->one(FLERR, "Fix temp/csld variable returned negative temperature");
error->one(FLERR, "Fix {} variable returned negative temperature", style);
modify->addstep_compute(update->ntimestep + nevery);
}

View File

@ -47,7 +47,7 @@ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) :
Fix(lmp, narg, arg),
tstr(nullptr), id_temp(nullptr), random(nullptr)
{
if (narg != 7) error->all(FLERR,"Illegal fix temp/csvr command");
if (narg != 7) error->all(FLERR,"Incorrect number of arguments for fix {} command", style);
// CSVR thermostat should be applied every step
@ -75,8 +75,8 @@ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) :
// error checks
if (t_period <= 0.0) error->all(FLERR,"Illegal fix temp/csvr command");
if (seed <= 0) error->all(FLERR,"Illegal fix temp/csvr command");
if (t_period <= 0.0) error->all(FLERR,"Illegal fix {} command period value", style);
if (seed <= 0) error->all(FLERR,"Illegal fix {} command seed value", style);
random = new RanMars(lmp,seed + comm->me);
@ -84,7 +84,7 @@ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) :
// id = fix-ID + temp, compute group = fix group
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} {} temp",id_temp,group->names[igroup]));
modify->add_compute(fmt::format("{} {} temp", id_temp, group->names[igroup]));
tflag = 1;
nmax = -1;
@ -124,17 +124,23 @@ void FixTempCSVR::init()
if (tstr) {
tvar = input->variable->find(tstr);
if (tvar < 0)
error->all(FLERR,"Variable name {} for fix temp/csvr does not exist", tstr);
error->all(FLERR,"Variable name {} for fix {} does not exist", tstr, style);
if (input->variable->equalstyle(tvar)) tstyle = EQUAL;
else error->all(FLERR,"Variable {} for fix temp/csvr is invalid style", tstr);
else error->all(FLERR,"Variable {} for fix {} is invalid style", tstr, style);
}
temperature = modify->get_compute_by_id(id_temp);
if (!temperature)
error->all(FLERR,"Temperature ID {} for fix temp/csvr does not exist", id_temp);
if (!temperature) {
error->all(FLERR,"Temperature compute ID {} for fix {} does not exist", id_temp, style);
} else {
if (temperature->tempflag == 0)
error->all(FLERR, "Compute ID {} for fix {} does not compute a temperature", id_temp, style);
if (temperature->tempbias) which = BIAS;
else which = NOBIAS;
}
if (temperature->tempbias) which = BIAS;
else which = NOBIAS;
if ((modify->check_rigid_group_overlap(groupbit)) && (comm->me == 0))
error->warning(FLERR,"Cannot thermostat atoms in rigid bodies with fix {}", style);
}
/* ---------------------------------------------------------------------- */
@ -153,7 +159,8 @@ void FixTempCSVR::end_of_step()
modify->clearstep_compute();
t_target = input->variable->compute_equal(tvar);
if (t_target < 0.0)
error->one(FLERR, "Fix temp/csvr variable returned negative temperature");
error->one(FLERR, "Fix {} variable {} returned negative temperature",
style, input->variable->names[tvar]);
modify->addstep_compute(update->ntimestep + nevery);
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -22,28 +21,25 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNPTGPU::FixNPTGPU(LAMMPS *lmp, int narg, char **arg) :
FixNHGPU(lmp, narg, arg)
FixNPTGPU::FixNPTGPU(LAMMPS *lmp, int narg, char **arg) : FixNHGPU(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix npt/gpu");
if (!pstat_flag)
error->all(FLERR,"Pressure control must be used with fix npt/gpu");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix npt/gpu");
if (!pstat_flag) error->all(FLERR, "Pressure control must be used with fix npt/gpu");
// create a new compute temp style
// id = fix-ID + temp
// compute group = all since pressure is always global (group all)
// and thus its KE/temperature contribution should use group all
id_temp = utils::strdup(std::string(id)+"_temp");
modify->add_compute(fmt::format("{} all temp",id_temp));
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} all temp", id_temp));
tcomputeflag = 1;
// create a new compute pressure style
// id = fix-ID + press, compute group = all
// pass id_temp as 4th arg to pressure constructor
id_press = utils::strdup(std::string(id)+"_press");
modify->add_compute(std::string(id_press)+" all pressure "+id_temp);
id_press = utils::strdup(std::string(id) + "_press");
modify->add_compute(std::string(id_press) + " all pressure " + id_temp);
pcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -23,18 +22,15 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNVTGPU::FixNVTGPU(LAMMPS *lmp, int narg, char **arg) :
FixNHGPU(lmp, narg, arg)
FixNVTGPU::FixNVTGPU(LAMMPS *lmp, int narg, char **arg) : FixNHGPU(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix nvt/gpu");
if (pstat_flag)
error->all(FLERR,"Pressure control can not be used with fix nvt/gpu");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix nvt/gpu");
if (pstat_flag) error->all(FLERR, "Pressure control can not be used with fix nvt/gpu");
// create a new compute temp style
// id = fix-ID + temp
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} {} temp",id_temp,group->names[igroup]));
modify->add_compute(fmt::format("{} {} temp", id_temp, group->names[igroup]));
tcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -22,13 +21,10 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNPTIntel::FixNPTIntel(LAMMPS *lmp, int narg, char **arg) :
FixNHIntel(lmp, narg, arg)
FixNPTIntel::FixNPTIntel(LAMMPS *lmp, int narg, char **arg) : FixNHIntel(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix npt/intel");
if (!pstat_flag)
error->all(FLERR,"Pressure control must be used with fix npt/intl");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix npt/intel");
if (!pstat_flag) error->all(FLERR, "Pressure control must be used with fix npt/intl");
// create a new compute temp style
// id = fix-ID + temp
@ -36,7 +32,7 @@ FixNPTIntel::FixNPTIntel(LAMMPS *lmp, int narg, char **arg) :
// and thus its KE/temperature contribution should use group all
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} all temp",id_temp));
modify->add_compute(fmt::format("{} all temp", id_temp));
tcomputeflag = 1;
// create a new compute pressure style
@ -44,6 +40,6 @@ FixNPTIntel::FixNPTIntel(LAMMPS *lmp, int narg, char **arg) :
// pass id_temp as 4th arg to pressure constructor
id_press = utils::strdup(std::string(id) + "_press");
modify->add_compute(fmt::format("{} all pressure {}",id_press, id_temp));
modify->add_compute(fmt::format("{} all pressure {}", id_press, id_temp));
pcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -23,19 +22,15 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNVTIntel::FixNVTIntel(LAMMPS *lmp, int narg, char **arg) :
FixNHIntel(lmp, narg, arg)
FixNVTIntel::FixNVTIntel(LAMMPS *lmp, int narg, char **arg) : FixNHIntel(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix nvt/intel");
if (pstat_flag)
error->all(FLERR,"Pressure control can not be used with fix nvt/intel");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix nvt/intel");
if (pstat_flag) error->all(FLERR, "Pressure control can not be used with fix nvt/intel");
// create a new compute temp style
// id = fix-ID + temp
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} {} temp",id_temp,group->names[igroup]));
modify->add_compute(fmt::format("{} {} temp", id_temp, group->names[igroup]));
tcomputeflag = 1;
}

View File

@ -201,7 +201,7 @@ void AtomVecSMD::write_data_restricted_to_general()
int nlocal = atom->nlocal;
memory->create(x0_hold,nlocal,3,"atomvec:x0_hold");
if (nlocal) memcpy(&x0_hold[0][0],&x0[0][0],3*nlocal*sizeof(double));
if (nlocal) memcpy(&x0_hold[0][0],&x0[0][0],(sizeof(double)*3*nlocal)&MEMCPYMASK);
for (int i = 0; i < nlocal; i++)
domain->restricted_to_general_coords(x0[i]);
@ -221,7 +221,7 @@ void AtomVecSMD::write_data_restore_restricted()
if (!x0_hold) return;
int nlocal = atom->nlocal;
memcpy(&x0[0][0],&x0_hold[0][0],3*nlocal*sizeof(double));
memcpy(&x0[0][0],&x0_hold[0][0],(sizeof(double)*3*nlocal)&MEMCPYMASK);
memory->destroy(x0_hold);
x0_hold = nullptr;
}

View File

@ -187,15 +187,15 @@ void FixNVTManifoldRattle::init()
// Makes sure the manifold params are set initially.
update_var_params();
int icompute = modify->find_compute(id_temp);
if (icompute < 0) {
error->all(FLERR,"Temperature ID for fix nvt/manifold/rattle "
"does not exist");
temperature = modify->get_compute_by_id(id_temp);
if (!temperature) {
error->all(FLERR,"Temperature compute ID {} for fix {} does not exist", id_temp, style);
} else {
if (temperature->tempflag == 0)
error->all(FLERR, "Compute ID {} for fix {} does not compute a temperature", id_temp, style);
if (temperature->tempbias) which = BIAS;
else which = NOBIAS;
}
temperature = modify->compute[icompute];
if (temperature->tempbias) which = BIAS;
else which = NOBIAS;
}
void FixNVTManifoldRattle::setup(int /*vflag*/)

View File

@ -136,13 +136,15 @@ void FixBondSwap::init()
// require an atom style with molecule IDs
if (atom->molecule == nullptr)
error->all(FLERR,
"Must use atom style with molecule IDs with fix bond/swap");
error->all(FLERR, "Must use atom style with molecule IDs with fix bond/swap");
int icompute = modify->find_compute(id_temp);
if (icompute < 0)
error->all(FLERR,"Temperature ID for fix bond/swap does not exist");
temperature = modify->compute[icompute];
temperature = modify->get_compute_by_id(id_temp);
if (!temperature) {
error->all(FLERR,"Temperature compute ID {} for fix {} does not exist", id_temp, style);
} else {
if (temperature->tempflag == 0)
error->all(FLERR, "Compute ID {} for fix {} does not compute a temperature", id_temp, style);
}
// pair and bonds must be defined
// no dihedral or improper potentials allowed
@ -159,7 +161,7 @@ void FixBondSwap::init()
"topology because no angle_style is defined");
if (force->dihedral || force->improper)
error->all(FLERR,"Fix bond/swap cannot use dihedral or improper styles");
error->all(FLERR,"Fix bond/swap cannot be used with dihedral or improper styles");
if (force->special_lj[1] != 0.0 || force->special_lj[2] != 1.0 ||
force->special_lj[3] != 1.0)

View File

@ -259,8 +259,12 @@ void FixIPI::init()
socketflag = 1;
// asks for evaluation of PE at first step
modify->compute[modify->find_compute("thermo_pe")]->invoked_scalar = -1;
modify->addstep_compute_all(update->ntimestep + 1);
auto c_pe = modify->get_compute_by_id("thermo_pe");
if (c_pe) {
c_pe->invoked_scalar = -1;
modify->addstep_compute_all(update->ntimestep + 1);
}
kspace_flag = (force->kspace) ? 1 : 0;
@ -444,8 +448,12 @@ void FixIPI::final_integrate()
pressconv=1/force->nktv2p*potconv*posconv3;
// compute for potential energy
pot=modify->compute[modify->find_compute("thermo_pe")]->compute_scalar();
pot*=potconv;
auto *c_pe = modify->get_compute_by_id("thermo_pe");
if (c_pe) {
pot = c_pe->compute_scalar();
pot*=potconv;
}
// probably useless check
if (!hasdata)
@ -469,18 +477,19 @@ void FixIPI::final_integrate()
for (int i = 0; i < 9; ++i) vir[i]=0.0;
int press_id = modify->find_compute("IPI_PRESS");
Compute* comp_p = modify->compute[press_id];
comp_p->compute_vector();
double myvol = domain->xprd*domain->yprd*domain->zprd/posconv3;
const double myvol = domain->xprd*domain->yprd*domain->zprd/posconv3;
Compute* comp_p = modify->get_compute_by_id("IPI_PRESS");
if (comp_p) {
comp_p->compute_vector();
vir[0] = comp_p->vector[0]*pressconv*myvol;
vir[4] = comp_p->vector[1]*pressconv*myvol;
vir[8] = comp_p->vector[2]*pressconv*myvol;
vir[1] = comp_p->vector[3]*pressconv*myvol;
vir[2] = comp_p->vector[4]*pressconv*myvol;
vir[5] = comp_p->vector[5]*pressconv*myvol;
retstr[0]=0;
vir[0] = comp_p->vector[0]*pressconv*myvol;
vir[4] = comp_p->vector[1]*pressconv*myvol;
vir[8] = comp_p->vector[2]*pressconv*myvol;
vir[1] = comp_p->vector[3]*pressconv*myvol;
vir[2] = comp_p->vector[4]*pressconv*myvol;
vir[5] = comp_p->vector[5]*pressconv*myvol;
retstr[0]=0;
}
if (master) {
// check for new messages

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -23,12 +22,10 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNPHAsphereOMP::FixNPHAsphereOMP(LAMMPS *lmp, int narg, char **arg) :
FixNHAsphereOMP(lmp, narg, arg)
FixNHAsphereOMP(lmp, narg, arg)
{
if (tstat_flag)
error->all(FLERR,"Temperature control can not be used with fix nph/asphere/tmp");
if (!pstat_flag)
error->all(FLERR,"Pressure control must be used with fix nph/asphere/omp");
if (tstat_flag) error->all(FLERR, "Temperature control can not be used with fix nph/asphere/tmp");
if (!pstat_flag) error->all(FLERR, "Pressure control must be used with fix nph/asphere/omp");
// create a new compute temp style
// id = fix-ID + temp
@ -36,7 +33,7 @@ FixNPHAsphereOMP::FixNPHAsphereOMP(LAMMPS *lmp, int narg, char **arg) :
// and thus its KE/temperature contribution should use group all
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} all temp/asphere",id_temp));
modify->add_compute(fmt::format("{} all temp/asphere", id_temp));
tcomputeflag = 1;
// create a new compute pressure style
@ -44,6 +41,6 @@ FixNPHAsphereOMP::FixNPHAsphereOMP(LAMMPS *lmp, int narg, char **arg) :
// pass id_temp as 4th arg to pressure constructor
id_press = utils::strdup(std::string(id) + "_press");
modify->add_compute(fmt::format("{} all pressure {}",id_press, id_temp));
modify->add_compute(fmt::format("{} all pressure {}", id_press, id_temp));
pcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -22,13 +21,10 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNPHOMP::FixNPHOMP(LAMMPS *lmp, int narg, char **arg) :
FixNHOMP(lmp, narg, arg)
FixNPHOMP::FixNPHOMP(LAMMPS *lmp, int narg, char **arg) : FixNHOMP(lmp, narg, arg)
{
if (tstat_flag)
error->all(FLERR,"Temperature control can not be used with fix nph/omp");
if (!pstat_flag)
error->all(FLERR,"Pressure control must be used with fix nph/omp");
if (tstat_flag) error->all(FLERR, "Temperature control can not be used with fix nph/omp");
if (!pstat_flag) error->all(FLERR, "Pressure control must be used with fix nph/omp");
// create a new compute temp style
// id = fix-ID + temp
@ -36,7 +32,7 @@ FixNPHOMP::FixNPHOMP(LAMMPS *lmp, int narg, char **arg) :
// and thus its KE/temperature contribution should use group all
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} all temp",id_temp));
modify->add_compute(fmt::format("{} all temp", id_temp));
tcomputeflag = 1;
// create a new compute pressure style
@ -44,6 +40,6 @@ FixNPHOMP::FixNPHOMP(LAMMPS *lmp, int narg, char **arg) :
// pass id_temp as 4th arg to pressure constructor
id_press = utils::strdup(std::string(id) + "_press");
modify->add_compute(fmt::format("{} all pressure {}",id_press, id_temp));
modify->add_compute(fmt::format("{} all pressure {}", id_press, id_temp));
pcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -22,13 +21,10 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNPHSphereOMP::FixNPHSphereOMP(LAMMPS *lmp, int narg, char **arg) :
FixNHSphereOMP(lmp, narg, arg)
FixNPHSphereOMP::FixNPHSphereOMP(LAMMPS *lmp, int narg, char **arg) : FixNHSphereOMP(lmp, narg, arg)
{
if (tstat_flag)
error->all(FLERR,"Temperature control can not be used with fix nph/sphere/omp");
if (!pstat_flag)
error->all(FLERR,"Pressure control must be used with fix nph/sphere/omp");
if (tstat_flag) error->all(FLERR, "Temperature control can not be used with fix nph/sphere/omp");
if (!pstat_flag) error->all(FLERR, "Pressure control must be used with fix nph/sphere/omp");
// create a new compute temp style
// id = fix-ID + temp
@ -36,7 +32,7 @@ FixNPHSphereOMP::FixNPHSphereOMP(LAMMPS *lmp, int narg, char **arg) :
// and thus its KE/temperature contribution should use group all
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} all temp/sphere",id_temp));
modify->add_compute(fmt::format("{} all temp/sphere", id_temp));
tcomputeflag = 1;
// create a new compute pressure style
@ -44,6 +40,6 @@ FixNPHSphereOMP::FixNPHSphereOMP(LAMMPS *lmp, int narg, char **arg) :
// pass id_temp as 4th arg to pressure constructor
id_press = utils::strdup(std::string(id) + "_press");
modify->add_compute(fmt::format("{} all pressure {}",id_press, id_temp));
modify->add_compute(fmt::format("{} all pressure {}", id_press, id_temp));
pcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -23,12 +22,10 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNPTAsphereOMP::FixNPTAsphereOMP(LAMMPS *lmp, int narg, char **arg) :
FixNHAsphereOMP(lmp, narg, arg)
FixNHAsphereOMP(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix npt/asphere/omp");
if (!pstat_flag)
error->all(FLERR,"Pressure control must be used with fix npt/asphere/omp");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix npt/asphere/omp");
if (!pstat_flag) error->all(FLERR, "Pressure control must be used with fix npt/asphere/omp");
// create a new compute temp style
// id = fix-ID + temp
@ -36,7 +33,7 @@ FixNPTAsphereOMP::FixNPTAsphereOMP(LAMMPS *lmp, int narg, char **arg) :
// and thus its KE/temperature contribution should use group all
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} all temp/asphere",id_temp));
modify->add_compute(fmt::format("{} all temp/asphere", id_temp));
tcomputeflag = 1;
// create a new compute pressure style
@ -44,6 +41,6 @@ FixNPTAsphereOMP::FixNPTAsphereOMP(LAMMPS *lmp, int narg, char **arg) :
// pass id_temp as 4th arg to pressure constructor
id_press = utils::strdup(std::string(id) + "_press");
modify->add_compute(fmt::format("{} all pressure {}",id_press, id_temp));
modify->add_compute(fmt::format("{} all pressure {}", id_press, id_temp));
pcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -22,13 +21,10 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNPTOMP::FixNPTOMP(LAMMPS *lmp, int narg, char **arg) :
FixNHOMP(lmp, narg, arg)
FixNPTOMP::FixNPTOMP(LAMMPS *lmp, int narg, char **arg) : FixNHOMP(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix npt/omp");
if (!pstat_flag)
error->all(FLERR,"Pressure control must be used with fix npt/omp");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix npt/omp");
if (!pstat_flag) error->all(FLERR, "Pressure control must be used with fix npt/omp");
// create a new compute temp style
// id = fix-ID + temp
@ -36,7 +32,7 @@ FixNPTOMP::FixNPTOMP(LAMMPS *lmp, int narg, char **arg) :
// and thus its KE/temperature contribution should use group all
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} all temp",id_temp));
modify->add_compute(fmt::format("{} all temp", id_temp));
tcomputeflag = 1;
// create a new compute pressure style
@ -44,6 +40,6 @@ FixNPTOMP::FixNPTOMP(LAMMPS *lmp, int narg, char **arg) :
// pass id_temp as 4th arg to pressure constructor
id_press = utils::strdup(std::string(id) + "_press");
modify->add_compute(fmt::format("{} all pressure {}",id_press, id_temp));
modify->add_compute(fmt::format("{} all pressure {}", id_press, id_temp));
pcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -22,13 +21,10 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNPTSphereOMP::FixNPTSphereOMP(LAMMPS *lmp, int narg, char **arg) :
FixNHSphereOMP(lmp, narg, arg)
FixNPTSphereOMP::FixNPTSphereOMP(LAMMPS *lmp, int narg, char **arg) : FixNHSphereOMP(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix npt/sphere/omp");
if (!pstat_flag)
error->all(FLERR,"Pressure control must be used with fix npt/sphere/omp");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix npt/sphere/omp");
if (!pstat_flag) error->all(FLERR, "Pressure control must be used with fix npt/sphere/omp");
// create a new compute temp style
// id = fix-ID + temp
@ -36,7 +32,7 @@ FixNPTSphereOMP::FixNPTSphereOMP(LAMMPS *lmp, int narg, char **arg) :
// and thus its KE/temperature contribution should use group all
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} all temp/sphere",id_temp));
modify->add_compute(fmt::format("{} all temp/sphere", id_temp));
tcomputeflag = 1;
// create a new compute pressure style
@ -44,6 +40,6 @@ FixNPTSphereOMP::FixNPTSphereOMP(LAMMPS *lmp, int narg, char **arg) :
// pass id_temp as 4th arg to pressure constructor
id_press = utils::strdup(std::string(id) + "_press");
modify->add_compute(fmt::format("{} all pressure {}",id_press, id_temp));
modify->add_compute(fmt::format("{} all pressure {}", id_press, id_temp));
pcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -24,18 +23,15 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNVTAsphereOMP::FixNVTAsphereOMP(LAMMPS *lmp, int narg, char **arg) :
FixNHAsphereOMP(lmp, narg, arg)
FixNHAsphereOMP(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix nvt/asphere/omp");
if (pstat_flag)
error->all(FLERR,"Pressure control can not be used with fix nvt/asphere/omp");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix nvt/asphere/omp");
if (pstat_flag) error->all(FLERR, "Pressure control can not be used with fix nvt/asphere/omp");
// create a new compute temp style
// id = fix-ID + temp
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} {} temp/asphere",
id_temp,group->names[igroup]));
modify->add_compute(fmt::format("{} {} temp/asphere", id_temp, group->names[igroup]));
tcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -23,18 +22,15 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNVTOMP::FixNVTOMP(LAMMPS *lmp, int narg, char **arg) :
FixNHOMP(lmp, narg, arg)
FixNVTOMP::FixNVTOMP(LAMMPS *lmp, int narg, char **arg) : FixNHOMP(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix nvt/omp");
if (pstat_flag)
error->all(FLERR,"Pressure control can not be used with fix nvt/omp");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix nvt/omp");
if (pstat_flag) error->all(FLERR, "Pressure control can not be used with fix nvt/omp");
// create a new compute temp style
// id = fix-ID + temp
id_temp = utils::strdup(std::string(id)+"_temp");
modify->add_compute(fmt::format("{} {} temp",id_temp,group->names[igroup]));
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} {} temp", id_temp, group->names[igroup]));
tcomputeflag = 1;
}

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -23,19 +22,15 @@ using namespace FixConst;
/* ---------------------------------------------------------------------- */
FixNVTSphereOMP::FixNVTSphereOMP(LAMMPS *lmp, int narg, char **arg) :
FixNHSphereOMP(lmp, narg, arg)
FixNVTSphereOMP::FixNVTSphereOMP(LAMMPS *lmp, int narg, char **arg) : FixNHSphereOMP(lmp, narg, arg)
{
if (!tstat_flag)
error->all(FLERR,"Temperature control must be used with fix nvt/sphere/omp");
if (pstat_flag)
error->all(FLERR,"Pressure control can not be used with fix nvt/sphere/omp");
if (!tstat_flag) error->all(FLERR, "Temperature control must be used with fix nvt/sphere/omp");
if (pstat_flag) error->all(FLERR, "Pressure control can not be used with fix nvt/sphere/omp");
// create a new compute temp style
// id = fix-ID + temp
id_temp = utils::strdup(std::string(id) + "_temp");
modify->add_compute(fmt::format("{} {} temp/sphere",
id_temp,group->names[igroup]));
modify->add_compute(fmt::format("{} {} temp/sphere", id_temp, group->names[igroup]));
tcomputeflag = 1;
}

View File

@ -88,15 +88,15 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
int iarg = 8;
nasr = 20;
// other command line options
// other command-line options
while (iarg < narg) {
if (strcmp(arg[iarg],"sysdim") == 0) {
if (++iarg >= narg) error->all(FLERR,"Illegal fix phonon command: incomplete command line options.");
if (++iarg >= narg) error->all(FLERR,"Illegal fix phonon command: incomplete command-line options.");
sdim = utils::inumeric(FLERR, arg[iarg],false,lmp);
if (sdim < 1) error->all(FLERR,"Illegal fix phonon command: sysdim should not be less than 1.");
} else if (strcmp(arg[iarg],"nasr") == 0) {
if (++iarg >= narg) error->all(FLERR,"Illegal fix phonon command: incomplete command line options.");
if (++iarg >= narg) error->all(FLERR,"Illegal fix phonon command: incomplete command-line options.");
nasr = utils::inumeric(FLERR, arg[iarg],false,lmp);
} else {

View File

@ -227,17 +227,24 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(check_style, "plumed") == 0)
error->all(FLERR, "There must be only one instance of fix plumed");
// PLUMED knows nothing about path integrals
if (utils::strmatch(check_style, "^pimd") || utils::strmatch(check_style, "^ipi"))
error->all(FLERR, "Fix plumed is incompatible with path-integrals");
// Avoid conflict with fixes that define internal pressure computes.
// See comment in the setup method
if (utils::strmatch(check_style, "^nph") || utils::strmatch(check_style, "^npt") ||
utils::strmatch(check_style, "^rigid/nph") || utils::strmatch(check_style, "^rigid/npt") ||
utils::strmatch(check_style, "^msst") || utils::strmatch(check_style, "^nphug") ||
utils::strmatch(check_style, "^ipi") || utils::strmatch(check_style, "^press/berendsen") ||
utils::strmatch(check_style, "^qbmsst"))
if (utils::strmatch(check_style, "^nph") || utils::strmatch(check_style, "^press/berendsen") ||
utils::strmatch(check_style, "^npt") || utils::strmatch(check_style, "^deform/pressure") ||
utils::strmatch(check_style, "^msst") || utils::strmatch(check_style, "^press/langevin") ||
utils::strmatch(check_style, "^nphug") || utils::strmatch(check_style, "^tgnpt/drude") ||
utils::strmatch(check_style, "^qbmsst") || utils::strmatch(check_style, "^rigid/nph") ||
utils::strmatch(check_style, "^rigid/npt") || utils::strmatch(check_style, "^box/relax"))
error->all(FLERR,
"Fix plumed must be defined before any other fixes, "
"that compute pressure internally");
"Fix plumed must be defined before any other fixes like fix {} that compute "
"pressure internally",
check_style);
}
}
@ -272,6 +279,22 @@ void FixPlumed::init()
// in a setup method
for (int i = 0; i < 6; i++) virial[i] = 0.;
c_pe = modify->get_compute_by_id(id_pe);
if (!c_pe) {
error->all(FLERR, "Potential energy compute ID {} for fix plumed does not exist", id_pe);
} else {
if (c_pe->peflag == 0)
error->all(FLERR, "Compute ID {} does not compute potential energy", id_pe);
}
c_press = modify->get_compute_by_id(id_press);
if (!c_press) {
error->all(FLERR, "Pressure compute ID {} for fix plumed does not exist", id_press);
} else {
if (c_press->pressflag == 0)
error->all(FLERR, "Compute ID {} does not compute pressure", id_press);
}
}
void FixPlumed::setup(int vflag)

View File

@ -162,8 +162,8 @@ constexpr double optimal_particles = 5.6;
* contacted. */
#define VOROPP_INTERNAL_ERROR 3
/** Voro++ returns this status code if it could not interpret the command line
* arguments passed to the command line utility. */
/** Voro++ returns this status code if it could not interpret the command-line
* arguments passed to the command-line utility. */
#define VOROPP_CMD_LINE_ERROR 4
} // namespace ptm_voro

View File

@ -316,18 +316,28 @@ void FixQBMSST::init()
// set compute ptrs
temperature = modify->get_compute_by_id(id_temp);
if (!temperature)
if (!temperature) {
error->all(FLERR, "Could not find fix qbmsst temperature compute ID {}", id_temp);
if (temperature->tempflag == 0)
error->all(FLERR, "Fix qbmsst compute ID {} does not compute temperature", id_temp);
} else {
if (temperature->tempflag == 0)
error->all(FLERR, "Fix qbmsst compute ID {} does not compute a temperature", id_temp);
}
pressure = modify->get_compute_by_id(id_press);
if (!pressure) error->all(FLERR, "Could not find fix qbmsst pressure compute ID {}", id_press);
if (pressure->pressflag == 0)
error->all(FLERR, "Fix qbmsst compute ID {} does not compute pressure", id_press);
if (!pressure) {
error->all(FLERR, "Could not find fix qbmsst pressure compute ID {}", id_press);
} else {
if (pressure->pressflag == 0)
error->all(FLERR, "Fix qbmsst compute ID {} does not compute pressure", id_press);
}
pe = modify->get_compute_by_id(id_pe);
if (!pe) error->all(FLERR, "Could not find fix qbmsst pe compute ID {}", id_pe);
if (pe->peflag == 0)
error->all(FLERR, "Fix qbmsst compute ID {} does not compute potential energy", id_pe);
if (!pe) {
error->all(FLERR, "Could not find fix qbmsst pe compute ID {}", id_pe);
} else {
if (pe->peflag == 0)
error->all(FLERR, "Fix qbmsst compute ID {} does not compute potential energy", id_pe);
}
// initiate the counter l and \mu
counter_l=0;

View File

@ -178,10 +178,10 @@ void FixAlchemy::init()
error->universe_all(FLERR, "Fix alchemy is not compatible with load balancing");
if (modify->get_fix_by_style("^alchemy").size() > 1)
error->universe_all(FLERR, "There may only one fix alchemy at a time");
error->universe_all(FLERR, "There may only be one fix alchemy at a time");
if (utils::strmatch(update->integrate_style, "^respa"))
error->universe_all(FLERR, "Must not use run style respa with fix alchemy");
error->universe_all(FLERR, "Must not use run_style respa with fix alchemy");
ivar = input->variable->find(id_lambda.c_str());
if (ivar < 0)
@ -190,6 +190,42 @@ void FixAlchemy::init()
error->universe_one(FLERR, fmt::format("Fix alchemy variable {} is invalid style", id_lambda));
lambda = input->variable->compute_equal(ivar);
// update and check pointers to internal compute styles
pe = modify->get_compute_by_id(id_pe);
if (!pe) {
error->universe_all(
FLERR,
fmt::format("Potential energy compute ID {} for fix {} does not exist", id_pe, style));
} else {
if (pe->peflag == 0)
error->universe_all(
FLERR,
fmt::format("Compute ID {} for fix {} does not compute potential energy", id_pe, style));
}
temp = modify->get_compute_by_id(id_temp);
if (!temp) {
error->universe_all(
FLERR, fmt::format("Temperature compute ID {} for fix {} does not exist", id_temp, style));
} else {
if (temp->tempflag == 0)
error->universe_all(
FLERR,
fmt::format("Compute ID {} for fix {} does not compute a temperature", id_temp, style));
}
press = modify->get_compute_by_id(id_press);
if (!press) {
error->universe_all(
FLERR, fmt::format("Pressure compute ID {} for fix {} does not exist", id_press, style));
} else {
if (press->pressflag == 0)
error->universe_all(
FLERR,
fmt::format("Compute ID {} for fix {} does not compute pressure", id_press, style));
}
// synchronize box dimensions, determine if resync during run will be needed.
synchronize_box(domain, samerank);

View File

@ -29,6 +29,7 @@
#include "compute.h"
#include "domain.h"
#include "error.h"
#include "fix_nh.h"
#include "force.h"
#include "modify.h"
#include "update.h"
@ -117,11 +118,11 @@ FixGrem::~FixGrem()
modify->delete_compute(id_press);
modify->delete_compute(id_ke);
modify->delete_compute(id_pe);
delete [] id_temp;
delete [] id_press;
delete [] id_ke;
delete [] id_pe;
delete [] id_nh;
delete[] id_temp;
delete[] id_press;
delete[] id_ke;
delete[] id_pe;
delete[] id_nh;
}
/* ---------------------------------------------------------------------- */
@ -141,55 +142,70 @@ void FixGrem::init()
if (domain->triclinic)
error->all(FLERR,"Triclinic cells are not supported");
// set temperature and pressure ptrs
// set temperature and other pointers to compute instances
int icompute = modify->find_compute(id_temp);
if (icompute < 0)
error->all(FLERR,"Temperature compute ID for fix grem does not exist");
temperature = modify->compute[icompute];
temperature = modify->get_compute_by_id(id_temp);
if (!temperature) {
error->all(FLERR,"Temperature compute ID {} for fix {} does not exist", id_temp, style);
} else {
if (temperature->tempflag == 0)
error->all(FLERR, "Compute ID {} for fix {} does not compute a temperature", id_temp, style);
}
icompute = modify->find_compute(id_ke);
if (icompute < 0)
error->all(FLERR,"KE compute ID for fix grem does not exist");
ke = modify->compute[icompute];
ke = modify->get_compute_by_id(id_ke);
if (!ke) {
error->all(FLERR,"Kinetic energy compute ID {} for fix {} does not exist", id_ke, style);
} else {
if (strcmp(ke->style, "ke") != 0)
error->all(FLERR, "Compute ID {} for fix {} does not compute kinetic energy", id_ke, style);
}
icompute = modify->find_compute(id_pe);
if (icompute < 0)
error->all(FLERR,"PE compute ID for fix grem does not exist");
pe = modify->compute[icompute];
pe = modify->get_compute_by_id(id_pe);
if (!pe) {
error->all(FLERR,"Potential energy compute ID {} for fix {} does not exist", id_pe, style);
} else {
if (pe->peflag == 0)
error->all(FLERR,"Compute ID {} for fix {} does not compute potential energy", id_pe, style);
}
int ifix = modify->find_fix(id_nh);
if (ifix < 0)
auto *ifix = modify->get_fix_by_id(id_nh);
if (!ifix) {
error->all(FLERR,"Fix id for nvt or npt fix does not exist");
Fix *nh = modify->fix[ifix];
auto t_start = (double *)nh->extract("t_start",ifix);
auto t_stop = (double *)nh->extract("t_stop",ifix);
if ((t_start != nullptr) && (t_stop != nullptr) && (ifix == 0)) {
tbath = *t_start;
if (*t_start != *t_stop)
error->all(FLERR,"Thermostat temperature ramp not allowed");
} else
error->all(FLERR,"Problem extracting target temperature from fix nvt or npt");
pressref = 0.0;
if (pressflag) {
int *p_flag = (int *)nh->extract("p_flag",ifix);
auto p_start = (double *) nh->extract("p_start",ifix);
auto p_stop = (double *) nh->extract("p_stop",ifix);
if ((p_flag != nullptr) && (p_start != nullptr) && (p_stop != nullptr)
&& (ifix == 1)) {
ifix = 0;
pressref = p_start[0];
if ((p_start[0] != p_stop[0]) || (p_flag[0] != 1)) ++ ifix;
if ((p_start[1] != p_stop[1]) || (p_flag[0] != 1)) ++ ifix;
if ((p_start[2] != p_stop[2]) || (p_flag[0] != 1)) ++ ifix;
if ((p_start[0] != p_start[1]) || (p_start[1] != p_start[2])) ++ifix;
if ((p_flag[3] != 0) || (p_flag[4] != 0) || (p_flag[5] != 0)) ++ifix;
if (ifix > 0)
error->all(FLERR,"Unsupported pressure settings in fix npt");
} else
error->all(FLERR,"Problem extracting target pressure from fix npt");
} else { // check for correct fix style
FixNH *nh = dynamic_cast<FixNH *>(ifix);
if (!nh) {
error->all(FLERR, "Fix ID {} is not a compatible Nose-Hoover fix for fix {}", id_nh, style);
} else {
int dummy;
auto t_start = (double *)nh->extract("t_start",dummy);
auto t_stop = (double *)nh->extract("t_stop",dummy);
if ((t_start != nullptr) && (t_stop != nullptr)) {
tbath = *t_start;
if (*t_start != *t_stop)
error->all(FLERR,"Temperature ramp in fix {} ID {} not allowed", nh->style, id_nh);
} else {
error->all(FLERR,"Problem extracting target temperature from fix {}", nh->style);
}
pressref = 0.0;
if (pressflag) {
int *p_flag = (int *)nh->extract("p_flag",dummy);
auto p_start = (double *) nh->extract("p_start",dummy);
auto p_stop = (double *) nh->extract("p_stop",dummy);
if ((p_flag != nullptr) && (p_start != nullptr) && (p_stop != nullptr)) {
int ifix = 0;
pressref = p_start[0];
if ((p_start[0] != p_stop[0]) || (p_flag[0] != 1)) ++ ifix;
if ((p_start[1] != p_stop[1]) || (p_flag[0] != 1)) ++ ifix;
if ((p_start[2] != p_stop[2]) || (p_flag[0] != 1)) ++ ifix;
if ((p_start[0] != p_start[1]) || (p_start[1] != p_start[2])) ++ifix;
if ((p_flag[3] != 0) || (p_flag[4] != 0) || (p_flag[5] != 0)) ++ifix;
if (ifix > 0)
error->all(FLERR,"Unsupported pressure settings in fix {} ID {}", nh->style, id_nh);
} else {
error->all(FLERR,"Problem extracting target pressure from fix {}", nh->style);
}
}
}
}
}

View File

@ -223,9 +223,13 @@ int FixNEB::setmask()
void FixNEB::init()
{
int icompute = modify->find_compute(id_pe);
if (icompute < 0) error->all(FLERR, "Potential energy ID for fix neb does not exist");
pe = modify->compute[icompute];
pe = modify->get_compute_by_id(id_pe);
if (!pe) {
error->all(FLERR,"Potential energy compute ID {} for fix {} does not exist", id_pe, style);
} else {
if (pe->peflag == 0)
error->all(FLERR,"Compute ID {} for fix {} does not compute potential energy", id_pe, style);
}
// turn off climbing mode, NEB command turns it on after init()

View File

@ -479,14 +479,27 @@ void FixPIMDLangevin::init()
langevin_init();
c_pe = modify->get_compute_by_id(id_pe);
if (!c_pe)
if (!c_pe) {
error->universe_all(
FLERR, fmt::format("Could not find fix {} potential energy compute ID {}", style, id_pe));
FLERR,
fmt::format("Potential energy compute ID {} for fix {} does not exist", id_pe, style));
} else {
if (c_pe->peflag == 0)
error->universe_all(
FLERR,
fmt::format("Compute ID {} for fix {} does not compute potential energy", id_pe, style));
}
c_press = modify->get_compute_by_id(id_press);
if (!c_press)
if (!c_press) {
error->universe_all(
FLERR, fmt::format("Could not find fix {} pressure compute ID {}", style, id_press));
} else {
if (c_press->pressflag == 0)
error->universe_all(
FLERR,
fmt::format("Compute ID {} for fix {} does not compute pressure", id_press, style));
}
t_prim = t_vir = t_cv = p_prim = p_vir = p_cv = p_md = 0.0;
}

View File

@ -770,9 +770,9 @@ void PRD::replicate(int ireplica)
int nlocal = atom->nlocal;
if (universe->iworld == ireplica) {
memcpy(tagall,tag,nlocal*sizeof(tagint));
memcpy(xall[0],x[0],3*nlocal*sizeof(double));
memcpy(imageall,image,nlocal*sizeof(imageint));
memcpy(tagall,tag,(nlocal*sizeof(tagint))&MEMCPYMASK);
memcpy(xall[0],x[0],(sizeof(double)*3*nlocal)&MEMCPYMASK);
memcpy(imageall,image,(nlocal*sizeof(imageint))&MEMCPYMASK);
}
MPI_Bcast(tagall,natoms,MPI_LMP_TAGINT,ireplica,comm_replica);

View File

@ -246,8 +246,12 @@ void FixRigidNH::init()
if (tcomputeflag) {
temperature = modify->get_compute_by_id(id_temp);
if (!temperature)
error->all(FLERR,"Temperature ID {} for fix {} does not exist", id_temp, style);
if (!temperature) {
error->all(FLERR,"Temperature compute ID {} for fix {} does not exist", id_temp, style);
} else {
if (temperature->tempflag == 0)
error->all(FLERR, "Compute ID {} for fix {} does not compute a temperature", id_temp, style);
}
}
if (pstat_flag) {
@ -260,9 +264,9 @@ void FixRigidNH::init()
auto deform = dynamic_cast<FixDeform *>(ifix);
if (deform) {
int *dimflag = deform->dimflag;
if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) ||
(p_flag[2] && dimflag[2]))
error->all(FLERR,"Cannot use fix {} and fix deform on same component of stress tensor", style);
if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || (p_flag[2] && dimflag[2]))
error->all(FLERR,"Cannot use fix {} and fix deform on same component of stress tensor",
style);
}
}
@ -284,7 +288,12 @@ void FixRigidNH::init()
// set pressure compute ptr
pressure = modify->get_compute_by_id(id_press);
if (!pressure) error->all(FLERR,"Pressure ID {} for fix {} does not exist", id_press, style);
if (!pressure) {
error->all(FLERR,"Pressure compute ID {} for fix {} does not exist", id_press, style);
} else {
if (pressure->pressflag == 0)
error->all(FLERR,"Compute ID {} for fix {} does not compute pressure", id_press, style);
}
// detect if any rigid fixes exist so rigid bodies move on remap
// this will include self

View File

@ -221,8 +221,12 @@ void FixRigidNHSmall::init()
if (tcomputeflag) {
temperature = modify->get_compute_by_id(id_temp);
if (!temperature)
error->all(FLERR,"Temperature ID {} for fix {} does not exist", id_temp, style);
if (!temperature) {
error->all(FLERR,"Temperature compute ID {} for fix {} does not exist", id_temp, style);
} else {
if (temperature->tempflag == 0)
error->all(FLERR, "Compute ID {} for fix {} does not compute a temperature", id_temp, style);
}
}
if (pstat_flag) {
@ -237,7 +241,8 @@ void FixRigidNHSmall::init()
int *dimflag = deform->dimflag;
if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) ||
(p_flag[2] && dimflag[2]))
error->all(FLERR,"Cannot use fix {} and fix deform on same component of stress tensor", style);
error->all(FLERR,"Cannot use fix {} and fix deform on same component of stress tensor",
style);
}
}
@ -259,7 +264,12 @@ void FixRigidNHSmall::init()
// set pressure compute ptr
pressure = modify->get_compute_by_id(id_press);
if (!pressure) error->all(FLERR,"Pressure ID {} for fix {} does not exist", id_press, style);
if (!pressure) {
error->all(FLERR,"Pressure compute ID {} for fix {} does not exist", id_press, style);
} else {
if (pressure->pressflag == 0)
error->all(FLERR,"Compute ID {} for fix {} does not compute pressure", id_press, style);
}
// detect if any rigid fixes exist so rigid bodies move on remap
// this will include self

View File

@ -248,18 +248,28 @@ void FixMSST::init()
// set compute ptrs
temperature = modify->get_compute_by_id(id_temp);
if (!temperature)
if (!temperature) {
error->all(FLERR, "Could not find fix msst temperature compute ID {}", id_temp);
if (temperature->tempflag == 0)
error->all(FLERR, "Fix msst compute ID {} does not compute temperature", id_temp);
} else {
if (temperature->tempflag == 0)
error->all(FLERR, "Fix msst compute ID {} does not compute a temperature", id_temp);
}
pressure = modify->get_compute_by_id(id_press);
if (!pressure) error->all(FLERR, "Could not find fix msst pressure compute ID {}", id_press);
if (pressure->pressflag == 0)
error->all(FLERR, "Fix msst compute ID {} does not compute pressure", id_press);
if (!pressure) {
error->all(FLERR, "Could not find fix msst pressure compute ID {}", id_press);
} else {
if (pressure->pressflag == 0)
error->all(FLERR, "Fix msst compute ID {} does not compute pressure", id_press);
}
pe = modify->get_compute_by_id(id_pe);
if (!pe) error->all(FLERR, "Could not find fix msst pe compute ID {}", id_pe);
if (pe->peflag == 0)
error->all(FLERR, "Fix msst compute ID {} does not compute potential energy", id_pe);
if (!pe) {
error->all(FLERR, "Could not find fix msst pe compute ID {}", id_pe);
} else {
if (pe->peflag == 0)
error->all(FLERR, "Fix msst compute ID {} does not compute potential energy", id_pe);
}
dtv = update->dt;
dtf = 0.5 * update->dt * force->ftm2v;

View File

@ -162,8 +162,12 @@ void FixNPHug::init()
// set pe ptr
pe = modify->get_compute_by_id(id_pe);
if (!pe)
if (!pe) {
error->all(FLERR, "Potential energy compute ID {} for fix {} does not exist", id_pe, style);
} else {
if (pe->peflag == 0)
error->all(FLERR, "Compute ID {} for fix {} does not compute potential energy", id_pe, style);
}
}

View File

@ -193,10 +193,13 @@ int FixNEBSpin::setmask()
void FixNEBSpin::init()
{
int icompute = modify->find_compute(id_pe);
if (icompute < 0)
error->all(FLERR,"Potential energy ID for fix neb does not exist");
pe = modify->compute[icompute];
pe = modify->get_compute_by_id(id_pe);
if (!pe) {
error->all(FLERR,"Potential energy compute ID {} for fix {} does not exist", id_pe, style);
} else {
if (pe->peflag == 0)
error->all(FLERR,"Compute ID {} for fix {} does not compute potential energy", id_pe, style);
}
// turn off climbing mode, NEB command turns it on after init()

Some files were not shown because too many files have changed in this diff Show More