Constant pressure-constant temperature molecular dynamics for rigid and partially rigid molecular systems