Merge pull request #3649 from akohlmey/collected-small-fixes

Collected small fixes
This commit is contained in:
Axel Kohlmeyer
2023-02-20 15:23:20 -05:00
committed by GitHub
54 changed files with 310 additions and 284 deletions

View File

@ -88,6 +88,18 @@ function(get_lammps_version version_header variable)
set(${variable} "${date}" PARENT_SCOPE)
endfunction()
# determine canonical URL for downloading backup copy from download.lammps.org/thirdparty
function(GetFallbackURL input output)
string(REPLACE "_URL" "" _tmp ${input})
string(TOLOWER ${_tmp} libname)
string(REGEX REPLACE "^https://.*/([^/]+gz)" "${LAMMPS_THIRDPARTY_URL}/${libname}-\\1" newurl "${${input}}")
if ("${newurl}" STREQUAL "${${input}}")
set(${output} "" PARENT_SCOPE)
else()
set(${output} ${newurl} PARENT_SCOPE)
endif()
endfunction(GetFallbackURL)
#################################################################################
# LAMMPS C++ interface. We only need the header related parts except on windows.
add_library(lammps INTERFACE)

View File

@ -159,6 +159,7 @@ if((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND (EXISTS /etc/os-release))
set(CMAKE_DISTRO_VERSION ${disversion})
endif()
# determine canonical URL for downloading backup copy from download.lammps.org/thirdparty
function(GetFallbackURL input output)
string(REPLACE "_URL" "" _tmp ${input})
string(TOLOWER ${_tmp} libname)

View File

@ -225,6 +225,13 @@ char_check :
role_check :
@( env LC_ALL=C grep -n ' :[a-z]\+`' $(RSTDIR)/*.rst && exit 1 || : )
link_check : $(VENV) html
@(\
. $(VENV)/bin/activate ; env PYTHONWARNINGS= PYTHONDONTWRITEBYTECODE=1 \
linkchecker -F html --check-extern html/Manual.html ;\
deactivate ;\
)
xmlgen : doxygen/xml/index.xml
doxygen/Doxyfile: doxygen/Doxyfile.in

View File

@ -1135,7 +1135,7 @@ VORONOI package
-----------------------------
To build with this package, you must download and build the
`Voro++ library <https://math.lbl.gov/voro++>`_ or install a
`Voro++ library <https://math.lbl.gov/voro++/>`_ or install a
binary package provided by your operating system.
.. tabs::

View File

@ -48,9 +48,9 @@ Build using GNU make
The LAMMPS manual is written in `reStructuredText <rst_>`_ format which
can be translated to different output format using the `Sphinx
<https://sphinx-doc.org>`_ document generator tool. It also
<https://www.sphinx-doc.org/>`_ document generator tool. It also
incorporates programmer documentation extracted from the LAMMPS C++
sources through the `Doxygen <https://doxygen.nl>`_ program. Currently
sources through the `Doxygen <https://doxygen.nl/>`_ program. Currently
the translation to HTML, PDF (via LaTeX), ePUB (for many e-book readers)
and MOBI (for Amazon Kindle readers) are supported. For that to work a
Python 3 interpreter, the ``doxygen`` tools and internet access to
@ -87,6 +87,7 @@ folder. The following ``make`` commands are available:
make anchor_check # check for duplicate anchor labels
make style_check # check for complete and consistent style lists
make package_check # check for complete and consistent package lists
make link_check # check for broken or outdated URLs
make spelling # spell-check the manual
----------

View File

@ -77,7 +77,7 @@ buffer, and they will be communicated together to minimize
communication overhead. The communication buffers are defined vectors
containing ``double`` values. To correctly store integers that may be
64-bit (bigint, tagint, imageint) in the buffer, you need to use the
`ubuf union <Communication buffer coding with ubuf>`_ construct.
:ref:`ubuf union <communication_buffer_coding_with_ubuf>` construct.
The *Fix*, *Compute*, and *Dump* classes can also invoke the same kind
of forward and reverse communication operations using the same *Comm*

View File

@ -643,6 +643,8 @@ Tohoku University (under MIT license)
---------------------------
.. _communication_buffer_coding_with_ubuf:
Communication buffer coding with *ubuf*
---------------------------------------

View File

@ -75,7 +75,7 @@ Using the GDB debugger to get a stack trace
There are two options to use the GDB debugger for identifying the origin
of the segmentation fault or similar crash. The GDB debugger has many
more features and options, as can be seen for example its `online
documentation <https://sourceware.org/gdb/current/onlinedocs/gdb/>`_.
documentation <https://www.sourceware.org/gdb/documentation/>`_.
Run LAMMPS from within the debugger
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -2155,7 +2155,7 @@ Procedures Bound to the :f:type:`lammps` Derived Type
The LAMMPS :doc:`dump style movie <dump_image>` supports generating movies
from images on-the-fly via creating a pipe to the
`ffmpeg <https://ffmpeg.org/ffmpeg/>`_ program.
`ffmpeg <https://ffmpeg.org/>`_ program.
This function checks whether this feature was
:ref:`enabled at compile time <graphics>`.
It does **not** check whether the ``ffmpeg`` itself is installed and usable.

View File

@ -11,12 +11,14 @@ LAMMPS in workshop settings, we had to redirect Windows users to
Linux Virtual Machines such as VirtualBox or Unix-like compilation with
Cygwin.
With the latest updates in Windows 10 (Version 2004, Build 19041 or higher),
Microsoft has added a new way to work on Linux-based code. The Windows
Subsystem for Linux (WSL). With WSL Version 2, you now get a Linux Virtual
Machine that transparently integrates into Windows. All you need is to ensure
you have the latest Windows updates installed and enable this new feature.
Linux VMs are then easily installed using the Microsoft Store.
With the latest updates in Windows 10 (Version 2004, Build 19041 or
higher), Microsoft has added a new way to work on Linux-based code. The
`Windows Subsystem for Linux (WSL)
<https://learn.microsoft.com/en-us/windows/wsl/>`_. With WSL Version 2,
you now get a Linux Virtual Machine that transparently integrates into
Windows. All you need is to ensure you have the latest Windows updates
installed and enable this new feature. Linux VMs are then easily
installed using the Microsoft Store.
In this tutorial, I'll show you how to set up and compile LAMMPS for both serial
and MPI usage in WSL2.

View File

@ -163,10 +163,10 @@ changed. How to do this depends on the build system you are using.
.. admonition:: Git protocols
:class: note
The servers at github.com support the "https://" access protocol for
The servers at github.com support the "https" access protocol for
anonymous, read-only access. If you have a suitably configured
GitHub account, you may also use SSH protocol with the URL
"git@github.com:lammps/lammps.git".
``git@github.com:lammps/lammps.git``.
The LAMMPS GitHub project is currently overseen by Axel Kohlmeyer
(Temple U, akohlmey at gmail.com).

View File

@ -46,7 +46,7 @@ In addition there are DOIs generated for individual stable releases:
- 3 March 2020 version: `DOI:10.5281/zenodo.3726417 <https://dx.doi.org/10.5281/zenodo.3726417>`_
- 29 October 2020 version: `DOI:10.5281/zenodo.4157471 <https://dx.doi.org/10.5281/zenodo.4157471>`_
- 29 September 2021 version: `DOI:10.5281/zenodo.6386596 <https//dx.doi.org/10.5281/zenodo.6386596>`_
- 29 September 2021 version: `DOI:10.5281/zenodo.6386596 <https://dx.doi.org/10.5281/zenodo.6386596>`_
Home page
^^^^^^^^^

View File

@ -34,7 +34,7 @@ Here are suggestions on how to perform these tasks:
a true molecular builder that will generate complex molecular models.
See the :doc:`Tools <Tools>` page for details on tools packaged with
LAMMPS. The `Pre-/post-processing page
<https:/www.lammps.org/prepost.html>`_ of the LAMMPS homepage
<https://www.lammps.org/prepost.html>`_ of the LAMMPS homepage
describes a variety of third party tools for this task. Furthermore,
some internal LAMMPS commands allow reconstructing, or selectively adding
topology information, as well as provide the option to insert molecule
@ -66,10 +66,9 @@ Here are suggestions on how to perform these tasks:
these various options.
* **Visualization:** LAMMPS can produce NETPBM, JPG, or PNG format
snapshot images on-the-fly via its :doc:`dump image <dump_image>`
command and pass them to an external program, `FFmpeg
<https://www.ffmpeg.org>`_, to generate movies from them. For
high-quality, interactive visualization, there are many excellent and
free tools available. See the `Visualization Tools
command and pass them to an external program, `FFmpeg <https://ffmpeg.org/>`_,
to generate movies from them. For high-quality, interactive visualization,
there are many excellent and free tools available. See the `Visualization Tools
<https://www.lammps.org/viz.html>`_ page of the LAMMPS website for
visualization packages that can process LAMMPS output data.
* **Plotting:** See the next bullet about Pizza.py as well as the

View File

@ -228,8 +228,9 @@ conversion of atomic information to continuum fields.
**Install:**
This package has :ref:`specific installation instructions <atc>` on the :doc:`Build extras <Build_extras>` page.
The ATC package requires that also the `MANYBODY <PKG-MANYBODY>`_ package is installed.
This package has :ref:`specific installation instructions <atc>` on the
:doc:`Build extras <Build_extras>` page. The ATC package requires that
also the :ref:`MANYBODY <PKG-MANYBODY>` package is installed.
**Supporting info:**
@ -391,8 +392,8 @@ rigid-body integrators with improved stability.
**Install:**
The CG-DNA package requires that also the `MOLECULE <PKG-MOLECULE>`_ and
`ASPHERE <PKG-ASPHERE>`_ packages are installed.
The CG-DNA package requires that also the :ref:`MOLECULE <PKG-MOLECULE>`
and :ref:`ASPHERE <PKG-ASPHERE>` packages are installed.
**Supporting info:**
@ -1114,15 +1115,15 @@ INTEL package
**Contents:**
Dozens of pair, fix, bond, angle, dihedral, improper, and kspace
styles which are optimized for Intel CPUs and KNLs (Knights Landing).
All of them have an "intel" in their style name. The
:doc:`INTEL package <Speed_intel>` page gives details of what hardware and
compilers are required on your system, and how to build and use this
package. Its styles can be invoked at run time via the "-sf intel" or
"-suffix intel" :doc:`command-line switches <Run_options>`. Also see
the :ref:`KOKKOS <PKG-KOKKOS>`, :ref:`OPT <PKG-OPT>`, and :ref:`OPENMP <PKG-OPENMP>` packages,
which have styles optimized for CPUs and KNLs.
Dozens of pair, fix, bond, angle, dihedral, improper, and kspace styles
which are optimized for Intel CPUs and KNLs (Knights Landing). All of
them have an "intel" in their style name. The :doc:`INTEL package
<Speed_intel>` page gives details of what hardware and compilers are
required on your system, and how to build and use this package. Its
styles can be invoked at run time via the "-sf intel" or "-suffix intel"
:doc:`command-line switches <Run_options>`. Also see the :ref:`KOKKOS
<PKG-KOKKOS>`, :ref:`OPT <PKG-OPT>`, and :ref:`OPENMP <PKG-OPENMP>`
packages, which have styles optimized for CPUs and KNLs.
You need to have an Intel compiler, version 14 or higher to take full
advantage of this package. While compilation with GNU compilers is
@ -1249,12 +1250,13 @@ Dozens of atom, pair, bond, angle, dihedral, improper, fix, compute
styles adapted to compile using the Kokkos library which can convert
them to OpenMP or CUDA code so that they run efficiently on multicore
CPUs, KNLs, or GPUs. All the styles have a "kk" as a suffix in their
style name. The :doc:`KOKKOS package <Speed_kokkos>` page gives
details of what hardware and software is required on your system, and
how to build and use this package. Its styles can be invoked at run
time via the "-sf kk" or "-suffix kk" :doc:`command-line switches <Run_options>`. Also see the :ref:`GPU <PKG-GPU>`, :ref:`OPT <PKG-OPT>`,
:ref:`INTEL <PKG-INTEL>`, and :ref:`OPENMP <PKG-OPENMP>` packages, which
have styles optimized for CPUs, KNLs, and GPUs.
style name. The :doc:`KOKKOS package <Speed_kokkos>` page gives details
of what hardware and software is required on your system, and how to
build and use this package. Its styles can be invoked at run time via
the "-sf kk" or "-suffix kk" :doc:`command-line switches <Run_options>`.
Also see the :ref:`GPU <PKG-GPU>`, :ref:`OPT <PKG-OPT>`, :ref:`INTEL
<PKG-INTEL>`, and :ref:`OPENMP <PKG-OPENMP>` packages, which have styles
optimized for CPUs, KNLs, and GPUs.
You must have a C++14 compatible compiler to use this package.
KOKKOS makes extensive use of advanced C++ features, which can
@ -2328,7 +2330,7 @@ and third order tensor from finite differences.
**Install:**
The PHONON package requires that also the `KSPACE <PKG-KSPACE>`_
The PHONON package requires that also the :ref:`KSPACE <PKG-KSPACE>`
package is installed.
@ -2929,11 +2931,9 @@ VORONOI package
**Contents:**
A compute command which calculates the Voronoi tesselation of a
collection of atoms by wrapping the `Voro++ library <voro-home_>`_. This
can be used to calculate the local volume or each atoms or its near
neighbors.
.. _voro-home: https://math.lbl.gov/voro++
collection of atoms by wrapping the `Voro++ library
<https://math.lbl.gov/voro++/>`_. This can be used to calculate the
local volume or each atoms or its near neighbors.
To use this package you must have the Voro++ library available on your
system.

View File

@ -15,9 +15,6 @@ Two components are necessary for Python to be able to invoke LAMMPS code:
``liblammps.dll``) from the folder where you compiled LAMMPS.
.. _ctypes: https://docs.python.org/3/library/ctypes.html
.. _python_virtualenv: https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment
.. _python_venv: https://docs.python.org/3/library/venv.html
.. _python_pep405: https://www.python.org/dev/peps/pep-0405
.. _python_install_guides:
@ -232,11 +229,11 @@ folder that the dynamic loader searches or inside of the installed
install (newer/different) versions of Python packages that would
potentially conflict with already installed system packages. It
also does not requite any superuser privileges. See `PEP 405:
Python Virtual Environments <python_pep405>`_ for more
Python Virtual Environments <https://peps.python.org/pep-0405/>`_ for more
information.
To create a virtual environment in the folder ``$HOME/myenv``,
use the `venv <python_venv>`_ module as follows.
use the `venv <https://docs.python.org/3/library/venv.html>`_ module as follows.
.. code-block:: bash
@ -244,8 +241,9 @@ folder that the dynamic loader searches or inside of the installed
python3 -m venv $HOME/myenv
For Python versions prior 3.3 you can use `virtualenv
<python_virtualenv>`_ command instead of "python3 -m venv". This
step has to be done only once.
<https://packaging.python.org/en/latest/key_projects/#virtualenv>`_
command instead of "python3 -m venv". This step has to be done
only once.
To activate the virtual environment type:
@ -414,10 +412,8 @@ follows:
sudo pip install mpi4py
.. _mpi4py_install: https://mpi4py.readthedocs.io/en/stable/install.html
For more detailed installation instructions and additional options,
please see the `mpi4py installation <mpi4py_install>`_ page.
please see the `mpi4py installation <https://mpi4py.readthedocs.io/en/stable/install.html>`_ page.
To use ``mpi4py`` and LAMMPS in parallel from Python, you **must** make

View File

@ -29,7 +29,7 @@ contact radius is used only to prevent particles belonging to
different physical bodies from penetrating each other. It is used by
the contact pair styles, e.g., smd/hertz and smd/tri_surface.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to using Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth
Mach Dynamics in LAMMPS.
The value of the contact radius will be 0.0 for particles not in the

View File

@ -26,7 +26,7 @@ Description
Define a computation that calculates the damage status of SPH particles
according to the damage model which is defined via the SMD SPH pair styles, e.g., the maximum plastic strain failure criterion.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to use Smooth Mach Dynamics in LAMMPS.
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to use Smooth Mach Dynamics in LAMMPS.
**Output Info:**

View File

@ -34,7 +34,7 @@ configuration. This compute is only really useful for debugging the
hourglass control mechanism which is part of the Total-Lagrangian SPH
pair style.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to use Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to use Smooth
Mach Dynamics in LAMMPS.
**Output Info:**

View File

@ -26,7 +26,7 @@ Description
Define a computation which outputs the per-particle enthalpy, i.e.,
the sum of potential energy and heat.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to use Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to use Smooth
Mach Dynamics in LAMMPS.
Output Info

View File

@ -27,7 +27,7 @@ Define a computation that outputs the equivalent plastic strain per
particle. This command is only meaningful if a material model with
plasticity is defined.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to use Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to use Smooth
Mach Dynamics in LAMMPS.
**Output Info:**

View File

@ -27,7 +27,7 @@ Define a computation that outputs the time rate of the equivalent
plastic strain. This command is only meaningful if a material model
with plasticity is defined.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to use Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to use Smooth
Mach Dynamics in LAMMPS.
**Output Info:**

View File

@ -28,7 +28,7 @@ The mass density is the mass of a particle which is constant during
the course of a simulation, divided by its volume, which can change
due to mechanical deformation.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to use Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to use Smooth
Mach Dynamics in LAMMPS.
Output info

View File

@ -27,7 +27,7 @@ Define a computation that calculates the deformation gradient. It is
only meaningful for particles which interact according to the
Total-Lagrangian SPH pair style.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to use Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to use Smooth
Mach Dynamics in LAMMPS.
Output info

View File

@ -32,7 +32,7 @@ time step. This calculation is performed automatically in the
relevant SPH pair styles and this compute only serves to make the
stable time increment accessible for output purposes.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to using Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth
Mach Dynamics in LAMMPS.
Output info

View File

@ -27,7 +27,7 @@ Define a computation that calculates the number of particles inside of
the smoothing kernel radius for particles interacting via the
Total-Lagrangian SPH pair style.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to using Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth
Mach Dynamics in LAMMPS.
Output info

View File

@ -28,7 +28,7 @@ associated with a particle as a rotated ellipsoid. It is only
meaningful for particles which interact according to the
Total-Lagrangian SPH pair style.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to use Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to use Smooth
Mach Dynamics in LAMMPS.
Output info

View File

@ -26,7 +26,7 @@ Description
Define a computation that calculates the Green-Lagrange strain tensor
for particles interacting via the Total-Lagrangian SPH pair style.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to using Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth
Mach Dynamics in LAMMPS.
Output info

View File

@ -26,7 +26,7 @@ Description
Define a computation that calculates the rate of the strain tensor for
particles interacting via the Total-Lagrangian SPH pair style.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to using Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth
Mach Dynamics in LAMMPS.
Output info

View File

@ -26,7 +26,7 @@ Description
Define a computation that outputs the Cauchy stress tensor for
particles interacting via the Total-Lagrangian SPH pair style.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to using Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth
Mach Dynamics in LAMMPS.
Output info

View File

@ -26,7 +26,7 @@ Description
Define a computation that returns the coordinates of the vertices
corresponding to the triangle-elements of a mesh created by the :doc:`fix smd/wall_surface <fix_smd_wall_surface>`.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to using Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth
Mach Dynamics in LAMMPS.
Output info

View File

@ -26,7 +26,7 @@ Description
Define a computation that outputs the effective shear modulus for
particles interacting via the updated Lagrangian SPH pair style.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to using Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth
Mach Dynamics in LAMMPS.
Output info

View File

@ -27,7 +27,7 @@ Define a computation that returns the number of neighbor particles
inside of the smoothing kernel radius for particles interacting via
the updated Lagrangian SPH pair style.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to using Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth
Mach Dynamics in LAMMPS.
Output info

View File

@ -26,7 +26,7 @@ Description
Define a computation that outputs the logarithmic strain tensor. for
particles interacting via the updated Lagrangian SPH pair style.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to using Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth
Mach Dynamics in LAMMPS.
Output info

View File

@ -27,7 +27,7 @@ Define a computation that outputs the rate of the logarithmic strain
tensor for particles interacting via the updated Lagrangian SPH pair
style.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to using Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth
Mach Dynamics in LAMMPS.
Output info

View File

@ -25,7 +25,7 @@ Description
Define a computation that outputs the Cauchy stress tensor.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to using Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth
Mach Dynamics in LAMMPS.
Output info

View File

@ -26,7 +26,7 @@ Description
Define a computation that provides the per-particle volume and the sum
of the per-particle volumes of the group for which the fix is defined.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to using Smooth
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth
Mach Dynamics in LAMMPS.
Output info

View File

@ -218,13 +218,13 @@ is used.
.. _png_format: https://en.wikipedia.org/wiki/Portable_Network_Graphics
.. _ppm_format: https://en.wikipedia.org/wiki/Netpbm
Similarly, the format of the resulting movie is chosen with the
*movie* dump style. This is handled by the underlying FFmpeg converter
and thus details have to be looked up in the `FFmpeg documentation
<https://ffmpeg.org/ffmpeg.html>`_. Typical examples are: .avi, .mpg,
.m4v, .mp4, .mkv, .flv, .mov, .gif Additional settings of the movie
compression like *bitrate* and *framerate* can be set using the
dump_modify command as described below.
Similarly, the format of the resulting movie is chosen with the *movie*
dump style. This is handled by the underlying FFmpeg converter and thus
details have to be looked up in the `FFmpeg documentation
<https://ffmpeg.org/>`_. Typical examples are: .avi, .mpg, .m4v, .mp4,
.mkv, .flv, .mov, .gif Additional settings of the movie compression like
*bitrate* and *framerate* can be set using the dump_modify command as
described below.
To write out JPEG and PNG format files, you must build LAMMPS with
support for the corresponding JPEG or PNG library. To convert images
@ -651,7 +651,7 @@ MPEG or other movie file you can use:
cat snap.*.ppm | ffmpeg -y -f image2pipe -c:v ppm -i - -b:v 2400k movie.avi
Front ends for FFmpeg exist for multiple platforms. For more
information see the `FFmpeg homepage <https://www.ffmpeg.org/>`_
information see the `FFmpeg homepage <https://ffmpeg.org/>`_
----------

View File

@ -2,7 +2,7 @@ Fix ave/spatial command
=======================
.. meta::
:http-equiv=Refresh: 5; url='https://docs.lammps.org/Commands_removed.html#fix-ave-spatial-and-fix-ave-spatial-sphere'
:http-equiv=Refresh: 5; url=Commands_removed.html#fix-ave-spatial-and-fix-ave-spatial-sphere
.. deprecated:: 11Dec2015

View File

@ -2,7 +2,7 @@ Fix ave/spatial command
=======================
.. meta::
:http-equiv=Refresh: 5; url='https://docs.lammps.org/Commands_removed.html#fix-ave-spatial-and-fix-ave-spatial-sphere'
:http-equiv=Refresh: 5; url=https://docs.lammps.org/Commands_removed.html#fix-ave-spatial-and-fix-ave-spatial-sphere
.. deprecated:: 11Dec2015

View File

@ -43,7 +43,7 @@ This fix inquires the minimum stable time increment across all
particles contained in the group for which this fix is defined. An
additional safety factor *s_fact* is applied to the time increment.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to use Smooth Mach
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to use Smooth Mach
Dynamics in LAMMPS.
Restart, fix_modify, output, run start/stop, minimize info

View File

@ -34,7 +34,7 @@ Description
The fix performs explicit time integration for particles which
interact according with the Total-Lagrangian SPH pair style.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to using Smooth Mach
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth Mach
Dynamics in LAMMPS.
The *limit_velocity* keyword will control the velocity, scaling the

View File

@ -36,7 +36,7 @@ Description
The fix performs explicit time integration for particles which
interact with the updated Lagrangian SPH pair style.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to using Smooth Mach
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth Mach
Dynamics in LAMMPS.
The *adjust_radius* keyword activates dynamic adjustment of the

View File

@ -60,7 +60,7 @@ particle to (omega cross Rperp) where omega is its angular velocity
around the rotation axis and Rperp is a perpendicular vector from the
rotation axis to the particle.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to using Smooth Mach
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to using Smooth Mach
Dynamics in LAMMPS.
Restart, fix_modify, output, run start/stop, minimize info

View File

@ -47,7 +47,7 @@ be run for 0 timesteps in order to properly register the new particles
in the system. See the "funnel_flow" example in the MACHDYN examples
directory.
See `this PDF guide <PDF/SMD_LAMMPS_userguide.pdf>`_ to use Smooth Mach
See `this PDF guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ to use Smooth Mach
Dynamics in LAMMPS.
Restart, fix_modify, output, run start/stop, minimize info

View File

@ -304,7 +304,7 @@ group and running further.
not all allow for use of a dynamic group. If you get an error
message that this is not allowed, but feel that it should be for the
fix or compute in question, then please post your reasoning to the
`LAMMPS forum at MatSci <https://matsci.org/c/lammps-development/>`_
`LAMMPS forum at MatSci <https://matsci.org/c/lammps-development/42>`_
and we can look into changing it. The same applies if you come
across inconsistent behavior when dynamic groups are allowed.

View File

@ -48,7 +48,7 @@ and a material model to compute shear stresses (the off-diagonal
components of the stress tensor). Damage and failure models can also
be added.
Please see the `SMD user guide <PDF/SMD_LAMMPS_userguide.pdf>`_ for a
Please see the `SMD user guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ for a
complete listing of the possible keywords and material models.
----------

View File

@ -59,7 +59,7 @@ Note that the use of \*GRADIENT_CORRECTION can lead to severe numerical
instabilities. For a general fluid simulation, \*NO_GRADIENT_CORRECTION
is recommended.
Please see the `SMD user guide <PDF/SMD_LAMMPS_userguide.pdf>`_ for a
Please see the `SMD user guide <PDF/MACHDYN_LAMMPS_userguide.pdf>`_ for a
complete listing of the possible keywords and material models.
----------

View File

@ -6,3 +6,4 @@ breathe
Pygments
six
pyyaml
linkchecker

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -18,14 +17,15 @@
#include "pair_beck.h"
#include <cmath>
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neigh_list.h"
#include "memory.h"
#include "error.h"
#include "force.h"
#include "math_special.h"
#include "memory.h"
#include "neigh_list.h"
#include <cmath>
using namespace LAMMPS_NS;
using namespace MathSpecial;
@ -54,16 +54,16 @@ PairBeck::~PairBeck()
void PairBeck::compute(int eflag, int vflag)
{
int i,j,ii,jj,inum,jnum,itype,jtype;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,r5,force_beck,factor_lj;
double r,rinv;
double aaij,alphaij,betaij;
double term1,term1inv,term2,term3,term4,term5,term6;
int *ilist,*jlist,*numneigh,**firstneigh;
int i, j, ii, jj, inum, jnum, itype, jtype;
double xtmp, ytmp, ztmp, delx, dely, delz, evdwl, fpair;
double rsq, r5, force_beck, factor_lj;
double r, rinv;
double aaij, alphaij, betaij;
double term1, term1inv, term2, term3, term4, term5, term6;
int *ilist, *jlist, *numneigh, **firstneigh;
evdwl = 0.0;
ev_init(eflag,vflag);
ev_init(eflag, vflag);
double **x = atom->x;
double **f = atom->f;
@ -96,45 +96,44 @@ void PairBeck::compute(int eflag, int vflag)
delx = xtmp - x[j][0];
dely = ytmp - x[j][1];
delz = ztmp - x[j][2];
rsq = delx*delx + dely*dely + delz*delz;
rsq = delx * delx + dely * dely + delz * delz;
jtype = type[j];
if (rsq < cutsq[itype][jtype]) {
r = sqrt(rsq);
r5 = rsq*rsq*r;
r5 = rsq * rsq * r;
aaij = aa[itype][jtype];
alphaij = alpha[itype][jtype];
betaij = beta[itype][jtype];
term1 = aaij*aaij + rsq;
term2 = powint(term1,-5);
term3 = 21.672 + 30.0*aaij*aaij + 6.0*rsq;
term4 = alphaij + r5*betaij;
term5 = alphaij + 6.0*r5*betaij;
rinv = 1.0/r;
force_beck = AA[itype][jtype]*exp(-1.0*r*term4)*term5;
force_beck -= BB[itype][jtype]*r*term2*term3;
term1 = aaij * aaij + rsq;
term2 = powint(term1, -5);
term3 = 21.672 + 30.0 * aaij * aaij + 6.0 * rsq;
term4 = alphaij + r5 * betaij;
term5 = alphaij + 6.0 * r5 * betaij;
rinv = 1.0 / r;
force_beck = AA[itype][jtype] * exp(-1.0 * r * term4) * term5;
force_beck -= BB[itype][jtype] * r * term2 * term3;
fpair = factor_lj*force_beck*rinv;
fpair = factor_lj * force_beck * rinv;
f[i][0] += delx*fpair;
f[i][1] += dely*fpair;
f[i][2] += delz*fpair;
f[i][0] += delx * fpair;
f[i][1] += dely * fpair;
f[i][2] += delz * fpair;
if (newton_pair || j < nlocal) {
f[j][0] -= delx*fpair;
f[j][1] -= dely*fpair;
f[j][2] -= delz*fpair;
f[j][0] -= delx * fpair;
f[j][1] -= dely * fpair;
f[j][2] -= delz * fpair;
}
if (eflag) {
term6 = powint(term1,-3);
term1inv = 1.0/term1;
evdwl = AA[itype][jtype]*exp(-1.0*r*term4);
evdwl -= BB[itype][jtype]*term6*(1.0+(2.709+3.0*aaij*aaij)*term1inv);
term6 = powint(term1, -3);
term1inv = 1.0 / term1;
evdwl = AA[itype][jtype] * exp(-1.0 * r * term4);
evdwl -= BB[itype][jtype] * term6 * (1.0 + (2.709 + 3.0 * aaij * aaij) * term1inv);
evdwl *= factor_lj;
}
if (evflag) ev_tally(i,j,nlocal,newton_pair,
evdwl,0.0,fpair,delx,dely,delz);
if (evflag) ev_tally(i, j, nlocal, newton_pair, evdwl, 0.0, fpair, delx, dely, delz);
}
}
}
@ -149,21 +148,20 @@ void PairBeck::compute(int eflag, int vflag)
void PairBeck::allocate()
{
allocated = 1;
int n = atom->ntypes;
int np1 = atom->ntypes + 1;
memory->create(setflag,n+1,n+1,"pair:setflag");
for (int i = 1; i <= n; i++)
for (int j = i; j <= n; j++)
setflag[i][j] = 0;
memory->create(setflag, np1, np1, "pair:setflag");
for (int i = 1; i < np1; i++)
for (int j = i; j < np1; j++) setflag[i][j] = 0;
memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(cutsq, np1, np1, "pair:cutsq");
memory->create(cut,n+1,n+1,"pair:cut");
memory->create(AA,n+1,n+1,"pair:AA");
memory->create(BB,n+1,n+1,"pair:BB");
memory->create(aa,n+1,n+1,"pair:aa");
memory->create(alpha,n+1,n+1,"pair:alpha");
memory->create(beta,n+1,n+1,"pair:beta");
memory->create(cut, np1, np1, "pair:cut");
memory->create(AA, np1, np1, "pair:AA");
memory->create(BB, np1, np1, "pair:BB");
memory->create(aa, np1, np1, "pair:aa");
memory->create(alpha, np1, np1, "pair:alpha");
memory->create(beta, np1, np1, "pair:beta");
}
/* ----------------------------------------------------------------------
@ -172,14 +170,14 @@ void PairBeck::allocate()
void PairBeck::settings(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal pair_style command");
if (narg != 1) error->all(FLERR, "Illegal pair_style command");
cut_global = utils::numeric(FLERR,arg[0],false,lmp);
cut_global = utils::numeric(FLERR, arg[0], false, lmp);
// reset cutoffs that have been explicitly set
if (allocated) {
int i,j;
int i, j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++)
if (setflag[i][j]) cut[i][j] = cut_global;
@ -192,26 +190,25 @@ void PairBeck::settings(int narg, char **arg)
void PairBeck::coeff(int narg, char **arg)
{
if (narg != 7 && narg != 8)
error->all(FLERR,"Incorrect args for pair coefficients");
if (narg != 7 && narg != 8) error->all(FLERR, "Incorrect args for pair coefficients");
if (!allocated) allocate();
int ilo,ihi,jlo,jhi;
utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error);
utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error);
int ilo, ihi, jlo, jhi;
utils::bounds(FLERR, arg[0], 1, atom->ntypes, ilo, ihi, error);
utils::bounds(FLERR, arg[1], 1, atom->ntypes, jlo, jhi, error);
double AA_one = utils::numeric(FLERR,arg[2],false,lmp);
double BB_one = utils::numeric(FLERR,arg[3],false,lmp);
double aa_one = utils::numeric(FLERR,arg[4],false,lmp);
double alpha_one = utils::numeric(FLERR,arg[5],false,lmp);
double beta_one = utils::numeric(FLERR,arg[6],false,lmp);
double AA_one = utils::numeric(FLERR, arg[2], false, lmp);
double BB_one = utils::numeric(FLERR, arg[3], false, lmp);
double aa_one = utils::numeric(FLERR, arg[4], false, lmp);
double alpha_one = utils::numeric(FLERR, arg[5], false, lmp);
double beta_one = utils::numeric(FLERR, arg[6], false, lmp);
double cut_one = cut_global;
if (narg == 8) cut_one = utils::numeric(FLERR,arg[7],false,lmp);
if (narg == 8) cut_one = utils::numeric(FLERR, arg[7], false, lmp);
int count = 0;
for (int i = ilo; i <= ihi; i++) {
for (int j = MAX(jlo,i); j <= jhi; j++) {
for (int j = MAX(jlo, i); j <= jhi; j++) {
AA[i][j] = AA_one;
BB[i][j] = BB_one;
aa[i][j] = aa_one;
@ -223,7 +220,7 @@ void PairBeck::coeff(int narg, char **arg)
}
}
if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients");
if (count == 0) error->all(FLERR, "Incorrect args for pair coefficients");
}
/* ----------------------------------------------------------------------
@ -232,7 +229,7 @@ void PairBeck::coeff(int narg, char **arg)
double PairBeck::init_one(int i, int j)
{
if (setflag[i][j] == 0) error->all(FLERR,"All pair coeffs are not set");
if (setflag[i][j] == 0) error->all(FLERR, "All pair coeffs are not set");
AA[j][i] = AA[i][j];
BB[j][i] = BB[i][j];
@ -251,17 +248,17 @@ void PairBeck::write_restart(FILE *fp)
{
write_restart_settings(fp);
int i,j;
int i, j;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
fwrite(&setflag[i][j],sizeof(int),1,fp);
fwrite(&setflag[i][j], sizeof(int), 1, fp);
if (setflag[i][j]) {
fwrite(&AA[i][j],sizeof(double),1,fp);
fwrite(&BB[i][j],sizeof(double),1,fp);
fwrite(&aa[i][j],sizeof(double),1,fp);
fwrite(&alpha[i][j],sizeof(double),1,fp);
fwrite(&beta[i][j],sizeof(double),1,fp);
fwrite(&cut[i][j],sizeof(double),1,fp);
fwrite(&AA[i][j], sizeof(double), 1, fp);
fwrite(&BB[i][j], sizeof(double), 1, fp);
fwrite(&aa[i][j], sizeof(double), 1, fp);
fwrite(&alpha[i][j], sizeof(double), 1, fp);
fwrite(&beta[i][j], sizeof(double), 1, fp);
fwrite(&cut[i][j], sizeof(double), 1, fp);
}
}
}
@ -275,27 +272,27 @@ void PairBeck::read_restart(FILE *fp)
read_restart_settings(fp);
allocate();
int i,j;
int i, j;
int me = comm->me;
for (i = 1; i <= atom->ntypes; i++)
for (j = i; j <= atom->ntypes; j++) {
if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error);
MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world);
if (me == 0) utils::sfread(FLERR, &setflag[i][j], sizeof(int), 1, fp, nullptr, error);
MPI_Bcast(&setflag[i][j], 1, MPI_INT, 0, world);
if (setflag[i][j]) {
if (me == 0) {
utils::sfread(FLERR,&AA[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&BB[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&aa[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&beta[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR, &AA[i][j], sizeof(double), 1, fp, nullptr, error);
utils::sfread(FLERR, &BB[i][j], sizeof(double), 1, fp, nullptr, error);
utils::sfread(FLERR, &aa[i][j], sizeof(double), 1, fp, nullptr, error);
utils::sfread(FLERR, &alpha[i][j], sizeof(double), 1, fp, nullptr, error);
utils::sfread(FLERR, &beta[i][j], sizeof(double), 1, fp, nullptr, error);
utils::sfread(FLERR, &cut[i][j], sizeof(double), 1, fp, nullptr, error);
}
MPI_Bcast(&AA[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&BB[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&aa[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&beta[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world);
MPI_Bcast(&AA[i][j], 1, MPI_DOUBLE, 0, world);
MPI_Bcast(&BB[i][j], 1, MPI_DOUBLE, 0, world);
MPI_Bcast(&aa[i][j], 1, MPI_DOUBLE, 0, world);
MPI_Bcast(&alpha[i][j], 1, MPI_DOUBLE, 0, world);
MPI_Bcast(&beta[i][j], 1, MPI_DOUBLE, 0, world);
MPI_Bcast(&cut[i][j], 1, MPI_DOUBLE, 0, world);
}
}
}
@ -306,8 +303,8 @@ void PairBeck::read_restart(FILE *fp)
void PairBeck::write_restart_settings(FILE *fp)
{
fwrite(&cut_global,sizeof(double),1,fp);
fwrite(&mix_flag,sizeof(int),1,fp);
fwrite(&cut_global, sizeof(double), 1, fp);
fwrite(&mix_flag, sizeof(int), 1, fp);
}
/* ----------------------------------------------------------------------
@ -318,44 +315,42 @@ void PairBeck::read_restart_settings(FILE *fp)
{
int me = comm->me;
if (me == 0) {
utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error);
utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error);
utils::sfread(FLERR, &cut_global, sizeof(double), 1, fp, nullptr, error);
utils::sfread(FLERR, &mix_flag, sizeof(int), 1, fp, nullptr, error);
}
MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world);
MPI_Bcast(&mix_flag,1,MPI_INT,0,world);
MPI_Bcast(&cut_global, 1, MPI_DOUBLE, 0, world);
MPI_Bcast(&mix_flag, 1, MPI_INT, 0, world);
}
/* ---------------------------------------------------------------------- */
double PairBeck::single(int /*i*/, int /*j*/, int itype, int jtype,
double rsq,
double /*factor_coul*/, double factor_lj,
double &fforce)
double PairBeck::single(int /*i*/, int /*j*/, int itype, int jtype, double rsq,
double /*factor_coul*/, double factor_lj, double &fforce)
{
double phi_beck,r,rinv;
double r5,force_beck;
double aaij,alphaij,betaij;
double term1,term1inv,term2,term3,term4,term5,term6;
double phi_beck, r, rinv;
double r5, force_beck;
double aaij, alphaij, betaij;
double term1, term1inv, term2, term3, term4, term5, term6;
r = sqrt(rsq);
r5 = rsq*rsq*r;
r5 = rsq * rsq * r;
aaij = aa[itype][jtype];
alphaij = alpha[itype][jtype];
betaij = beta[itype][jtype];
term1 = aaij*aaij + rsq;
term2 = powint(term1,-5);
term3 = 21.672 + 30.0*aaij*aaij + 6.0*rsq;
term4 = alphaij + r5*betaij;
term5 = alphaij + 6.0*r5*betaij;
rinv = 1.0/r;
force_beck = AA[itype][jtype]*exp(-1.0*r*term4)*term5;
force_beck -= BB[itype][jtype]*r*term2*term3;
fforce = factor_lj*force_beck*rinv;
term1 = aaij * aaij + rsq;
term2 = powint(term1, -5);
term3 = 21.672 + 30.0 * aaij * aaij + 6.0 * rsq;
term4 = alphaij + r5 * betaij;
term5 = alphaij + 6.0 * r5 * betaij;
rinv = 1.0 / r;
force_beck = AA[itype][jtype] * exp(-1.0 * r * term4) * term5;
force_beck -= BB[itype][jtype] * r * term2 * term3;
fforce = factor_lj * force_beck * rinv;
term6 = powint(term1,-3);
term1inv = 1.0/term1;
phi_beck = AA[itype][jtype]*exp(-1.0*r*term4);
phi_beck -= BB[itype][jtype]*term6*(1.0+(2.709+3.0*aaij*aaij)*term1inv);
term6 = powint(term1, -3);
term1inv = 1.0 / term1;
phi_beck = AA[itype][jtype] * exp(-1.0 * r * term4);
phi_beck -= BB[itype][jtype] * term6 * (1.0 + (2.709 + 3.0 * aaij * aaij) * term1inv);
return factor_lj*phi_beck;
return factor_lj * phi_beck;
}

View File

@ -185,7 +185,6 @@ void PairMLIAPKokkos<DeviceType>::settings(int narg, char ** arg)
new_args.push_back(arg[iarg++]);
} else if (strcmp(arg[iarg], "unified") == 0) {
#ifdef MLIAP_PYTHON
printf("IN SETUP UNIFIED\n");
if (model != nullptr) error->all(FLERR,"Illegal multiple pair_style mliap model definitions");
if (descriptor != nullptr) error->all(FLERR,"Illegal multiple pair_style mliap descriptor definitions");
if (iarg+2 > narg) utils::missing_cmd_args(FLERR, "pair_style mliap unified", error);

View File

@ -1,4 +1,3 @@
// clang-format off
/* ----------------------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
https://www.lammps.org/, Sandia National Laboratories
@ -13,24 +12,24 @@
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
#include "omp_compat.h"
#include "pair_beck_omp.h"
#include <cmath>
#include "atom.h"
#include "comm.h"
#include "force.h"
#include "neigh_list.h"
#include "math_special.h"
#include "neigh_list.h"
#include "suffix.h"
#include <cmath>
#include "omp_compat.h"
using namespace LAMMPS_NS;
using namespace MathSpecial;
/* ---------------------------------------------------------------------- */
PairBeckOMP::PairBeckOMP(LAMMPS *lmp) :
PairBeck(lmp), ThrOMP(lmp, THR_PAIR)
PairBeckOMP::PairBeckOMP(LAMMPS *lmp) : PairBeck(lmp), ThrOMP(lmp, THR_PAIR)
{
suffix_flag |= Suffix::OMP;
respa_enable = 0;
@ -40,14 +39,14 @@ PairBeckOMP::PairBeckOMP(LAMMPS *lmp) :
void PairBeckOMP::compute(int eflag, int vflag)
{
ev_init(eflag,vflag);
ev_init(eflag, vflag);
const int nall = atom->nlocal + atom->nghost;
const int nthreads = comm->nthreads;
const int inum = list->inum;
#if defined(_OPENMP)
#pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(eflag,vflag)
#pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(eflag, vflag)
#endif
{
int ifrom, ito, tid;
@ -59,41 +58,47 @@ void PairBeckOMP::compute(int eflag, int vflag)
if (evflag) {
if (eflag) {
if (force->newton_pair) eval<1,1,1>(ifrom, ito, thr);
else eval<1,1,0>(ifrom, ito, thr);
if (force->newton_pair)
eval<1, 1, 1>(ifrom, ito, thr);
else
eval<1, 1, 0>(ifrom, ito, thr);
} else {
if (force->newton_pair) eval<1,0,1>(ifrom, ito, thr);
else eval<1,0,0>(ifrom, ito, thr);
if (force->newton_pair)
eval<1, 0, 1>(ifrom, ito, thr);
else
eval<1, 0, 0>(ifrom, ito, thr);
}
} else {
if (force->newton_pair) eval<0,0,1>(ifrom, ito, thr);
else eval<0,0,0>(ifrom, ito, thr);
if (force->newton_pair)
eval<0, 0, 1>(ifrom, ito, thr);
else
eval<0, 0, 0>(ifrom, ito, thr);
}
thr->timer(Timer::PAIR);
reduce_thr(this, eflag, vflag, thr);
} // end of omp parallel region
} // end of omp parallel region
}
template <int EVFLAG, int EFLAG, int NEWTON_PAIR>
void PairBeckOMP::eval(int iifrom, int iito, ThrData * const thr)
void PairBeckOMP::eval(int iifrom, int iito, ThrData *const thr)
{
int i,j,ii,jj,jnum,itype,jtype;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,r5,force_beck,factor_lj;
double r,rinv;
double aaij,alphaij,betaij;
double term1,term1inv,term2,term3,term4,term5,term6;
int *ilist,*jlist,*numneigh,**firstneigh;
int i, j, ii, jj, jnum, itype, jtype;
double xtmp, ytmp, ztmp, delx, dely, delz, evdwl, fpair;
double rsq, r5, force_beck, factor_lj;
double r, rinv;
double aaij, alphaij, betaij;
double term1, term1inv, term2, term3, term4, term5, term6;
int *ilist, *jlist, *numneigh, **firstneigh;
evdwl = 0.0;
const auto * _noalias const x = (dbl3_t *) atom->x[0];
auto * _noalias const f = (dbl3_t *) thr->get_f()[0];
const auto *_noalias const x = (dbl3_t *) atom->x[0];
auto *_noalias const f = (dbl3_t *) thr->get_f()[0];
int *type = atom->type;
int nlocal = atom->nlocal;
double *special_lj = force->special_lj;
double fxtmp,fytmp,fztmp;
double fxtmp, fytmp, fztmp;
ilist = list->ilist;
numneigh = list->numneigh;
@ -110,7 +115,7 @@ void PairBeckOMP::eval(int iifrom, int iito, ThrData * const thr)
itype = type[i];
jlist = firstneigh[i];
jnum = numneigh[i];
fxtmp=fytmp=fztmp=0.0;
fxtmp = fytmp = fztmp = 0.0;
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
@ -120,45 +125,45 @@ void PairBeckOMP::eval(int iifrom, int iito, ThrData * const thr)
delx = xtmp - x[j].x;
dely = ytmp - x[j].y;
delz = ztmp - x[j].z;
rsq = delx*delx + dely*dely + delz*delz;
rsq = delx * delx + dely * dely + delz * delz;
jtype = type[j];
if (rsq < cutsq[itype][jtype]) {
r = sqrt(rsq);
r5 = rsq*rsq*r;
r5 = rsq * rsq * r;
aaij = aa[itype][jtype];
alphaij = alpha[itype][jtype];
betaij = beta[itype][jtype];
term1 = aaij*aaij + rsq;
term2 = powint(term1,-5);
term3 = 21.672 + 30.0*aaij*aaij + 6.0*rsq;
term4 = alphaij + r5*betaij;
term5 = alphaij + 6.0*r5*betaij;
rinv = 1.0/r;
force_beck = AA[itype][jtype]*exp(-1.0*r*term4)*term5;
force_beck -= BB[itype][jtype]*r*term2*term3;
term1 = aaij * aaij + rsq;
term2 = powint(term1, -5);
term3 = 21.672 + 30.0 * aaij * aaij + 6.0 * rsq;
term4 = alphaij + r5 * betaij;
term5 = alphaij + 6.0 * r5 * betaij;
rinv = 1.0 / r;
force_beck = AA[itype][jtype] * exp(-1.0 * r * term4) * term5;
force_beck -= BB[itype][jtype] * r * term2 * term3;
fpair = factor_lj*force_beck*rinv;
fpair = factor_lj * force_beck * rinv;
f[i].x += delx*fpair;
f[i].y += dely*fpair;
f[i].z += delz*fpair;
f[i].x += delx * fpair;
f[i].y += dely * fpair;
f[i].z += delz * fpair;
if (NEWTON_PAIR || j < nlocal) {
f[j].x -= delx*fpair;
f[j].y -= dely*fpair;
f[j].z -= delz*fpair;
f[j].x -= delx * fpair;
f[j].y -= dely * fpair;
f[j].z -= delz * fpair;
}
if (EFLAG) {
term6 = powint(term1,-3);
term1inv = 1.0/term1;
evdwl = AA[itype][jtype]*exp(-1.0*r*term4);
evdwl -= BB[itype][jtype]*term6*(1.0+(2.709+3.0*aaij*aaij)*term1inv);
term6 = powint(term1, -3);
term1inv = 1.0 / term1;
evdwl = AA[itype][jtype] * exp(-1.0 * r * term4);
evdwl -= BB[itype][jtype] * term6 * (1.0 + (2.709 + 3.0 * aaij * aaij) * term1inv);
evdwl *= factor_lj;
}
if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR,
evdwl,0.0,fpair,delx,dely,delz,thr);
if (EVFLAG)
ev_tally_thr(this, i, j, nlocal, NEWTON_PAIR, evdwl, 0.0, fpair, delx, dely, delz, thr);
}
}
f[i].x += fxtmp;

View File

@ -5302,7 +5302,7 @@ int lammps_config_has_jpeg_support() {
\verbatim embed:rst
The LAMMPS :doc:`dump style movie <dump_image>` supports generating movies
from images on-the-fly via creating a pipe to the
`ffmpeg <https://ffmpeg.org/ffmpeg/>`_ program.
`ffmpeg <https://ffmpeg.org/>`_ program.
This function checks whether this feature was :ref:`enabled at compile time <graphics>`.
It does **not** check whether the ``ffmpeg`` itself is installed and usable.
\endverbatim

View File

@ -498,10 +498,10 @@ void Output::calculate_next_dump(int which, int idump, bigint ntimestep)
next_dump[idump] += every_dump[idump];
} else {
next_dump[idump] = static_cast<bigint>
(input->variable->compute_equal(ivar_dump[idump]));
next_dump[idump] = static_cast<bigint>(input->variable->compute_equal(ivar_dump[idump]));
if (next_dump[idump] <= ntimestep)
error->all(FLERR,"Dump every variable returned a bad timestep");
error->all(FLERR,"Dump {} every variable {} returned a bad timestep: {}",
dump[idump]->id, var_dump[idump], next_dump[idump]);
}
// dump mode is by simulation time
@ -511,8 +511,7 @@ void Output::calculate_next_dump(int which, int idump, bigint ntimestep)
bigint nextdump;
double nexttime;
double tcurrent = update->atime +
(ntimestep - update->atimestep) * update->dt;
double tcurrent = update->atime + (ntimestep - update->atimestep) * update->dt;
if (every_time_dump[idump] > 0.0) {

View File

@ -73,7 +73,14 @@ enum{DONE,ADD,SUBTRACT,MULTIPLY,DIVIDE,CARAT,MODULO,UNARY,
enum{SUM,XMIN,XMAX,AVE,TRAP,SLOPE};
#define BIG 1.0e20
static constexpr double BIG = 1.0e20;
// INT64_MAX cannot be represented with a double. reduce to avoid overflow when casting back.
#if defined(LAMMPS_SMALLBIG) || defined(LAMMPS_BIGBIG)
static constexpr double MAXBIGINT_DOUBLE = (double) (MAXBIGINT-512);
#else
static constexpr double MAXBIGINT_DOUBLE = (double) MAXBIGINT;
#endif
// constants for variable expressions. customize by adding new items.
// if needed (cf. 'version') initialize in Variable class constructor.
@ -2721,8 +2728,8 @@ double Variable::collapse_tree(Tree *tree)
else if (update->ntimestep < ivalue2) {
bigint offset = update->ntimestep - ivalue1;
tree->value = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3;
if (tree->value > ivalue2) tree->value = (double) MAXBIGINT;
} else tree->value = (double) MAXBIGINT;
if (tree->value > ivalue2) tree->value = (double) MAXBIGINT_DOUBLE;
} else tree->value = (double) MAXBIGINT_DOUBLE;
return tree->value;
}
@ -2758,11 +2765,11 @@ double Variable::collapse_tree(Tree *tree)
if (istep > ivalue5) {
offset = ivalue5 - ivalue1;
istep = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3;
if (istep > ivalue2) istep = MAXBIGINT;
if (istep > ivalue2) istep = MAXBIGINT_DOUBLE;
}
}
} else istep = MAXBIGINT;
tree->value = istep;
} else istep = MAXBIGINT_DOUBLE;
tree->value = (double)istep;
return tree->value;
}
@ -3060,8 +3067,8 @@ double Variable::eval_tree(Tree *tree, int i)
else if (update->ntimestep < ivalue2) {
bigint offset = update->ntimestep - ivalue1;
arg = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3;
if (arg > ivalue2) arg = (double) MAXBIGINT;
} else arg = (double) MAXBIGINT;
if (arg > ivalue2) arg = (double) MAXBIGINT_DOUBLE;
} else arg = (double) MAXBIGINT_DOUBLE;
return arg;
}
@ -3092,10 +3099,10 @@ double Variable::eval_tree(Tree *tree, int i)
if (istep > ivalue5) {
offset = ivalue5 - ivalue1;
istep = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3;
if (istep > ivalue2) istep = MAXBIGINT;
if (istep > ivalue2) istep = MAXBIGINT_DOUBLE;
}
}
} else istep = MAXBIGINT;
} else istep = MAXBIGINT_DOUBLE;
arg = istep;
return arg;
}
@ -3627,8 +3634,8 @@ int Variable::math_function(char *word, char *contents, Tree **tree, Tree **tree
else if (update->ntimestep < ivalue2) {
bigint offset = update->ntimestep - ivalue1;
value = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3;
if (value > ivalue2) value = (double) MAXBIGINT;
} else value = (double) MAXBIGINT;
if (value > ivalue2) value = (double) MAXBIGINT_DOUBLE;
} else value = (double) MAXBIGINT_DOUBLE;
argstack[nargstack++] = value;
}
@ -3662,10 +3669,10 @@ int Variable::math_function(char *word, char *contents, Tree **tree, Tree **tree
if (istep > ivalue5) {
offset = ivalue5 - ivalue1;
istep = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3;
if (istep > ivalue2) istep = MAXBIGINT;
if (istep > ivalue2) istep = MAXBIGINT_DOUBLE;
}
}
} else istep = MAXBIGINT;
} else istep = MAXBIGINT_DOUBLE;
double value = istep;
argstack[nargstack++] = value;
}