|
3 | 3 | # Jerome Henin <[email protected]> |
4 | 4 | # |
5 | 5 | # Changes: |
| 6 | +# 2020-05-03: added prev_lambda option to runFEP, improved doc |
6 | 7 | # 2018-04-18: added interleaved double-wide sampling (IDWS) |
7 | 8 | # 2010-04-24: added runFEPmin |
8 | 9 | # 2009-11-17: changed for NAMD 2.7 keywords |
|
12 | 13 | ############################################################## |
13 | 14 |
|
14 | 15 | ############################################################## |
15 | | -# Example NAMD input: |
| 16 | +## Example NAMD input: calculation with smaller windows at |
| 17 | +## the ends |
16 | 18 | # |
17 | 19 | # source fep.tcl |
18 | 20 | # |
|
24 | 26 | # alchEquilSteps 500 |
25 | 27 | # |
26 | 28 | # set nSteps 5000 |
27 | | -# set init {0 0.05 0.1} |
| 29 | +# |
| 30 | +## A) Simple schedule: 20 windows from 0 to 1, in a single run |
| 31 | +# |
| 32 | +# runFEP 0.0 1.0 0.05 $nSteps |
| 33 | +# |
| 34 | +## B) Same thing, in two NAMD separate runs with a restart |
| 35 | +# |
| 36 | +## First run |
| 37 | +# runFEP 0.0 0.5 0.05 $nSteps |
| 38 | +# |
| 39 | +## Restart |
| 40 | +# runFEP 0.5 1.0 0.05 $nSteps |
| 41 | +# |
| 42 | +## C) Lambda schedule with narrower windows at the end points |
| 43 | +## Using two explicit lists of lambda points |
| 44 | +# |
| 45 | +# set init {0.0 0.05 0.1} |
28 | 46 | # set end {0.9 0.95 1.0} |
29 | 47 | # |
30 | 48 | # runFEPlist $init $nSteps |
|
38 | 56 | ############################################################## |
39 | 57 |
|
40 | 58 | ############################################################## |
41 | | -# Special usage for Interleaved Double-Wide sampling |
| 59 | +## Special usage for Interleaved Double-Wide sampling |
| 60 | +## A) Simple schedule: 20 windows from 0 to 1, in a single run |
| 61 | +# |
| 62 | +# runFEP 0.0 1.0 0.05 $nSteps true |
| 63 | +# |
| 64 | +## B) Same thing, in two NAMD separate runs with a restart |
42 | 65 | # |
43 | | -# Example of a piecewise calculation with restarts |
| 66 | +## First run |
| 67 | +# runFEP 0.0 0.5 0.05 $nSteps true |
| 68 | +# |
| 69 | +## Restart - need to tell the script the previous lambda point: 0.45 |
| 70 | +# runFEP 0.5 1.0 0.05 $nSteps true 0.45 |
| 71 | +# |
| 72 | +## C) Example of a piecewise calculation with restarts |
44 | 73 | # and a nonlinear lambda schedule |
45 | 74 | # |
46 | | -## Run individual points 0, 0.05 then the series from 0.1 to 0.4 |
| 75 | +## Run individual points 0, 0.05 then the series from 0.1 to 0.5 |
47 | 76 | # |
48 | | -# runFEPlist [concat {0. 0.05} [FEPlist 0.1 0.4 0.1]] $numSteps true |
| 77 | +# runFEPlist [concat {0. 0.05} [FEPlist 0.1 0.5 0.1]] $numSteps true |
49 | 78 | # |
50 | 79 | ## Continue series from 0.5 to 0.9, sampling backward dE from 0.4 |
51 | 80 | # |
@@ -82,7 +111,7 @@ proc runFEPlist { lambdaList nSteps { IDWS false } { prev_lambda -1 } } { |
82 | 111 | firsttimestep 0 |
83 | 112 | alchLambda $l1 |
84 | 113 | alchLambda2 $l2 |
85 | | - |
| 114 | + |
86 | 115 | if { $IDWS && ($prev_lambda >= 0.) } { |
87 | 116 | alchLambdaIDWS $prev_lambda |
88 | 117 | } |
@@ -110,14 +139,14 @@ proc runFEPlist { lambdaList nSteps { IDWS false } { prev_lambda -1 } } { |
110 | 139 |
|
111 | 140 |
|
112 | 141 | ############################################################## |
113 | | -# proc runFEP { start stop dLambda nSteps {IDWS} } |
| 142 | +# proc runFEP { start stop dLambda nSteps {IDWS} {prev_lambda} } |
114 | 143 | # |
115 | 144 | # run FEP windows of width dLambda between values start and stop |
116 | 145 | ############################################################## |
117 | 146 |
|
118 | | -proc runFEP { start stop dLambda nSteps { IDWS false }} { |
| 147 | +proc runFEP { start stop dLambda nSteps { IDWS false } { prev_lambda -1 } } { |
119 | 148 |
|
120 | | - runFEPlist [FEPlist $start $stop $dLambda] $nSteps $IDWS |
| 149 | + runFEPlist [FEPlist $start $stop $dLambda] $nSteps $IDWS $prev_lambda |
121 | 150 | } |
122 | 151 |
|
123 | 152 |
|
@@ -188,7 +217,7 @@ proc runFEPmin { start stop dLambda nSteps nMinSteps temp} { |
188 | 217 | } |
189 | 218 | } |
190 | 219 |
|
191 | | - if { $nMinSteps > 0 } { |
| 220 | + if { $nMinSteps > 0 } { |
192 | 221 | alchLambda $start |
193 | 222 | alchLambda2 $start |
194 | 223 | minimize $nMinSteps |
|
0 commit comments