File tree 2 files changed +17
-4
lines changed 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,17 @@ for this in grompp was lost. Now both grompp and mdrun will exit with an error.
63
63
:issue: `3775 `
64
64
:issue: `5053 `
65
65
66
+ Correct dH/dlambda with MTS and perturbed constraints
67
+ """""""""""""""""""""""""""""""""""""""""""""""""""""
68
+
69
+ When doing free-energy calculations with multiple time stepping and perturbed
70
+ constraint lengths, the slow force contributions to dH/dlambda were incorrectly
71
+ multiplied by the MTS factor. The effect of this is usually rather small
72
+ when only integrating the PME grid part less frequently, but can be substantial
73
+ when the non-bonded pair interactions are not integrated at every step.
74
+
75
+ :issue: `5060 `
76
+
66
77
Fixes for ``gmx `` tools
67
78
^^^^^^^^^^^^^^^^^^^^^^^
68
79
Original file line number Diff line number Diff line change @@ -1588,12 +1588,14 @@ void gmx::LegacySimulator::do_md()
1588
1588
else
1589
1589
{
1590
1590
/* With multiple time stepping we need to do an additional normal
1591
- * update step to obtain the virial, as the actual MTS integration
1591
+ * update step to obtain the virial and dH/dl , as the actual MTS integration
1592
1592
* using an acceleration where the slow forces are multiplied by mtsFactor.
1593
1593
* Using that acceleration would result in a virial with the slow
1594
1594
* force contribution would be a factor mtsFactor too large.
1595
1595
*/
1596
- if (simulationWork.useMts && bCalcVir && constr != nullptr )
1596
+ const bool separateVirialConstraining =
1597
+ (simulationWork.useMts && (bCalcVir || computeDHDL) && constr != nullptr );
1598
+ if (separateVirialConstraining)
1597
1599
{
1598
1600
upd.update_for_constraint_virial (*ir,
1599
1601
md->homenr ,
@@ -1643,8 +1645,8 @@ void gmx::LegacySimulator::do_md()
1643
1645
step,
1644
1646
state,
1645
1647
upd.xp ()->arrayRefWithPadding (),
1646
- &dvdl_constr,
1647
- bCalcVir && !simulationWork. useMts ,
1648
+ separateVirialConstraining ? nullptr : &dvdl_constr,
1649
+ bCalcVir && !separateVirialConstraining ,
1648
1650
shake_vir);
1649
1651
1650
1652
upd.update_sd_second_half (*ir,
You can’t perform that action at this time.
0 commit comments