1 "LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
3 :link(lws,http://lammps.sandia.gov)
5 :link(lc,Section_commands.html#comm)
9 fix npt/body command :h3
13 fix ID group-ID npt/body keyword value ... :pre
15 ID, group-ID are documented in "fix"_fix.html command
16 npt/body = style name of this fix command
17 additional thermostat and barostat related keyword/value pairs from the "fix npt"_fix_nh.html command can be appended :ul
21 fix 1 all npt/body temp 300.0 300.0 100.0 iso 0.0 0.0 1000.0
22 fix 2 all npt/body temp 300.0 300.0 100.0 x 5.0 5.0 1000.0
23 fix 2 all npt/body temp 300.0 300.0 100.0 x 5.0 5.0 1000.0 drag 0.2
24 fix 2 water npt/body temp 300.0 300.0 100.0 aniso 0.0 0.0 1000.0 dilate partial :pre
28 Perform constant NPT integration to update position, velocity,
29 orientation, and angular velocity each timestep for body
30 particles in the group using a Nose/Hoover temperature
31 thermostat and Nose/Hoover pressure barostat. P is pressure; T is
32 temperature. This creates a system trajectory consistent with the
33 isothermal-isobaric ensemble.
35 This fix differs from the "fix npt"_fix_nh.html command, which
36 assumes point particles and only updates their position and velocity.
38 The thermostat is applied to both the translational and rotational
39 degrees of freedom for the body particles, assuming a compute is
40 used which calculates a temperature that includes the rotational
41 degrees of freedom (see below). The translational degrees of freedom
42 can also have a bias velocity removed from them before thermostatting
43 takes place; see the description below.
45 Additional parameters affecting the thermostat and barostat are
46 specified by keywords and values documented with the "fix
47 npt"_fix_nh.html command. See, for example, discussion of the {temp},
48 {iso}, {aniso}, and {dilate} keywords.
50 The particles in the fix group are the only ones whose velocities and
51 positions are updated by the velocity/position update portion of the
54 Regardless of what particles are in the fix group, a global pressure is
55 computed for all particles. Similarly, when the size of the simulation
56 box is changed, all particles are re-scaled to new positions, unless the
57 keyword {dilate} is specified with a value of {partial}, in which case
58 only the particles in the fix group are re-scaled. The latter can be
59 useful for leaving the coordinates of particles in a solid substrate
60 unchanged and controlling the pressure of a surrounding fluid.
64 This fix computes a temperature and pressure each timestep. To do
65 this, the fix creates its own computes of style "temp/body" and
66 "pressure", as if these commands had been issued:
68 compute fix-ID_temp all temp/body
69 compute fix-ID_press all pressure fix-ID_temp :pre
71 See the "compute temp/body"_compute_temp_body.html and "compute
72 pressure"_compute_pressure.html commands for details. Note that the
73 IDs of the new computes are the fix-ID + underscore + "temp" or fix_ID
74 + underscore + "press", and the group for the new computes is "all"
75 since pressure is computed for the entire system.
77 Note that these are NOT the computes used by thermodynamic output (see
78 the "thermo_style"_thermo_style.html command) with ID = {thermo_temp}
79 and {thermo_press}. This means you can change the attributes of this
80 fix's temperature or pressure via the
81 "compute_modify"_compute_modify.html command or print this temperature
82 or pressure during thermodynamic output via the "thermo_style
83 custom"_thermo_style.html command using the appropriate compute-ID.
84 It also means that changing attributes of {thermo_temp} or
85 {thermo_press} will have no effect on this fix.
87 Like other fixes that perform thermostatting, this fix can be used
88 with "compute commands"_compute.html that calculate a temperature
89 after removing a "bias" from the atom velocities. E.g. removing the
90 center-of-mass velocity from a group of atoms or only calculating
91 temperature on the x-component of velocity or only calculating
92 temperature for atoms in a geometric region. This is not done by
93 default, but only if the "fix_modify"_fix_modify.html command is used
94 to assign a temperature compute to this fix that includes such a bias
95 term. See the doc pages for individual "compute
96 commands"_compute.html to determine which ones include a bias. In
97 this case, the thermostat works in the following manner: the current
98 temperature is calculated taking the bias into account, bias is
99 removed from each atom, thermostatting is performed on the remaining
100 thermal degrees of freedom, and the bias is added back in.
104 Styles with a {gpu}, {intel}, {kk}, {omp}, or {opt} suffix are
105 functionally the same as the corresponding style without the suffix.
106 They have been optimized to run faster, depending on your available
107 hardware, as discussed in "Section 5"_Section_accelerate.html
108 of the manual. The accelerated styles take the same arguments and
109 should produce the same results, except for round-off and precision
112 These accelerated styles are part of the GPU, USER-INTEL, KOKKOS,
113 USER-OMP and OPT packages, respectively. They are only enabled if
114 LAMMPS was built with those packages. See the "Making
115 LAMMPS"_Section_start.html#start_3 section for more info.
117 You can specify the accelerated styles explicitly in your input script
118 by including their suffix, or you can use the "-suffix command-line
119 switch"_Section_start.html#start_7 when you invoke LAMMPS, or you can
120 use the "suffix"_suffix.html command in your input script.
122 See "Section 5"_Section_accelerate.html of the manual for
123 more instructions on how to use the accelerated styles effectively.
125 [Restart, fix_modify, output, run start/stop, minimize info:]
127 This fix writes the state of the Nose/Hoover thermostat and barostat
128 to "binary restart files"_restart.html. See the
129 "read_restart"_read_restart.html command for info on how to re-specify
130 a fix in an input script that reads a restart file, so that the
131 operation of the fix continues in an uninterrupted fashion.
133 The "fix_modify"_fix_modify.html {temp} and {press} options are
134 supported by this fix. You can use them to assign a
135 "compute"_compute.html you have defined to this fix which will be used
136 in its thermostatting or barostatting procedure. If you do this, note
137 that the kinetic energy derived from the compute temperature should be
138 consistent with the virial term computed using all atoms for the
139 pressure. LAMMPS will warn you if you choose to compute temperature
140 on a subset of atoms.
142 The "fix_modify"_fix_modify.html {energy} option is supported by this
143 fix to add the energy change induced by Nose/Hoover thermostatting and
144 barostatting to the system's potential energy as part of
145 "thermodynamic output"_thermo_style.html.
147 This fix computes the same global scalar and global vector of
148 quantities as does the "fix npt"_fix_nh.html command.
150 This fix can ramp its target temperature and pressure over multiple
151 runs, using the {start} and {stop} keywords of the "run"_run.html
152 command. See the "run"_run.html command for details of how to do
155 This fix is not invoked during "energy minimization"_minimize.html.
159 This fix is part of the BODY package. It is only enabled if LAMMPS
160 was built with that package. See the "Making
161 LAMMPS"_Section_start.html#start_3 section for more info.
163 This fix requires that atoms store torque and angular momementum and a
164 quaternion as defined by the "atom_style body"_atom_style.html
169 "fix npt"_fix_nh.html, "fix nve_body"_fix_nve_body.html, "fix
170 nvt_body"_fix_nvt_body.html, "fix_modify"_fix_modify.html