Merge pull request #2848 from akohlmey/collected-small-changes
Collected small changes for the next patch release
This commit is contained in:
@ -244,15 +244,16 @@ if(PKG_ADIOS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT CMAKE_CROSSCOMPILING)
|
if(NOT CMAKE_CROSSCOMPILING)
|
||||||
set(MPI_CXX_SKIP_MPICXX TRUE)
|
|
||||||
find_package(MPI QUIET)
|
find_package(MPI QUIET)
|
||||||
option(BUILD_MPI "Build MPI version" ${MPI_FOUND})
|
option(BUILD_MPI "Build MPI version" ${MPI_FOUND})
|
||||||
else()
|
else()
|
||||||
set(MPI_CXX_SKIP_MPICXX TRUE)
|
|
||||||
option(BUILD_MPI "Build MPI version" OFF)
|
option(BUILD_MPI "Build MPI version" OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(BUILD_MPI)
|
if(BUILD_MPI)
|
||||||
|
# do not include the (obsolete) MPI C++ bindings which makes
|
||||||
|
# for leaner object files and avoids namespace conflicts
|
||||||
|
set(MPI_CXX_SKIP_MPICXX TRUE)
|
||||||
# We use a non-standard procedure to cross-compile with MPI on Windows
|
# We use a non-standard procedure to cross-compile with MPI on Windows
|
||||||
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
|
if((CMAKE_SYSTEM_NAME STREQUAL "Windows") AND CMAKE_CROSSCOMPILING)
|
||||||
include(MPI4WIN)
|
include(MPI4WIN)
|
||||||
@ -368,6 +369,8 @@ if(PKG_MSCG OR PKG_ATC OR PKG_AWPMD OR PKG_ML-QUIP OR PKG_LATTE)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# tweak jpeg library names to avoid linker errors with MinGW cross-compilation
|
||||||
|
set(JPEG_NAMES libjpeg libjpeg-62)
|
||||||
find_package(JPEG QUIET)
|
find_package(JPEG QUIET)
|
||||||
option(WITH_JPEG "Enable JPEG support" ${JPEG_FOUND})
|
option(WITH_JPEG "Enable JPEG support" ${JPEG_FOUND})
|
||||||
if(WITH_JPEG)
|
if(WITH_JPEG)
|
||||||
|
|||||||
@ -54,8 +54,8 @@ if(DOWNLOAD_PLUMED)
|
|||||||
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumedWrapper.a")
|
set(PLUMED_BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/libplumedWrapper.a")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.7.1/plumed-src-2.7.1.tgz" CACHE STRING "URL for PLUMED tarball")
|
set(PLUMED_URL "https://github.com/plumed/plumed2/releases/download/v2.7.2/plumed-src-2.7.2.tgz" CACHE STRING "URL for PLUMED tarball")
|
||||||
set(PLUMED_MD5 "4eac6a462ec84dfe0cec96c82421b8e8" CACHE STRING "MD5 checksum of PLUMED tarball")
|
set(PLUMED_MD5 "cfa0b4dd90a81c25d3302e8d97bfeaea" CACHE STRING "MD5 checksum of PLUMED tarball")
|
||||||
|
|
||||||
mark_as_advanced(PLUMED_URL)
|
mark_as_advanced(PLUMED_URL)
|
||||||
mark_as_advanced(PLUMED_MD5)
|
mark_as_advanced(PLUMED_MD5)
|
||||||
@ -72,7 +72,6 @@ if(DOWNLOAD_PLUMED)
|
|||||||
${PLUMED_CONFIG_OMP}
|
${PLUMED_CONFIG_OMP}
|
||||||
CXX=${PLUMED_CONFIG_CXX}
|
CXX=${PLUMED_CONFIG_CXX}
|
||||||
CC=${PLUMED_CONFIG_CC}
|
CC=${PLUMED_CONFIG_CC}
|
||||||
PATCH_COMMAND sed -i "/^#include <algorithm>/a #include <limits>" <SOURCE_DIR>/src/lepton/Operation.h
|
|
||||||
BUILD_BYPRODUCTS ${PLUMED_BUILD_BYPRODUCTS}
|
BUILD_BYPRODUCTS ${PLUMED_BUILD_BYPRODUCTS}
|
||||||
)
|
)
|
||||||
ExternalProject_get_property(plumed_build INSTALL_DIR)
|
ExternalProject_get_property(plumed_build INSTALL_DIR)
|
||||||
|
|||||||
@ -25,7 +25,7 @@ RasMol visualization programs. Pizza.py has tools that do interactive
|
|||||||
3d OpenGL visualization and one that creates SVG images of dump file
|
3d OpenGL visualization and one that creates SVG images of dump file
|
||||||
snapshots.
|
snapshots.
|
||||||
|
|
||||||
.. _pizza: https://pizza.sandia.gov
|
.. _pizza: https://lammps.github.io/pizza
|
||||||
|
|
||||||
.. _ensight: https://www.ansys.com/products/fluids/ansys-ensight
|
.. _ensight: https://www.ansys.com/products/fluids/ansys-ensight
|
||||||
|
|
||||||
|
|||||||
@ -24,11 +24,15 @@ General features
|
|||||||
^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
* runs on a single processor or in parallel
|
* runs on a single processor or in parallel
|
||||||
* distributed-memory message-passing parallelism (MPI)
|
* distributed memory message-passing parallelism (MPI)
|
||||||
* spatial-decomposition of simulation domain for parallelism
|
* shared memory multi-threading parallelism (OpenMP)
|
||||||
* open-source distribution
|
* spatial decomposition of simulation domain for MPI parallelism
|
||||||
* highly portable C++
|
* particle decomposition inside of spatial decomposition for OpenMP parallelism
|
||||||
* optional libraries used: MPI and single-processor FFT
|
* GPLv2 licensed open-source distribution
|
||||||
|
* highly portable C++-11
|
||||||
|
* modular code with most functionality in optional packages
|
||||||
|
* only depends on MPI library for basic parallel functionality
|
||||||
|
* other libraries are optional and only required for specific packages
|
||||||
* GPU (CUDA and OpenCL), Intel Xeon Phi, and OpenMP support for many code features
|
* GPU (CUDA and OpenCL), Intel Xeon Phi, and OpenMP support for many code features
|
||||||
* easy to extend with new features and functionality
|
* easy to extend with new features and functionality
|
||||||
* runs from an input script
|
* runs from an input script
|
||||||
@ -170,9 +174,12 @@ Multi-replica models
|
|||||||
^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
* :doc:`nudged elastic band <neb>`
|
* :doc:`nudged elastic band <neb>`
|
||||||
|
* :doc:`hyperdynamics <hyper>`
|
||||||
* :doc:`parallel replica dynamics <prd>`
|
* :doc:`parallel replica dynamics <prd>`
|
||||||
* :doc:`temperature accelerated dynamics <tad>`
|
* :doc:`temperature accelerated dynamics <tad>`
|
||||||
* :doc:`parallel tempering <temper>`
|
* :doc:`parallel tempering <temper>`
|
||||||
|
* :doc:`path-integral MD <fix_pimd>`
|
||||||
|
* multi-walker collective variables with :doc:`Colvars <fix_colvars>` and :doc:`Plumed <fix_plumed>`
|
||||||
|
|
||||||
.. _prepost:
|
.. _prepost:
|
||||||
|
|
||||||
@ -187,7 +194,7 @@ Pre- and post-processing
|
|||||||
plotting, and visualization for LAMMPS simulations. Pizza.py is
|
plotting, and visualization for LAMMPS simulations. Pizza.py is
|
||||||
written in `Python <python_>`_ and is available for download from `the Pizza.py WWW site <pizza_>`_.
|
written in `Python <python_>`_ and is available for download from `the Pizza.py WWW site <pizza_>`_.
|
||||||
|
|
||||||
.. _pizza: https://pizza.sandia.gov
|
.. _pizza: https://lammps.github.io/pizza
|
||||||
|
|
||||||
.. _python: http://www.python.org
|
.. _python: http://www.python.org
|
||||||
|
|
||||||
|
|||||||
@ -77,7 +77,7 @@ Here are suggestions on how to perform these tasks:
|
|||||||
it easier to analyze and plot. See the :doc:`Tools <Tools>` doc page
|
it easier to analyze and plot. See the :doc:`Tools <Tools>` doc page
|
||||||
for more discussion of the various tools.
|
for more discussion of the various tools.
|
||||||
* **Pizza.py:** Our group has also written a separate toolkit called
|
* **Pizza.py:** Our group has also written a separate toolkit called
|
||||||
`Pizza.py <https://pizza.sandia.gov>`_ which can do certain kinds of
|
`Pizza.py <https://lammps.github.io/pizza>`_ which can do certain kinds of
|
||||||
setup, analysis, plotting, and visualization (via OpenGL) for LAMMPS
|
setup, analysis, plotting, and visualization (via OpenGL) for LAMMPS
|
||||||
simulations. It thus provides some functionality for several of the
|
simulations. It thus provides some functionality for several of the
|
||||||
above bullets. Pizza.py is written in `Python <http://www.python.org>`_
|
above bullets. Pizza.py is written in `Python <http://www.python.org>`_
|
||||||
|
|||||||
@ -18,10 +18,11 @@ supercomputers.
|
|||||||
.. _mpi: https://en.wikipedia.org/wiki/Message_Passing_Interface
|
.. _mpi: https://en.wikipedia.org/wiki/Message_Passing_Interface
|
||||||
.. _lws: https://www.lammps.org
|
.. _lws: https://www.lammps.org
|
||||||
|
|
||||||
LAMMPS is written in C++. Earlier versions were written in F77 and
|
LAMMPS is written in C++ and requires a compiler that is at least
|
||||||
F90. See the `History page <https://www.lammps.org/history.html>`_ of
|
compatible with the C++-11 standard.
|
||||||
the website for details. All versions can be downloaded from the
|
Earlier versions were written in F77 and F90. See the `History page
|
||||||
`LAMMPS website <lws_>`_.
|
<https://www.lammps.org/history.html>`_ of the website for details. All
|
||||||
|
versions can be downloaded from the `LAMMPS website <lws_>`_.
|
||||||
|
|
||||||
LAMMPS is designed to be easy to modify or extend with new
|
LAMMPS is designed to be easy to modify or extend with new
|
||||||
capabilities, such as new force fields, atom types, boundary
|
capabilities, such as new force fields, atom types, boundary
|
||||||
@ -41,8 +42,9 @@ short distances, so that the local density of particles never becomes
|
|||||||
too large. This is in contrast to methods used for modeling plasma
|
too large. This is in contrast to methods used for modeling plasma
|
||||||
or gravitational bodies (e.g. galaxy formation).
|
or gravitational bodies (e.g. galaxy formation).
|
||||||
|
|
||||||
On parallel machines, LAMMPS uses spatial-decomposition techniques to
|
On parallel machines, LAMMPS uses spatial-decomposition techniques with
|
||||||
partition the simulation domain into small sub-domains of equal
|
MPI parallelization to partition the simulation domain into small
|
||||||
computational cost, one of which is assigned to each processor.
|
sub-domains of equal computational cost, one of which is assigned to
|
||||||
Processors communicate and store "ghost" atom information for atoms
|
each processor. Processors communicate and store "ghost" atom
|
||||||
that border their sub-domain.
|
information for atoms that border their sub-domain. Multi-threading
|
||||||
|
parallelization with with particle-decomposition can be used in addition.
|
||||||
|
|||||||
@ -35,9 +35,9 @@ visualization package you have installed.
|
|||||||
Note that for GL, you need to be able to run the Pizza.py GL tool,
|
Note that for GL, you need to be able to run the Pizza.py GL tool,
|
||||||
which is included in the pizza sub-directory. See the Pizza.py doc pages for more info:
|
which is included in the pizza sub-directory. See the Pizza.py doc pages for more info:
|
||||||
|
|
||||||
* `https://pizza.sandia.gov <pizza_>`_
|
* `https://lammps.github.io/pizza <pizza_>`_
|
||||||
|
|
||||||
.. _pizza: https://pizza.sandia.gov
|
.. _pizza: https://lammps.github.io/pizza
|
||||||
|
|
||||||
Note that for AtomEye, you need version 3, and there is a line in the
|
Note that for AtomEye, you need version 3, and there is a line in the
|
||||||
scripts that specifies the path and name of the executable. See the
|
scripts that specifies the path and name of the executable. See the
|
||||||
|
|||||||
@ -15,7 +15,7 @@ Sandia which provides tools for doing setup, analysis, plotting, and
|
|||||||
visualization for LAMMPS simulations.
|
visualization for LAMMPS simulations.
|
||||||
|
|
||||||
.. _lws: https://www.lammps.org
|
.. _lws: https://www.lammps.org
|
||||||
.. _pizza: https://pizza.sandia.gov
|
.. _pizza: https://lammps.github.io/pizza
|
||||||
.. _python: https://www.python.org
|
.. _python: https://www.python.org
|
||||||
|
|
||||||
Additional tools included in the LAMMPS distribution are described on
|
Additional tools included in the LAMMPS distribution are described on
|
||||||
|
|||||||
@ -558,7 +558,7 @@ Related commands
|
|||||||
:doc:`group <group>`, :doc:`processors <processors>`,
|
:doc:`group <group>`, :doc:`processors <processors>`,
|
||||||
:doc:`fix balance <fix_balance>`, :doc:`comm_style <comm_style>`
|
:doc:`fix balance <fix_balance>`, :doc:`comm_style <comm_style>`
|
||||||
|
|
||||||
.. _pizza: https://pizza.sandia.gov
|
.. _pizza: https://lammps.github.io/pizza
|
||||||
|
|
||||||
Default
|
Default
|
||||||
"""""""
|
"""""""
|
||||||
|
|||||||
@ -119,8 +119,7 @@ The per-atom vector values will be an ID > 0, as explained above.
|
|||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|
||||||
These computes are part of the EXTRA-COMPUTE package. They are only enabled if
|
none
|
||||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info.
|
|
||||||
|
|
||||||
Related commands
|
Related commands
|
||||||
""""""""""""""""
|
""""""""""""""""
|
||||||
|
|||||||
@ -182,8 +182,7 @@ page for an overview of LAMMPS output options.
|
|||||||
Restrictions
|
Restrictions
|
||||||
""""""""""""
|
""""""""""""
|
||||||
|
|
||||||
This compute is part of the EXTRA-COMPUTE package. It is only enabled if
|
none
|
||||||
LAMMPS was built with that package. See the :doc:`Build package <Build_package>` page for more info.
|
|
||||||
|
|
||||||
Related commands
|
Related commands
|
||||||
""""""""""""""""
|
""""""""""""""""
|
||||||
|
|||||||
@ -230,7 +230,7 @@ individual values and the file itself.
|
|||||||
The *atom*, *local*, and *custom* styles create files in a simple text
|
The *atom*, *local*, and *custom* styles create files in a simple text
|
||||||
format that is self-explanatory when viewing a dump file. Some of the
|
format that is self-explanatory when viewing a dump file. Some of the
|
||||||
LAMMPS post-processing tools described on the :doc:`Tools <Tools>` doc
|
LAMMPS post-processing tools described on the :doc:`Tools <Tools>` doc
|
||||||
page, including `Pizza.py <https://pizza.sandia.gov>`_,
|
page, including `Pizza.py <https://lammps.github.io/pizza>`_,
|
||||||
work with this format, as does the :doc:`rerun <rerun>` command.
|
work with this format, as does the :doc:`rerun <rerun>` command.
|
||||||
|
|
||||||
For post-processing purposes the *atom*, *local*, and *custom* text
|
For post-processing purposes the *atom*, *local*, and *custom* text
|
||||||
|
|||||||
@ -590,8 +590,8 @@ Play the movie:
|
|||||||
% mplayer foo.mpg
|
% mplayer foo.mpg
|
||||||
% ffplay bar.avi
|
% ffplay bar.avi
|
||||||
|
|
||||||
* c) Use the `Pizza.py <https://pizza.sandia.gov>`_
|
* c) Use the `Pizza.py <https://lammps.github.io/pizza>`_
|
||||||
`animate tool <https://pizza.sandia.gov/doc/animate.html>`_,
|
`animate tool <https://lammps.github.io/pizza/doc/animate.html>`_,
|
||||||
which works directly on a series of image files.
|
which works directly on a series of image files.
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|||||||
@ -403,7 +403,7 @@ Related commands
|
|||||||
:doc:`group <group>`, :doc:`processors <processors>`, :doc:`balance <balance>`,
|
:doc:`group <group>`, :doc:`processors <processors>`, :doc:`balance <balance>`,
|
||||||
:doc:`comm_style <comm_style>`
|
:doc:`comm_style <comm_style>`
|
||||||
|
|
||||||
.. _pizza: https://pizza.sandia.gov
|
.. _pizza: https://lammps.github.io/pizza
|
||||||
|
|
||||||
Default
|
Default
|
||||||
"""""""
|
"""""""
|
||||||
|
|||||||
@ -89,7 +89,7 @@ first stage) is changed to:
|
|||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
|
|
||||||
Fi = -Grad(V) + 2 (Grad(V) dot T') T'
|
Fi = -Grad(V) + 2 (Grad(V) dot T') T' + Fnudge_perp
|
||||||
|
|
||||||
and the relaxation procedure is continued to a new converged MEP.
|
and the relaxation procedure is continued to a new converged MEP.
|
||||||
|
|
||||||
|
|||||||
@ -53,6 +53,7 @@ checksums = { \
|
|||||||
'2.6.3' : 'a9f8028fd74528c2024781ea1fdefeee', \
|
'2.6.3' : 'a9f8028fd74528c2024781ea1fdefeee', \
|
||||||
'2.7.0' : '95f29dd0c067577f11972ff90dfc7d12', \
|
'2.7.0' : '95f29dd0c067577f11972ff90dfc7d12', \
|
||||||
'2.7.1' : '4eac6a462ec84dfe0cec96c82421b8e8', \
|
'2.7.1' : '4eac6a462ec84dfe0cec96c82421b8e8', \
|
||||||
|
'2.7.2' : 'cfa0b4dd90a81c25d3302e8d97bfeaea', \
|
||||||
}
|
}
|
||||||
|
|
||||||
# parse and process arguments
|
# parse and process arguments
|
||||||
|
|||||||
@ -1823,7 +1823,6 @@ class lammps(object):
|
|||||||
|
|
||||||
with ExceptionCheck(self):
|
with ExceptionCheck(self):
|
||||||
return self.lib.lammps_fix_external_get_force(self.lmp, fix_id.encode())
|
return self.lib.lammps_fix_external_get_force(self.lmp, fix_id.encode())
|
||||||
return None
|
|
||||||
|
|
||||||
# -------------------------------------------------------------------------
|
# -------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@ -647,7 +647,6 @@ void PPPMDispDielectric::fieldforce_c_ad()
|
|||||||
|
|
||||||
// convert E-field to force and substract self forces
|
// convert E-field to force and substract self forces
|
||||||
const double qfactor = qqrd2e * scale;
|
const double qfactor = qqrd2e * scale;
|
||||||
double qtmp = eps[i]*q[i];
|
|
||||||
|
|
||||||
s1 = x[i][0]*hx_inv;
|
s1 = x[i][0]*hx_inv;
|
||||||
s2 = x[i][1]*hy_inv;
|
s2 = x[i][1]*hy_inv;
|
||||||
@ -751,7 +750,7 @@ void PPPMDispDielectric::fieldforce_c_peratom()
|
|||||||
extended to non-neutral systems (J. Chem. Phys. 131, 094107).
|
extended to non-neutral systems (J. Chem. Phys. 131, 094107).
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void PPPMDispDielectric::slabcorr(int eflag)
|
void PPPMDispDielectric::slabcorr(int /*eflag*/)
|
||||||
{
|
{
|
||||||
// compute local contribution to global dipole moment
|
// compute local contribution to global dipole moment
|
||||||
|
|
||||||
|
|||||||
@ -116,7 +116,7 @@ ComputeHMA::ComputeHMA(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
computeU = computeP = computeCv = -1;
|
computeU = computeP = computeCv = -1;
|
||||||
returnAnharmonic = 0;
|
returnAnharmonic = 0;
|
||||||
size_vector = 0;
|
size_vector = 0;
|
||||||
memory->create(extlist, 3, "hma:extlist");
|
extlist = new int[3];
|
||||||
for (int iarg=4; iarg<narg; iarg++) {
|
for (int iarg=4; iarg<narg; iarg++) {
|
||||||
if (!strcmp(arg[iarg], "u")) {
|
if (!strcmp(arg[iarg], "u")) {
|
||||||
if (computeU>-1) continue;
|
if (computeU>-1) continue;
|
||||||
@ -145,20 +145,11 @@ ComputeHMA::ComputeHMA(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size_vector == 0) {
|
if (size_vector == 0) error->all(FLERR,"Illegal compute hma command");
|
||||||
error->all(FLERR,"Illegal compute hma command");
|
vector = new double[size_vector];
|
||||||
}
|
|
||||||
if (size_vector<3) {
|
|
||||||
memory->grow(extlist, size_vector, "hma:extlist");
|
|
||||||
}
|
|
||||||
memory->create(vector, size_vector, "hma:vector");
|
|
||||||
|
|
||||||
if (computeU>-1 || computeCv>-1) {
|
if (computeU>-1 || computeCv>-1) peflag = 1;
|
||||||
peflag = 1;
|
if (computeP>-1) pressflag = 1;
|
||||||
}
|
|
||||||
if (computeP>-1) {
|
|
||||||
pressflag = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
nmax = 0;
|
nmax = 0;
|
||||||
}
|
}
|
||||||
@ -172,8 +163,9 @@ ComputeHMA::~ComputeHMA()
|
|||||||
|
|
||||||
delete[] id_fix;
|
delete[] id_fix;
|
||||||
delete[] id_temp;
|
delete[] id_temp;
|
||||||
memory->destroy(extlist);
|
delete[] extlist;
|
||||||
memory->destroy(vector);
|
delete[] vector;
|
||||||
|
|
||||||
memory->destroy(deltaR);
|
memory->destroy(deltaR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
// clang-format off
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||||
https://www.lammps.org/, Sandia National Laboratories
|
https://www.lammps.org/, Sandia National Laboratories
|
||||||
@ -14,28 +13,26 @@
|
|||||||
|
|
||||||
#include "compute_force_tally.h"
|
#include "compute_force_tally.h"
|
||||||
|
|
||||||
#include <cmath>
|
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "group.h"
|
#include "comm.h"
|
||||||
#include "pair.h"
|
|
||||||
#include "update.h"
|
|
||||||
#include "memory.h"
|
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "comm.h"
|
#include "group.h"
|
||||||
|
#include "memory.h"
|
||||||
|
#include "pair.h"
|
||||||
|
#include "update.h"
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
ComputeForceTally::ComputeForceTally(LAMMPS *lmp, int narg, char **arg) :
|
ComputeForceTally::ComputeForceTally(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg)
|
||||||
Compute(lmp, narg, arg)
|
|
||||||
{
|
{
|
||||||
if (narg < 4) error->all(FLERR, "Illegal compute force/tally command");
|
if (narg < 4) error->all(FLERR, "Illegal compute force/tally command");
|
||||||
|
|
||||||
igroup2 = group->find(arg[3]);
|
igroup2 = group->find(arg[3]);
|
||||||
if (igroup2 == -1)
|
if (igroup2 == -1) error->all(FLERR, "Could not find compute force/tally second group ID");
|
||||||
error->all(FLERR,"Could not find compute force/tally second group ID");
|
|
||||||
groupbit2 = group->bitmask[igroup2];
|
groupbit2 = group->bitmask[igroup2];
|
||||||
|
|
||||||
scalar_flag = 1;
|
scalar_flag = 1;
|
||||||
@ -76,8 +73,7 @@ void ComputeForceTally::init()
|
|||||||
if (force->pair->single_enable == 0 || force->pair->manybody_flag)
|
if (force->pair->single_enable == 0 || force->pair->manybody_flag)
|
||||||
error->warning(FLERR, "Compute force/tally used with incompatible pair style");
|
error->warning(FLERR, "Compute force/tally used with incompatible pair style");
|
||||||
|
|
||||||
if (force->bond || force->angle || force->dihedral
|
if (force->bond || force->angle || force->dihedral || force->improper || force->kspace)
|
||||||
|| force->improper || force->kspace)
|
|
||||||
error->warning(FLERR, "Compute force/tally only called from pair style");
|
error->warning(FLERR, "Compute force/tally only called from pair style");
|
||||||
}
|
}
|
||||||
did_setup = -1;
|
did_setup = -1;
|
||||||
@ -106,24 +102,21 @@ void ComputeForceTally::pair_setup_callback(int, int)
|
|||||||
// clear storage
|
// clear storage
|
||||||
|
|
||||||
for (int i = 0; i < ntotal; ++i)
|
for (int i = 0; i < ntotal; ++i)
|
||||||
for (int j=0; j < size_peratom_cols; ++j)
|
for (int j = 0; j < size_peratom_cols; ++j) fatom[i][j] = 0.0;
|
||||||
fatom[i][j] = 0.0;
|
|
||||||
|
|
||||||
for (int i=0; i < size_peratom_cols; ++i)
|
for (int i = 0; i < size_peratom_cols; ++i) vector[i] = ftotal[i] = 0.0;
|
||||||
vector[i] = ftotal[i] = 0.0;
|
|
||||||
|
|
||||||
did_setup = update->ntimestep;
|
did_setup = update->ntimestep;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
void ComputeForceTally::pair_tally_callback(int i, int j, int nlocal, int newton,
|
void ComputeForceTally::pair_tally_callback(int i, int j, int nlocal, int newton, double, double,
|
||||||
double, double, double fpair,
|
double fpair, double dx, double dy, double dz)
|
||||||
double dx, double dy, double dz)
|
|
||||||
{
|
{
|
||||||
const int *const mask = atom->mask;
|
const int *const mask = atom->mask;
|
||||||
|
|
||||||
if ( ((mask[i] & groupbit) && (mask[j] & groupbit2))
|
if (((mask[i] & groupbit) && (mask[j] & groupbit2)) ||
|
||||||
|| ((mask[i] & groupbit2) && (mask[j] & groupbit))) {
|
((mask[i] & groupbit2) && (mask[j] & groupbit))) {
|
||||||
|
|
||||||
if (newton || i < nlocal) {
|
if (newton || i < nlocal) {
|
||||||
if (mask[i] & groupbit) {
|
if (mask[i] & groupbit) {
|
||||||
@ -184,8 +177,7 @@ void ComputeForceTally::unpack_reverse_comm(int n, int *list, double *buf)
|
|||||||
double ComputeForceTally::compute_scalar()
|
double ComputeForceTally::compute_scalar()
|
||||||
{
|
{
|
||||||
invoked_scalar = update->ntimestep;
|
invoked_scalar = update->ntimestep;
|
||||||
if ((did_setup != invoked_scalar)
|
if ((did_setup != invoked_scalar) || (update->eflag_global != invoked_scalar))
|
||||||
|| (update->eflag_global != invoked_scalar))
|
|
||||||
error->all(FLERR, "Energy was not tallied on needed timestep");
|
error->all(FLERR, "Energy was not tallied on needed timestep");
|
||||||
|
|
||||||
// sum accumulated forces across procs
|
// sum accumulated forces across procs
|
||||||
@ -201,8 +193,7 @@ double ComputeForceTally::compute_scalar()
|
|||||||
void ComputeForceTally::compute_peratom()
|
void ComputeForceTally::compute_peratom()
|
||||||
{
|
{
|
||||||
invoked_peratom = update->ntimestep;
|
invoked_peratom = update->ntimestep;
|
||||||
if ((did_setup != invoked_peratom)
|
if ((did_setup != invoked_peratom) || (update->eflag_global != invoked_peratom))
|
||||||
|| (update->eflag_global != invoked_peratom))
|
|
||||||
error->all(FLERR, "Energy was not tallied on needed timestep");
|
error->all(FLERR, "Energy was not tallied on needed timestep");
|
||||||
|
|
||||||
// collect contributions from ghost atoms
|
// collect contributions from ghost atoms
|
||||||
@ -213,8 +204,7 @@ void ComputeForceTally::compute_peratom()
|
|||||||
// clear out ghost atom data after it has been collected to local atoms
|
// clear out ghost atom data after it has been collected to local atoms
|
||||||
const int nall = atom->nlocal + atom->nghost;
|
const int nall = atom->nlocal + atom->nghost;
|
||||||
for (int i = atom->nlocal; i < nall; ++i)
|
for (int i = atom->nlocal; i < nall; ++i)
|
||||||
for (int j = 0; j < size_peratom_cols; ++j)
|
for (int j = 0; j < size_peratom_cols; ++j) fatom[i][j] = 0.0;
|
||||||
fatom[i][j] = 0.0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,7 +214,6 @@ void ComputeForceTally::compute_peratom()
|
|||||||
|
|
||||||
double ComputeForceTally::memory_usage()
|
double ComputeForceTally::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = (nmax < 0) ? 0 : nmax*size_peratom_cols * sizeof(double);
|
double bytes = (nmax < 0) ? 0 : nmax * (double)size_peratom_cols * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
// clang-format off
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||||
https://www.lammps.org/, Sandia National Laboratories
|
https://www.lammps.org/, Sandia National Laboratories
|
||||||
@ -15,13 +14,13 @@
|
|||||||
#include "compute_heat_flux_tally.h"
|
#include "compute_heat_flux_tally.h"
|
||||||
|
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "group.h"
|
#include "comm.h"
|
||||||
#include "pair.h"
|
|
||||||
#include "update.h"
|
|
||||||
#include "memory.h"
|
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "comm.h"
|
#include "group.h"
|
||||||
|
#include "memory.h"
|
||||||
|
#include "pair.h"
|
||||||
|
#include "update.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
@ -33,8 +32,7 @@ ComputeHeatFluxTally::ComputeHeatFluxTally(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
if (narg < 4) error->all(FLERR, "Illegal compute heat/flux/tally command");
|
if (narg < 4) error->all(FLERR, "Illegal compute heat/flux/tally command");
|
||||||
|
|
||||||
igroup2 = group->find(arg[3]);
|
igroup2 = group->find(arg[3]);
|
||||||
if (igroup2 == -1)
|
if (igroup2 == -1) error->all(FLERR, "Could not find compute heat/flux/tally second group ID");
|
||||||
error->all(FLERR,"Could not find compute heat/flux/tally second group ID");
|
|
||||||
groupbit2 = group->bitmask[igroup2];
|
groupbit2 = group->bitmask[igroup2];
|
||||||
|
|
||||||
vector_flag = 1;
|
vector_flag = 1;
|
||||||
@ -79,8 +77,7 @@ void ComputeHeatFluxTally::init()
|
|||||||
if (force->pair->single_enable == 0 || force->pair->manybody_flag)
|
if (force->pair->single_enable == 0 || force->pair->manybody_flag)
|
||||||
error->warning(FLERR, "Compute heat/flux/tally used with incompatible pair style");
|
error->warning(FLERR, "Compute heat/flux/tally used with incompatible pair style");
|
||||||
|
|
||||||
if (force->bond || force->angle || force->dihedral
|
if (force->bond || force->angle || force->dihedral || force->improper || force->kspace)
|
||||||
|| force->improper || force->kspace)
|
|
||||||
error->warning(FLERR, "Compute heat/flux/tally only called from pair style");
|
error->warning(FLERR, "Compute heat/flux/tally only called from pair style");
|
||||||
}
|
}
|
||||||
did_setup = -1;
|
did_setup = -1;
|
||||||
@ -118,21 +115,20 @@ void ComputeHeatFluxTally::pair_setup_callback(int, int)
|
|||||||
stress[i][5] = 0.0;
|
stress[i][5] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i < size_vector; ++i)
|
for (int i = 0; i < size_vector; ++i) vector[i] = heatj[i] = 0.0;
|
||||||
vector[i] = heatj[i] = 0.0;
|
|
||||||
|
|
||||||
did_setup = update->ntimestep;
|
did_setup = update->ntimestep;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
void ComputeHeatFluxTally::pair_tally_callback(int i, int j, int nlocal, int newton,
|
void ComputeHeatFluxTally::pair_tally_callback(int i, int j, int nlocal, int newton, double evdwl,
|
||||||
double evdwl, double ecoul, double fpair,
|
double ecoul, double fpair, double dx, double dy,
|
||||||
double dx, double dy, double dz)
|
double dz)
|
||||||
{
|
{
|
||||||
const int *const mask = atom->mask;
|
const int *const mask = atom->mask;
|
||||||
|
|
||||||
if ( ((mask[i] & groupbit) && (mask[j] & groupbit2))
|
if (((mask[i] & groupbit) && (mask[j] & groupbit2)) ||
|
||||||
|| ((mask[i] & groupbit2) && (mask[j] & groupbit))) {
|
((mask[i] & groupbit2) && (mask[j] & groupbit))) {
|
||||||
|
|
||||||
const double epairhalf = 0.5 * (evdwl + ecoul);
|
const double epairhalf = 0.5 * (evdwl + ecoul);
|
||||||
fpair *= 0.5;
|
fpair *= 0.5;
|
||||||
@ -253,8 +249,10 @@ void ComputeHeatFluxTally::compute_vector()
|
|||||||
const double *const si = stress[i];
|
const double *const si = stress[i];
|
||||||
double ke_i;
|
double ke_i;
|
||||||
|
|
||||||
if (rmass) ke_i = pfactor * rmass[i];
|
if (rmass)
|
||||||
else ke_i = pfactor * mass[type[i]];
|
ke_i = pfactor * rmass[i];
|
||||||
|
else
|
||||||
|
ke_i = pfactor * mass[type[i]];
|
||||||
ke_i *= (vi[0] * vi[0] + vi[1] * vi[1] + vi[2] * vi[2]);
|
ke_i *= (vi[0] * vi[0] + vi[1] * vi[1] + vi[2] * vi[2]);
|
||||||
ke_i += eatom[i];
|
ke_i += eatom[i];
|
||||||
|
|
||||||
@ -283,7 +281,6 @@ void ComputeHeatFluxTally::compute_vector()
|
|||||||
|
|
||||||
double ComputeHeatFluxTally::memory_usage()
|
double ComputeHeatFluxTally::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = (nmax < 0) ? 0 : nmax*comm_reverse * sizeof(double);
|
double bytes = (nmax < 0) ? 0 : nmax * (double)comm_reverse * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -233,6 +233,6 @@ void ComputeHeatFluxVirialTally::compute_peratom()
|
|||||||
|
|
||||||
double ComputeHeatFluxVirialTally::memory_usage()
|
double ComputeHeatFluxVirialTally::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = (nmax < 0) ? 0 : nmax * size_peratom_cols * sizeof(double);
|
double bytes = (nmax < 0) ? 0 : nmax * (double)size_peratom_cols * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
// clang-format off
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||||
https://www.lammps.org/, Sandia National Laboratories
|
https://www.lammps.org/, Sandia National Laboratories
|
||||||
@ -15,25 +14,23 @@
|
|||||||
#include "compute_pe_mol_tally.h"
|
#include "compute_pe_mol_tally.h"
|
||||||
|
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
|
#include "comm.h"
|
||||||
|
#include "error.h"
|
||||||
|
#include "force.h"
|
||||||
#include "group.h"
|
#include "group.h"
|
||||||
#include "pair.h"
|
#include "pair.h"
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
#include "error.h"
|
|
||||||
#include "force.h"
|
|
||||||
#include "comm.h"
|
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
ComputePEMolTally::ComputePEMolTally(LAMMPS *lmp, int narg, char **arg) :
|
ComputePEMolTally::ComputePEMolTally(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg)
|
||||||
Compute(lmp, narg, arg)
|
|
||||||
{
|
{
|
||||||
if (narg < 4) error->all(FLERR, "Illegal compute pe/mol/tally command");
|
if (narg < 4) error->all(FLERR, "Illegal compute pe/mol/tally command");
|
||||||
|
|
||||||
igroup2 = group->find(arg[3]);
|
igroup2 = group->find(arg[3]);
|
||||||
if (igroup2 == -1)
|
if (igroup2 == -1) error->all(FLERR, "Could not find compute pe/mol/tally second group ID");
|
||||||
error->all(FLERR,"Could not find compute pe/mol/tally second group ID");
|
|
||||||
groupbit2 = group->bitmask[igroup2];
|
groupbit2 = group->bitmask[igroup2];
|
||||||
|
|
||||||
vector_flag = 1;
|
vector_flag = 1;
|
||||||
@ -65,15 +62,13 @@ void ComputePEMolTally::init()
|
|||||||
else
|
else
|
||||||
force->pair->add_tally_callback(this);
|
force->pair->add_tally_callback(this);
|
||||||
|
|
||||||
if (atom->molecule_flag == 0)
|
if (atom->molecule_flag == 0) error->all(FLERR, "Compute pe/mol/tally requires molecule IDs");
|
||||||
error->all(FLERR,"Compute pe/mol/tally requires molecule IDs");
|
|
||||||
|
|
||||||
if (comm->me == 0) {
|
if (comm->me == 0) {
|
||||||
if (force->pair->single_enable == 0 || force->pair->manybody_flag)
|
if (force->pair->single_enable == 0 || force->pair->manybody_flag)
|
||||||
error->warning(FLERR, "Compute pe/mol/tally used with incompatible pair style");
|
error->warning(FLERR, "Compute pe/mol/tally used with incompatible pair style");
|
||||||
|
|
||||||
if (force->bond || force->angle || force->dihedral
|
if (force->bond || force->angle || force->dihedral || force->improper || force->kspace)
|
||||||
|| force->improper || force->kspace)
|
|
||||||
error->warning(FLERR, "Compute pe/mol/tally only called from pair style");
|
error->warning(FLERR, "Compute pe/mol/tally only called from pair style");
|
||||||
}
|
}
|
||||||
did_setup = -1;
|
did_setup = -1;
|
||||||
@ -93,29 +88,33 @@ void ComputePEMolTally::pair_setup_callback(int, int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
void ComputePEMolTally::pair_tally_callback(int i, int j, int nlocal, int newton,
|
void ComputePEMolTally::pair_tally_callback(int i, int j, int nlocal, int newton, double evdwl,
|
||||||
double evdwl, double ecoul, double,
|
double ecoul, double, double, double, double)
|
||||||
double, double, double)
|
|
||||||
{
|
{
|
||||||
const int *const mask = atom->mask;
|
const int *const mask = atom->mask;
|
||||||
const tagint *const molid = atom->molecule;
|
const tagint *const molid = atom->molecule;
|
||||||
|
|
||||||
if ( ((mask[i] & groupbit) && (mask[j] & groupbit2))
|
if (((mask[i] & groupbit) && (mask[j] & groupbit2)) ||
|
||||||
|| ((mask[i] & groupbit2) && (mask[j] & groupbit))) {
|
((mask[i] & groupbit2) && (mask[j] & groupbit))) {
|
||||||
|
|
||||||
evdwl *= 0.5; ecoul *= 0.5;
|
evdwl *= 0.5;
|
||||||
|
ecoul *= 0.5;
|
||||||
if (newton || i < nlocal) {
|
if (newton || i < nlocal) {
|
||||||
if (molid[i] == molid[j]) {
|
if (molid[i] == molid[j]) {
|
||||||
etotal[0] += evdwl; etotal[1] += ecoul;
|
etotal[0] += evdwl;
|
||||||
|
etotal[1] += ecoul;
|
||||||
} else {
|
} else {
|
||||||
etotal[2] += evdwl; etotal[3] += ecoul;
|
etotal[2] += evdwl;
|
||||||
|
etotal[3] += ecoul;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (newton || j < nlocal) {
|
if (newton || j < nlocal) {
|
||||||
if (molid[i] == molid[j]) {
|
if (molid[i] == molid[j]) {
|
||||||
etotal[0] += evdwl; etotal[1] += ecoul;
|
etotal[0] += evdwl;
|
||||||
|
etotal[1] += ecoul;
|
||||||
} else {
|
} else {
|
||||||
etotal[2] += evdwl; etotal[3] += ecoul;
|
etotal[2] += evdwl;
|
||||||
|
etotal[3] += ecoul;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -133,4 +132,3 @@ void ComputePEMolTally::compute_vector()
|
|||||||
|
|
||||||
MPI_Allreduce(etotal, vector, size_vector, MPI_DOUBLE, MPI_SUM, world);
|
MPI_Allreduce(etotal, vector, size_vector, MPI_DOUBLE, MPI_SUM, world);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
// clang-format off
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||||
https://www.lammps.org/, Sandia National Laboratories
|
https://www.lammps.org/, Sandia National Laboratories
|
||||||
@ -15,26 +14,24 @@
|
|||||||
#include "compute_pe_tally.h"
|
#include "compute_pe_tally.h"
|
||||||
|
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "group.h"
|
#include "comm.h"
|
||||||
#include "pair.h"
|
|
||||||
#include "update.h"
|
|
||||||
#include "memory.h"
|
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "force.h"
|
#include "force.h"
|
||||||
#include "comm.h"
|
#include "group.h"
|
||||||
|
#include "memory.h"
|
||||||
|
#include "pair.h"
|
||||||
|
#include "update.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
ComputePETally::ComputePETally(LAMMPS *lmp, int narg, char **arg) :
|
ComputePETally::ComputePETally(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg)
|
||||||
Compute(lmp, narg, arg)
|
|
||||||
{
|
{
|
||||||
if (narg < 4) error->all(FLERR, "Illegal compute pe/tally command");
|
if (narg < 4) error->all(FLERR, "Illegal compute pe/tally command");
|
||||||
|
|
||||||
igroup2 = group->find(arg[3]);
|
igroup2 = group->find(arg[3]);
|
||||||
if (igroup2 == -1)
|
if (igroup2 == -1) error->all(FLERR, "Could not find compute pe/tally second group ID");
|
||||||
error->all(FLERR,"Could not find compute pe/tally second group ID");
|
|
||||||
groupbit2 = group->bitmask[igroup2];
|
groupbit2 = group->bitmask[igroup2];
|
||||||
|
|
||||||
scalar_flag = 1;
|
scalar_flag = 1;
|
||||||
@ -75,8 +72,7 @@ void ComputePETally::init()
|
|||||||
if (force->pair->single_enable == 0 || force->pair->manybody_flag)
|
if (force->pair->single_enable == 0 || force->pair->manybody_flag)
|
||||||
error->warning(FLERR, "Compute pe/tally used with incompatible pair style");
|
error->warning(FLERR, "Compute pe/tally used with incompatible pair style");
|
||||||
|
|
||||||
if (force->bond || force->angle || force->dihedral
|
if (force->bond || force->angle || force->dihedral || force->improper || force->kspace)
|
||||||
|| force->improper || force->kspace)
|
|
||||||
error->warning(FLERR, "Compute pe/tally only called from pair style");
|
error->warning(FLERR, "Compute pe/tally only called from pair style");
|
||||||
}
|
}
|
||||||
did_setup = -1;
|
did_setup = -1;
|
||||||
@ -104,8 +100,7 @@ void ComputePETally::pair_setup_callback(int, int)
|
|||||||
|
|
||||||
// clear storage
|
// clear storage
|
||||||
|
|
||||||
for (int i=0; i < ntotal; ++i)
|
for (int i = 0; i < ntotal; ++i) eatom[i][0] = eatom[i][1] = 0.0;
|
||||||
eatom[i][0] = eatom[i][1] = 0.0;
|
|
||||||
|
|
||||||
vector[0] = etotal[0] = vector[1] = etotal[1] = 0.0;
|
vector[0] = etotal[0] = vector[1] = etotal[1] = 0.0;
|
||||||
|
|
||||||
@ -113,23 +108,27 @@ void ComputePETally::pair_setup_callback(int, int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
void ComputePETally::pair_tally_callback(int i, int j, int nlocal, int newton,
|
void ComputePETally::pair_tally_callback(int i, int j, int nlocal, int newton, double evdwl,
|
||||||
double evdwl, double ecoul, double,
|
double ecoul, double, double, double, double)
|
||||||
double, double, double)
|
|
||||||
{
|
{
|
||||||
const int *const mask = atom->mask;
|
const int *const mask = atom->mask;
|
||||||
|
|
||||||
if ( ((mask[i] & groupbit) && (mask[j] & groupbit2))
|
if (((mask[i] & groupbit) && (mask[j] & groupbit2)) ||
|
||||||
|| ((mask[i] & groupbit2) && (mask[j] & groupbit))) {
|
((mask[i] & groupbit2) && (mask[j] & groupbit))) {
|
||||||
|
|
||||||
evdwl *= 0.5; ecoul *= 0.5;
|
evdwl *= 0.5;
|
||||||
|
ecoul *= 0.5;
|
||||||
if (newton || i < nlocal) {
|
if (newton || i < nlocal) {
|
||||||
etotal[0] += evdwl; eatom[i][0] += evdwl;
|
etotal[0] += evdwl;
|
||||||
etotal[1] += ecoul; eatom[i][1] += ecoul;
|
eatom[i][0] += evdwl;
|
||||||
|
etotal[1] += ecoul;
|
||||||
|
eatom[i][1] += ecoul;
|
||||||
}
|
}
|
||||||
if (newton || j < nlocal) {
|
if (newton || j < nlocal) {
|
||||||
etotal[0] += evdwl; eatom[j][0] += evdwl;
|
etotal[0] += evdwl;
|
||||||
etotal[1] += ecoul; eatom[j][1] += ecoul;
|
eatom[j][0] += evdwl;
|
||||||
|
etotal[1] += ecoul;
|
||||||
|
eatom[j][1] += ecoul;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -168,8 +167,7 @@ void ComputePETally::unpack_reverse_comm(int n, int *list, double *buf)
|
|||||||
double ComputePETally::compute_scalar()
|
double ComputePETally::compute_scalar()
|
||||||
{
|
{
|
||||||
invoked_scalar = update->ntimestep;
|
invoked_scalar = update->ntimestep;
|
||||||
if ((did_setup != invoked_scalar)
|
if ((did_setup != invoked_scalar) || (update->eflag_global != invoked_scalar))
|
||||||
|| (update->eflag_global != invoked_scalar))
|
|
||||||
error->all(FLERR, "Energy was not tallied on needed timestep");
|
error->all(FLERR, "Energy was not tallied on needed timestep");
|
||||||
|
|
||||||
// sum accumulated energies across procs
|
// sum accumulated energies across procs
|
||||||
@ -185,8 +183,7 @@ double ComputePETally::compute_scalar()
|
|||||||
void ComputePETally::compute_peratom()
|
void ComputePETally::compute_peratom()
|
||||||
{
|
{
|
||||||
invoked_peratom = update->ntimestep;
|
invoked_peratom = update->ntimestep;
|
||||||
if ((did_setup != invoked_peratom)
|
if ((did_setup != invoked_peratom) || (update->eflag_global != invoked_peratom))
|
||||||
|| (update->eflag_global != invoked_peratom))
|
|
||||||
error->all(FLERR, "Energy was not tallied on needed timestep");
|
error->all(FLERR, "Energy was not tallied on needed timestep");
|
||||||
|
|
||||||
// collect contributions from ghost atoms
|
// collect contributions from ghost atoms
|
||||||
@ -196,8 +193,7 @@ void ComputePETally::compute_peratom()
|
|||||||
|
|
||||||
// clear out ghost atom data after it has been collected to local atoms
|
// clear out ghost atom data after it has been collected to local atoms
|
||||||
const int nall = atom->nlocal + atom->nghost;
|
const int nall = atom->nlocal + atom->nghost;
|
||||||
for (int i = atom->nlocal; i < nall; ++i)
|
for (int i = atom->nlocal; i < nall; ++i) eatom[i][0] = eatom[i][1] = 0.0;
|
||||||
eatom[i][0] = eatom[i][1] = 0.0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,7 +203,6 @@ void ComputePETally::compute_peratom()
|
|||||||
|
|
||||||
double ComputePETally::memory_usage()
|
double ComputePETally::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = (nmax < 0) ? 0 : nmax*size_peratom_cols * sizeof(double);
|
double bytes = (nmax < 0) ? 0 : nmax * (double)size_peratom_cols * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
// clang-format off
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||||
https://www.lammps.org/, Sandia National Laboratories
|
https://www.lammps.org/, Sandia National Laboratories
|
||||||
@ -15,27 +14,25 @@
|
|||||||
#include "compute_stress_tally.h"
|
#include "compute_stress_tally.h"
|
||||||
|
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "group.h"
|
|
||||||
#include "pair.h"
|
|
||||||
#include "update.h"
|
|
||||||
#include "memory.h"
|
|
||||||
#include "error.h"
|
|
||||||
#include "force.h"
|
|
||||||
#include "comm.h"
|
#include "comm.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
|
#include "error.h"
|
||||||
|
#include "force.h"
|
||||||
|
#include "group.h"
|
||||||
|
#include "memory.h"
|
||||||
|
#include "pair.h"
|
||||||
|
#include "update.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
ComputeStressTally::ComputeStressTally(LAMMPS *lmp, int narg, char **arg) :
|
ComputeStressTally::ComputeStressTally(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg)
|
||||||
Compute(lmp, narg, arg)
|
|
||||||
{
|
{
|
||||||
if (narg < 4) error->all(FLERR, "Illegal compute stress/tally command");
|
if (narg < 4) error->all(FLERR, "Illegal compute stress/tally command");
|
||||||
|
|
||||||
igroup2 = group->find(arg[3]);
|
igroup2 = group->find(arg[3]);
|
||||||
if (igroup2 == -1)
|
if (igroup2 == -1) error->all(FLERR, "Could not find compute stress/tally second group ID");
|
||||||
error->all(FLERR,"Could not find compute stress/tally second group ID");
|
|
||||||
groupbit2 = group->bitmask[igroup2];
|
groupbit2 = group->bitmask[igroup2];
|
||||||
|
|
||||||
scalar_flag = 1;
|
scalar_flag = 1;
|
||||||
@ -78,8 +75,7 @@ void ComputeStressTally::init()
|
|||||||
if (force->pair->single_enable == 0 || force->pair->manybody_flag)
|
if (force->pair->single_enable == 0 || force->pair->manybody_flag)
|
||||||
error->warning(FLERR, "Compute stress/tally used with incompatible pair style");
|
error->warning(FLERR, "Compute stress/tally used with incompatible pair style");
|
||||||
|
|
||||||
if (force->bond || force->angle || force->dihedral
|
if (force->bond || force->angle || force->dihedral || force->improper || force->kspace)
|
||||||
|| force->improper || force->kspace)
|
|
||||||
error->warning(FLERR, "Compute stress/tally only called from pair style");
|
error->warning(FLERR, "Compute stress/tally only called from pair style");
|
||||||
}
|
}
|
||||||
did_setup = -1;
|
did_setup = -1;
|
||||||
@ -108,24 +104,21 @@ void ComputeStressTally::pair_setup_callback(int, int)
|
|||||||
// clear storage
|
// clear storage
|
||||||
|
|
||||||
for (int i = 0; i < ntotal; ++i)
|
for (int i = 0; i < ntotal; ++i)
|
||||||
for (int j=0; j < size_peratom_cols; ++j)
|
for (int j = 0; j < size_peratom_cols; ++j) stress[i][j] = 0.0;
|
||||||
stress[i][j] = 0.0;
|
|
||||||
|
|
||||||
for (int i=0; i < size_peratom_cols; ++i)
|
for (int i = 0; i < size_peratom_cols; ++i) vector[i] = virial[i] = 0.0;
|
||||||
vector[i] = virial[i] = 0.0;
|
|
||||||
|
|
||||||
did_setup = update->ntimestep;
|
did_setup = update->ntimestep;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
void ComputeStressTally::pair_tally_callback(int i, int j, int nlocal, int newton,
|
void ComputeStressTally::pair_tally_callback(int i, int j, int nlocal, int newton, double, double,
|
||||||
double, double, double fpair,
|
double fpair, double dx, double dy, double dz)
|
||||||
double dx, double dy, double dz)
|
|
||||||
{
|
{
|
||||||
const int *const mask = atom->mask;
|
const int *const mask = atom->mask;
|
||||||
|
|
||||||
if ( ((mask[i] & groupbit) && (mask[j] & groupbit2))
|
if (((mask[i] & groupbit) && (mask[j] & groupbit2)) ||
|
||||||
|| ((mask[i] & groupbit2) && (mask[j] & groupbit))) {
|
((mask[i] & groupbit2) && (mask[j] & groupbit))) {
|
||||||
|
|
||||||
fpair *= 0.5;
|
fpair *= 0.5;
|
||||||
const double v0 = dx * dx * fpair;
|
const double v0 = dx * dx * fpair;
|
||||||
@ -136,20 +129,32 @@ void ComputeStressTally::pair_tally_callback(int i, int j, int nlocal, int newto
|
|||||||
const double v5 = dy * dz * fpair;
|
const double v5 = dy * dz * fpair;
|
||||||
|
|
||||||
if (newton || i < nlocal) {
|
if (newton || i < nlocal) {
|
||||||
virial[0] += v0; stress[i][0] += v0;
|
virial[0] += v0;
|
||||||
virial[1] += v1; stress[i][1] += v1;
|
stress[i][0] += v0;
|
||||||
virial[2] += v2; stress[i][2] += v2;
|
virial[1] += v1;
|
||||||
virial[3] += v3; stress[i][3] += v3;
|
stress[i][1] += v1;
|
||||||
virial[4] += v4; stress[i][4] += v4;
|
virial[2] += v2;
|
||||||
virial[5] += v5; stress[i][5] += v5;
|
stress[i][2] += v2;
|
||||||
|
virial[3] += v3;
|
||||||
|
stress[i][3] += v3;
|
||||||
|
virial[4] += v4;
|
||||||
|
stress[i][4] += v4;
|
||||||
|
virial[5] += v5;
|
||||||
|
stress[i][5] += v5;
|
||||||
}
|
}
|
||||||
if (newton || j < nlocal) {
|
if (newton || j < nlocal) {
|
||||||
virial[0] += v0; stress[j][0] += v0;
|
virial[0] += v0;
|
||||||
virial[1] += v1; stress[j][1] += v1;
|
stress[j][0] += v0;
|
||||||
virial[2] += v2; stress[j][2] += v2;
|
virial[1] += v1;
|
||||||
virial[3] += v3; stress[j][3] += v3;
|
stress[j][1] += v1;
|
||||||
virial[4] += v4; stress[j][4] += v4;
|
virial[2] += v2;
|
||||||
virial[5] += v5; stress[j][5] += v5;
|
stress[j][2] += v2;
|
||||||
|
virial[3] += v3;
|
||||||
|
stress[j][3] += v3;
|
||||||
|
virial[4] += v4;
|
||||||
|
stress[j][4] += v4;
|
||||||
|
virial[5] += v5;
|
||||||
|
stress[j][5] += v5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -196,8 +201,7 @@ void ComputeStressTally::unpack_reverse_comm(int n, int *list, double *buf)
|
|||||||
double ComputeStressTally::compute_scalar()
|
double ComputeStressTally::compute_scalar()
|
||||||
{
|
{
|
||||||
invoked_scalar = update->ntimestep;
|
invoked_scalar = update->ntimestep;
|
||||||
if ((did_setup != invoked_scalar)
|
if ((did_setup != invoked_scalar) || (update->eflag_global != invoked_scalar))
|
||||||
|| (update->eflag_global != invoked_scalar))
|
|
||||||
error->all(FLERR, "Energy was not tallied on needed timestep");
|
error->all(FLERR, "Energy was not tallied on needed timestep");
|
||||||
|
|
||||||
// sum accumulated forces across procs
|
// sum accumulated forces across procs
|
||||||
@ -217,8 +221,7 @@ double ComputeStressTally::compute_scalar()
|
|||||||
void ComputeStressTally::compute_peratom()
|
void ComputeStressTally::compute_peratom()
|
||||||
{
|
{
|
||||||
invoked_peratom = update->ntimestep;
|
invoked_peratom = update->ntimestep;
|
||||||
if ((did_setup != invoked_peratom)
|
if ((did_setup != invoked_peratom) || (update->eflag_global != invoked_peratom))
|
||||||
|| (update->eflag_global != invoked_peratom))
|
|
||||||
error->all(FLERR, "Energy was not tallied on needed timestep");
|
error->all(FLERR, "Energy was not tallied on needed timestep");
|
||||||
|
|
||||||
// collect contributions from ghost atoms
|
// collect contributions from ghost atoms
|
||||||
@ -228,8 +231,7 @@ void ComputeStressTally::compute_peratom()
|
|||||||
|
|
||||||
const int nall = atom->nlocal + atom->nghost;
|
const int nall = atom->nlocal + atom->nghost;
|
||||||
for (int i = atom->nlocal; i < nall; ++i)
|
for (int i = atom->nlocal; i < nall; ++i)
|
||||||
for (int j = 0; j < size_peratom_cols; ++j)
|
for (int j = 0; j < size_peratom_cols; ++j) stress[i][j] = 0.0;
|
||||||
stress[i][j] = 0.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert to stress*volume units = -pressure*volume
|
// convert to stress*volume units = -pressure*volume
|
||||||
@ -251,7 +253,6 @@ void ComputeStressTally::compute_peratom()
|
|||||||
|
|
||||||
double ComputeStressTally::memory_usage()
|
double ComputeStressTally::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = (nmax < 0) ? 0 : nmax*size_peratom_cols * sizeof(double);
|
double bytes = (nmax < 0) ? 0 : nmax * (double)size_peratom_cols * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -50,7 +50,7 @@ CUB_URL="https://github.com/NVlabs/cub/archive/1.12.0.tar.gz"
|
|||||||
KOKKOS_URL="https://github.com/kokkos/kokkos/archive/3.4.01.tar.gz"
|
KOKKOS_URL="https://github.com/kokkos/kokkos/archive/3.4.01.tar.gz"
|
||||||
KIM_URL="https://s3.openkim.org/kim-api/kim-api-2.2.1.txz"
|
KIM_URL="https://s3.openkim.org/kim-api/kim-api-2.2.1.txz"
|
||||||
MSCG_URL="https://github.com/uchicago-voth/MSCG-release/archive/1.7.3.1.tar.gz"
|
MSCG_URL="https://github.com/uchicago-voth/MSCG-release/archive/1.7.3.1.tar.gz"
|
||||||
PLUMED_URL="https://github.com/plumed/plumed2/releases/download/v2.7.1/plumed-src-2.7.1.tgz"
|
PLUMED_URL="https://github.com/plumed/plumed2/releases/download/v2.7.2/plumed-src-2.7.2.tgz"
|
||||||
PACELIB_URL="https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.4.9.tar.gz"
|
PACELIB_URL="https://github.com/ICAMS/lammps-user-pace/archive/refs/tags/v.2021.4.9.tar.gz"
|
||||||
LATTE_URL="https://github.com/lanl/LATTE/archive/v1.2.2.tar.gz"
|
LATTE_URL="https://github.com/lanl/LATTE/archive/v1.2.2.tar.gz"
|
||||||
SCAFACOS_URL="https://github.com/scafacos/scafacos/releases/download/v1.0.1/scafacos-1.0.1.tar.gz"
|
SCAFACOS_URL="https://github.com/scafacos/scafacos/releases/download/v1.0.1/scafacos-1.0.1.tar.gz"
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
lammps_version: 2 Jul 2021
|
lammps_version: 2 Jul 2021
|
||||||
date_generated: Wed Jul 21 15:49:45 2021
|
date_generated: Wed Jul 21 15:49:45 2021
|
||||||
epsilon: 1e-11
|
epsilon: 2e-11
|
||||||
prerequisites: ! |
|
prerequisites: ! |
|
||||||
pair reaxff
|
pair reaxff
|
||||||
fix qeq/reaxff
|
fix qeq/reaxff
|
||||||
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
lammps_version: 2 Jul 2021
|
lammps_version: 2 Jul 2021
|
||||||
date_generated: Wed Jul 21 15:49:47 2021
|
date_generated: Wed Jul 21 15:49:47 2021
|
||||||
epsilon: 1e-12
|
epsilon: 3e-12
|
||||||
prerequisites: ! |
|
prerequisites: ! |
|
||||||
pair reaxff
|
pair reaxff
|
||||||
fix qeq/reaxff
|
fix qeq/reaxff
|
||||||
@ -281,7 +281,6 @@ TEST_F(FileOperationsTest, error_message_warn)
|
|||||||
|
|
||||||
TEST_F(FileOperationsTest, error_all_one)
|
TEST_F(FileOperationsTest, error_all_one)
|
||||||
{
|
{
|
||||||
char buf[64];
|
|
||||||
BEGIN_HIDE_OUTPUT();
|
BEGIN_HIDE_OUTPUT();
|
||||||
command("echo none");
|
command("echo none");
|
||||||
command("log none");
|
command("log none");
|
||||||
|
|||||||
@ -94,7 +94,8 @@ TEST(Tokenizer, copy_constructor)
|
|||||||
|
|
||||||
TEST(Tokenizer, move_constructor)
|
TEST(Tokenizer, move_constructor)
|
||||||
{
|
{
|
||||||
Tokenizer u = std::move(Tokenizer("test new word ", " "));
|
Tokenizer t("test new word ", " ");
|
||||||
|
Tokenizer u = std::move(t);
|
||||||
ASSERT_THAT(u.next(), Eq("test"));
|
ASSERT_THAT(u.next(), Eq("test"));
|
||||||
ASSERT_THAT(u.next(), Eq("new"));
|
ASSERT_THAT(u.next(), Eq("new"));
|
||||||
ASSERT_THAT(u.next(), Eq("word"));
|
ASSERT_THAT(u.next(), Eq("word"));
|
||||||
@ -248,7 +249,8 @@ TEST(ValueTokenizer, copy_constructor)
|
|||||||
|
|
||||||
TEST(ValueTokenizer, move_constructor)
|
TEST(ValueTokenizer, move_constructor)
|
||||||
{
|
{
|
||||||
ValueTokenizer u = std::move(ValueTokenizer(" test new word ", " "));
|
ValueTokenizer t(" test new word ", " ");
|
||||||
|
ValueTokenizer u = std::move(t);
|
||||||
ASSERT_THAT(u.next_string(), Eq("test"));
|
ASSERT_THAT(u.next_string(), Eq("test"));
|
||||||
ASSERT_THAT(u.next_string(), Eq("new"));
|
ASSERT_THAT(u.next_string(), Eq("new"));
|
||||||
ASSERT_THAT(u.next_string(), Eq("word"));
|
ASSERT_THAT(u.next_string(), Eq("word"));
|
||||||
|
|||||||
Reference in New Issue
Block a user