For generating an isobaric–isothermal ensemble in molecular dynamics simulations of atomic systems a correct ensemble distribution can be obtained by the approach of Martyna, Tobias and Klein [J. Chem. Phys. 101, 4177–4189 (1994)]. The constituting equations of the latter approach have been also generalised to molecular systems [M. E. Tuckerman, Statistical Mechanics: Theory and Molecular Simulation, Oxford Graduate Texts (2010)] using the molecular virial instead of the atomic one. An is...