atomistics.calculators.lammps.shared.get_box_relax_command#
- atomistics.calculators.lammps.shared.get_box_relax_command(pressure: float | Iterable[float | None], vmax: float | None) → str[source]#
Build a LAMMPS
fix box/relaxcommand string for the given pressure specification.When
pressureis a scalar the command uses isotropic relaxation (iso). Whenpressureis an iterable of length 3, the x/y/z components are set individually; components that areNoneare omitted. An iterable of length 6 additionally sets the xy/xz/yz off-diagonal components.- Parameters:
pressure (float | Iterable[float | None]) – Target pressure in bar. A scalar applies isotropic pressure; an iterable of 3 or 6 elements applies anisotropic pressure component-wise (
Noneentries are skipped).vmax (float | None) – Maximum fractional volume change per timestep (LAMMPS
vmaxkeyword). Novmaxclause is added whenNone.
- Returns:
A complete LAMMPS
fixcommand string.- Return type:
str
- Raises:
ValueError – If
pressureis an iterable whose length is not 3 or 6.TypeError – If
vmaxis not afloat.