Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
eac746f
Merge branch 'develop' of github.com:lammps/lammps into develop
Bibobu Apr 8, 2025
78fc90f
Merge branch 'develop' of github.com:lammps/lammps into develop
Bibobu Apr 24, 2025
b704866
Merge branch 'develop' of github.com:lammps/lammps into develop
Bibobu Apr 29, 2025
cc03f98
Merge branch 'fix-gauss' of github.com:martok/lammps into develop
Bibobu May 2, 2025
a30dc01
Merge branch 'develop' of github.com:lammps/lammps into develop
Bibobu May 20, 2025
398dacc
Merge branch 'develop' of github.com:lammps/lammps into develop
Bibobu Jun 2, 2025
dbbad88
Merge branch 'develop' of github.com:lammps/lammps into develop
Bibobu Jun 17, 2025
2fa0592
Added some variable to fix_nh
Bibobu Jul 1, 2025
9231add
Added the isochoric flag to fix_nh.h
Bibobu Aug 6, 2025
2c6ff10
Works better with ;
Bibobu Aug 6, 2025
1ef72cd
Added isochoric option in fix_nh.cpp
Bibobu Aug 6, 2025
5cb0dc8
Added documentation for fix_nh isochoric option
Bibobu Aug 6, 2025
f0d59fa
Added some details in isochoric keyword documentation
Bibobu Aug 6, 2025
6121037
Merge branch 'develop' of github.com:lammps/lammps into NPTisochoric
Bibobu Aug 6, 2025
01d6cca
Added isochoric default value to doc.
Bibobu Aug 6, 2025
1a0eb42
Merge branch 'develop' of github.com:lammps/lammps into NPTisochoric
Bibobu Sep 2, 2025
3706468
Merge branch 'develop' into NPTisochoric
akohlmey Nov 24, 2025
3b18baa
Merge branch 'develop' into NPTisochoric
akohlmey Feb 21, 2026
cd2d543
replace non-portable text logical operator with traditional one
akohlmey Feb 21, 2026
b0787a9
Merge branch 'NPTisochoric' of github.com:Bibobu/lammps into NPTisoch…
Bibobu Feb 23, 2026
11c9532
Added p_isoch array for isochoric option
Bibobu Feb 23, 2026
c4d2516
Refactored isochoric option to allow for dimension choice
Bibobu Feb 23, 2026
7c52c97
Rephrased the documentation of isochoric option according to changes.
Bibobu Feb 23, 2026
00eadbe
Typo
Bibobu Feb 23, 2026
a977271
Corrected periodic boundary check for isochoric dimensions
Bibobu Feb 23, 2026
ca277fe
Rephrased *isochoric* keyword explanation.
Bibobu Feb 25, 2026
356de88
Changed the algorithm to recompute scaling factor with regard to refe…
Bibobu Mar 2, 2026
f06ae1d
Added isochoric NPT option to the OPENMP nosé-hoover version.
Bibobu Mar 2, 2026
71f74c2
Merge branch 'NPTisochoric' of github.com:Bibobu/lammps into NPTisoch…
Bibobu Mar 2, 2026
41598ec
Merge branch 'develop' into NPTisochoric
Bibobu Mar 2, 2026
3d54eb7
Merge branch 'develop' into NPTisochoric
akohlmey Mar 3, 2026
877f898
Added falsy test file for isochoric npt option
Bibobu Mar 5, 2026
100c2e4
Merge branch 'NPTisochoric' of github.com:Bibobu/lammps into NPTisoch…
Bibobu Mar 5, 2026
7de590e
flush small values for stress or global scalars or vectors to zero to…
akohlmey Mar 5, 2026
7520387
update test reference
akohlmey Mar 5, 2026
b26822a
add label_map check for consistent type checks
jrgissing Mar 14, 2026
1899d3f
add rest of label_map check
jrgissing Mar 14, 2026
1df0be5
Add runtime check for type label consistency...
jrgissing Mar 14, 2026
ccda46b
move check to Modify::setup, must be after neighboring
jrgissing Mar 14, 2026
6e62141
copy/paste error
jrgissing Mar 14, 2026
f1a74fc
add verbose success to molecule 'check_types'
jrgissing Mar 14, 2026
a44868d
Update labelmap.rst
jrgissing Mar 14, 2026
7cf3b20
parse keyword/arg with syntax checks
jrgissing Mar 15, 2026
fe65ba6
bool->int due to old MPI version issues
jrgissing Mar 15, 2026
bf1ccfd
more old MPI issues
jrgissing Mar 15, 2026
87bdf45
ok, this is a STUBS issue
jrgissing Mar 15, 2026
6609f24
Fix typo in labelmap.rst regarding check_labels
jrgissing Mar 17, 2026
6cff77b
thanks, Copilot!
jrgissing Mar 18, 2026
7785a8c
Merge branch 'data_file_type_label_checks' of https://github.com/jrgi…
jrgissing Mar 18, 2026
cd432b9
skip interactions that have been turned off
jrgissing Mar 18, 2026
c12e305
apply clang-format
akohlmey Mar 27, 2026
bc504e1
remove redundant barriers
akohlmey Mar 27, 2026
10d7a2a
we use versionadded for added features
akohlmey Mar 27, 2026
d432062
small doc and spelling tweaks
akohlmey Mar 27, 2026
f5e3118
Merge branch 'develop' into data_file_type_label_checks
akohlmey Mar 27, 2026
cbf9d0e
Merge pull request #4680 from Bibobu/NPTisochoric
akohlmey Mar 27, 2026
8394b58
Merge pull request #4916 from jrgissing/data_file_type_label_checks
akohlmey Mar 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions doc/src/fix_nh.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Syntax
*scaleyz* value = *yes* or *no* = scale yz with lz
*scalexz* value = *yes* or *no* = scale xz with lz
*flip* value = *yes* or *no* = allow or disallow box flips when it becomes highly skewed
*isochoric* = *x* or *y* or *z* or *xy* or *yz* or *xz*
*fixedpoint* values = x y z
x,y,z = perform barostat dilation/contraction around this point (distance units)
*update* value = *dipole* or *dipole/dlm*
Expand Down Expand Up @@ -375,6 +376,24 @@ acquire ghost atoms around a processor's irregular-shaped subdomain.
For extreme values of tilt, LAMMPS may also lose atoms and generate an
error.

The *isochoric* keyword allows to maintain constant volume when barostating
up to two dimensions with this fix. The values following the isochoric keyword indicates the
dimensions to use in that regard: "x" indicates the x dimension, "yz" (no
space) indicates the y and z dimensions, etc. The selected dimensions are scaled to
compensate the strain induced by the barostat and keep the system at a constant volume
(or area in 2d). It is not possible to use this keyword if all the
dimensions are coupled to barostats. In the case of 2d simulations, only x and
y dimensions can be used to maintain a constant plane area. If you want to perform
strain with constant volume, the :doc:`fix deform <fix_deform>` command using
*volume* keyword is more likely to suit your needs.

.. note::
If large strains are caused by the barostat because the initial configuration
is far from pressure equilibrium or equilibrated too fast, the system will
see large strains on the other dimensions as well. It is recommended to
perform preliminary NPT equilibration if necessary using standard NPT
simulations.

The *fixedpoint* keyword specifies the fixed point for barostat volume
changes. By default, it is the center of the box. Whatever point is
chosen will not move during the simulation. For example, if the lower
Expand Down Expand Up @@ -702,10 +721,10 @@ Related commands
Default
"""""""

The keyword defaults are tchain = 3, pchain = 3, mtk = yes, tloop = 1,
ploop = 1, nreset = 0, drag = 0.0, dilate = all, couple = none,
flip = yes, scaleyz = scalexz = scalexy = yes if periodic in second
dimension and not coupled to barostat, otherwise no.
The keyword defaults are tchain = 3, pchain = 3, mtk = yes, tloop = 1, ploop =
1, nreset = 0, drag = 0.0, dilate = all, couple = none, flip = yes, scaleyz =
scalexz = scalexy = yes if periodic in second dimension and not coupled to
barostat, otherwise no.

----------

Expand Down
41 changes: 33 additions & 8 deletions doc/src/labelmap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ Syntax

labelmap option args

* *option* = *atom* or *bond* or *angle* or *dihedral* or *improper* or *clear* or *write*
* *option* = *atom* or *bond* or *angle* or *dihedral* or *improper* or *clear* or *write* or *check_labels*

.. parsed-literal::

*clear* = no args
*write* arg = filename
*atom* or *bond* or *angle* or *dihedral* or *improper*
args = list of one or more numeric-type/type-label pairs
*check_labels* value = string
string = string containing any of the following characters: 'b', 'a', 'd', or 'i'

Examples
""""""""
Expand Down Expand Up @@ -54,12 +56,12 @@ or '[' and ']', parenthesis '(' and ')', dash '-', underscore '_', plus
'+' and equals '=' signs and more. They must not contain blanks or any
other whitespace. Note that type labels must be put in single or double
quotation marks if they contain the '#' character or if they contain a
double (") or single quotation mark ('). If the label contains both
a single and a double quotation mark, then triple quotation (""") must
be used. When enclosing a type label with quotation marks, the
LAMMPS input parser may require adding leading or trailing blanks
around the type label so it can identify the enclosing quotation
marks. Those blanks will be removed when defining the label.
double (") or single quotation mark ('). If the label contains both a
single and a double quotation mark, then triple quotation (""") must be
used. When enclosing a type label with quotation marks, the LAMMPS
input parser may require adding leading or trailing blanks around the
type label so it can identify the enclosing quotation marks. Those
blanks will be removed when defining the label.

A *labelmap* command can only modify the label map for one type-kind
(atom types, bond types, etc). Any number of numeric-type/type-label
Expand All @@ -79,6 +81,29 @@ label mappings to a file as a sequence of *labelmap* commands, so the
file can be copied into a new LAMMPS input file or read in using the
:doc:`include <include>` command.

.. versionadded:: TBD

The *check_labels* keyword provides a warning if the type label of a
bond, angle, dihedral, or improper defined in the simulation is not
consistent with the atom types of its constituent atoms. This
consistency check is performed only once, when the simulation is
initialized by the first :doc:`run <run>` or :doc:`minimize <minimize>`
command after this *labelmap* command. The *check_labels* value is a
single string that should contain one or more of the characters 'b',
'a', 'd', and 'i', which correspond to bonds, angles, dihedrals, and
impropers, respectively. For example, the keyword/value pair
'check_labels badi' will check all the type labels of all higher-order
interactions, while 'check_labels adi' will only check type labels for
angles, dihedrals, and impropers. The *check_labels* keyword requires a
specific :doc:`type label<Howto_type_labels>` format to infer the types
of higher-order interactions. Bond, angle, dihedral, and improper type
labels must contain their constituent atom types delimited by hyphens,
e.g., 'c2-c2-c2-n' for a dihedral that contains three atoms of type 'c2'
and one atom of 'n'. If the constituent atoms do not have these atom
types in the proper order, a warning will be generated when using this
*check_types* keyword. Interactions that have been disabled, e.g., via
:doc:`fix_shake <fix_shake>`, will not be checked.

----------

Restrictions
Expand All @@ -88,7 +113,7 @@ This command must come after the simulation box is defined by a
:doc:`read_data <read_data>`, :doc:`read_restart <read_restart>`, or
:doc:`create_box <create_box>` command.

Label maps are currently not supported when using the KOKKOS package.
Label maps are considered experimental when using the KOKKOS package.

Related commands
""""""""""""""""
Expand Down
2 changes: 2 additions & 0 deletions doc/utils/sphinx-config/false_positives.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Addington
addstep
addtorque
adf
adi
Adhikari
adiam
adim
Expand Down Expand Up @@ -238,6 +239,7 @@ Babaei
Baconnier
backcolor
Baczewski
badi
Baer
Bagchi
Bagi
Expand Down
40 changes: 40 additions & 0 deletions src/OPENMP/fix_nh_omp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ using dbl3_t = struct { double x,y,z; };
void FixNHOMP::remap()
{
double oldlo,oldhi,expfac;
double isofac;

double * const * _noalias const x = atom->x;
const int * _noalias const mask = atom->mask;
Expand Down Expand Up @@ -121,36 +122,75 @@ void FixNHOMP::remap()
}
}

if (isochoric) isofac = vol_start;

// scale diagonal components
// scale tilt factors with cell, if set

if (p_flag[0]) {
oldlo = domain->boxlo[0];
oldhi = domain->boxhi[0];
expfac = exp(dto*omega_dot[0]);
isofac /= expfac;
domain->boxlo[0] = (oldlo-fixedpoint[0])*expfac + fixedpoint[0];
domain->boxhi[0] = (oldhi-fixedpoint[0])*expfac + fixedpoint[0];
if (isochoric) isofac /= domain->boxhi[0] - domain->boxlo[0];
}

if (p_flag[1]) {
oldlo = domain->boxlo[1];
oldhi = domain->boxhi[1];
expfac = exp(dto*omega_dot[1]);
isofac /= expfac;
domain->boxlo[1] = (oldlo-fixedpoint[1])*expfac + fixedpoint[1];
domain->boxhi[1] = (oldhi-fixedpoint[1])*expfac + fixedpoint[1];
if (isochoric) isofac /= domain->boxhi[1] - domain->boxlo[1];
if (scalexy) h[5] *= expfac;
}

if (p_flag[2]) {
oldlo = domain->boxlo[2];
oldhi = domain->boxhi[2];
expfac = exp(dto*omega_dot[2]);
isofac /= expfac;
domain->boxlo[2] = (oldlo-fixedpoint[2])*expfac + fixedpoint[2];
domain->boxhi[2] = (oldhi-fixedpoint[2])*expfac + fixedpoint[2];
if (isochoric) isofac /= domain->boxhi[2] - domain->boxlo[2];
if (scalexz) h[4] *= expfac;
if (scaleyz) h[3] *= expfac;
}

if (isochoric) {
for (int i = 0; i < 3; i++) {
if (p_isoch[i] || !p_flag[i]) isofac /= (domain->boxhi[i]-domain->boxlo[i]);
}
int iso_sum = p_isoch[0] + p_isoch[1] + p_isoch[2];
if (iso_sum == 2) isofac = sqrt(isofac);
if (p_isoch[0]) {
// Scale x
oldlo = domain->boxlo[0];
oldhi = domain->boxhi[0];
domain->boxlo[0] = (oldlo-fixedpoint[0])*isofac + fixedpoint[0];
domain->boxhi[0] = (oldhi-fixedpoint[0])*isofac + fixedpoint[0];
}
if (p_isoch[1]) {
// Scale y
oldlo = domain->boxlo[1];
oldhi = domain->boxhi[1];
domain->boxlo[1] = (oldlo-fixedpoint[1])*isofac + fixedpoint[1];
domain->boxhi[1] = (oldhi-fixedpoint[1])*isofac + fixedpoint[1];
if (scalexy) h[5] *= isofac;
}
if (p_isoch[2]) {
oldlo = domain->boxlo[2];
oldhi = domain->boxhi[2];
domain->boxlo[2] = (oldlo-fixedpoint[2])*isofac + fixedpoint[2];
domain->boxhi[2] = (oldhi-fixedpoint[2])*isofac + fixedpoint[2];
if (scalexz) h[4] *= isofac;
if (scaleyz) h[3] *= isofac;
}
}

// off-diagonal components, second half

if (pstyle == TRICLINIC) {
Expand Down
Loading