Merge pull request #3020 from akohlmey/collected-small-changes

Collected small changes and fixes
This commit is contained in:
Axel Kohlmeyer
2021-11-17 14:00:13 -05:00
committed by GitHub
22 changed files with 121 additions and 77 deletions

View File

@ -48,7 +48,6 @@ set(ALL_PACKAGES
PHONON
PLUGIN
POEMS
PYTHON
QEQ
REACTION
REAXFF

View File

@ -141,7 +141,8 @@ unrelated feature, you should switch branches!
Committing changes to the *develop*, *release*, or *stable* branches
is strongly discouraged. While it may be convenient initially, it
will create more work in the long run. Various texts and tutorials
on using git effectively discuss the motivation for this.
on using git effectively discuss the motivation for using feature
branches instead.
**After changes are made**

View File

@ -28,8 +28,9 @@ provides `limited support for subversion clients <svn_>`_.
You can follow the LAMMPS development on 3 different git branches:
* **stable** : this branch is updated with every stable release;
updates are always "fast forward" merges from *develop*
* **stable** : this branch is updated from the *release* branch with
every stable release version and also has selected bug fixes and updates
back-ported from the *develop* branch
* **release** : this branch is updated with every patch release;
updates are always "fast forward" merges from *develop*
* **develop** : this branch follows the ongoing development and
@ -47,20 +48,22 @@ your machine and "release" is one of the 3 branches listed above.
(Note that you actually download all 3 branches; you can switch
between them at any time using "git checkout <branch name>".)
.. note::
.. admonition:: Saving time and disk space when using ``git clone``
The complete git history of the LAMMPS project is quite large because
it contains the entire commit history of the project since fall 2006,
which includes the time when LAMMPS was managed with subversion. This
also includes commits that have added and removed some large files
(mostly by accident). If you do not need access to the entire commit
history, you can speed up the "cloning" process and reduce local disk
space requirements by using the *--depth* git command line flag thus
create a "shallow clone" of the repository that contains only a
subset of the git history. Using a depth of 1000 is usually sufficient
to include the head commits of the *develop* and the *release* branches.
To include the head commit of the *stable* branch you may need a depth
of up to 10000.
which includes the time when LAMMPS was managed with subversion.
This includes a few commits that have added and removed some large
files (mostly by accident). If you do not need access to the entire
commit history (most people don't), you can speed up the "cloning"
process and reduce local disk space requirements by using the
*--depth* git command line flag. That will create a "shallow clone"
of the repository containing only a subset of the git history. Using
a depth of 1000 is usually sufficient to include the head commits of
the *develop* and the *release* branches. To include the head commit
of the *stable* branch you may need a depth of up to 10000. If you
later need more of the git history, you can always convert the
shallow clone into a "full clone".
Once the command completes, your directory will contain the same files
as if you unpacked a current LAMMPS tarball, with the exception, that

View File

@ -10,23 +10,31 @@ Whenever we fix a bug or update or add a feature, it will be merged into
the *develop* branch of the git repository. When a sufficient number of
changes have accumulated *and* the software passes a set of automated
tests, we release it in the next *patch* release, which are made every
few weeks. Info on patch releases are on `this website page
few weeks. The *release* branch of the git repository is updated with
every such release. Info on patch releases are on `this website page
<https://www.lammps.org/bug.html>`_.
Once or twice a year, only bug fixes and small, non-intrusive changes are
included for a period of time, and the code is subjected to more detailed
Once or twice a year, we apply only bug fixes and small, non-intrusive
changes to the *develop* branch and the code is subjected to more detailed
and thorough testing than the default automated testing. The latest
patch release after such a period is then labeled as a *stable* version.
patch release after such a period is then also labeled as a *stable* version
and the *stable* branch is updated with it. Between stable releases
we occasionally release some updates to the stable release containing
only bug fixes and updates back-ported from *develop* but no new features
and update the *stable* branch accordingly.
Each version of LAMMPS contains all the features and bug-fixes up to
and including its version date.
Each version of LAMMPS contains all the documented features up to and
including its version date.
The version date is printed to the screen and logfile every time you
run LAMMPS. It is also in the file src/version.h and in the LAMMPS
directory name created when you unpack a tarball. And it is on the
first page of the :doc:`manual <Manual>`.
* If you browse the HTML pages on the LAMMPS WWW site, they always
describe the most current patch release of LAMMPS.
* If you browse the HTML pages on the LAMMPS WWW site, they will by
default describe the most current patch release version of LAMMPS.
In the navigation bar on the bottom left, there is the option to
view instead the documentation for the most recent *stable* version
or the latest version from the current development branch.
* If you browse the HTML pages included in your tarball, they
describe the version you have, which may be older.

View File

@ -710,7 +710,9 @@ default and it can be disabled with the :code:`checksum` keyword.
Restrictions
""""""""""""
none
Not all *dump_modify* options can be applied to all dump styles.
Details are in the discussions of the individual options.
Related commands
""""""""""""""""

View File

@ -205,7 +205,7 @@ For *damping mass_velocity*, the normal damping is given by:
\eta_n = \eta_{n0} m_{eff}
Here, :math:`\eta_{n0}` is the damping coefficient specified for the normal
contact model, in units of *mass*\ /\ *time* and
contact model, in units of 1/\ *time* and
:math:`m_{eff} = m_i m_j/(m_i + m_j)` is the effective mass.
Use *damping mass_velocity* to reproduce the damping behavior of
*pair gran/hooke/\**.

View File

@ -26,15 +26,29 @@ Examples
Description
"""""""""""
The *lebedeva/z* style computes the Lebedeva interaction
potential as described in :ref:`(Lebedeva et al.) <Leb01>`. An important simplification is made,
which is to take all normals along the z-axis.
The *lebedeva/z* pair style computes the Lebedeva interaction potential
as described in :ref:`(Lebedeva1) <Leb01>` and :ref:`(Lebedeva2)
<Leb02>`. An important simplification is made, which is to take all
normals along the z-axis.
The Lebedeva potential is intended for the description of the interlayer
interaction between graphene layers. To perform a realistic simulation,
this potential must be used in combination with an intralayer potential
such as :doc:`AIREBO <pair_airebo>` or :doc:`Tersoff <pair_tersoff>`
facilitated by using pair style :doc:`hybrid/overlay <pair_hybrid>`. To
keep the intralayer properties unaffected, the interlayer interaction
within the same layers should be avoided. This can be achieved by
assigning different atom types to atoms of different layers (e.g. 1 and
2 in the examples above).
Other interactions can be set to zero using pair_style *none*\ .
.. math::
E = & \frac{1}{2} \sum_i \sum_{i \neq j} V_{ij}\\
E = & \frac{1}{2} \sum_i \sum_{j \neq i} V_{ij}\\
V_{ij} = & B e^{-\alpha(r_{ij} - z_0)} \\
& + C(1 + D_1\rho^2_{ij} + D_2\rho^4_{ij} e^{-\lambda_1\rho^2_{ij}} e^{-\lambda_2 (z^2_{ij} - z^2_0)} \\
& + C(1 + D_1\rho^2_{ij} + D_2\rho^4_{ij}) e^{-\lambda_1\rho^2_{ij}} e^{-\lambda_2 (z^2_{ij} - z^2_0)} \\
& - A \left(\frac{z_0}{r_ij}\right)^6 + A \left( \frac{z_0}{r_c} \right)^6 \\
\rho^2_{ij} = & x^2_{ij} + y^2_{ij} \qquad (\mathbf{n_i} \equiv \mathbf{\hat{z}})
@ -43,12 +57,15 @@ Energies are shifted so that they go continuously to zero at the cutoff assuming
that the exponential part of :math:`V_{ij}` (first term) decays sufficiently fast.
This shift is achieved by the last term in the equation for :math:`V_{ij}` above.
The parameter file (e.g. CC.Lebedeva), is intended for use with metal
:doc:`units <units>`, with energies in meV. An additional parameter, *S*,
is available to facilitate scaling of energies.
The provided parameter file (CC.Lebedeva) contains two sets of parameters.
This potential must be used in combination with hybrid/overlay.
Other interactions can be set to zero using pair_style *none*\ .
- The first set (element name "C") is suitable for normal conditions and
is taken from :ref:`(Popov1) <Popov>`
- The second set (element name "C1") is suitable for high-pressure
conditions and is taken from :ref:`(Koziol1) <Koziol>`
Both sets contain an additional parameter, *S*, that can be used to
facilitate scaling of energies and is set to 1.0 by default.
Restrictions
""""""""""""
@ -77,4 +94,16 @@ none
.. _Leb01:
**(Lebedeva et al.)** I. V. Lebedeva, A. A. Knizhnik, A. M. Popov, Y. E. Lozovik, B. V. Potapkin, Phys. Rev. B, 84, 245437 (2011)
**(Lebedeva1)** I. V. Lebedeva, A. A. Knizhnik, A. M. Popov, Y. E. Lozovik, B. V. Potapkin, Phys. Rev. B, 84, 245437 (2011)
.. _Leb02:
**(Lebedeva2)** I. V. Lebedeva, A. A. Knizhnik, A. M. Popov, Y. E. Lozovik, B. V. Potapkin, Physica E: 44, 949-954 (2012)
.. _Popov:
**(Popov1)** A.M. Popov, I. V. Lebedeva, A. A. Knizhnik, Y. E. Lozovik and B. V. Potapkin, Chem. Phys. Lett. 536, 82-86 (2012).
.. _Koziol:
**(Koziol1)** Z. Koziol, G. Gawlik and J. Jagielski, Chinese Phys. B 28, 096101 (2019).

View File

@ -1125,6 +1125,7 @@ gaussian
gaussians
Gaussians
Gavhane
Gawlik
gayberne
gcc
gcmc
@ -1483,6 +1484,7 @@ Izz
Jacobsen
Jadhao
Jadhav
Jagielski
jagreat
Jahn
Jalalvand
@ -1609,6 +1611,7 @@ Koslowski
Kosovan
Koster
Kosztin
Koziol
Kp
kradius
Kraker

View File

@ -1,12 +1,13 @@
# DATE: 2018-11-28 UNITS: metal CONTRIBUTOR: Zbigniew Koziol softquake@gmail.com CITATION: Z. Koziol et al.: https://arxiv.org/abs/1803.05162
# DATE: 2021-11-04 UNITS: metal CONTRIBUTOR: Zbigniew Koziol softquake@gmail.com CITATION: Z. Koziol et al.: https://arxiv.org/abs/1803.05162
#
# Lebedeva Potential. https://doi.org/10.1016/j.physe.2011.07.018
# Lebedeva potential: https://doi.org/10.1039/C0CP02614J and https://doi.org/10.1016/j.physe.2011.07.018
# Parameters must be in this order as here, otherwise their values may be changed.
# Energies here are given in meV.
# The last one, S, is convenient for scaling the potential amplitude. S is a multiplication factor for A, B, C
# A B C z0 alpha D1 D2 lambda1 lambda2 S
# These are values according to Levedeva et al
#C C 10.510 11.6523.34 35.883 3.34 4.16 -0.86232 0.10049 0.48703 0.46445 1.0
# These are values according to Lebedeva et al.: https://doi.org/10.1016/j.cplett.2012.03.082
C C 10.510 11.652 29.5 3.34 4.16 -0.86232 0.10049 0.48703 0.46445 1.0
#
# These are values by Z. Koziol et al.: https://arxiv.org/abs/1803.05162
C C 14.558 21.204 1.8 3.198 4.16 -0.862 0.10049 0.6 0.4 1.0
C1 C1 14.558 21.204 1.8 3.198 4.16 -0.862 0.10049 0.6 0.4 1.0

View File

@ -89,9 +89,7 @@ void ComputeTempDrude::dof_compute()
int dim = domain->dimension;
int *drudetype = fix_drude->drudetype;
fix_dof = 0;
for (int i = 0; i < modify->nfix; i++)
fix_dof += modify->fix[i]->dof(igroup);
adjust_dof_fix();
bigint dof_core_loc = 0, dof_drude_loc = 0;
for (int i = 0; i < nlocal; i++) {

View File

@ -35,7 +35,6 @@ class ComputeTempDrude : public Compute {
int modify_param(int, char **);
private:
int fix_dof;
class FixDrude *fix_drude;
char *id_temp;
class Compute *temperature;

View File

@ -43,7 +43,6 @@ class ComputeTempRotate : public Compute {
double memory_usage();
private:
int fix_dof;
double tfactor, masstotal;
double **vbiasall; // stored velocity bias for all atoms
int maxbias; // size of vbiasall array

View File

@ -115,6 +115,7 @@ void AtomVecSMD::grow_pointers()
vfrac = atom->vfrac;
rmass = atom->rmass;
x0 = atom->x0;
x = atom->x;
radius = atom->radius;
contact_radius = atom->contact_radius;
molecule = atom->molecule;
@ -129,13 +130,11 @@ void AtomVecSMD::grow_pointers()
/* ----------------------------------------------------------------------
clear extra forces starting at atom N
nbytes = # of bytes to clear for a per-atom vector
NOTE: does f need to be re-cleared?
------------------------------------------------------------------------- */
void AtomVecSMD::force_clear(int n, size_t nbytes)
{
memset(&desph[n],0,nbytes);
memset(&f[n][0],0,3*nbytes);
}
/* ----------------------------------------------------------------------

View File

@ -53,7 +53,7 @@ ComputeSMDTriangleVertices::ComputeSMDTriangleVertices(LAMMPS *lmp, int narg, ch
/* ---------------------------------------------------------------------- */
ComputeSMDTriangleVertices::~ComputeSMDTriangleVertices() {
memory->sfree(outputVector);
memory->destroy(outputVector);
}
/* ---------------------------------------------------------------------- */

View File

@ -85,7 +85,8 @@ PairULSPH::PairULSPH(LAMMPS *lmp) :
PairULSPH::~PairULSPH() {
if (allocated) {
//printf("... deallocating\n");
memory->destroy(setflag);
memory->destroy(cutsq);
memory->destroy(Q1);
memory->destroy(rho0);
memory->destroy(eos);

View File

@ -569,10 +569,12 @@ void FixDeposit::pre_exchange()
// coord is new position of geometric center of mol, not COM
// FixShake::set_molecule stores shake info for molecule
if (mode == MOLECULE) {
if (rigidflag)
fixrigid->set_molecule(nlocalprev,maxtag_all,imol,coord,vnew,quat);
else if (shakeflag)
fixshake->set_molecule(nlocalprev,maxtag_all,imol,coord,vnew,quat);
}
success = 1;
break;

View File

@ -54,7 +54,7 @@ void Verlet::init()
bool do_time_integrate = false;
for (const auto &fix : modify->get_fix_list())
if (fix->time_integrate) do_time_integrate;
if (fix->time_integrate) do_time_integrate = true;
if (!do_time_integrate && (comm->me == 0))
error->warning(FLERR,"No fixes with time integration, atoms won't move");

View File

@ -0,0 +1 @@
../../unittest/.clang-format

View File

@ -10,8 +10,8 @@
#include "utils.h"
#include <cstring>
#include <iostream>
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
@ -342,14 +342,13 @@ static char *plugin_generator(const char *text, int state)
{
const char *subcmd[] = {"load", "unload", "list", "clear", nullptr};
const char *sub;
static std::size_t idx=0, len;
static std::size_t idx = 0, len;
if (!state) idx = 0;
len = strlen(text);
while ((sub = subcmd[idx]) != nullptr) {
++idx;
if (strncmp(text,sub,len) == 0)
return dupstring(sub);
if (strncmp(text, sub, len) == 0) return dupstring(sub);
}
return nullptr;
}
@ -358,13 +357,12 @@ static char *plugin_style_generator(const char *text, int state)
{
const char *styles[] = {"pair", "fix", "command", nullptr};
const char *s;
static std::size_t idx=0, len;
static std::size_t idx = 0, len;
if (!state) idx = 0;
len = strlen(text);
while ((s = styles[idx]) != nullptr) {
++idx;
if (strncmp(text,s,len) == 0)
return dupstring(s);
if (strncmp(text, s, len) == 0) return dupstring(s);
}
return nullptr;
}
@ -384,8 +382,7 @@ static char *plugin_name_generator(const char *text, int state)
lammps_plugin_name(idx, style, name, BUFLEN);
++idx;
if (words[2] == style) {
if (strncmp(name, words[3].c_str(), len) == 0)
return dupstring(name);
if (strncmp(name, words[3].c_str(), len) == 0) return dupstring(name);
}
}
return nullptr;
@ -527,9 +524,7 @@ static char **cmd_completion(const char *text, int start, int)
} else if (words.size() == 2) { // expand third word
// these commands have a group name as 3rd word
if ((words[0] == "fix")
|| (words[0] == "compute")
|| (words[0] == "dump")) {
if ((words[0] == "fix") || (words[0] == "compute") || (words[0] == "dump")) {
matches = rl_completion_matches(text, group_generator);
} else if (words[0] == "region") {
matches = rl_completion_matches(text, region_generator);
@ -736,7 +731,7 @@ int main(int argc, char **argv)
// switch to the user's documents directory.
auto curdir = platform::current_directory();
if (utils::strmatch(curdir,"[Ss]ystem32")) {
if (utils::strmatch(curdir, "[Ss]ystem32")) {
std::string docdir = getenv("HOMEDRIVE");
docdir += getenv("HOMEPATH");
docdir += "\\Documents";

View File

@ -54,6 +54,10 @@ if(BUILD_MPI)
set(MPI_TEST_NUM_PROCS 1)
set(MPI_TEST_WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
cmake_parse_arguments(MPI_TEST "" "NAME;NUM_PROCS;WORKING_DIRECTORY" "COMMAND" ${ARGN})
# Do not add test when oversubscribing
if(MPI_TEST_NUMPROCS GREATER MPIEXEC_MAX_NUMPROCS)
return()
endif()
list(GET MPI_TEST_COMMAND 0 EXECUTABLE)
list(REMOVE_AT MPI_TEST_COMMAND 0)
set(ARGS ${MPI_TEST_COMMAND})

View File

@ -246,7 +246,7 @@ TEST_F(GroupTest, Molecular)
ASSERT_DOUBLE_EQ(group->mass(group->find("half")), 40);
ASSERT_DOUBLE_EQ(group->mass(group->find("half"), domain->find_region("top")), 10);
ASSERT_NEAR(group->charge(group->find("top")), 0, 1.0e-14);
ASSERT_DOUBLE_EQ(group->charge(group->find("right"), domain->find_region("top")), 0);
ASSERT_NEAR(group->charge(group->find("right"), domain->find_region("top")), 0, 1.0e-14);
TEST_FAILURE(".*ERROR: Illegal group command.*", command("group three include xxx"););
}

View File

@ -14,7 +14,7 @@ post_commands: ! ""
input_file: in.bilayer
pair_style: hybrid/overlay lebedeva/z 16.0
pair_coeff: ! |
* * lebedeva/z CC.Lebedeva C C C
* * lebedeva/z CC.Lebedeva C1 C1 C1
extract: ! ""
natoms: 48
init_vdwl: 2360.887727742073