Skip to content

Commit

Permalink
fix_modify interface tests for LAMMPS
Browse files Browse the repository at this point in the history
  • Loading branch information
jhenin authored and giacomofiorin committed Mar 18, 2019
1 parent 44145a8 commit 29e16b8
Show file tree
Hide file tree
Showing 10 changed files with 385 additions and 0 deletions.
1 change: 1 addition & 0 deletions lammps/tests/interface/README
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
The tests in this directory are meant to test and document the behavior
of the LAMMPS interface to the colvars library.
Group 01: fix colvars command options
Group 02: fix_modify
7 changes: 7 additions & 0 deletions lammps/tests/interface/harmonic.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
harmonic {
colvars one

centers 10.
forceConstant 1.
}

10 changes: 10 additions & 0 deletions lammps/tests/interface/in.02a
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# LAMMPS test 02a: redefining already existing colvar
# Validated: 13 February 2019-IBPC
include inc.minimal
fix f1 all colvars minimal.cfg unwrap yes output 02a

run 0 post no

fix_modify f1 configfile minimal.cfg # redefining same colvar, should fail

run 0 post no
10 changes: 10 additions & 0 deletions lammps/tests/interface/in.02b
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# LAMMPS test 02a: fix_modify to add bias acting on existing colvar
# Validated: 13 February 2019-IBPC
include inc.minimal
fix f1 all colvars minimal.cfg unwrap yes output 02b

run 0 post no

fix_modify f1 configfile harmonic.cfg # should work

run 0 post no
11 changes: 11 additions & 0 deletions lammps/tests/interface/ref/02a.colvars.state
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
configuration {
step 0
dt 1.000000e+00
version 2019-02-07
}

colvar {
name one
x 6.00000000000000e+00
}

2 changes: 2 additions & 0 deletions lammps/tests/interface/ref/02a.colvars.traj
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# step one
0 6.00000000000000e+00
18 changes: 18 additions & 0 deletions lammps/tests/interface/ref/02b.colvars.state
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
configuration {
step 0
dt 1.000000e+00
version 2019-02-07
}

colvar {
name one
x 6.00000000000000e+00
}

restraint {
configuration {
step 0
name harmonic1
}
}

4 changes: 4 additions & 0 deletions lammps/tests/interface/ref/02b.colvars.traj
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# step one
0 6.00000000000000e+00
# step one
0 6.00000000000000e+00
145 changes: 145 additions & 0 deletions lammps/tests/interface/ref/log.02a
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# Validated:
include inc.minimal
# minimal system config: two groups of two atoms
units real
atom_style atomic
atom_modify map array # XXX this should not be needed

pair_style lj/cut 5.0
read_data data.minimal
Reading data file ...
orthogonal box = (-5 -5 -10) to (5 5 10)
reading atoms ...
4 atoms
reading velocities ...
4 velocities

group g1 id 1 2
2 atoms in group g1
group g2 id 3 4
2 atoms in group g2

variable com1z equal xcm(g1,z)
variable com2z equal xcm(g2,z)
variable fcm1z equal fcm(g1,z)
variable fcm2z equal fcm(g2,z)
variable cveng equal f_f1

thermo_style custom step pe v_com1z v_com2z v_fcm1z v_fcm2z v_cveng
thermo 1

fix f1 all colvars minimal.cfg unwrap yes output 02a

run 0 post no
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 7
ghost atom cutoff = 7
binsize = 3.5, bins = 3 3 6
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair lj/cut, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d/newton
bin: standard
Setting up Verlet run ...
Unit style : real
Current step : 0
Time step : 1
colvars: Creating proxy instance
colvars: ----------------------------------------------------------------------
colvars: Please cite Fiorin et al, Mol Phys 2013:
colvars: http://dx.doi.org/10.1080/00268976.2013.813594
colvars: in any publication based on this calculation.
colvars: ----------------------------------------------------------------------
colvars: Reading new configuration from file "minimal.cfg":
colvars: # smp = on [default]
colvars: # colvarsTrajFrequency = 100 [default]
colvars: # colvarsRestartFrequency = 0 [default]
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 = "" [default]
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 2 atoms requested.
colvars: Initializing atom group "group2".
colvars: # name = "" [default]
colvars: # centerReference = off [default]
colvars: # rotateReference = off [default]
colvars: # atomsOfGroup = "" [default]
colvars: # indexGroup = "" [default]
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 2 atoms requested.
colvars: # oneSiteSystemForce = off [default]
colvars: # oneSiteTotalForce = off [default]
colvars: All components initialized.
colvars: # timeStepFactor = 1 [default]
colvars: # width = 1 [default]
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 = off [default]
colvars: # subtractAppliedForce = off [default]
colvars: # runAve = off [default]
colvars: # corrFunc = off [default]
colvars: ----------------------------------------------------------------------
colvars: Collective variables initialized, 1 in total.
colvars: No collective variables biases were defined.
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 "02a.colvars.state".
colvars: Writing to colvar trajectory file "02a.colvars.traj".
colvars: Re-initialized atom group for variable "one":0/0. 2 atoms: total mass = 2, total charge = 0.
colvars: Re-initialized atom group for variable "one":0/1. 2 atoms: total mass = 2, total charge = 0.
Step PotEng v_com1z v_com2z v_fcm1z v_fcm2z v_cveng
0 -0.0002563444 -7 -13 -2.99925e-05 2.99925e-05 0
colvars: Saving collective variables state to "02a.colvars.state".


fix_modify f1 configfile minimal.cfg # redefining same colvar, should fail
colvars: ----------------------------------------------------------------------
colvars: Reading new configuration from file "minimal.cfg":
colvars: # smp = on [default]
colvars: # colvarsTrajFrequency = 100 [default]
colvars: # colvarsRestartFrequency = 0 [default]
colvars: # scriptedColvarForces = off [default]
colvars: # scriptingAfterBiases = off [default]
colvars: ----------------------------------------------------------------------
colvars: Initializing a new collective variable.
colvars: # name = "one"
colvars: Error: this colvar cannot have the same name, "one", as another colvar.
ERROR on proc 0: Fatal error in the collective variables module.
(../colvarproxy_lammps.cpp)
Last command: fix_modify f1 configfile minimal.cfg # redefining same colvar, should fail
177 changes: 177 additions & 0 deletions lammps/tests/interface/ref/log.02b
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
# Validated:
include inc.minimal
# minimal system config: two groups of two atoms
units real
atom_style atomic
atom_modify map array # XXX this should not be needed

pair_style lj/cut 5.0
read_data data.minimal
Reading data file ...
orthogonal box = (-5 -5 -10) to (5 5 10)
reading atoms ...
4 atoms
reading velocities ...
4 velocities

group g1 id 1 2
2 atoms in group g1
group g2 id 3 4
2 atoms in group g2

variable com1z equal xcm(g1,z)
variable com2z equal xcm(g2,z)
variable fcm1z equal fcm(g1,z)
variable fcm2z equal fcm(g2,z)
variable cveng equal f_f1

thermo_style custom step pe v_com1z v_com2z v_fcm1z v_fcm2z v_cveng
thermo 1

fix f1 all colvars minimal.cfg unwrap yes output 02b

run 0 post no
Neighbor list info ...
update every 1 steps, delay 10 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 7
ghost atom cutoff = 7
binsize = 3.5, bins = 3 3 6
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair lj/cut, perpetual
attributes: half, newton on
pair build: half/bin/atomonly/newton
stencil: half/bin/3d/newton
bin: standard
Setting up Verlet run ...
Unit style : real
Current step : 0
Time step : 1
colvars: Creating proxy instance
colvars: ----------------------------------------------------------------------
colvars: Please cite Fiorin et al, Mol Phys 2013:
colvars: http://dx.doi.org/10.1080/00268976.2013.813594
colvars: in any publication based on this calculation.
colvars: ----------------------------------------------------------------------
colvars: Reading new configuration from file "minimal.cfg":
colvars: # smp = on [default]
colvars: # colvarsTrajFrequency = 100 [default]
colvars: # colvarsRestartFrequency = 0 [default]
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 = "" [default]
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 2 atoms requested.
colvars: Initializing atom group "group2".
colvars: # name = "" [default]
colvars: # centerReference = off [default]
colvars: # rotateReference = off [default]
colvars: # atomsOfGroup = "" [default]
colvars: # indexGroup = "" [default]
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 2 atoms requested.
colvars: # oneSiteSystemForce = off [default]
colvars: # oneSiteTotalForce = off [default]
colvars: All components initialized.
colvars: # timeStepFactor = 1 [default]
colvars: # width = 1 [default]
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 = off [default]
colvars: # subtractAppliedForce = off [default]
colvars: # runAve = off [default]
colvars: # corrFunc = off [default]
colvars: ----------------------------------------------------------------------
colvars: Collective variables initialized, 1 in total.
colvars: No collective variables biases were defined.
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 "02b.colvars.state".
colvars: Writing to colvar trajectory file "02b.colvars.traj".
colvars: Re-initialized atom group for variable "one":0/0. 2 atoms: total mass = 2, total charge = 0.
colvars: Re-initialized atom group for variable "one":0/1. 2 atoms: total mass = 2, total charge = 0.
Step PotEng v_com1z v_com2z v_fcm1z v_fcm2z v_cveng
0 -0.0002563444 -7 -13 -2.99925e-05 2.99925e-05 0
colvars: Saving collective variables state to "02b.colvars.state".


fix_modify f1 configfile harmonic.cfg # should work
colvars: ----------------------------------------------------------------------
colvars: Reading new configuration from file "harmonic.cfg":
colvars: # smp = on [default]
colvars: # colvarsTrajFrequency = 100 [default]
colvars: # colvarsRestartFrequency = 0 [default]
colvars: # scriptedColvarForces = off [default]
colvars: # scriptingAfterBiases = 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 = off [default]
colvars: # timeStepFactor = 1 [default]
colvars: # writeTISamples = off [default]
colvars: # writeTIPMF = off [default]
colvars: # centers = { 10 }
colvars: # targetCenters = { 10 } [default]
colvars: # outputCenters = off [default]
colvars: # forceConstant = 1
colvars: # targetForceConstant = -1 [default]
colvars: ----------------------------------------------------------------------
colvars: Collective variables biases initialized, 1 in total.
colvars: ----------------------------------------------------------------------
colvars: Collective variables module (re)initialized.
colvars: ----------------------------------------------------------------------
colvars: Re-initialized atom group for variable "one":0/0. 2 atoms: total mass = 2, total charge = 0.
colvars: Re-initialized atom group for variable "one":0/1. 2 atoms: total mass = 2, total charge = 0.

run 0 post no
Setting up Verlet run ...
Unit style : real
Current step : 0
Time step : 1
colvars: Re-initialized atom group for variable "one":0/0. 2 atoms: total mass = 2, total charge = 0.
colvars: Re-initialized atom group for variable "one":0/1. 2 atoms: total mass = 2, total charge = 0.
Step PotEng v_com1z v_com2z v_fcm1z v_fcm2z v_cveng
0 -0.0002563444 -7 -13 3.99997 -3.99997 8
colvars: Saving collective variables state to "02b.colvars.state".

colvars: Resetting the Collective Variables module.

Please see the log.cite file for references relevant to this simulation

Total wall time: 0:00:00

0 comments on commit 29e16b8

Please sign in to comment.