This module calculates the instantaneous values of thermodynamic state variables for the particles of a given group.
Construct thermodynamics module.
| Parameters: |
|
|---|
Returns the number of particles
selected by args.group.
Returns the number density
using the volume from
args.box.
Returns the mean kinetic energy per particle:
.
Returns the mean potential energy per particle:
,
where
denotes the sum of external and pair
potentials.
Returns the mean total energy per particle:
.
Returns the pressure computed from the virial:
.
Returns the instantaneous temperature as given by the kinetic energy:
.
Returns the centre-of-mass velocity:
.
Returns the centre of mass:
,
where
refers to absolute particle positions, i.e.,
extended by their image vectors for periodic boundary conditions.
Returns the mean particle mass:
.
Returns mean virial per particle as computed from the trace of the potential part of the stress tensor:

Returns the mean hypervirial per particle, see the book by M. P. Allen and D. J. Tildesley (Clarendon Press, Oxford, 1987) for a definition. This quantity may be used to determine the isochoric compressibility from NVE simulations, which does not work very well in practice. A superior route is to extrapolate the static structure factor to zero wavenumber.
This method will be deprecated in the next release.
Returns the elements of the stress tensor
as a
vector. The first
(= dimension) elements contain the diagonal
followed by
off-diagonal elements
The stress tensor is computed as
![\Pi_{\alpha\beta} = \sum_{i=1}^N \left[
m_i v_{i\alpha} v_{i\beta} +
\frac{1}{2}\sum_{j \neq i} \frac{r_{ij\alpha} r_{ij\beta}}{r_{ij}} \, U'(r_{ij})
\right] \/,](../../_images/math/b0c3443f51c035b489a1841e90e82d37f2e47df5.png)
where
in nearest image convention.
Space dimension
of the simulation box as a number.
Instance of halmd.mdsim.particle_groups used to construct the module.
Write state variables to a file.
| Parameters: |
|
|---|---|
| Returns: | instance of group writer |
The argument location specifies a path in a structured file format like H5MD given as a table of strings. If omitted it defaults to {"observables", group.label}.
The table fields specifies which data fields are written. It may either be passed as an indexed table, e.g. {"pressure"}, or as a dictionary, e.g., {p = "pressure"}; the table form is interpreted as {pressure = "pressure", …}. The keys denote the field names in the file and are appended to location. The values specify the data methods of the thermodynamics module, i.e., all methods described above except for dimension and group. The default is {"potential_energy", "pressure", "temperature", "center_of_mass_velocity"}.
Disconnect thermodynamics writer from observables sampler.