Unverified Commit 3f8efed1 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

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

Collected bug fixes and small updates
parents 5855d334 fc10e885
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ src/GPU/pair_vashishta_gpu.* @andeplane
src/KOKKOS/pair_vashishta_kokkos.*  @andeplane
src/MANYBODY/pair_vashishta_table.* @andeplane
src/MANYBODY/pair_atm.*             @sergeylishchuk
src/USER-MISC/fix_bond_react.*      @jrgissing
src/USER-REACTION/fix_bond_react.*  @jrgissing
src/USER-MISC/*_grem.*              @dstelter92
src/USER-MISC/compute_stress_mop*.* @RomainVermorel

+6 −13
Original line number Diff line number Diff line
@@ -49,22 +49,15 @@ include files provided with LAMMPS are included with double quotes

For headers declaring functions of the C-library, the corresponding
C++ versions should be included (examples: `#include <cstdlib>` or
`#include <cctypes>`).  However, these includes are limited to those defined
in the C++98 standard.  Some files thus must use the older style until
the minimum C++ standard requirement of LAMMPS is lifted to C++11 or
even beyond (examples: `#include <stdint.h>` versus `#include <cstdint>`
or `#include <inttypes.h>` versus `#include <cinttypes>`).
`#include <cctypes>` instead of `#include <stdlib.h>` or
`#include<ctypes.h>` ).

### C++ Standard Compliance

LAMMPS core files currently correspond to the C++98 standard. Files
requiring C++11 or later are only permitted in (optional) packages
and particularly packages that are not part of the list of commonly
used packages such as MOLECULE, KSPACE, MANYBODY, or RIGID.

Also, LAMMPS uses the C-style stdio library for I/O instead of iostreams.
Since using both at the same time can cause problems, iostreams should
be avoided where possible.
LAMMPS core files use standard conforming C++ compatible with the
C++11 standard, unless explicitly noted.  Also, LAMMPS uses the C-style
stdio library for I/O instead of iostreams.  Since using both at the
same time can cause problems, iostreams should be avoided where possible.

### Lean Header Files

+9 −9
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

compute stress/atom command
===========================

compute centroid/stress/atom command
====================================

@@ -223,15 +224,14 @@ The per-atom array values will be in pressure\*volume

Restrictions
""""""""""""
Currently, compute *centroid/stress/atom* does not support
pair styles with many-body interactions,
such as :doc:`Tersoff <pair_tersoff>`,
and LAMMPS will generate an error in such cases.
In principal, equivalent formulation
to that of angle, dihedral and improper contributions
in the virial :math:`W_{ab}` formula
can also be applied to the many-body pair styles,
and is planned in the future.

Currently (Spring 2020), compute *centroid/stress/atom* does not support
pair styles with many-body interactions, such as :doc:`Tersoff
<pair_tersoff>`, or pair styles with long-range Coulomb interactions.
LAMMPS will generate an error in such cases.  In principal, equivalent
formulation to that of angle, dihedral and improper contributions in the
virial :math:`W_{ab}` formula can also be applied to the many-body pair
styles, and is planned in the future.

Related commands
""""""""""""""""
+16 −16
Original line number Diff line number Diff line
@@ -47,16 +47,22 @@ and the specified geometric :doc:`region <region>` in order to have
energy added or subtracted to it.  If not specified, then the atoms in
the group are affected wherever they may move to.

Heat addition/subtraction is performed every N timesteps.  The *eflux*
parameter can be specified as a numeric constant or as a variable (see
below).  If it is a numeric constant or equal-style variable which
evaluates to a scalar value, then the *eflux* determines the change in
aggregate energy of the entire group of atoms per unit time, e.g. in
eV/psec for :doc:`metal units <units>`.  In this case it is an
"extensive" quantity, meaning its magnitude should be scaled with the
number of atoms in the group.  Note that since *eflux* has per-time
units (i.e. it is a flux), this means that a larger value of N will
add/subtract a larger amount of energy each time the fix is invoked.
Heat addition/subtraction is performed every N timesteps.

The *eflux* parameter can be specified as a numeric constant or as an
equal- or atom-style :doc:`variable <variable>`.  If the value is a
variable, it should be specified as v_name, where *name* is the variable
name.  In this case, the variable will be evaluated each timestep, and
its current value(s) used to determine the flux.

If *eflux* is a numeric constant or equal-style variable which evaluates
to a scalar value, then *eflux* determines the change in aggregate energy
of the entire group of atoms per unit time, e.g. in eV/psec for
:doc:`metal units <units>`.  In this case it is an "extensive" quantity,
meaning its magnitude should be scaled with the number of atoms in the
group.  Note that since *eflux* also has per-time units (i.e. it is a
flux), this means that a larger value of N will add/subtract a larger
amount of energy each time the fix is invoked.

.. note::

@@ -71,12 +77,6 @@ the energy flux for a single atom, again in units of energy per unit
time.  In this case, each value is an "intensive" quantity, which need
not be scaled with the number of atoms in the group.

As mentioned above, the *eflux* parameter can be specified as an
equal-style or atom_style :doc:`variable <variable>`.  If the value is a
variable, it should be specified as v_name, where name is the variable
name.  In this case, the variable will be evaluated each timestep, and
its value(s) used to determine the flux.

Equal-style variables can specify formulas with various mathematical
functions, and include :doc:`thermo_style <thermo_style>` command
keywords for the simulation box parameters and timestep and elapsed
+11 −4
Original line number Diff line number Diff line
@@ -430,11 +430,18 @@ void PairBuckLongCoulLong::write_data(FILE *fp)

void PairBuckLongCoulLong::write_data_all(FILE *fp)
{
  for (int i = 1; i <= atom->ntypes; i++)
    for (int j = i; j <= atom->ntypes; j++)
  for (int i = 1; i <= atom->ntypes; i++) {
    for (int j = i; j <= atom->ntypes; j++) {
      if (ewald_order & (1<<6)) {
      fprintf(fp,"%d %d %g %g\n",i,j,
              buck_a_read[i][j],buck_rho_read[i][j]);
      } else {
        fprintf(fp,"%d %d %g %g %g\n",i,j,
                buck_a_read[i][j],buck_rho_read[i][j],buck_c_read[i][j]);
      }
    }
  }
}

/* ----------------------------------------------------------------------
   compute pair interactions
Loading