Skip to content

Commit

Permalink
Regtest for lambda-ABF in NAMD
Browse files Browse the repository at this point in the history
  • Loading branch information
jhenin committed Jun 5, 2024
1 parent be9584d commit b094ab9
Show file tree
Hide file tree
Showing 22 changed files with 476 additions and 20 deletions.
2 changes: 1 addition & 1 deletion namd/src/colvarproxy_namd.C
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,7 @@ int colvarproxy_namd::request_alch_energy_freq(int const freq) {
return COLVARS_INPUT_ERROR;
}
if (!simparams->alchOn) {
cvm::error("alch must be enabled for lambda-dynamics.\n");
cvm::error("alchOn must be enabled for lambda-dynamics.\n");
return COLVARS_INPUT_ERROR;
}
if (!simparams->alchThermIntOn) {
Expand Down
120 changes: 120 additions & 0 deletions namd/tests/interface/009_lambda_dynamics/AutoDiff/test.colvars.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
colvars: ----------------------------------------------------------------------
colvars: Please cite Fiorin et al, Mol Phys 2013:
colvars: https://doi.org/10.1080/00268976.2013.813594
colvars: as well as all other papers listed below for individual features used.
colvars: This version was built with the C++11 standard or higher.
colvars: Summary of compile-time features available in this build:
colvars: - SMP parallelism: enabled (num. threads = 4)
colvars: - Lepton custom functions: available
colvars: - Tcl interpreter: available
colvars: Redefining the Tcl "cv" command to the new script interface.
colvars: The restart output state file will be "test.tmp.colvars.state".
colvars: The final output state file will be "test.colvars.state".
colvars: ----------------------------------------------------------------------
colvars: Reading new configuration from file "test.in":
colvars: # units = "" [default]
colvars: # smp = on [default]
colvars: # colvarsTrajFrequency = 1
colvars: # colvarsRestartFrequency = 10 [default]
colvars: # scriptedColvarForces = off [default]
colvars: # scriptingAfterBiases = off [default]
colvars: # sourceTclFile = "" [default]
colvars: ----------------------------------------------------------------------
colvars: Initializing a new collective variable.
colvars: # name = "lambda"
colvars: Initializing a new "alchLambda" component.
colvars: Warning: cannot cite unknown feature "alchLambda colvar component"
colvars: # name = "" [default]
colvars: # componentCoeff = 1 [default]
colvars: # componentExp = 1 [default]
colvars: # period = 0 [default]
colvars: # wrapAround = 0 [default]
colvars: # forceNoPBC = off [default]
colvars: # scalable = on [default]
colvars: All components initialized.
colvars: # timeStepFactor = 1 [default]
colvars: # width = 1 [default]
colvars: # lowerBoundary = 0
colvars: # upperBoundary = 1
colvars: # hardLowerBoundary = off [default]
colvars: # hardUpperBoundary = off [default]
colvars: # expandBoundaries = off [default]
colvars: # extendedLagrangian = on
colvars: Enabling the extended Lagrangian term for colvar "lambda".
colvars: # extendedTemp = 300 [default]
colvars: # extendedMass = 150000
colvars: # outputEnergy = off [default]
colvars: # extendedLangevinDamping = 1000
colvars: # reflectingLowerBoundary = on
colvars: # reflectingUpperBoundary = on
colvars: # outputValue = on [default]
colvars: # outputVelocity = off [default]
colvars: # outputTotalForce = off [default]
colvars: # outputAppliedForce = off [default]
colvars: # subtractAppliedForce = off [default]
colvars: # runAve = off [default]
colvars: # corrFunc = off [default]
colvars: ----------------------------------------------------------------------
colvars: Collective variables initialized, 1 in total.
colvars: ----------------------------------------------------------------------
colvars: Initializing a new "abf" instance.
colvars: # name = "abf1" [default]
colvars: # colvars = { lambda }
colvars: # stepZeroData = off [default]
colvars: # outputEnergy = off [default]
colvars: # outputFreq = 10 [default]
colvars: # timeStepFactor = 1 [default]
colvars: # applyBias = on [default]
colvars: # hideJacobian = off [default]
colvars: Jacobian (geometric) forces will be included in reported free energy gradients.
colvars: # fullSamples = 10
colvars: # minSamples = 5 [default]
colvars: # inputPrefix = [default]
colvars: # historyFreq = 0 [default]
colvars: # shared = off [default]
colvars: # updateBias = on [default]
colvars: # maxForce = [default]
colvars: # integrate = on [default]
colvars: Finished ABF setup.
colvars: ----------------------------------------------------------------------
colvars: Collective variables biases initialized, 1 in total.
colvars: ----------------------------------------------------------------------
colvars: Collective variables module (re)initialized.
colvars: ----------------------------------------------------------------------
colvars: Updating NAMD interface:
colvars: updating atomic data (0 atoms).
colvars: updating group data (0 scalable groups, 0 atoms in total).
colvars: updating grid object data (0 grid objects in total).
colvars:
colvars: SUMMARY OF COLVARS FEATURES USED SO FAR AND THEIR CITATIONS:
colvars:
colvars: - BAOA integrator:
colvars: BouRabee2010 https://doi.org/10.1137/090758842
colvars:
colvars: - Colvars module:
colvars: - Colvars-NAMD interface:
colvars: Fiorin2013 https://doi.org/10.1080/00268976.2013.813594
colvars:
colvars: - ABF colvar bias implementation:
colvars: - Internal-forces free energy estimator:
colvars: Henin2010 https://doi.org/10.1021/ct9004432
colvars:
colvars: - NAMD engine:
colvars: Phillips2020 https://doi.org/10.1063/5.0014475
colvars:
colvars: updating target temperature (T = 300 K).
colvars: Updating NAMD interface:
colvars: updating atomic data (0 atoms).
colvars: updating group data (0 scalable groups, 0 atoms in total).
colvars: updating grid object data (0 grid objects in total).
colvars: updating target temperature (T = 300 K).
colvars: Current simulation parameters: initial step = 0, integration timestep = 1
colvars: Updating atomic parameters (masses, charges, etc).
colvars: The restart output state file will be "test.tmp.colvars.state".
colvars: Initializing extended coordinate to colvar value.
colvars: Synchronizing (emptying the buffer of) trajectory file "test.colvars.traj".
colvars: Synchronizing (emptying the buffer of) trajectory file "test.colvars.traj".
colvars: Saving collective variables state to "test.tmp.colvars.state".
colvars: Synchronizing (emptying the buffer of) trajectory file "test.colvars.traj".
colvars: Saving collective variables state to "test.tmp.colvars.state".
colvars: Saving collective variables state to "test.colvars.state".
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
configuration {
step 20
dt 1.000000e+00
}

colvar {
name lambda
x 0.017939564860453
extended_x 0.017939564860453
extended_v -0.0039272175432668
}

abf {
configuration {
step 20
name abf1
}

samples
20

gradient
-21.07662231815
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# step lambda
0 0.00000000000000e+00
1 1.58189758101320e-04
2 1.19327841511289e-03
3 3.70857622331628e-03
4 6.04081163026493e-03
5 7.98098139879974e-03
6 9.47926305485469e-03
7 1.01202609943538e-02
8 1.01712183611063e-02
9 9.05055355392043e-03
10 8.89176211928347e-03
11 1.05872292938942e-02
12 1.28132662393818e-02
13 1.40183748162680e-02
14 1.51097870579963e-02
15 1.81395457523218e-02
16 2.07363948627074e-02
17 2.15663253895955e-02
18 2.19450610288923e-02
19 2.09442028306918e-02
20 1.79395648604526e-02
4 changes: 4 additions & 0 deletions namd/tests/interface/009_lambda_dynamics/AutoDiff/test.count
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 1
# 0.00000000000000e+00 1.00000000000000e+00 1 0

5.00000000000000e-01 20
4 changes: 4 additions & 0 deletions namd/tests/interface/009_lambda_dynamics/AutoDiff/test.grad
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 1
# 0.00000000000000e+00 1.00000000000000e+00 1 0

5.00000000000000e-01 -2.10766223181505e+01
5 changes: 5 additions & 0 deletions namd/tests/interface/009_lambda_dynamics/AutoDiff/test.pmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 1
# -5.00000000000000e-01 1.00000000000000e+00 2 0

0.00000000000000e+00 2.10766223181505e+01
1.00000000000000e+00 0.00000000000000e+00
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
colvars: ----------------------------------------------------------------------
colvars: Please cite Fiorin et al, Mol Phys 2013:
colvars: https://doi.org/10.1080/00268976.2013.813594
colvars: as well as all other papers listed below for individual features used.
colvars: This version was built with the C++11 standard or higher.
colvars: Summary of compile-time features available in this build:
colvars: - SMP parallelism: enabled (num. threads = 4)
colvars: - Lepton custom functions: available
colvars: - Tcl interpreter: available
colvars: Redefining the Tcl "cv" command to the new script interface.
colvars: The restart output state file will be "test.restart.tmp.colvars.state".
colvars: The final output state file will be "test.restart.colvars.state".
colvars: ----------------------------------------------------------------------
colvars: Reading new configuration from file "test.in":
colvars: # units = "" [default]
colvars: # smp = on [default]
colvars: # colvarsTrajFrequency = 1
colvars: # colvarsRestartFrequency = 10 [default]
colvars: # scriptedColvarForces = off [default]
colvars: # scriptingAfterBiases = off [default]
colvars: # sourceTclFile = "" [default]
colvars: ----------------------------------------------------------------------
colvars: Initializing a new collective variable.
colvars: # name = "lambda"
colvars: Initializing a new "alchLambda" component.
colvars: Warning: cannot cite unknown feature "alchLambda colvar component"
colvars: # name = "" [default]
colvars: # componentCoeff = 1 [default]
colvars: # componentExp = 1 [default]
colvars: # period = 0 [default]
colvars: # wrapAround = 0 [default]
colvars: # forceNoPBC = off [default]
colvars: # scalable = on [default]
colvars: All components initialized.
colvars: # timeStepFactor = 1 [default]
colvars: # width = 1 [default]
colvars: # lowerBoundary = 0
colvars: # upperBoundary = 1
colvars: # hardLowerBoundary = off [default]
colvars: # hardUpperBoundary = off [default]
colvars: # expandBoundaries = off [default]
colvars: # extendedLagrangian = on
colvars: Enabling the extended Lagrangian term for colvar "lambda".
colvars: # extendedTemp = 300 [default]
colvars: # extendedMass = 150000
colvars: # outputEnergy = off [default]
colvars: # extendedLangevinDamping = 1000
colvars: # reflectingLowerBoundary = on
colvars: # reflectingUpperBoundary = on
colvars: # outputValue = on [default]
colvars: # outputVelocity = off [default]
colvars: # outputTotalForce = off [default]
colvars: # outputAppliedForce = off [default]
colvars: # subtractAppliedForce = off [default]
colvars: # runAve = off [default]
colvars: # corrFunc = off [default]
colvars: ----------------------------------------------------------------------
colvars: Collective variables initialized, 1 in total.
colvars: ----------------------------------------------------------------------
colvars: Initializing a new "abf" instance.
colvars: # name = "abf1" [default]
colvars: # colvars = { lambda }
colvars: # stepZeroData = off [default]
colvars: # outputEnergy = off [default]
colvars: # outputFreq = 10 [default]
colvars: # timeStepFactor = 1 [default]
colvars: # applyBias = on [default]
colvars: # hideJacobian = off [default]
colvars: Jacobian (geometric) forces will be included in reported free energy gradients.
colvars: # fullSamples = 10
colvars: # minSamples = 5 [default]
colvars: # inputPrefix = [default]
colvars: # historyFreq = 0 [default]
colvars: # shared = off [default]
colvars: # updateBias = on [default]
colvars: # maxForce = [default]
colvars: # integrate = on [default]
colvars: Finished ABF setup.
colvars: ----------------------------------------------------------------------
colvars: Collective variables biases initialized, 1 in total.
colvars: ----------------------------------------------------------------------
colvars: Collective variables module (re)initialized.
colvars: ----------------------------------------------------------------------
colvars: Updating NAMD interface:
colvars: updating atomic data (0 atoms).
colvars: updating group data (0 scalable groups, 0 atoms in total).
colvars: updating grid object data (0 grid objects in total).
colvars:
colvars: SUMMARY OF COLVARS FEATURES USED SO FAR AND THEIR CITATIONS:
colvars:
colvars: - BAOA integrator:
colvars: BouRabee2010 https://doi.org/10.1137/090758842
colvars:
colvars: - Colvars module:
colvars: - Colvars-NAMD interface:
colvars: Fiorin2013 https://doi.org/10.1080/00268976.2013.813594
colvars:
colvars: - ABF colvar bias implementation:
colvars: - Internal-forces free energy estimator:
colvars: Henin2010 https://doi.org/10.1021/ct9004432
colvars:
colvars: - NAMD engine:
colvars: Phillips2020 https://doi.org/10.1063/5.0014475
colvars:
colvars: updating target temperature (T = 300 K).
colvars: ----------------------------------------------------------------------
colvars: Loading state from text file "test.colvars.state".
colvars: Restarting collective variable "lambda" from value: 0.0179396
colvars: Restarted abf bias "abf1" with step number 20.
colvars: ----------------------------------------------------------------------
colvars: Updating NAMD interface:
colvars: updating atomic data (0 atoms).
colvars: updating group data (0 scalable groups, 0 atoms in total).
colvars: updating grid object data (0 grid objects in total).
colvars: updating target temperature (T = 300 K).
colvars: Current simulation parameters: initial step = 20, integration timestep = 1
colvars: Updating atomic parameters (masses, charges, etc).
colvars: The restart output state file will be "test.restart.tmp.colvars.state".
colvars: Synchronizing (emptying the buffer of) trajectory file "test.restart.colvars.traj".
colvars: Synchronizing (emptying the buffer of) trajectory file "test.restart.colvars.traj".
colvars: Saving collective variables state to "test.restart.tmp.colvars.state".
colvars: Synchronizing (emptying the buffer of) trajectory file "test.restart.colvars.traj".
colvars: Saving collective variables state to "test.restart.tmp.colvars.state".
colvars: Saving collective variables state to "test.restart.colvars.state".
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
configuration {
step 40
dt 1.000000e+00
}

colvar {
name lambda
x 0.02273484988199
extended_x 0.02273484988199
extended_v -0.0039050494285154
}

abf {
configuration {
step 40
name abf1
}

samples
40

gradient
-22.446008885682
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# step lambda
20 1.79395648604530e-02
21 1.49992941052693e-02
22 1.21946330562864e-02
23 1.09929345082144e-02
24 1.18495428543575e-02
25 1.31445493932408e-02
26 1.43077987902124e-02
27 1.47517911806093e-02
28 1.46807494197067e-02
29 1.34898108165063e-02
30 1.33035794715814e-02
31 1.50108946364389e-02
32 1.72664594652867e-02
33 1.85065811567009e-02
34 1.96374992188600e-02
35 2.27101696863379e-02
36 2.53525217024379e-02
37 2.62294494632504e-02
38 2.66547145690537e-02
39 2.56982742031037e-02
40 2.27348498819902e-02
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 1
# 0.00000000000000e+00 1.00000000000000e+00 1 0

5.00000000000000e-01 40
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 1
# 0.00000000000000e+00 1.00000000000000e+00 1 0

5.00000000000000e-01 -2.24460088856819e+01
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 1
# -5.00000000000000e-01 1.00000000000000e+00 2 0

0.00000000000000e+00 2.24460088856819e+01
1.00000000000000e+00 0.00000000000000e+00
11 changes: 11 additions & 0 deletions namd/tests/interface/009_lambda_dynamics/alchemy.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

langevin on
langevinTemp 300.0
langevinDamping 0.000000001

alch on
alchType TI
alchFile ../Common/da.pdb
alchCol B
alchLambda 0

Loading

0 comments on commit b094ab9

Please sign in to comment.