doc adjust and code comments

This commit is contained in:
Steve Plimpton
2024-02-21 14:18:26 -07:00
parent 4c0952dc70
commit cd4c97f8d8
4 changed files with 201 additions and 141 deletions

View File

@ -4,6 +4,9 @@
fix deform command fix deform command
================== ==================
:doc:`fix deform/pressure <fix_deform_pressure>` command
==================
Accelerator Variants: *deform/kk* Accelerator Variants: *deform/kk*
Syntax Syntax
@ -11,18 +14,18 @@ Syntax
.. code-block:: LAMMPS .. code-block:: LAMMPS
fix ID group-ID deform N parameter args ... keyword value ... fix ID group-ID fixstyle N parameter style args ... keyword value ...
* ID, group-ID are documented in :doc:`fix <fix>` command * ID, group-ID are documented in :doc:`fix <fix>` command
* deform = style name of this fix command * fixstyle = *deform* or *deform/pressure*
* N = perform box deformation every this many timesteps * N = perform box deformation every this many timesteps
* one or more parameter/arg pairs may be appended * one or more parameter/style/args sequences of arguments may be appended
.. parsed-literal:: .. parsed-literal::
parameter = *x* or *y* or *z* or *xy* or *xz* or *yz* parameter = *x* or *y* or *z* or *xy* or *xz* or *yz*
*x*, *y*, *z* args = style value(s) *x*, *y*, *z* args = style value(s)
style = *final* or *delta* or *scale* or *vel* or *erate* or *trate* or *volume* or *wiggle* or *variable* style = *final* or *delta* or *scale* or *vel* or *erate* or *trate* or *volume* or *wiggle* or *variable* or *pressure* or *pressure/mean*
*final* values = lo hi *final* values = lo hi
lo hi = box boundaries at end of run (distance units) lo hi = box boundaries at end of run (distance units)
*delta* values = dlo dhi *delta* values = dlo dhi
@ -43,6 +46,13 @@ Syntax
*variable* values = v_name1 v_name2 *variable* values = v_name1 v_name2
v_name1 = variable with name1 for box length change as function of time v_name1 = variable with name1 for box length change as function of time
v_name2 = variable with name2 for change rate as function of time v_name2 = variable with name2 for change rate as function of time
*pressure* values = target gain (ONLY available in :doc:`fix deform/pressure <fix_deform_pressure>` command)
target = target pressure (pressure units)
gain = proportional gain constant (1/(time * pressure) or 1/time units)
*pressure/mean* values = target gain (ONLY available in :doc:`fix deform/pressure <fix_deform_pressure>` command)
target = target pressure (pressure units)
gain = proportional gain constant (1/(time * pressure) or 1/time units)
*xy*, *xz*, *yz* args = style value *xy*, *xz*, *yz* args = style value
style = *final* or *delta* or *vel* or *erate* or *trate* or *wiggle* or *variable* style = *final* or *delta* or *vel* or *erate* or *trate* or *wiggle* or *variable*
*final* value = tilt *final* value = tilt
@ -62,9 +72,12 @@ Syntax
*variable* values = v_name1 v_name2 *variable* values = v_name1 v_name2
v_name1 = variable with name1 for tilt change as function of time v_name1 = variable with name1 for tilt change as function of time
v_name2 = variable with name2 for change rate as function of time v_name2 = variable with name2 for change rate as function of time
*pressure* values = target gain (ONLY available in :doc:`fix deform/pressure <fix_deform_pressure>` command)
target = target pressure (pressure units)
gain = proportional gain constant (1/(time * pressure) or 1/time units)
* zero or more keyword/value pairs may be appended * zero or more keyword/value pairs may be appended
* keyword = *remap* or *flip* or *units* * keyword = *remap* or *flip* or *units* or *couple* or *vol/balance/p* or *max/rate* or *normalize/pressure*
.. parsed-literal:: .. parsed-literal::
@ -77,6 +90,15 @@ Syntax
*units* value = *lattice* or *box* *units* value = *lattice* or *box*
lattice = distances are defined in lattice units lattice = distances are defined in lattice units
box = distances are defined in simulation box units box = distances are defined in simulation box units
*couple* value = *none* or *xyz* or *xy* or *yz* or *xz* (ONLY available in :doc:`fix deform/pressure <fix_deform_pressure>` command)
couple pressure values of various dimensions
*vol/balance/p* value = *yes* or *no* (ONLY available in :doc:`fix deform/pressure <fix_deform_pressure>` command)
Modifies the behavior of the *volume* option to try and balance pressures
*max/rate* value = *rate* (ONLY available in :doc:`fix deform/pressure <fix_deform_pressure>` command)
rate = maximum strain rate for pressure control
*normalize/pressure* value = *yes* or *no* (ONLY available in :doc:`fix deform/pressure <fix_deform_pressure>` command)
Modifies pressure controls such that the deviation in pressure is normalized by the target pressure
Examples Examples
"""""""" """"""""
@ -88,6 +110,8 @@ Examples
fix 1 all deform 1 xy erate 0.001 remap v fix 1 all deform 1 xy erate 0.001 remap v
fix 1 all deform 10 y delta -0.5 0.5 xz vel 1.0 fix 1 all deform 10 y delta -0.5 0.5 xz vel 1.0
See examples for :doc:`fix deform/pressure <fix_deform_pressure>` on its doc page
Description Description
""""""""""" """""""""""
@ -95,31 +119,46 @@ Change the volume and/or shape of the simulation box during a dynamics
run. Orthogonal simulation boxes have 3 adjustable parameters run. Orthogonal simulation boxes have 3 adjustable parameters
(x,y,z). Triclinic (non-orthogonal) simulation boxes have 6 (x,y,z). Triclinic (non-orthogonal) simulation boxes have 6
adjustable parameters (x,y,z,xy,xz,yz). Any or all of them can be adjustable parameters (x,y,z,xy,xz,yz). Any or all of them can be
adjusted independently and simultaneously by this command. For adjusted independently and simultaneously.
additional pressure-based controls, see
:doc:`fix deform/pressure <fix_deform_pressure>`.
This fix can be used to perform non-equilibrium MD (NEMD) simulations The fix deform command allows use of all the arguments listed above,
of a continuously strained system. See the :doc:`fix nvt/sllod <fix_nvt_sllod>` and :doc:`compute temp/deform <compute_temp_deform>` commands for more details. Note except those flagged as available ONLY for the :doc:`fix
that simulation of a continuously extended system (extensional flow) deform/pressure <fix_deform_pressure>` command, which are
can be modeled using the :ref:`UEF package <PKG-UEF>` and its :doc:`fix commands <fix_nh_uef>`. pressure-based controls. The fix deform/pressure command allows use
of all the arguments listed above.
The rest of this doc page explains the options common to both
commands. The :doc:`fix deform/pressure <fix_deform_pressure>` doc
page explains the options available ONLY with the fix deform/pressure
command. Note that a simulation can define only a single deformation
command: fix deform or fix deform/pressure.
Both these fixes can be used to perform non-equilibrium MD (NEMD)
simulations of a continuously strained system. See the :doc:`fix
nvt/sllod <fix_nvt_sllod>` and :doc:`compute temp/deform
<compute_temp_deform>` commands for more details. Note that
simulation of a continuously extended system (extensional flow) can be
modeled using the :ref:`UEF package <PKG-UEF>` and its :doc:`fix
commands <fix_nh_uef>`.
For the *x*, *y*, *z* parameters, the associated dimension cannot be For the *x*, *y*, *z* parameters, the associated dimension cannot be
shrink-wrapped. For the *xy*, *yz*, *xz* parameters, the associated shrink-wrapped. For the *xy*, *yz*, *xz* parameters, the associated
second dimension cannot be shrink-wrapped. Dimensions not varied by this second dimension cannot be shrink-wrapped. Dimensions not varied by
command can be periodic or non-periodic. Dimensions corresponding to this command can be periodic or non-periodic. Dimensions
unspecified parameters can also be controlled by a :doc:`fix npt <fix_nh>` or :doc:`fix nph <fix_nh>` command. corresponding to unspecified parameters can also be controlled by a
:doc:`fix npt <fix_nh>` or :doc:`fix nph <fix_nh>` command.
The size and shape of the simulation box at the beginning of the The size and shape of the simulation box at the beginning of the
simulation run were either specified by the simulation run were either specified by the :doc:`create_box
:doc:`create_box <create_box>` or :doc:`read_data <read_data>` or <create_box>` or :doc:`read_data <read_data>` or :doc:`read_restart
:doc:`read_restart <read_restart>` command used to setup the simulation <read_restart>` command used to setup the simulation initially if it
initially if it is the first run, or they are the values from the end is the first run, or they are the values from the end of the previous
of the previous run. The :doc:`create_box <create_box>`, :doc:`read data <read_data>`, and :doc:`read_restart <read_restart>` commands run. The :doc:`create_box <create_box>`, :doc:`read data
specify whether the simulation box is orthogonal or non-orthogonal <read_data>`, and :doc:`read_restart <read_restart>` commands specify
(triclinic) and explain the meaning of the xy,xz,yz tilt factors. If whether the simulation box is orthogonal or non-orthogonal (triclinic)
fix deform changes the xy,xz,yz tilt factors, then the simulation box and explain the meaning of the xy,xz,yz tilt factors. If fix deform
must be triclinic, even if its initial tilt factors are 0.0. changes the xy,xz,yz tilt factors, then the simulation box must be
triclinic, even if its initial tilt factors are 0.0.
As described below, the desired simulation box size and shape at the As described below, the desired simulation box size and shape at the
end of the run are determined by the parameters of the fix deform end of the run are determined by the parameters of the fix deform
@ -260,21 +299,22 @@ of the units keyword below.
The *variable* style changes the specified box length dimension by The *variable* style changes the specified box length dimension by
evaluating a variable, which presumably is a function of time. The evaluating a variable, which presumably is a function of time. The
variable with *name1* must be an :doc:`equal-style variable <variable>` variable with *name1* must be an :doc:`equal-style variable
and should calculate a change in box length in units of distance. <variable>` and should calculate a change in box length in units of
Note that this distance is in box units, not lattice units; see the distance. Note that this distance is in box units, not lattice units;
discussion of the *units* keyword below. The formula associated with see the discussion of the *units* keyword below. The formula
variable *name1* can reference the current timestep. Note that it associated with variable *name1* can reference the current timestep.
should return the "change" in box length, not the absolute box length. Note that it should return the "change" in box length, not the
This means it should evaluate to 0.0 when invoked on the initial absolute box length. This means it should evaluate to 0.0 when
timestep of the run following the definition of fix deform. It should invoked on the initial timestep of the run following the definition of
evaluate to a value > 0.0 to dilate the box at future times, or a fix deform. It should evaluate to a value > 0.0 to dilate the box at
value < 0.0 to compress the box. future times, or a value < 0.0 to compress the box.
The variable *name2* must also be an :doc:`equal-style variable <variable>` and should calculate the rate of box length The variable *name2* must also be an :doc:`equal-style variable
change, in units of distance/time, i.e. the time-derivative of the <variable>` and should calculate the rate of box length change, in
*name1* variable. This quantity is used internally by LAMMPS to reset units of distance/time, i.e. the time-derivative of the *name1*
atom velocities when they cross periodic boundaries. It is computed variable. This quantity is used internally by LAMMPS to reset atom
velocities when they cross periodic boundaries. It is computed
internally for the other styles, but you must provide it when using an internally for the other styles, but you must provide it when using an
arbitrary variable. arbitrary variable.
@ -416,12 +456,13 @@ can reference the current timestep. Note that it should return the
should evaluate to 0.0 when invoked on the initial timestep of the run should evaluate to 0.0 when invoked on the initial timestep of the run
following the definition of fix deform. following the definition of fix deform.
The variable *name2* must also be an :doc:`equal-style variable <variable>` and should calculate the rate of tilt change, The variable *name2* must also be an :doc:`equal-style variable
in units of distance/time, i.e. the time-derivative of the *name1* <variable>` and should calculate the rate of tilt change, in units of
variable. This quantity is used internally by LAMMPS to reset atom distance/time, i.e. the time-derivative of the *name1* variable. This
velocities when they cross periodic boundaries. It is computed quantity is used internally by LAMMPS to reset atom velocities when
internally for the other styles, but you must provide it when using an they cross periodic boundaries. It is computed internally for the
arbitrary variable. other styles, but you must provide it when using an arbitrary
variable.
Here is an example of using the *variable* style to perform the same Here is an example of using the *variable* style to perform the same
box deformation as the *wiggle* style formula listed above, where we box deformation as the *wiggle* style formula listed above, where we
@ -512,33 +553,40 @@ box without explicit remapping of their coordinates.
.. note:: .. note::
For non-equilibrium MD (NEMD) simulations using "remap v" it is For non-equilibrium MD (NEMD) simulations using "remap v" it is
usually desirable that the fluid (or flowing material, e.g. granular usually desirable that the fluid (or flowing material,
particles) stream with a velocity profile consistent with the e.g. granular particles) stream with a velocity profile consistent
deforming box. As mentioned above, using a thermostat such as :doc:`fix nvt/sllod <fix_nvt_sllod>` or :doc:`fix lavgevin <fix_langevin>` with the deforming box. As mentioned above, using a thermostat
(with a bias provided by :doc:`compute temp/deform <compute_temp_deform>`), will typically accomplish such as :doc:`fix nvt/sllod <fix_nvt_sllod>` or :doc:`fix lavgevin
that. If you do not use a thermostat, then there is no driving force <fix_langevin>` (with a bias provided by :doc:`compute temp/deform
pushing the atoms to flow in a manner consistent with the deforming <compute_temp_deform>`), will typically accomplish that. If you do
box. E.g. for a shearing system the box deformation velocity may vary not use a thermostat, then there is no driving force pushing the
atoms to flow in a manner consistent with the deforming box.
E.g. for a shearing system the box deformation velocity may vary
from 0 at the bottom to 10 at the top of the box. But the stream from 0 at the bottom to 10 at the top of the box. But the stream
velocity profile of the atoms may vary from -5 at the bottom to +5 at velocity profile of the atoms may vary from -5 at the bottom to +5
the top. You can monitor these effects using the :doc:`fix ave/chunk <fix_ave_chunk>`, :doc:`compute temp/deform <compute_temp_deform>`, and :doc:`compute temp/profile <compute_temp_profile>` commands. One way to induce at the top. You can monitor these effects using the :doc:`fix
atoms to stream consistent with the box deformation is to give them an ave/chunk <fix_ave_chunk>`, :doc:`compute temp/deform
<compute_temp_deform>`, and :doc:`compute temp/profile
<compute_temp_profile>` commands. One way to induce atoms to
stream consistent with the box deformation is to give them an
initial velocity profile, via the :doc:`velocity ramp <velocity>` initial velocity profile, via the :doc:`velocity ramp <velocity>`
command, that matches the box deformation rate. This also typically command, that matches the box deformation rate. This also
helps the system come to equilibrium more quickly, even if a typically helps the system come to equilibrium more quickly, even
thermostat is used. if a thermostat is used.
.. note:: .. note::
If a :doc:`fix rigid <fix_rigid>` is defined for rigid bodies, and If a :doc:`fix rigid <fix_rigid>` is defined for rigid bodies, and
*remap* is set to *x*, then the center-of-mass coordinates of rigid *remap* is set to *x*, then the center-of-mass coordinates of rigid
bodies will be remapped to the changing simulation box. This will be bodies will be remapped to the changing simulation box. This will
done regardless of whether atoms in the rigid bodies are in the fix be done regardless of whether atoms in the rigid bodies are in the
deform group or not. The velocity of the centers of mass are not fix deform group or not. The velocity of the centers of mass are
remapped even if *remap* is set to *v*, since :doc:`fix nvt/sllod <fix_nvt_sllod>` does not currently do anything special not remapped even if *remap* is set to *v*, since :doc:`fix
nvt/sllod <fix_nvt_sllod>` does not currently do anything special
for rigid particles. If you wish to perform a NEMD simulation of for rigid particles. If you wish to perform a NEMD simulation of
rigid particles, you can either thermostat them independently or rigid particles, you can either thermostat them independently or
include a background fluid and thermostat the fluid via :doc:`fix nvt/sllod <fix_nvt_sllod>`. include a background fluid and thermostat the fluid via :doc:`fix
nvt/sllod <fix_nvt_sllod>`.
The *flip* keyword allows the tilt factors for a triclinic box to The *flip* keyword allows the tilt factors for a triclinic box to
exceed half the distance of the parallel box length, as discussed exceed half the distance of the parallel box length, as discussed
@ -570,7 +618,8 @@ command if you want to include lattice spacings in a variable formula.
Restart, fix_modify, output, run start/stop, minimize info Restart, fix_modify, output, run start/stop, minimize info
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""
This fix will restore the initial box settings from :doc:`binary restart files <restart>`, which allows the fix to be properly continue This fix will restore the initial box settings from :doc:`binary
restart files <restart>`, which allows the fix to be properly continue
deformation, when using the start/stop options of the :doc:`run <run>` deformation, when using the start/stop options of the :doc:`run <run>`
command. None of the :doc:`fix_modify <fix_modify>` options are command. None of the :doc:`fix_modify <fix_modify>` options are
relevant to this fix. No global or per-atom quantities are stored by relevant to this fix. No global or per-atom quantities are stored by
@ -588,13 +637,15 @@ Restrictions
You cannot apply x, y, or z deformations to a dimension that is You cannot apply x, y, or z deformations to a dimension that is
shrink-wrapped via the :doc:`boundary <boundary>` command. shrink-wrapped via the :doc:`boundary <boundary>` command.
You cannot apply xy, yz, or xz deformations to a second dimension (y in You cannot apply xy, yz, or xz deformations to a second dimension (y
xy) that is shrink-wrapped via the :doc:`boundary <boundary>` command. in xy) that is shrink-wrapped via the :doc:`boundary <boundary>`
command.
Related commands Related commands
"""""""""""""""" """"""""""""""""
:doc:`fix deform/pressure <fix_deform_pressure>`, :doc:`change_box <change_box>` :doc:`fix deform/pressure <fix_deform_pressure>`, :doc:`change_box
<change_box>`
Default Default
""""""" """""""

View File

@ -8,12 +8,12 @@ Syntax
.. parsed-literal:: .. parsed-literal::
fix ID group-ID deform N parameter args ... keyword value ... fix ID group-ID deform/pressure N parameter style args ... keyword value ...
* ID, group-ID are documented in :doc:`fix <fix>` command * ID, group-ID are documented in :doc:`fix <fix>` command
* deform = style name of this fix command * deform/pressure = style name of this fix command
* N = perform box deformation every this many timesteps * N = perform box deformation every this many timesteps
* one or more parameter/arg pairs may be appended * one or more parameter/arg sequences may be appended
.. parsed-literal:: .. parsed-literal::
@ -26,13 +26,15 @@ Syntax
*pressure/mean* values = target gain *pressure/mean* values = target gain
target = target pressure (pressure units) target = target pressure (pressure units)
gain = proportional gain constant (1/(time * pressure) or 1/time units) gain = proportional gain constant (1/(time * pressure) or 1/time units)
All other styles operate identically to those in :doc:`fix deform <fix_deform>` NOTE: All other styles are documented by the :doc:`fix deform <fix_deform>` command
*xy*, *xz*, *yz* args = style value *xy*, *xz*, *yz* args = style value
style = *final* or *delta* or *vel* or *erate* or *trate* or *wiggle* or *variable* or *pressure* style = *final* or *delta* or *vel* or *erate* or *trate* or *wiggle* or *variable* or *pressure*
*pressure* values = target gain *pressure* values = target gain
target = target pressure (pressure units) target = target pressure (pressure units)
gain = proportional gain constant (1/(time * pressure) or 1/time units) gain = proportional gain constant (1/(time * pressure) or 1/time units)
All other styles operate identically to those in :doc:`fix deform <fix_deform>` NOTE: All other styles are documented by the :doc:`fix deform <fix_deform>` command
*box* = style value *box* = style value
style = *volume* or *pressure* style = *volume* or *pressure*
*volume* value = none = isotropically adjust system to preserve volume of system *volume* value = none = isotropically adjust system to preserve volume of system
@ -53,7 +55,7 @@ Syntax
rate = maximum strain rate for pressure control rate = maximum strain rate for pressure control
*normalize/pressure* value = *yes* or *no* *normalize/pressure* value = *yes* or *no*
Modifies pressure controls such that the deviation in pressure is normalized by the target pressure Modifies pressure controls such that the deviation in pressure is normalized by the target pressure
All other options operate identically to those in :doc:`fix deform <fix_deform>` NOTE: All other keywords are documented by the :doc:`fix deform <fix_deform>` command
Examples Examples
"""""""" """"""""
@ -67,19 +69,20 @@ Examples
Description Description
""""""""""" """""""""""
This fix is an extension of :doc:`fix deform <fix_deform>`, inheriting This fix is an extension of the :doc:`fix deform <fix_deform>`
all of its features and adding new pressure-based controls to allow for command, which allows all of its options to be used as well as new
new deformation protocols. All details in :doc:`fix deform <fix_deform>` pressure-based controls implemented by this command.
apply to this fix unless otherwise noted.
All arguments described on the :doc:`fix deform <fix_deform>` doc page
also apply to this fix unless otherwise noted below. The rest of this
doc page explains the arguments specific to this fix. Note that a
simulation can define only a single deformation command: fix deform or
fix deform/pressure.
---------- ----------
For the *x*, *y*, and *z* parameters, this is the meaning of their For the *x*, *y*, and *z* parameters, this is the meaning of the
styles and values. styles and values provided by this fix.
The *final*, *delta*, *scale*, *vel*, *erate*, *trate*, *volume*,
*wiggle*, and *variable* styles all behave identically to those in
:doc:`fix deform <fix_deform>`. Additional styles are described below.
The *pressure* style adjusts a dimension's box length to control the The *pressure* style adjusts a dimension's box length to control the
corresponding component of the pressure tensor. This option attempts to corresponding component of the pressure tensor. This option attempts to
@ -127,13 +130,9 @@ along one dimension.
---------- ----------
For the *xy*, *xz*, and *yz* parameters, this is the meaning of their For the *xy*, *xz*, and *yz* parameters, this is the meaning of the
styles and values. Note that changing the tilt factors of a triclinic styles and values provided by this fix. Note that changing the
box does not change its volume. tilt factors of a triclinic box does not change its volume.
The *final*, *delta*, *vel*, *erate*, *trate*, *wiggle*, and *variable*
styles all behave identically to those in :doc:`fix deform <fix_deform>`.
Additional styles are described below.
The *pressure* style adjusts a tilt factor to control the corresponding The *pressure* style adjusts a tilt factor to control the corresponding
off-diagonal component of the pressure tensor. This option attempts to off-diagonal component of the pressure tensor. This option attempts to
@ -144,29 +143,32 @@ tilt factor T evolves according to the equation
\frac{d T(t)}{dt} = L(t) k (P - P_t) \frac{d T(t)}{dt} = L(t) k (P - P_t)
where :math:`k` is a proportional gain constant, :math:`P_t` is the target where :math:`k` is a proportional gain constant, :math:`P_t` is the
pressure, :math:`P` is the current pressure, and :math:`L` is the perpendicular target pressure, :math:`P` is the current pressure, and :math:`L` is
box length. The target pressure accepts either a constant numeric value or a the perpendicular box length. The target pressure accepts either a
LAMMPS :ref:`variable <variable>`. Notably, this variable can be a function constant numeric value or a LAMMPS :ref:`variable
of time or other components of the pressure tensor. By default, :math:`k` <variable>`. Notably, this variable can be a function of time or other
has units of 1/(time * pressure) although this will change if the components of the pressure tensor. By default, :math:`k` has units of
*normalize/pessure* option is set as :ref:`discussed below <deform_normalize>`. 1/(time * pressure) although this will change if the
There is no proven method to choosing an appropriate value of :math:`k` as it *normalize/pessure* option is set as :ref:`discussed below
will depend on thespecific details of a simulation and testing different <deform_normalize>`. There is no proven method to choosing an
values is recommended. One can also apply a maximum limit to the magnitude appropriate value of :math:`k` as it will depend on the specific
of the applied strain using the :ref:`max/rate <deform_max_rate>` option. details of a simulation and testing different values is
recommended. One can also apply a maximum limit to the magnitude of
the applied strain using the :ref:`max/rate <deform_max_rate>` option.
---------- ----------
The *box* parameter provides an additonal control over the *x*, *y*, The *box* parameter provides an additional control over the *x*, *y*,
and *z* box lengths by isotropically dilating or contracting the box to and *z* box lengths by isotropically dilating or contracting the box
either maintain a fixed mean pressure or volume. This isotropic scaling to either maintain a fixed mean pressure or volume. This isotropic
is applied after the box is deformed by the above *x*, *y*, *z*, *xy*, scaling is applied after the box is deformed by the above *x*, *y*,
*xz*, and *yz* styles, acting as a second deformation step. This parameter *z*, *xy*, *xz*, and *yz* styles, acting as a second deformation
will change the overall strain rate in the *x*, *y*, or *z* dimensions. step. This parameter will change the overall strain rate in the *x*,
This parameter can only be used in combination with the *x*, *y*, or *z* *y*, or *z* dimensions. This parameter can only be used in
commands: *vel*, *erate*, *trate*, *pressure*, or *wiggle*. This is the meaning combination with the *x*, *y*, or *z* commands: *vel*, *erate*,
of its styles and values. *trate*, *pressure*, or *wiggle*. This is the meaning of its styles
and values.
The *volume* style isotropically scales box lengths to maintain a constant The *volume* style isotropically scales box lengths to maintain a constant
box volume in response to deformation from other parameters. This style box volume in response to deformation from other parameters. This style
@ -186,9 +188,7 @@ dimensions (deforming the shape of the box), while maintaining a mean pressure.
---------- ----------
The *flip*, *remap*, and *units* keywords all behave identically The optional keywords provided by this fix are described below.
to those in :doc:`fix deform <fix_deform>`. Additional optional
keywords are described below.
.. _deform_normalize: .. _deform_normalize:
@ -240,44 +240,47 @@ dimension equal using a method described in :ref:`(Huang2014) <Huang2014>`.
---------- ----------
If any pressure controls are used, this fix computes a temperature and If any pressure controls are used, this fix computes a temperature and
pressure each timestep. To do this, the fix creates its own computes of pressure each timestep. To do this, the fix creates its own computes
style "temp" and "pressure", as if these commands had been issued: of style "temp" and "pressure", as if these commands had been issued:
.. code-block:: LAMMPS .. code-block:: LAMMPS
compute fix-ID_temp group-ID temp compute fix-ID_temp group-ID temp
compute fix-ID_press group-ID pressure fix-ID_temp compute fix-ID_press group-ID pressure fix-ID_temp
See the :doc:`compute temp <compute_temp>` and :doc:`compute pressure <compute_pressure>` commands for details. Note that the See the :doc:`compute temp <compute_temp>` and :doc:`compute pressure
IDs of the new computes are the fix-ID + underscore + "temp" or fix_ID <compute_pressure>` commands for details. Note that the IDs of the
new computes are the fix-ID + underscore + "temp" or fix_ID
+ underscore + "press", and the group for the new computes is the same + underscore + "press", and the group for the new computes is the same
as the fix group. as the fix group.
Note that these are NOT the computes used by thermodynamic output (see Note that these are NOT the computes used by thermodynamic output (see
the :doc:`thermo_style <thermo_style>` command) with ID = *thermo_temp* the :doc:`thermo_style <thermo_style>` command) with ID =
and *thermo_press*. This means you can change the attributes of this *thermo_temp* and *thermo_press*. This means you can change the
fix's temperature or pressure via the attributes of this fix's temperature or pressure via the
:doc:`compute_modify <compute_modify>` command or print this temperature :doc:`compute_modify <compute_modify>` command or print this
or pressure during thermodynamic output via the temperature or pressure during thermodynamic output via the
:doc:`thermo_style custom <thermo_style>` command using the appropriate :doc:`thermo_style custom <thermo_style>` command using the
compute-ID. It also means that changing attributes of *thermo_temp* or appropriate compute-ID. It also means that changing attributes of
*thermo_press* will have no effect on this fix. *thermo_temp* or *thermo_press* will have no effect on this fix.
Restart, fix_modify, output, run start/stop, minimize info Restart, fix_modify, output, run start/stop, minimize info
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""
This fix will restore the initial box settings from :doc:`binary restart files <restart>`, which allows the fix to be properly continue This fix will restore the initial box settings from :doc:`binary
restart files <restart>`, which allows the fix to be properly continue
deformation, when using the start/stop options of the :doc:`run <run>` deformation, when using the start/stop options of the :doc:`run <run>`
command. No global or per-atom quantities are stored by this fix for access command. No global or per-atom quantities are stored by this fix for
by various :doc:`output commands <Howto_output>`. access by various :doc:`output commands <Howto_output>`.
If any pressure controls are used, the :doc:`fix_modify <fix_modify>` *temp* If any pressure controls are used, the :doc:`fix_modify <fix_modify>`
and *press* options are supported by this fix, unklike in :doc:`fix deform <fix_deform>`. *temp* and *press* options are supported by this fix, unlike in
You can use them to assign a :doc:`compute <compute>` you have defined to :doc:`fix deform <fix_deform>`. You can use them to assign a
this fix which will be used in its temperature and pressure calculations. :doc:`compute <compute>` you have defined to this fix which will be
If you do this, note that the kinetic energy derived from the compute used in its temperature and pressure calculations. If you do this,
temperature should be consistent with the virial term computed using all note that the kinetic energy derived from the compute temperature
atoms for the pressure. LAMMPS will warn you if you choose to compute should be consistent with the virial term computed using all atoms for
the pressure. LAMMPS will warn you if you choose to compute
temperature on a subset of atoms. temperature on a subset of atoms.
This fix can perform deformation over multiple runs, using the *start* This fix can perform deformation over multiple runs, using the *start*
@ -292,8 +295,9 @@ Restrictions
You cannot apply x, y, or z deformations to a dimension that is You cannot apply x, y, or z deformations to a dimension that is
shrink-wrapped via the :doc:`boundary <boundary>` command. shrink-wrapped via the :doc:`boundary <boundary>` command.
You cannot apply xy, yz, or xz deformations to a second dimension (y in You cannot apply xy, yz, or xz deformations to a second dimension (y
xy) that is shrink-wrapped via the :doc:`boundary <boundary>` command. in xy) that is shrink-wrapped via the :doc:`boundary <boundary>`
command.
Related commands Related commands
"""""""""""""""" """"""""""""""""
@ -303,8 +307,7 @@ Related commands
Default Default
""""""" """""""
The option defaults are remap = x, flip = yes, units = lattice, and The option defaults are normalize/pressure = no.
normalize/pressure = no.
---------- ----------

View File

@ -55,7 +55,7 @@ FixDeformPressure::FixDeformPressure(LAMMPS *lmp, int narg, char **arg) :
memset(set_extra, 0, 7 * sizeof(SetExtra)); memset(set_extra, 0, 7 * sizeof(SetExtra));
memset(&set_box, 0, sizeof(Set)); memset(&set_box, 0, sizeof(Set));
// parse child-specific arguments // parse only parameter/style arguments specific to this child class
int index, iarg; int index, iarg;
int i = 0; int i = 0;
@ -115,6 +115,7 @@ FixDeformPressure::FixDeformPressure(LAMMPS *lmp, int narg, char **arg) :
set_extra[index].pgain = utils::numeric(FLERR, arg[iarg + 3], false, lmp); set_extra[index].pgain = utils::numeric(FLERR, arg[iarg + 3], false, lmp);
i += 4; i += 4;
} else error->all(FLERR, "Illegal fix deform/pressure command: {}", arg[iarg + 1]); } else error->all(FLERR, "Illegal fix deform/pressure command: {}", arg[iarg + 1]);
} else if (strcmp(arg[iarg], "box") == 0) { } else if (strcmp(arg[iarg], "box") == 0) {
if (strcmp(arg[iarg + 1], "volume") == 0) { if (strcmp(arg[iarg + 1], "volume") == 0) {
set_box.style = VOLUME; set_box.style = VOLUME;
@ -850,7 +851,6 @@ void FixDeformPressure::restart(char *buf)
} }
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
void FixDeformPressure::options(int i, int narg, char **arg) void FixDeformPressure::options(int i, int narg, char **arg)
@ -860,6 +860,8 @@ void FixDeformPressure::options(int i, int narg, char **arg)
vol_balance_flag = 0; vol_balance_flag = 0;
normalize_pressure_flag = 0; normalize_pressure_flag = 0;
// parse only options not handled by parent class
int iarg, nskip; int iarg, nskip;
while (i < leftover_iarg.size()) { while (i < leftover_iarg.size()) {
iarg = leftover_iarg[i]; iarg = leftover_iarg[i];

View File

@ -72,7 +72,8 @@ irregular(nullptr), set(nullptr)
set = new Set[6]; set = new Set[6];
memset(set, 0, 6 * sizeof(Set)); memset(set, 0, 6 * sizeof(Set));
// parse arguments // parse all parameter/style arguments for this parent and also child classes
// for child classes, simply store them in leftover_iarg and skip over them
triclinic = domain->triclinic; triclinic = domain->triclinic;
@ -1009,6 +1010,9 @@ void FixDeform::options(int narg, char **arg)
{"vol/balance/p", 2}}); {"vol/balance/p", 2}});
} }
// parse all optional arguments for this parent and also child classes
// for child classes, simply store them in leftover_iarg and skip over them
int iarg = 0; int iarg = 0;
while (iarg < narg) { while (iarg < narg) {
if (strcmp(arg[iarg], "remap") == 0) { if (strcmp(arg[iarg], "remap") == 0) {