header->pcrd[i].pull_type = ir->pull->coord[i].eType;
header->pcrd[i].geometry = ir->pull->coord[i].eGeom;
header->pcrd[i].ngroup = ir->pull->coord[i].ngroup;
- /* Angle type coordinates are handled fully in degrees in gmx wham */
- header->pcrd[i].k = ir->pull->coord[i].k*pull_conversion_factor_internal2userinput(&ir->pull->coord[i]);
+ /* Angle type coordinates are handled fully in degrees in gmx wham.
+ * The pull "distance" appears with a power of -2 in the force constant,
+ * so we need to multiply with the internal units (radians for angle)
+ * to user units (degrees for an angle) with the same power.
+ */
+ header->pcrd[i].k = ir->pull->coord[i].k/gmx::square(pull_conversion_factor_internal2userinput(&ir->pull->coord[i]));
header->pcrd[i].init_dist = ir->pull->coord[i].init;
copy_ivec(ir->pull->coord[i].dim, header->pcrd[i].dim);