From f4000efd8a43e8131a3669e445da62699e253c6e Mon Sep 17 00:00:00 2001 From: jtclemm Date: Mon, 17 Jul 2023 11:52:06 -0600 Subject: [PATCH] Adding reference section to doc pages, update misc error messages --- doc/src/fix_nonaffine_displacement.rst | 12 +++++++++++- src/EXTRA-FIX/fix_nonaffine_displacement.cpp | 8 +++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/doc/src/fix_nonaffine_displacement.rst b/doc/src/fix_nonaffine_displacement.rst index 466a7b1ab0..99d98b451b 100644 --- a/doc/src/fix_nonaffine_displacement.rst +++ b/doc/src/fix_nonaffine_displacement.rst @@ -70,7 +70,9 @@ displacement. A deformation gradient tensor is then calculated as D^2_\mathrm{min} = \sum_{\mathrm{neighbors}} \left| \vec{r} - F \vec{r}_0 \right|^2 and a strain tensor is calculated :math:`E = F F^{T} - I` where :math:`I` -is the identity tensor. +is the identity tensor. This calculation is only performed on timesteps that +are a multiple of *nevery* (including timestep zero). Data accessed before +this occurs will simply be zeroed. The *integrated* style simply integrates the velocity of particles every timestep to calculate a displacement. This style only works if @@ -78,6 +80,14 @@ used in conjunction with another fix that deforms the box and displaces atom positions such as :doc:`the remap x option of fix deform `, :doc:`fix press/berendsen `, or :doc:`fix nh `. +Both of these methods require defining a reference state. With the *fixed* reference +style, the user picks a specific timestep *nstep* from which particle positions are saved. +If peratom data is accessed from this compute prior to this timestep, it will simply be +zeroed. The *update* reference style implies the reference state will be updated every +*nstep* timesteps. The *offset* reference only applies to the *d2min* metric and will +update the reference state *nstep* timesteps before a multiple of *nevery* timesteps. + + ---------- Restart, fix_modify, output, run start/stop, minimize info diff --git a/src/EXTRA-FIX/fix_nonaffine_displacement.cpp b/src/EXTRA-FIX/fix_nonaffine_displacement.cpp index f18fdd2c4a..bb5c2ca0c3 100755 --- a/src/EXTRA-FIX/fix_nonaffine_displacement.cpp +++ b/src/EXTRA-FIX/fix_nonaffine_displacement.cpp @@ -116,6 +116,9 @@ FixNonaffineDisplacement::FixNonaffineDisplacement(LAMMPS *lmp, int narg, char * if (cut_style == RADIUS && (!atom->radius_flag)) error->all(FLERR, "Fix nonaffine/displacement radius style requires atom attribute radius"); + if (nad_style == INTEGRATED && reference_style == OFFSET) + error->all(FLERR, "Fix nonaffine/displacement cannot use the integrated style with an offset reference state"); + peratom_flag = 1; peratom_freq = nevery; nmax = -1; @@ -347,11 +350,6 @@ void FixNonaffineDisplacement::save_reference_state() void FixNonaffineDisplacement::calculate_D2Min() { - if (!reference_saved) { - error->warning(FLERR, "Calculating D2Min without a saved reference state"); - return; - } - // invoke half neighbor list (will copy or build if necessary) neighbor->build_one(list);