Skip to content

Commit

Permalink
Merge pull request lammps#4111 from akohlmey/collected-small-fixes
Browse files Browse the repository at this point in the history
Collected small fixes
  • Loading branch information
akohlmey authored Apr 3, 2024
2 parents a017a77 + 4c99249 commit 1529a61
Show file tree
Hide file tree
Showing 29 changed files with 547 additions and 936 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ src/bond.* @sjplimp
src/comm*.* @sjplimp
src/compute.* @sjplimp
src/dihedral.* @sjplimp
src/domain.* @sjplimp
src/domain.* @sjplimp @stanmoore1
src/dump*.* @sjplimp
src/error.* @sjplimp
src/finish.* @sjplimp
Expand Down
4 changes: 2 additions & 2 deletions doc/src/Developer_utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,10 @@ Tohoku University (under MIT license)

----------

.. doxygenfunction:: MathEigen::jacobi3(double const *const *mat, double *eval, double **evec)
.. doxygenfunction:: MathEigen::jacobi3(double const *const *mat, double *eval, double **evec, int sort)
:project: progguide

.. doxygenfunction:: MathEigen::jacobi3(double const mat[3][3], double *eval, double evec[3][3])
.. doxygenfunction:: MathEigen::jacobi3(double const mat[3][3], double *eval, double evec[3][3], int sort)
:project: progguide

---------------------------
Expand Down
51 changes: 40 additions & 11 deletions doc/src/Errors_details.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,44 @@ discussions of such cases.
Unknown identifier in data file
-------------------------------

This error happens when LAMMPS encounters a line of text in an unexpected format
while reading a data file. This is most commonly cause by inconsistent header and
section data. The header section informs LAMMPS how many entries or lines are expected in the
various sections (like Atoms, Masses, Pair Coeffs, *etc.*\ ) of the data file.
If there is a mismatch, LAMMPS will either keep reading beyond the end of a section
or stop reading before the section has ended.

Such a mismatch can happen unexpectedly when the first line of the data
is *not* a comment as required by the format. That would result in
LAMMPS expecting, for instance, 0 atoms because the "atoms" header line
is treated as a comment.
This error happens when LAMMPS encounters a line of text with an
unexpected keyword while :doc:`reading a data file <read_data>`. This
would be either header keywords or section header keywords. This is
most commonly due to a mistyped keyword or due to a keyword that is
inconsistent with the :doc:`atom style <atom_style>` used.

The header section informs LAMMPS how many entries or lines are expected
in the various sections (like Atoms, Masses, Pair Coeffs, *etc.*\ ) of
the data file. If there is a mismatch, LAMMPS will either keep reading
beyond the end of a section or stop reading before the section has
ended. In that case the next line will not contain a recognized keyword.

Such a mismatch can also happen when the first line of the data
is *not* a comment as required by the format, but a line with a valid
header keyword. That would result in LAMMPS expecting, for instance,
0 atoms because the "atoms" header line is the first line and thus
treated as a comment.

Another possibility to trigger this error is to have a keyword in the
data file that corresponds to a fix (e.g. :doc:`fix cmap <fix_cmap>`)
but the :doc:`read_data <read_data>` command is missing the (optional)
arguments that identify the fix and the header keyword and section
keyword or those arguments are inconsistent with the keywords in the
data file.

.. _err0002:

Incorrect format in ... section of data file
--------------------------------------------

This error happens when LAMMPS reads the contents of a section of a
:doc:`data file <read_data>` and the number of parameters in the line
differs from what is expected. This most commonly happens, when the
atom style is different from what is expected for a specific data file
since changing the atom style usually changes the format of the line.

This error can also happen when the number of entries indicated in the
header of a data file (e.g. the number of atoms) is larger than the
number of lines provided (e.g. in the corresponding Atoms section)
and then LAMMPS will continue reading into the next section and that
would have a completely different format.
1 change: 0 additions & 1 deletion doc/src/fix_ave_correlate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ Examples
fix 1 all ave/correlate 1 50 10000 &
c_thermo_press[1] c_thermo_press[2] c_thermo_press[3] &
type upper ave running title1 "My correlation data"
fix 1 all ave/correlate 1 50 10000 c_thermo_press[*]
Description
Expand Down
13 changes: 8 additions & 5 deletions doc/src/fix_ave_correlate_long.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ Syntax
.. parsed-literal::
c_ID = global scalar calculated by a compute with ID
c_ID[I] = Ith component of global vector calculated by a compute with ID
c_ID[I] = Ith component of global vector calculated by a compute with ID, I can include wildcard (see below)
f_ID = global scalar calculated by a fix with ID
f_ID[I] = Ith component of global vector calculated by a fix with ID
f_ID[I] = Ith component of global vector calculated by a fix with ID, I can include wildcard (see below)
v_name = global value calculated by an equal-style variable with name
v_name[I] = Ith component of global vector calculated by a vector-style variable with name
v_name[I] = Ith component of a vector-style variable with name, I can include wildcard (see below)
* zero or more keyword/arg pairs may be appended
* keyword = *type* or *start* or *file* or *overwrite* or *title1* or *title2* or *ncorr* or *nlen* or *ncount*
Expand Down Expand Up @@ -63,6 +63,7 @@ Examples
fix 1 all ave/correlate/long 1 10000 &
c_thermo_press[1] c_thermo_press[2] c_thermo_press[3] &
type upper title1 "My correlation data" nlen 15 ncount 3
fix 1 all ave/correlate/long 1 10000 c_thermo_press[*]
Description
"""""""""""
Expand All @@ -80,8 +81,10 @@ specified values may represent calculations performed by computes and
fixes which store their own "group" definitions.

Each listed value can be the result of a compute or fix or the
evaluation of an equal-style variable. See the
:doc:`fix ave/correlate <fix_ave_correlate>` page for details.
evaluation of an equal-style or vector-style variable. For
vector-style variables, the specified indices can include a wildcard
character. See the :doc:`fix ave/correlate <fix_ave_correlate>` page
for details.

The *Nevery* and *Nfreq* arguments specify on what time steps the input
values will be used to calculate correlation data and the frequency
Expand Down
75 changes: 38 additions & 37 deletions doc/src/fix_ttm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,23 +136,23 @@ transfer between the subsystems:
\bigtriangledown (\kappa_e \bigtriangledown T_e) -
g_p (T_e - T_a) + g_s T_a'
where C_e is the specific heat, rho_e is the density, kappa_e is the
thermal conductivity, T is temperature, the "e" and "a" subscripts
represent electronic and atomic subsystems respectively, g_p is the
coupling constant for the electron-ion interaction, and g_s is the
electron stopping coupling parameter. C_e, rho_e, and kappa_e are
specified as parameters to the fix. The other quantities are derived.
The form of the heat diffusion equation used here is almost the same
as that in equation 6 of :ref:`(Duffy) <Duffy>`, with the exception that the
electronic density is explicitly represented, rather than being part
of the specific heat parameter.
where :math:`C_e` is the specific heat, :math:`\rho_e` is the density,
:math:`\kappa_e` is the thermal conductivity, *T* is temperature, the
"e" and "a" subscripts represent electronic and atomic subsystems
respectively, :math:`g_p` is the coupling constant for the electron-ion
interaction, and :math:`g_s` is the electron stopping coupling
parameter. :math:`C_e`, :math:`\rho_e`, and :math:`\kappa_e` are
specified as parameters to the fix *ttm* or *ttm/grid*. The other
quantities are derived. The form of the heat diffusion equation used
here is almost the same as that in equation 6 of :ref:`(Duffy) <Duffy>`,
with the exception that the electronic density is explicitly
represented, rather than being part of the specific heat parameter.

Currently, the TTM fixes assume that none of the user-supplied
parameters will vary with temperature. Note that :ref:`(Duffy)
<Duffy>` used a tanh() functional form for the temperature dependence
of the electronic specific heat, but ignored temperature dependencies
of any of the other parameters. See more discussion below for fix
ttm/mod.
parameters will vary with temperature. Note that :ref:`(Duffy) <Duffy>`
used a tanh() functional form for the temperature dependence of the
electronic specific heat, but ignored temperature dependencies of any of
the other parameters. See more discussion below for fix *ttm/mod*.

.. note::

Expand Down Expand Up @@ -265,41 +265,42 @@ heat sources (e.g. laser heating in ablation simulations):
\bigtriangledown (\kappa_e \bigtriangledown T_e) -
g_p (T_e - T_a) + g_s T_a' + \theta (x-x_{surface})I_0 \exp(-x/l_{skin})
where theta is the Heaviside step function, I_0 is the (absorbed)
laser pulse intensity for ablation simulations, l_skin is the depth
of skin-layer, and all other designations have the same meaning as in
the former equation. The duration of the pulse is set by the parameter
*tau* in the *init_file*.
where :math:`\theta` is the Heaviside step function, :math:`I_0` is the
(absorbed) laser pulse intensity for ablation simulations,
:math:`l_{skin}` is the depth of the skin-layer, and all other
designations have the same meaning as in the former equation. The
duration of the pulse is set by the parameter *tau* in the *init_file*.

Fix ttm/mod also allows users to specify the dependencies of C_e and
kappa_e on the electronic temperature. The specific heat is expressed
as
Fix *ttm/mod* also allows users to specify the dependencies of
:math:`C_e` and :math:`\kappa_e` on the electronic temperature. The
specific heat is expressed as

.. math::
C_e = C_0 + (a_0 + a_1 X + a_2 X^2 + a_3 X^3 + a_4 X^4) \exp (-(AX)^2)
where *X* = T_e/1000, and the thermal conductivity is defined as
kappa_e = D_e\*rho_e\*C_e, where D_e is the thermal diffusion
coefficient.
where :math:`X = \frac{T_e}{1000}`, and the thermal conductivity is
defined as :math:`\kappa_e = D_e \cdot rho_e \cdot C_e`, where
:math:`D_e` is the thermal diffusion coefficient.

Electronic pressure effects are included in the TTM model to account
for the blast force acting on ions because of electronic pressure
gradient (see :ref:`(Chen) <Chen>`, :ref:`(Norman) <Norman>`). The total force
Electronic pressure effects are included in the TTM model to account for
the blast force acting on ions because of electronic pressure gradient
(see :ref:`(Chen) <Chen>`, :ref:`(Norman) <Norman>`). The total force
acting on an ion is:

.. math::
{\vec F}_i = - \partial U / \partial {\vec r}_i + {\vec
F}_{langevin} - \nabla P_e/n_{ion}
where F_langevin is a force from Langevin thermostat simulating
electron-phonon coupling, and nabla P_e/n_ion is the electron blast
force.
where :math:`F_{langevin}` is a force from Langevin thermostat
simulating electron-phonon coupling, and :math:`\nabla P_e/n_{ion}` is
the electron blast force.

The electronic pressure is taken to be P_e = B\*rho_e\*C_e\*T_e
The electronic pressure is taken to be :math:`P_e = B \cdot rho_e \cdot
C_e \cdot T_e`

The current fix ttm/mod implementation allows TTM simulations with a
The current fix *ttm/mod* implementation allows TTM simulations with a
vacuum. The vacuum region is defined as the grid cells with zero
electronic temperature. The numerical scheme does not allow energy
exchange with such cells. Since the material can expand to previously
Expand All @@ -319,10 +320,10 @@ electronic pressure gradient is calculated as
\frac{x}{x+\lambda}\frac{(C_e{}T_e)_{x+\Delta
x}-(C_e{}T_e)_{x}}{\Delta x} \right]
where lambda is the electron mean free path (see :ref:`(Norman) <Norman>`,
:ref:`(Pisarev) <Pisarev>`)
where :math:`\lambda` is the electron mean free path (see :ref:`(Norman)
<Norman>`, :ref:`(Pisarev) <Pisarev>`)

The fix ttm/mod parameter file *init_file* has the following syntax.
The fix *ttm/mod* parameter file *init_file* has the following syntax.
Every line with an odd number is considered as a comment and
ignored. The lines with the even numbers are treated as follows:

Expand Down
31 changes: 31 additions & 0 deletions doc/src/variable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1174,12 +1174,17 @@ custom atom properties are the same; just replace the leading "i" with

+--------+---------------+------------------------------------------+
| equal | i_name[I] | element of per-atom vector (I = atom ID) |
+--------+---------------+------------------------------------------+
| equal | i2_name[I][J] | element of per-atom array (I = atom ID) |
+--------+---------------+------------------------------------------+
+--------+---------------+------------------------------------------+
| vector | i_name[I] | element of per-atom vector (I = atom ID) |
+--------+---------------+------------------------------------------+
| vector | i2_name[I][J] | element of per-atom array (I = atom ID) |
+--------+---------------+------------------------------------------+
+--------+---------------+------------------------------------------+
| atom | i_name | per-atom vector |
+--------+---------------+------------------------------------------+
| atom | i2_name[I] | column of per-atom array |
+--------+---------------+------------------------------------------+

Expand Down Expand Up @@ -1222,15 +1227,23 @@ table:

+--------+------------+------------------------------------------+
| equal | c_ID | global scalar |
+--------+------------+------------------------------------------+
| equal | c_ID[I] | element of global vector |
+--------+------------+------------------------------------------+
| equal | c_ID[I][J] | element of global array |
+--------+------------+------------------------------------------+
| equal | C_ID[I] | element of per-atom vector (I = atom ID) |
+--------+------------+------------------------------------------+
| equal | C_ID[I][J] | element of per-atom array (I = atom ID) |
+--------+------------+------------------------------------------+
+--------+------------+------------------------------------------+
| vector | c_ID | global vector |
+--------+------------+------------------------------------------+
| vector | c_ID[I] | column of global array |
+--------+------------+------------------------------------------+
+--------+------------+------------------------------------------+
| atom | c_ID | per-atom vector |
+--------+------------+------------------------------------------+
| atom | c_ID[I] | column of per-atom array |
+--------+------------+------------------------------------------+

Expand Down Expand Up @@ -1286,15 +1299,23 @@ and atom-style variables are listed in the following table:

+--------+------------+------------------------------------------+
| equal | f_ID | global scalar |
+--------+------------+------------------------------------------+
| equal | f_ID[I] | element of global vector |
+--------+------------+------------------------------------------+
| equal | f_ID[I][J] | element of global array |
+--------+------------+------------------------------------------+
| equal | F_ID[I] | element of per-atom vector (I = atom ID) |
+--------+------------+------------------------------------------+
| equal | F_ID[I][J] | element of per-atom array (I = atom ID) |
+--------+------------+------------------------------------------+
+--------+------------+------------------------------------------+
| vector | f_ID | global vector |
+--------+------------+------------------------------------------+
| vector | f_ID[I] | column of global array |
+--------+------------+------------------------------------------+
+--------+------------+------------------------------------------+
| atom | f_ID | per-atom vector |
+--------+------------+------------------------------------------+
| atom | f_ID[I] | column of per-atom array |
+--------+------------+------------------------------------------+

Expand Down Expand Up @@ -1365,17 +1386,27 @@ per-atom vector.

+--------+-----------+-----------------------------------------------------------------------------------+
| equal | v_name | global scalar from an equal-style variable |
+--------+-----------+-----------------------------------------------------------------------------------+
| equal | v_name[I] | element of global vector from a vector-style variable |
+--------+-----------+-----------------------------------------------------------------------------------+
| equal | v_name[I] | element of per-atom vector (I = atom ID) from an atom- or atomfile-style variable |
+--------+-----------+-----------------------------------------------------------------------------------+
+--------+-----------+-----------------------------------------------------------------------------------+
| vector | v_name | global scalar from an equal-style variable |
+--------+-----------+-----------------------------------------------------------------------------------+
| vector | v_name | global vector from a vector-style variable |
+--------+-----------+-----------------------------------------------------------------------------------+
| vector | v_name[I] | element of global vector from a vector-style variable |
+--------+-----------+-----------------------------------------------------------------------------------+
| vector | v_name[I] | element of per-atom vector (I = atom ID) from an atom- or atomfile-style variable |
+--------+-----------+-----------------------------------------------------------------------------------+
+--------+-----------+-----------------------------------------------------------------------------------+
| atom | v_name | global scalar from an equal-style variable |
+--------+-----------+-----------------------------------------------------------------------------------+
| atom | v_name | per-atom vector from an atom-style or atomfile-style variable |
+--------+-----------+-----------------------------------------------------------------------------------+
| atom | v_name[I] | element of global vector from a vector-style variable |
+--------+-----------+-----------------------------------------------------------------------------------+
| atom | v_name[I] | element of per-atom vector (I = atom ID) from an atom- or atomfile-style variable |
+--------+-----------+-----------------------------------------------------------------------------------+

Expand Down
5 changes: 4 additions & 1 deletion lib/gpu/lal_base_amoeba.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@

//#define ASYNC_DEVICE_COPY

#if 0
#if !defined(USE_OPENCL) && !defined(USE_HIP)
// temporary workaround for int2 also defined in cufft
#ifdef int2
#undef int2
#endif
#include "cufft.h"
#endif
#endif

namespace LAMMPS_AL {

Expand Down Expand Up @@ -313,10 +315,11 @@ class BaseAmoeba {
virtual int fphi_mpole();
virtual int polar_real(const int eflag, const int vflag) = 0;


#if 0
#if !defined(USE_OPENCL) && !defined(USE_HIP)
cufftHandle plan;
#endif
#endif
bool fft_plan_created;
};

Expand Down
6 changes: 4 additions & 2 deletions src/BODY/body_rounded_polyhedron.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,9 @@ int BodyRoundedPolyhedron::nedges(AtomVecBody::Bonus *bonus)
{
int nvertices = bonus->ivalue[0];
int nedges = bonus->ivalue[1];
//int nfaces = bonus->ivalue[2];
if (nvertices == 1) return 0;
else if (nvertices == 2) return 1;
return nedges; //(nvertices+nfaces-2); // Euler formula: V-E+F=2
return nedges;
}

/* ---------------------------------------------------------------------- */
Expand All @@ -116,6 +115,9 @@ double *BodyRoundedPolyhedron::edges(AtomVecBody::Bonus *bonus)

int BodyRoundedPolyhedron::nfaces(AtomVecBody::Bonus *bonus)
{
int nvertices = bonus->ivalue[0];
if (nvertices < 3) return 0;

return bonus->ivalue[2];
}

Expand Down
Loading

0 comments on commit 1529a61

Please sign in to comment.