Skip to content

Commit

Permalink
Add test for Colvars state being read from LAMMPS binary restart file
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomofiorin committed Sep 6, 2023
1 parent 52a2663 commit ddea477
Show file tree
Hide file tree
Showing 11 changed files with 433 additions and 0 deletions.
132 changes: 132 additions & 0 deletions lammps/tests/interface/003_binary_restart/AutoDiff/test.colvars.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
colvars: Creating proxy instance
colvars: ----------------------------------------------------------------------
colvars: Please cite Fiorin et al, Mol Phys 2013:
colvars: https://dx.doi.org/10.1080/00268976.2013.813594
colvars: in any publication based on this calculation.
colvars: This version was built with the C++11 standard or higher.
colvars: Using LAMMPS interface, version "2019-08-17".
colvars: ----------------------------------------------------------------------
colvars: Reading new configuration from file "test.in":
colvars: # indexFile = "index.ndx"
colvars: The following index groups were read from the index file "index.ndx":
colvars: Protein (104 atoms).
colvars: Protein_noH (51 atoms).
colvars: Protein_Backbone (40 atoms).
colvars: Protein_C-alpha (10 atoms).
colvars: RMSD_atoms (10 atoms).
colvars: Protein_C-alpha_1_2 (2 atoms).
colvars: Protein_C-alpha_9_10 (2 atoms).
colvars: Protein_C-alpha_1 (1 atoms).
colvars: group1 (4 atoms).
colvars: Protein_C-alpha_2 (1 atoms).
colvars: group2 (4 atoms).
colvars: Protein_C-alpha_3 (1 atoms).
colvars: group3 (4 atoms).
colvars: Protein_C-alpha_4 (1 atoms).
colvars: group4 (4 atoms).
colvars: Protein_C-alpha_5 (1 atoms).
colvars: group5 (4 atoms).
colvars: Protein_C-alpha_6 (1 atoms).
colvars: group6 (4 atoms).
colvars: Protein_C-alpha_7 (1 atoms).
colvars: group7 (4 atoms).
colvars: Protein_C-alpha_8 (1 atoms).
colvars: group8 (4 atoms).
colvars: Protein_C-alpha_9 (1 atoms).
colvars: group9 (4 atoms).
colvars: Protein_C-alpha_10 (1 atoms).
colvars: group10 (4 atoms).
colvars: heavy_atoms (51 atoms).
colvars: # smp = on [default]
colvars: # colvarsTrajFrequency = 1
colvars: # colvarsRestartFrequency = 10
colvars: # scriptedColvarForces = off [default]
colvars: # scriptingAfterBiases = off [default]
colvars: ----------------------------------------------------------------------
colvars: Initializing a new collective variable.
colvars: # name = "one"
colvars: Initializing a new "distance" 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: Initializing atom group "group1".
colvars: # name = "" [default]
colvars: # centerReference = off [default]
colvars: # rotateReference = off [default]
colvars: # atomsOfGroup = "" [default]
colvars: # indexGroup = "group1"
colvars: # psfSegID = [default]
colvars: # atomsFile = "" [default]
colvars: # dummyAtom = ( 0 , 0 , 0 ) [default]
colvars: # enableForces = on [default]
colvars: # enableFitGradients = on [default]
colvars: # printAtomIDs = off [default]
colvars: Atom group "group1" defined with 4 atoms requested.
colvars: Initializing atom group "group2".
colvars: # name = "" [default]
colvars: # centerReference = off [default]
colvars: # rotateReference = off [default]
colvars: # atomsOfGroup = "" [default]
colvars: # indexGroup = "group2"
colvars: # psfSegID = [default]
colvars: # atomsFile = "" [default]
colvars: # dummyAtom = ( 0 , 0 , 0 ) [default]
colvars: # enableForces = on [default]
colvars: # enableFitGradients = on [default]
colvars: # printAtomIDs = off [default]
colvars: Atom group "group2" defined with 4 atoms requested.
colvars: # oneSiteSystemForce = off [default]
colvars: # oneSiteTotalForce = off [default]
colvars: All components initialized.
colvars: # timeStepFactor = 1 [default]
colvars: # width = 0.5
colvars: # lowerBoundary = 0 [default]
colvars: # upperBoundary = 0 [default]
colvars: # expandBoundaries = off [default]
colvars: # extendedLagrangian = off [default]
colvars: # outputValue = on [default]
colvars: # outputVelocity = off [default]
colvars: # outputTotalForce = off [default]
colvars: # outputAppliedForce = on
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 "harmonic" instance.
colvars: # name = "harmonic1" [default]
colvars: # colvars = { one }
colvars: # outputEnergy = on
colvars: # timeStepFactor = 1 [default]
colvars: # writeTISamples = off [default]
colvars: # writeTIPMF = off [default]
colvars: # centers = { 0.1 }
colvars: # targetCenters = { 0.2 }
colvars: # targetNumSteps = 10
colvars: # targetNumStages = 0 [default]
colvars: # outputAccumulatedWork = on
colvars: # outputCenters = on
colvars: # forceConstant = 0.001
colvars: # targetForceConstant = -1 [default]
colvars: The force constant for colvar "one" will be rescaled to 0.004 according to the specified width (0.5).
colvars: ----------------------------------------------------------------------
colvars: Collective variables biases initialized, 1 in total.
colvars: ----------------------------------------------------------------------
colvars: Collective variables module (re)initialized.
colvars: ----------------------------------------------------------------------
colvars: The restart output state file will be "rest.colvars.state".
colvars: The final output state file will be "test.colvars.state".
colvars: Writing to colvar trajectory file "test.colvars.traj".
colvars: Re-initialized atom group for variable "one":0/0. 4 atoms: total mass = 54.028, total charge = -0.72.
colvars: Re-initialized atom group for variable "one":0/1. 4 atoms: total mass = 54.028, total charge = -0.4.
colvars: Synchronizing (emptying the buffer of) trajectory file "test.colvars.traj".
colvars: Saving collective variables state to "rest.colvars.state".
colvars: Synchronizing (emptying the buffer of) trajectory file "test.colvars.traj".
colvars: Saving collective variables state to "rest.colvars.state".
colvars: Saving collective variables state to "test.colvars.state".
colvars: Resetting the Collective Variables module.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
configuration {
step 20
dt 1.000000e+00
}

colvar {
name one
x 3.21927610288861e+00
}

restraint {
configuration {
step 20
name harmonic1
firstStep 0
centers 2.00000000000000e-01
accumulatedWork -1.22156562115015e-03
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# step one fa_one E_harmonic1 x0_one W_harmonic1
0 3.20554673729024e+00 -1.24221869491610e-02 1.92888410749882e-02 1.00000000000000e-01 0.00000000000000e+00
1 3.20438161758906e+00 -1.23775264703562e-02 1.91503951905462e-02 1.10000000000000e-01 -1.23775264703563e-04
2 3.20388055819324e+00 -1.23355222327730e-02 1.90206385944045e-02 1.20000000000000e-01 -2.47130487031292e-04
3 3.20405695050090e+00 -1.22962278020036e-02 1.88996522698458e-02 1.30000000000000e-01 -3.70092765051328e-04
4 3.20488566343521e+00 -1.22595426537408e-02 1.87870482598613e-02 1.40000000000000e-01 -4.92688191588736e-04
5 3.20630523013386e+00 -1.22252209205354e-02 1.86820033194872e-02 1.50000000000000e-01 -6.14940400794091e-04
6 3.20822193294306e+00 -1.21928877317723e-02 1.85833139049503e-02 1.60000000000000e-01 -7.36869278111813e-04
7 3.21051524726036e+00 -1.21620609890414e-02 1.84894659376454e-02 1.70000000000000e-01 -8.58489888002227e-04
8 3.21304438443477e+00 -1.21321775377391e-02 1.83987164759025e-02 1.80000000000000e-01 -9.79811663379618e-04
9 3.21565597399793e+00 -1.21026238959917e-02 1.83091881459787e-02 1.90000000000000e-01 -1.10083790233954e-03
10 3.21819297026538e+00 -1.20727718810615e-02 1.82189776115188e-02 2.00000000000000e-01 -1.22156562115015e-03
11 3.22050455244023e+00 -1.20820182097609e-02 1.82468955026243e-02 2.00000000000000e-01 -1.22156562115015e-03
12 3.22245626645718e+00 -1.20898250658287e-02 1.82704837652926e-02 2.00000000000000e-01 -1.22156562115015e-03
13 3.22393923848317e+00 -1.20957569539327e-02 1.82884170360763e-02 2.00000000000000e-01 -1.22156562115015e-03
14 3.22487721259280e+00 -1.20995088503712e-02 1.82997643025264e-02 2.00000000000000e-01 -1.22156562115015e-03
15 3.22523054868521e+00 -1.21009221947408e-02 1.83040397453964e-02 2.00000000000000e-01 -1.22156562115015e-03
16 3.22499693749777e+00 -1.20999877499911e-02 1.83012129437417e-02 2.00000000000000e-01 -1.22156562115015e-03
17 3.22420921060027e+00 -1.20968368424011e-02 1.82916826989590e-02 2.00000000000000e-01 -1.22156562115015e-03
18 3.22293098631693e+00 -1.20917239452677e-02 1.82762234960701e-02 2.00000000000000e-01 -1.22156562115015e-03
19 3.22125091863508e+00 -1.20850036745403e-02 1.82559142267067e-02 2.00000000000000e-01 -1.22156562115015e-03
20 3.21927610288861e+00 -1.20771044115544e-02 1.82320563709485e-02 2.00000000000000e-01 -1.22156562115015e-03
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
colvars: Creating proxy instance
colvars: ----------------------------------------------------------------------
colvars: Please cite Fiorin et al, Mol Phys 2013:
colvars: https://dx.doi.org/10.1080/00268976.2013.813594
colvars: in any publication based on this calculation.
colvars: This version was built with the C++11 standard or higher.
colvars: Using LAMMPS interface, version "2019-08-17".
colvars: ----------------------------------------------------------------------
colvars: Reading new configuration from file "test.in":
colvars: # indexFile = "index.ndx"
colvars: The following index groups were read from the index file "index.ndx":
colvars: Protein (104 atoms).
colvars: Protein_noH (51 atoms).
colvars: Protein_Backbone (40 atoms).
colvars: Protein_C-alpha (10 atoms).
colvars: RMSD_atoms (10 atoms).
colvars: Protein_C-alpha_1_2 (2 atoms).
colvars: Protein_C-alpha_9_10 (2 atoms).
colvars: Protein_C-alpha_1 (1 atoms).
colvars: group1 (4 atoms).
colvars: Protein_C-alpha_2 (1 atoms).
colvars: group2 (4 atoms).
colvars: Protein_C-alpha_3 (1 atoms).
colvars: group3 (4 atoms).
colvars: Protein_C-alpha_4 (1 atoms).
colvars: group4 (4 atoms).
colvars: Protein_C-alpha_5 (1 atoms).
colvars: group5 (4 atoms).
colvars: Protein_C-alpha_6 (1 atoms).
colvars: group6 (4 atoms).
colvars: Protein_C-alpha_7 (1 atoms).
colvars: group7 (4 atoms).
colvars: Protein_C-alpha_8 (1 atoms).
colvars: group8 (4 atoms).
colvars: Protein_C-alpha_9 (1 atoms).
colvars: group9 (4 atoms).
colvars: Protein_C-alpha_10 (1 atoms).
colvars: group10 (4 atoms).
colvars: heavy_atoms (51 atoms).
colvars: # smp = on [default]
colvars: # colvarsTrajFrequency = 1
colvars: # colvarsRestartFrequency = 10
colvars: # scriptedColvarForces = off [default]
colvars: # scriptingAfterBiases = off [default]
colvars: ----------------------------------------------------------------------
colvars: Initializing a new collective variable.
colvars: # name = "one"
colvars: Initializing a new "distance" 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: Initializing atom group "group1".
colvars: # name = "" [default]
colvars: # centerReference = off [default]
colvars: # rotateReference = off [default]
colvars: # atomsOfGroup = "" [default]
colvars: # indexGroup = "group1"
colvars: # psfSegID = [default]
colvars: # atomsFile = "" [default]
colvars: # dummyAtom = ( 0 , 0 , 0 ) [default]
colvars: # enableForces = on [default]
colvars: # enableFitGradients = on [default]
colvars: # printAtomIDs = off [default]
colvars: Atom group "group1" defined with 4 atoms requested.
colvars: Initializing atom group "group2".
colvars: # name = "" [default]
colvars: # centerReference = off [default]
colvars: # rotateReference = off [default]
colvars: # atomsOfGroup = "" [default]
colvars: # indexGroup = "group2"
colvars: # psfSegID = [default]
colvars: # atomsFile = "" [default]
colvars: # dummyAtom = ( 0 , 0 , 0 ) [default]
colvars: # enableForces = on [default]
colvars: # enableFitGradients = on [default]
colvars: # printAtomIDs = off [default]
colvars: Atom group "group2" defined with 4 atoms requested.
colvars: # oneSiteSystemForce = off [default]
colvars: # oneSiteTotalForce = off [default]
colvars: All components initialized.
colvars: # timeStepFactor = 1 [default]
colvars: # width = 0.5
colvars: # lowerBoundary = 0 [default]
colvars: # upperBoundary = 0 [default]
colvars: # expandBoundaries = off [default]
colvars: # extendedLagrangian = off [default]
colvars: # outputValue = on [default]
colvars: # outputVelocity = off [default]
colvars: # outputTotalForce = off [default]
colvars: # outputAppliedForce = on
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 "harmonic" instance.
colvars: # name = "harmonic1" [default]
colvars: # colvars = { one }
colvars: # outputEnergy = on
colvars: # timeStepFactor = 1 [default]
colvars: # writeTISamples = off [default]
colvars: # writeTIPMF = off [default]
colvars: # centers = { 0.1 }
colvars: # targetCenters = { 0.2 }
colvars: # targetNumSteps = 10
colvars: # targetNumStages = 0 [default]
colvars: # outputAccumulatedWork = on
colvars: # outputCenters = on
colvars: # forceConstant = 0.001
colvars: # targetForceConstant = -1 [default]
colvars: The force constant for colvar "one" will be rescaled to 0.004 according to the specified width (0.5).
colvars: ----------------------------------------------------------------------
colvars: Collective variables biases initialized, 1 in total.
colvars: ----------------------------------------------------------------------
colvars: Collective variables module (re)initialized.
colvars: ----------------------------------------------------------------------
colvars: ----------------------------------------------------------------------
colvars: Restarting from file "test.colvars.state".
colvars: Restarting collective variable "one" from value: 3.21928
colvars: ----------------------------------------------------------------------
colvars: The restart output state file will be "rest.colvars.state".
colvars: The final output state file will be "test.restart.colvars.state".
colvars: Writing to colvar trajectory file "test.restart.colvars.traj".
colvars: Re-initialized atom group for variable "one":0/0. 4 atoms: total mass = 54.028, total charge = -0.72.
colvars: Re-initialized atom group for variable "one":0/1. 4 atoms: total mass = 54.028, total charge = -0.4.
colvars: Synchronizing (emptying the buffer of) trajectory file "test.restart.colvars.traj".
colvars: Saving collective variables state to "rest.colvars.state".
colvars: Synchronizing (emptying the buffer of) trajectory file "test.restart.colvars.traj".
colvars: Saving collective variables state to "rest.colvars.state".
colvars: Saving collective variables state to "test.restart.colvars.state".
colvars: Resetting the Collective Variables module.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
configuration {
step 40
dt 1.000000e+00
}

colvar {
name one
x 3.21816782210277e+00
}

restraint {
configuration {
step 40
name harmonic1
firstStep 0
centers 2.00000000000000e-01
accumulatedWork -1.22156562115015e-03
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# step one fa_one E_harmonic1 x0_one W_harmonic1
20 3.21927610420273e+00 -1.20771044168109e-02 1.82320563868192e-02 2.00000000000000e-01 -1.22156562115015e-03
21 3.21712493217758e+00 -1.20684997287103e-02 1.82060857127351e-02 2.00000000000000e-01 -1.22156562115015e-03
22 3.21491957781060e+00 -1.20596783112424e-02 1.81794801213313e-02 2.00000000000000e-01 -1.22156562115015e-03
23 3.21277838638075e+00 -1.20511135455230e-02 1.81536672108860e-02 2.00000000000000e-01 -1.22156562115015e-03
24 3.21080868797887e+00 -1.20432347519155e-02 1.81299379112181e-02 2.00000000000000e-01 -1.22156562115015e-03
25 3.20910075273950e+00 -1.20364030109580e-02 1.81093746802748e-02 2.00000000000000e-01 -1.22156562115015e-03
26 3.20772353744991e+00 -1.20308941497996e-02 1.80928017554604e-02 2.00000000000000e-01 -1.22156562115015e-03
27 3.20672256044185e+00 -1.20268902417674e-02 1.80807611109400e-02 2.00000000000000e-01 -1.22156562115015e-03
28 3.20611979984341e+00 -1.20244791993736e-02 1.80735125020211e-02 2.00000000000000e-01 -1.22156562115015e-03
29 3.20591518168161e+00 -1.20236607267264e-02 1.80710521589280e-02 2.00000000000000e-01 -1.22156562115015e-03
30 3.20608917462516e+00 -1.20243566985006e-02 1.80731442515971e-02 2.00000000000000e-01 -1.22156562115015e-03
31 3.20660613772624e+00 -1.20264245509050e-02 1.80793609348262e-02 2.00000000000000e-01 -1.22156562115015e-03
32 3.20741824461812e+00 -1.20296729784725e-02 1.80891289961239e-02 2.00000000000000e-01 -1.22156562115015e-03
33 3.20846986624845e+00 -1.20338794649938e-02 1.81017818722499e-02 2.00000000000000e-01 -1.22156562115015e-03
34 3.20970218001743e+00 -1.20388087200697e-02 1.81166144248033e-02 2.00000000000000e-01 -1.22156562115015e-03
35 3.21105763094978e+00 -1.20442305237991e-02 1.81329361138018e-02 2.00000000000000e-01 -1.22156562115015e-03
36 3.21248380017773e+00 -1.20499352007109e-02 1.81501172926665e-02 2.00000000000000e-01 -1.22156562115015e-03
37 3.21393637834814e+00 -1.20557455133925e-02 1.81676249854606e-02 2.00000000000000e-01 -1.22156562115015e-03
38 3.21538117931034e+00 -1.20615247172414e-02 1.81850473130780e-02 2.00000000000000e-01 -1.22156562115015e-03
39 3.21679532830021e+00 -1.20671813132008e-02 1.82021081057079e-02 2.00000000000000e-01 -1.22156562115015e-03
40 3.21816782210277e+00 -1.20726712884111e-02 1.82186740047531e-02 2.00000000000000e-01 -1.22156562115015e-03
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LAMMPS (12 Dec 2018)
1 change: 1 addition & 0 deletions lammps/tests/interface/003_binary_restart/notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Based on 000_distance_harmonic-centers-moving
34 changes: 34 additions & 0 deletions lammps/tests/interface/003_binary_restart/test.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
colvarsTrajFrequency 1
colvarsRestartFrequency 10
indexFile index.ndx

colvar {

name one

outputAppliedForce on

width 0.5

distance {
group1 {
indexGroup group1
}
group2 {
indexGroup group2
}
}
}

harmonic {
colvars one
centers 0.1
forceConstant 0.001

targetCenters 0.2
targetNumSteps 10

outputEnergy yes
outputCenters yes
outputAccumulatedWork yes
}
Loading

0 comments on commit ddea477

Please sign in to comment.