A hybrid method for the calculation of the pressure tenser in molecular dynamics (MD) simulations, which combines both the thermodynamic and mechanical definitions, is presented here. The need for a new approach was motivated initially by MD simulations of crystalline poly(ethylene oxide) (PEO) (S. Neyertz, D. Brown, and J. O. Thomas, 1994, J, chem. Phys., 101, 10064), as the combination in this model of effectively 'infinite' chains, holonomic constraints and the long-range Coulomb potential calculated via the Ewald summation method, presented difficulties with regard to the traditional routes for calculation of the pressure tenser. However, this technique is quite general and thus applicable also to most MD simulations performed using periodic boundary conditions. In this paper, we address in detail the contribution of forces arising from different parts of the potential and the constraints to the pressure tenser. The method is then illustrated in a model of crystalline PEO, where the sensitivity of the pressure tenser to details of the potential provides an effective criterion for assessing possible parameter sets.