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 57 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 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
2061cde
Simplified code by removing interval routines and changing names of v…
fabsugar Feb 5, 2025
9a3b335
Reflection put as default when use_grid active. Introduced control fo…
fabsugar Feb 8, 2025
92a8d2a
useHillsReflection if off by default for now, this should change and …
fabsugar Feb 8, 2025
708d8d5
Added and run test for reflection for namd
fabsugar Feb 8, 2025
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,207 @@
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: SMP parallelism is enabled (num threads = 4).
colvars: This version was built with the C++11 standard or higher.
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: # 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: # sourceTclFile = "" [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: # centerToOrigin = off [default]
colvars: # centerToReference = off [default]
colvars: # rotateToReference = off [default]
colvars: # atomsOfGroup = "" [default]
colvars: # indexGroup = "group1"
colvars: # psfSegID = [default]
colvars: # atomsFile = "" [default]
colvars: # dummyAtom = ( 0 , 0 , 0 ) [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: # centerToOrigin = off [default]
colvars: # centerToReference = off [default]
colvars: # rotateToReference = off [default]
colvars: # atomsOfGroup = "" [default]
colvars: # indexGroup = "group2"
colvars: # psfSegID = [default]
colvars: # atomsFile = "" [default]
colvars: # dummyAtom = ( 0 , 0 , 0 ) [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 = 3.2
colvars: # upperBoundary = 10.2
colvars: # hardLowerBoundary = on
colvars: # hardUpperBoundary = on
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 "harmonicwalls" instance.
colvars: # name = "wall_one"
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: # forceConstant = 1
colvars: # decoupling = off [default]
colvars: # targetForceConstant = -1 [default]
colvars: # lowerWalls = { 3.2 }
colvars: # upperWalls = { 10.2 }
colvars: # lowerWallConstant = 1 [default]
colvars: # upperWallConstant = 1 [default]
colvars: The lower wall force constant for colvar "one" will be rescaled to 4 according to the specified width (0.5).
colvars: The upper wall force constant for colvar "one" will be rescaled to 4 according to the specified width (0.5).
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: # useHillsReflection = on
colvars: # reflectionRange = 6 [default]
colvars: Reflection range is 6.
colvars: # reflectionLowLimitUseCVs = [default]
colvars: Using all non-periodic variables for lower limits of reflection
colvars: # reflectionUpLimitUseCVs = [default]
colvars: Using all non-periodic variables for upper limits of reflection
colvars: # reflectionLowLimit = { 3.2 } [default]
colvars: Reflection condition is applied on a lower limit for CV 0.
colvars: Reflection condition lower limit for this CV is 3.2.
colvars: # reflectionUpLimit = { 10.2 } [default]
colvars: Reflection condition is applied on an upper limit for CV 0.
colvars: Reflection condition upper limit for this CV is 10.2.
colvars: # ebMeta = off [default]
colvars: ----------------------------------------------------------------------
colvars: Collective variables biases initialized, 2 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: updating grid object data (0 grid objects in total).
colvars:
colvars: SUMMARY OF COLVARS FEATURES USED SO FAR AND THEIR CITATIONS:
colvars:
colvars: - Colvars module:
colvars: - Colvars-NAMD interface:
colvars: - Metadynamics colvar bias implementation:
colvars: - Optimal rotation via flexible fitting:
colvars: - distance colvar component:
colvars: - harmonicWalls colvar bias implementation:
colvars: Fiorin2013 https://doi.org/10.1080/00268976.2013.813594
colvars:
colvars: - NAMD engine:
colvars: - Scalable center-of-mass computation (NAMD):
colvars: Phillips2020 https://doi.org/10.1063/5.0014475
colvars:
colvars: updating target temperature (T = 0 K).
colvars: Updating NAMD interface:
colvars: updating atomic data (0 atoms).
colvars: updating group data (2 scalable groups, 8 atoms in total).
colvars: updating grid object data (0 grid objects in total).
colvars: updating target temperature (T = 0 K).
colvars: Current simulation parameters: initial step = 0, integration timestep = 1
colvars: Updating atomic parameters (masses, charges, etc).
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: 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,52 @@
configuration {
step 20
dt 1.000000e+00
}

colvar {
name one
x 3.2168853380692
}

restraint {
configuration {
step 20
name wall_one
}
}

metadynamics {
configuration {
step 20
name metadynamics1
}

hills_energy
grid_parameters {
n_colvars 1
lower_boundaries 3.2
upper_boundaries 10.2
widths 0.5
sizes 14
}
2.90793197471122e-03 2.29589040998682e-04 1.43098718458920e-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 3.2
upper_boundaries 10.2
widths 0.5
sizes 14
}
-7.38291182480299e-03 -1.74872845262777e-03 -1.81663860935017e-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.20437148316484e+00 0.00000000000000e+00
2 3.20384028588952e+00 0.00000000000000e+00
3 3.20396721186862e+00 0.00000000000000e+00
4 3.20472817286016e+00 0.00000000000000e+00
5 3.20606308065050e+00 0.00000000000000e+00
6 3.20787989000757e+00 0.00000000000000e+00
7 3.21005997940810e+00 0.00000000000000e+00
8 3.21246460651160e+00 0.00000000000000e+00
9 3.21494247383722e+00 0.00000000000000e+00
10 3.21733851230199e+00 3.69111079117202e-03
11 3.21950373044117e+00 3.69111079117202e-03
12 3.22130516783262e+00 3.69111079117202e-03
13 3.22263513141286e+00 3.69111079117202e-03
14 3.22341825276891e+00 3.69111079117202e-03
15 3.22361556235479e+00 3.69111079117202e-03
16 3.22322531690825e+00 3.69111079117202e-03
17 3.22228092687886e+00 3.69111079117202e-03
18 3.22084669842434e+00 3.69111079117202e-03
19 3.21901213410055e+00 3.69111079117202e-03
20 3.21688533806922e+00 7.38291182480299e-03
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 1
# 3.20000000000000e+00 5.00000000000000e-01 14 0

3.45000000000000e+00 -0.00000000000000e+00
3.95000000000000e+00 2.67834293371254e-03
4.45000000000000e+00 2.90650098752663e-03
4.95000000000000e+00 2.90793197471122e-03
5.45000000000000e+00 2.90793197471122e-03
5.95000000000000e+00 2.90793197471122e-03
6.45000000000000e+00 2.90793197471122e-03
6.95000000000000e+00 2.90793197471122e-03
7.45000000000000e+00 2.90793197471122e-03
7.95000000000000e+00 2.90793197471122e-03
8.45000000000000e+00 2.90793197471122e-03
8.95000000000000e+00 2.90793197471122e-03
9.45000000000000e+00 2.90793197471122e-03
9.95000000000000e+00 2.90793197471122e-03
Loading
Loading