- /* To fullfill the orientation restrictions on triclinic boxes
- * we will set mu_yx, mu_zx and mu_zy to 0 and correct
- * the other elements of mu to first order.
- */
- mu[YY][XX] += mu[XX][YY];
- mu[ZZ][XX] += mu[XX][ZZ];
- mu[ZZ][YY] += mu[YY][ZZ];
- mu[XX][YY] = 0;
- mu[XX][ZZ] = 0;
- mu[YY][ZZ] = 0;
-
- /* Keep track of the work the barostat applies on the system.
- * Without constraints force_vir tells us how Epot changes when scaling.
- * With constraints constraint_vir gives us the constraint contribution
- * to both Epot and Ekin. Although we are not scaling velocities, scaling
- * the coordinates leads to scaling of distances involved in constraints.
- * This in turn changes the angular momentum (even if the constrained
- * distances are corrected at the next step). The kinetic component
- * of the constraint virial captures the angular momentum change.
- */
- for (int d = 0; d < DIM; d++)
- {
- for (int n = 0; n <= d; n++)
- {
- *baros_integral -=
- 2 * (mu[d][n] - (n == d ? 1 : 0)) * (force_vir[d][n] + constraint_vir[d][n]);
- }
- }
-
- if (debug)
- {
- pr_rvecs(debug, 0, "PC: pres ", pres, 3);
- pr_rvecs(debug, 0, "PC: mu ", mu, 3);
- }
-
- if (mu[XX][XX] < 0.99 || mu[XX][XX] > 1.01 || mu[YY][YY] < 0.99 || mu[YY][YY] > 1.01
- || mu[ZZ][ZZ] < 0.99 || mu[ZZ][ZZ] > 1.01)
- {
- char buf2[22];
- sprintf(buf,
- "\nStep %s Warning: pressure scaling more than 1%%, "
- "mu: %g %g %g\n",
- gmx_step_str(step, buf2),
- mu[XX][XX],
- mu[YY][YY],
- mu[ZZ][ZZ]);
- if (fplog)
- {
- fprintf(fplog, "%s", buf);
- }
- fprintf(stderr, "%s", buf);
- }