Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement reflecting boundary conditions for metadynamics bias #525

Draft
wants to merge 53 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
934cd61
Starting to implement interval (forces removal beyond boundaries) and…
fabsugar Aug 22, 2022
9fc5b37
Introduced init_reflection
fabsugar Aug 22, 2022
8302e9d
Introduced init_interval
fabsugar Aug 23, 2022
34a9f05
Added reflection & interval routines
fabsugar Aug 29, 2022
e9d47fe
Added calls to reflected hills when required
fabsugar Aug 29, 2022
0bf98e0
Introduced reflection and iontervals vars in colvarbias_meta.h
fabsugar Aug 30, 2022
e3f48a2
Removed forces beyond CVs intervals when defined in colvarbias_meta.cpp
fabsugar Aug 30, 2022
66093a6
Update argument of hill() to match recent version of colvars
fabsugar Aug 30, 2022
5163dc8
Corrected INPUT_ERROR with COLVARS_INPUT_ERROR in colvarbias_meta.cpp
fabsugar Aug 30, 2022
aab0e41
Added declaration of reflection routines in colvarbias_meta.h
fabsugar Aug 30, 2022
8f4fdce
Modified sigmas and call to set_ones
fabsugar Aug 31, 2022
02afcae
h_w substituted with colvar_sigmas
fabsugar Aug 31, 2022
c7db8b3
Changed some variables from int to size_t, this was giving error in t…
fabsugar Aug 31, 2022
cb48db3
Changed some size_t to int
fabsugar Aug 31, 2022
9b44d38
Introduced nvars and int of num_variables as the latter is size_t
fabsugar Aug 31, 2022
9ac6602
Trying to remove warnings causing problems in checks
fabsugar Aug 31, 2022
f0af682
Trying to resolve "error: '>>' should be '> >' within a nested templa…
fabsugar Aug 31, 2022
9a7baf1
Removed monodimensional reflection
fabsugar Sep 19, 2022
6bf1a92
In calc_hills_force, boundary check is now outside the hills loop for…
fabsugar Sep 27, 2022
285e7c7
Modified init_reflection introducing lower and upper boundaries of th…
fabsugar Sep 27, 2022
fc9bd4d
reflection_type removed
fabsugar Sep 27, 2022
4cb892e
reflection states generated only if reflection is active
fabsugar Sep 27, 2022
5c8bc14
removed i index onn interval in calc_hills_force
fabsugar Sep 28, 2022
14f95e9
modifed cal_hills to account for interval
fabsugar Sep 28, 2022
0b84760
Finished adding curr_values to calc_hills to account for interval
fabsugar Sep 28, 2022
b0cb106
some changes of declaratins leading to compilation error
fabsugar Sep 28, 2022
2e45cfb
Modified calc_energy and project_hills to account for hills reflectio…
fabsugar Sep 29, 2022
6c3b2dd
condition for reflection+interval added externally to calc_hills_force
fabsugar Sep 29, 2022
3b6e283
Remove requiremend of hard boundaries as a default for grid + reflection
fabsugar Sep 29, 2022
0b54d3f
a few changes to resolve compilation errors
fabsugar Sep 29, 2022
9e36ad5
changed variables->values with colvar_values in calc_energy
fabsugar Sep 29, 2022
c191439
Added errors/warning and defaults to account for periodic variables +…
fabsugar Sep 29, 2022
438da0b
Resolved compilation errors due to curr_values on calc energy
fabsugar Sep 30, 2022
309a49f
Updated calc_energy in case reflection boundaries are grid boundaries,
fabsugar Oct 1, 2022
511260d
cal_energy modified to put interval upper boundaries inside the grid …
fabsugar Oct 1, 2022
cda84c0
Corretted bug on allocation of ref_state array for reflection
fabsugar Oct 1, 2022
599de0b
Corrected bug in multidimensional reflection visible in 3D
fabsugar Oct 4, 2022
ce0bc53
Fix leftover compiler issues; also remove trailing whitespace via Git…
giacomofiorin Oct 7, 2022
ca7490b
Resolving compilers issues, chenged limits of CVs to integers so cont…
fabsugar Oct 7, 2022
1273538
num_variables casted to int when required
fabsugar Oct 7, 2022
c3a04f5
corrected bug on calc_energy at the boundary
fabsugar Oct 7, 2022
3884846
Corrected calc_force to take into account that also the force components
fabsugar Oct 9, 2022
c2d9a90
Corrected calc_energy and calc_forces function to check that upper li…
fabsugar Oct 21, 2022
7da9f41
Removed some spaces
fabsugar Nov 4, 2022
23c5503
Added >= to check values out of upper boundary just to be extra precise
fabsugar Nov 4, 2022
dde917a
Introdiced error if reflection limits are explicity specified out of …
fabsugar Nov 4, 2022
39c4d13
Modified implementation of interval in calc_energy and calc_forces
fabsugar Nov 7, 2022
f55e9c5
removed obsolete/unused h_replica in reflect_multid routine
fabsugar Apr 18, 2023
77b0e92
Added interval vectors as argument of project hills function. This fi…
fabsugar Apr 19, 2023
bdfb158
Integrate change to stream access
giacomofiorin Apr 19, 2023
f0dfd8d
Fix remaining merge conflicts
giacomofiorin Oct 13, 2023
958d5ff
Added test for reflection in metadynamics (not tested yet)
fabsugar Feb 6, 2024
2834285
Corrected typos on reflection test
fabsugar Feb 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
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: SMP parallelism is enabled; if needed, use "smp off" to override this.
colvars: This version was built with the C++11 standard or higher.
colvars: ----------------------------------------------------------------------
colvars: Reading new configuration from file "test.in":
colvars: # units = "" [default]
colvars: # indexFile = "index.ndx"
colvars: The following index groups are currently defined:
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: Enabling scalable calculation for group "group1".
colvars: # printAtomIDs = off [default]
colvars: Atom group "group1" defined with 4 atoms requested: total mass = 54.028, total charge = -0.72.
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: Enabling scalable calculation for group "group2".
colvars: # printAtomIDs = off [default]
colvars: Atom group "group2" defined with 4 atoms requested: total mass = 54.028, total charge = -0.4.
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 = 10
colvars: # hardLowerBoundary = on [default]
colvars: # hardUpperBoundary = off [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 "metadynamics" instance.
colvars: # name = "metadynamics1" [default]
colvars: # colvars = { one }
colvars: # stepZeroData = off [default]
colvars: # outputEnergy = off [default]
colvars: # outputFreq = 10 [default]
colvars: # timeStepFactor = 1 [default]
colvars: # writeTISamples = off [default]
colvars: # writeTIPMF = off [default]
colvars: # hillWeight = 0.001
colvars: # newHillFrequency = 10
colvars: # gaussianSigmas = [default]
colvars: # hillWidth = 1.25331
colvars: Half-widths of the Gaussian hills (sigma's):
colvars: one: 0.313329
colvars: # multipleReplicas = off [default]
colvars: # useGrids = on [default]
colvars: # gridsUpdateFrequency = 10 [default]
colvars: # rebinGrids = off [default]
colvars: # writeFreeEnergyFile = on [default]
colvars: # keepHills = off [default]
colvars: # keepFreeEnergyFiles = off [default]
colvars: # writeHillsTrajectory = off [default]
colvars: # wellTempered = off [default]
colvars: # biasTemperature = -1 [default]
colvars: # ebMeta = off [default]
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 (2 scalable groups, 8 atoms in total).
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: The restart output state file will be "test.tmp.colvars.state".
colvars: The final output state file will be "test.colvars.state".
colvars: Opening trajectory file "test.colvars.traj".
colvars: Redefining the Tcl "cv" command to the new script interface.
colvars: Updating NAMD interface:
colvars: updating atomic data (0 atoms).
colvars: updating group data (2 scalable groups, 8 atoms in total).
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: The restart output state file will be "test.tmp.colvars.state".
colvars: The final output state file will be "test.colvars.state".
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,47 @@
configuration {
step 20
dt 1.000000e+00
}

colvar {
name one
x 3.21688278597333e+00
}

metadynamics {
configuration {
step 20
name metadynamics1
}
hills_energy
grid_parameters {
n_colvars 1
lower_boundaries 0.00000000000000e+00
upper_boundaries 1.00000000000000e+01
widths 5.00000000000000e-01
sizes 20
}
0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00
3.46920492770083e-08 1.70721010112539e-05 6.58298335288197e-04
1.98901157291202e-03 4.70902104436801e-04 8.73580076380761e-06
0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00
0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00
0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00
0.00000000000000e+00 0.00000000000000e+00
hills_energy_gradients
grid_parameters {
n_colvars 1
lower_boundaries 0.00000000000000e+00
upper_boundaries 1.00000000000000e+01
widths 5.00000000000000e-01
sizes 20
}
0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00
5.18433073974142e-07 1.68175610579987e-04 3.13214890940428e-03
-6.66334787942696e-04 -2.55603942784152e-03 -9.19086519769792e-05
0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00
0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00
0.00000000000000e+00 0.00000000000000e+00 0.00000000000000e+00
0.00000000000000e+00 0.00000000000000e+00
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# step one fa_one
0 3.20554673468334e+00 0.00000000000000e+00
1 3.20437148316546e+00 0.00000000000000e+00
2 3.20384028589204e+00 0.00000000000000e+00
3 3.20396721187433e+00 0.00000000000000e+00
4 3.20472817287036e+00 0.00000000000000e+00
5 3.20606308066645e+00 0.00000000000000e+00
6 3.20787989003051e+00 0.00000000000000e+00
7 3.21005997943917e+00 0.00000000000000e+00
8 3.21246460655188e+00 0.00000000000000e+00
9 3.21494247388772e+00 0.00000000000000e+00
10 3.21733851236362e+00 3.30884583259955e-04
11 3.21950367891521e+00 3.30884583259955e-04
12 3.22130501376020e+00 3.30884583259955e-04
13 3.22263482513293e+00 3.30884583259955e-04
14 3.22341774651982e+00 3.30884583259955e-04
15 3.22361481079113e+00 3.30884583259955e-04
16 3.22322427751010e+00 3.30884583259955e-04
17 3.22227956023865e+00 3.30884583259955e-04
18 3.22084496840419e+00 3.30884583259955e-04
19 3.21901000786075e+00 3.30884583259955e-04
20 3.21688278597333e+00 6.66334787942696e-04
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 1
# 0.00000000000000e+00 5.00000000000000e-01 20 0

2.50000000000000e-01 1.98901157291202e-03
7.50000000000000e-01 1.98901157291202e-03
1.25000000000000e+00 1.98901157291202e-03
1.75000000000000e+00 1.98897688086274e-03
2.25000000000000e+00 1.97193947190077e-03
2.75000000000000e+00 1.33071323762382e-03
3.25000000000000e+00 -0.00000000000000e+00
3.75000000000000e+00 1.51810946847522e-03
4.25000000000000e+00 1.98027577214821e-03
4.75000000000000e+00 1.98901157291202e-03
5.25000000000000e+00 1.98901157291202e-03
5.75000000000000e+00 1.98901157291202e-03
6.25000000000000e+00 1.98901157291202e-03
6.75000000000000e+00 1.98901157291202e-03
7.25000000000000e+00 1.98901157291202e-03
7.75000000000000e+00 1.98901157291202e-03
8.25000000000000e+00 1.98901157291202e-03
8.75000000000000e+00 1.98901157291202e-03
9.25000000000000e+00 1.98901157291202e-03
9.75000000000000e+00 1.98901157291202e-03
Loading
Loading