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

Opening pull request #64

Open
wants to merge 144 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
feb7dae
Fix to polarization correction
Jan 23, 2014
ce56a7a
Merge branch 'master' of github.com:leeping/forcebalance
Jan 28, 2014
7322bbc
Merge branch 'master' of https://github.com/leeping/forcebalance
Feb 11, 2014
bc3a415
Begin adding interface for RP contraction
Feb 11, 2014
17ebcd3
Added RPMD kinetic energy calculation
Mar 19, 2014
8eb02fa
Merge branch 'master' of github.com:leeping/forcebalance
Mar 19, 2014
c5ce8b5
test commit
Mar 19, 2014
4186cab
Test
Mar 19, 2014
98b2a15
TEST
Mar 19, 2014
7adaafe
test1
Mar 19, 2014
b0a74f9
CustomBondForce
Mar 20, 2014
ce5c264
CustomBondForce(error in getPerBondParameterName)
Mar 20, 2014
bee0c4d
CustomBondForce(working version)
Mar 22, 2014
d2a1c65
RPMD input should be list of integer not number
Mar 23, 2014
4e15d71
Energy estimator
Mar 26, 2014
a1a1970
Merge branch 'master' of github.com:leeping/forcebalance
Mar 26, 2014
9b3524d
Merge branch 'master' of github.com:leeping/forcebalance
Mar 26, 2014
d2abf50
Update rpmd energy estimating(centroid instead of primitive energy es…
Mar 26, 2014
16939e4
Centroid Energy Estimator
Mar 27, 2014
0ed58f5
test setposition
Apr 2, 2014
1c55582
RPMD set_position (test)
Apr 4, 2014
c8524e4
Undo get multipole function
Apr 5, 2014
5ffd3fb
update energy estimator
Apr 7, 2014
5f55c7e
Implement Potential and Kinetic energy calculators for RPMD simulatio…
Apr 9, 2014
83817f3
Replace code that calculate quantum kinetic energy by function
Apr 9, 2014
fc50a07
Fix a few RPMD related bug
Apr 9, 2014
f1a5cde
Adding centroid position calculator
Apr 9, 2014
9cdf137
Change nothing, just test
Apr 9, 2014
8b69702
Fix some minor(but important!) bug.
Apr 9, 2014
520ede4
Try again.
Apr 9, 2014
8a7d23d
RPMD Virtual Site
Apr 10, 2014
96bea44
change nothing
Apr 10, 2014
67b6c75
fix syntax error
Apr 10, 2014
b826b1d
Use centroid KE to calculate KE in RPMD
Apr 10, 2014
cc9abba
Edit the fractionation ratio energy function
May 5, 2014
9a89502
edit HD
May 5, 2014
5a427d9
":"
May 5, 2014
0994408
undo last step
May 5, 2014
a80f321
undo
May 6, 2014
75091d0
Merge branch 'master' of https://github.com/frankmenglin/forcebalance
JNapoli May 14, 2014
dbb1048
Fix some verbose inline comments. Mainly testing commit/push. No subs…
JNapoli May 16, 2014
3843e6f
Change rpmd_beads to rpmd_opts for clarity.
JNapoli May 16, 2014
38a51e5
Add support for storing and setting positions for RPMD simulation.
JNapoli May 18, 2014
ad92387
Revise code for setting virtual sites in RPMD images.
JNapoli May 18, 2014
8c6f9f7
Incorporate modifications suggested by Lee-Ping. Remove redundancies.
JNapoli May 19, 2014
c845d54
Begin adding RPMD test files.
JNapoli May 19, 2014
5d0d482
Updated cctools version
May 28, 2014
e27a0b4
Merge branch 'master' of github.com:leeping/forcebalance
May 28, 2014
086cdb3
Merge branch 'master' of github.com:leeping/forcebalance
Jun 2, 2014
cdd7db3
Fixed some stuff.
JNapoli Jun 2, 2014
14525c0
Merge branch 'master' of github.com:JNapoli/forcebalance
JNapoli Jun 2, 2014
6d64e37
Add code to average dipole values over all copies of an RPMD system.
JNapoli Jun 3, 2014
02ae762
Commit cctools changes.
Jun 4, 2014
dcc07e1
Fix merge conflict.
Jun 4, 2014
fb96293
Enable use of PDB file for coordinates.
JNapoli Jun 9, 2014
fd1c159
Merge branch 'master' of github.com:JNapoli/forcebalance
JNapoli Jun 9, 2014
ee369ff
Begin validation script for RPMD functionality. Modify openmmio.py to…
JNapoli Jun 22, 2014
1c7d768
Remove unnecessary code in test script. Add directory containing qtip…
JNapoli Jun 22, 2014
672e454
Begin fix for constraint modification code.
JNapoli Jun 25, 2014
945bc15
Typo fix
JNapoli Jun 25, 2014
7e59ed2
Fix method call syntax. Whoops.
JNapoli Jun 25, 2014
f075620
Clean up update_simulation() and constraint checking.
JNapoli Jun 25, 2014
dfe462f
Remove stray print statement.
JNapoli Jun 25, 2014
cb61a7d
Revise RPMD unit test.
Jun 26, 2014
4ed220c
Revise xyz_rpmd data structure; add RPMD functionality to evaluate_()…
JNapoli Jun 26, 2014
6fe3b13
Undo get_dipole() modification and put that functionality in evaluate…
JNapoli Jun 26, 2014
6815c71
Fix get_forces() bug.
JNapoli Jun 26, 2014
9ae4e58
We had been assuming non-empty parameter vectors; fixed now?
JNapoli Jun 26, 2014
4264b20
Merge branch 'master' of github.com:leeping/forcebalance
JNapoli Jun 26, 2014
1585e93
Shorten test case
JNapoli Jun 26, 2014
efa1c88
Fixes for unit test
JNapoli Jun 26, 2014
bd5505e
Updated OpenMM on Jenkins
JNapoli Jun 26, 2014
386c334
Remove verbosity option in unit test.
JNapoli Jun 27, 2014
a8e8b00
Clean and delete unnecessary lines.
JNapoli Jun 27, 2014
b303fb0
Fix setting of virtural sites and postprocessing of dipoles.
JNapoli Jun 27, 2014
4089816
Add dipole test to test_rpmd.py
JNapoli Jun 28, 2014
662f571
Fix indentation issue in rpmd_dips().
JNapoli Jun 28, 2014
f158ce0
Test new centroid virial estimator.
JNapoli Jul 7, 2014
def4160
Try setting positions a different way.
Jul 8, 2014
6bb8f1b
Add functions to test first terms in energy estimators.
JNapoli Jul 10, 2014
fb49a1a
Another test.
JNapoli Jul 10, 2014
e488793
Add functions to calculate Cv for NVT simulation.
JNapoli Jul 31, 2014
7363513
Merge branch 'master' of github.com:leeping/forcebalance
JNapoli Sep 18, 2014
a832a52
Update energy estimators to latest version. Clean up functions that w…
JNapoli Sep 18, 2014
23b379b
Commit most recent changes for pull to ICME.
JNapoli Sep 18, 2014
923a54b
Incorporate calculation of Cp analytic derivative for RPMD.
JNapoli Oct 13, 2014
382f540
Revert to original version of rpmd unit test
JNapoli Oct 14, 2014
0df398f
Push changes for pull on ICME
JNapoli Oct 23, 2014
4e5e28d
Merge branch 'master' of https://github.com/chenchens/forcebalance
JNapoli Oct 24, 2014
c0b0d6e
Merge branch 'master' of https://github.com/chenchens/forcebalance
Oct 24, 2014
cc8257f
Merge leeping master
Oct 30, 2014
abfed09
Clean up old changes
Nov 2, 2014
3a5b281
Merge branch 'master' of github.com:JNapoli/forcebalance
JNapoli Nov 2, 2014
b1be9a8
Add CopyCustomBondedParameters to use with qtip4pf
JNapoli Nov 5, 2014
8aad83e
Oops
JNapoli Nov 8, 2014
77d227d
Add code for centroid virial gradient.
JNapoli Nov 12, 2014
8edf122
Revise rpmd gradient method.
JNapoli Nov 12, 2014
d053eb5
Revise postprocessing and gradient calculations for RPMD
JNapoli Nov 16, 2014
077f223
Push for pull to ICME
JNapoli Jan 19, 2015
7e0fe67
Fix thermal expansion
JNapoli Jan 24, 2015
73992c1
Fix variable name error
JNapoli Jan 24, 2015
34c03a3
Standardize control flow. Fix RPMDH bug.
JNapoli Jan 26, 2015
d1b3dfc
Standardize control flow for PIMD.
JNapoli Feb 3, 2015
66de576
Incorporate RPMD specific gradients into liquid.py
JNapoli Feb 11, 2015
b0a2930
Add RPMD gradients to liquid.py
JNapoli Feb 12, 2015
a41b978
Finish incorporating derivatives into liquid.py
JNapoli Feb 12, 2015
202744b
Minor change to read() method.
JNapoli Feb 12, 2015
c1aa04b
Make npt_result pickle more general
JNapoli Feb 12, 2015
761c324
Fix variable swap in npt_result pickle
JNapoli Feb 13, 2015
dde2457
Change the way the heat capacity correction is calculated. Reflect th…
JNapoli Feb 16, 2015
fe570cb
Add code for fitting total energy w/ centroid virial QKE. This tests …
JNapoli Feb 21, 2015
20e7a19
Make sure parser doesn't break.
JNapoli Feb 21, 2015
a12460a
Whoops
JNapoli Feb 24, 2015
910e57a
Fix reference before assignment
JNapoli Feb 24, 2015
b9e37f0
Remove centroid virial quantum kinetic energy liquid target. Enable c…
JNapoli Feb 28, 2015
840854a
Use RPMDMonteCarloBarostat for PIMD simulations.
JNapoli Feb 28, 2015
60bf570
Fix division error and setting of n_mcbarostat.
JNapoli Feb 28, 2015
b16ab3f
Replace H in alpha grad with RPMDH
JNapoli Mar 14, 2015
57bb5ea
CUDA platform is much faster for PIMD gas phase simulation
JNapoli Mar 25, 2015
5737550
Change nonbonded parameters
JNapoli Apr 16, 2015
6b1a1e1
Ensure that defaults make it in
JNapoli Apr 16, 2015
6c7f278
Add pbc condition to setting of nonbonded cutoffs
JNapoli Apr 17, 2015
82f5984
Add code to save centroids and only store one system copy.
JNapoli May 1, 2015
cf37183
Fix a reference before assignment and nonbonded method in preparation…
JNapoli Jul 7, 2015
dbbc01c
Write AbInitio_LAMMPS target
JNapoli Aug 26, 2015
5ff6873
Some small bug fixes
JNapoli Aug 27, 2015
96e7cfe
Lammps branch is up to date
JNapoli Oct 19, 2015
a39108c
Add logic for only using one bead in postprocessing
JNapoli Oct 19, 2015
770e7e5
Device number change for testing
JNapoli Oct 19, 2015
879d145
get_V function now returns forces if requested
JNapoli Oct 27, 2015
bff0326
Merge branch 'lammps'
JNapoli Nov 9, 2015
8c1ed5b
Use reference for gas phase simulation on xstream for now
Nov 16, 2015
4eef879
Debug statement for CUDA device
Nov 16, 2015
f8e6a0b
Remove duplicate calculation of centroids. Other minor edits
Nov 17, 2015
2022690
Merge branch 'master' of github.com:JNapoli/forcebalance
JNapoli Nov 17, 2015
a961a05
Redo PIMD estimators and write custom reporter for PIMD.
JNapoli Nov 21, 2015
d2ab2b2
Merge branch 'master' of github.com:JNapoli/forcebalance
JNapoli Nov 21, 2015
82c298a
Delete simulation objects explicitly. Otherwise they crash on Xstream.
JNapoli Nov 26, 2015
eca7a6e
Hopefully can use CUDA platform for both simulations now.
JNapoli Nov 26, 2015
7447ff5
Fix small bugs
JNapoli Nov 27, 2015
6ad026b
Merge branch 'master' of github.com:JNapoli/forcebalance
JNapoli Nov 27, 2015
68df6ff
Merge leeping master
JNapoli Dec 2, 2015
1bd6a55
Replace molecular_dynamics method with original method. All PIMD code…
JNapoli Dec 2, 2015
95505ac
Refactor lammpsio calculation of energy series
JNapoli Dec 21, 2015
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
Prev Previous commit
Next Next commit
Add code to save centroids and only store one system copy.
  • Loading branch information
JNapoli committed May 1, 2015
commit 82f59845ea73a47e70c5cf7332e50ea8e73ef9d6
29 changes: 22 additions & 7 deletions src/openmmio.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,12 @@ def centroid_kinetic(Sim, props):
CV_second_term = 0.0
P = props['P']
N = props['N']
centroid = np.array([[0.0,0.0,0.0]]*N)
for i in range(P):
centroid += np.array(props['Positions'][i]) / P
if 'centroids' in props:
centroid = props['centroids']
else:
centroid = np.array([[0.0,0.0,0.0]]*N)
for i in range(P):
centroid += np.array(props['Positions'][i]) / P
for i in range(P):
diff = np.array(props['Positions'][i]) - centroid
diff[np.where(props['Vsites'])[0],:] = 0.0
Expand All @@ -107,6 +110,14 @@ def centroid_kinetic(Sim, props):
else:
Sim.context.getState(getEnergy=True).getKineticEnergy()

def compute_centroids(Sim, props):
N = props['N']
P = props['P']
centroids = np.array([[0.0,0.0,0.0]]*N)
for i in range(P):
centroids += np.array(props['Positions'][i]) / P
return centroids

def get_forces(Sim):
"""Return forces on each atom or forces averaged over all copies in case of RPMD."""
if isinstance(Sim.integrator, RPMDIntegrator):
Expand Down Expand Up @@ -1012,7 +1023,7 @@ def set_positions(self, shot=0, traj=None):
else:
rpmdIntegrator = self.simulation.context.getIntegrator()
for i in range(rpmdIntegrator.getNumCopies()):
temp_positions = self.xyz_rpmd[shot][0][i]
temp_positions = self.xyz_rpmd[shot][0][0]
rpmdIntegrator.setPositions(i,temp_positions)

def get_charges(self):
Expand Down Expand Up @@ -1172,7 +1183,9 @@ def evaluate_(self, force=False, dipole=False, traj=False, rpmd=False):
Energies.append(R1["Energy"])
if force: Forces.append(R1["Force"])
if dipole: Dipoles.append(rpmd_dips(self.simulation, self.nbcharges, self.AtomLists['Mass']))
if rpmd: RPMD_CV_est.append(self.calc_cv())
if rpmd:
self.rpmd_frame_props['centroids'] = self.centroids[I]
RPMD_CV_est.append(self.calc_cv())
else:
for I in range(len(self.xyz_omms)):
self.set_positions(I)
Expand Down Expand Up @@ -1415,6 +1428,7 @@ def molecular_dynamics(self, nsteps, timestep, temperature=None, pressure=None,
Temps = []
self.rpmd_frame_props = {}
self.rpmd_frame_props['States'] = []
self.centroids = []
if self.rpmd:
vsites = []
# Build boolean array indicating which particles are virtual
Expand Down Expand Up @@ -1528,6 +1542,7 @@ def molecular_dynamics(self, nsteps, timestep, temperature=None, pressure=None,
else:
kinetic = centroid_kinetic(self.simulation, self.rpmd_frame_props)
primitive_kinetic_tuple = evaluate_kinetic(self.simulation, self.rpmd_frame_props)
self.centroids.append(compute_centroids(self.simulation, self.rpmd_frame_props))
potential = evaluate_potential(self.simulation)
if not self.rpmd:
kinetic_temperature = 2.0 * kinetic / kB / self.ndof
Expand All @@ -1544,7 +1559,7 @@ def molecular_dynamics(self, nsteps, timestep, temperature=None, pressure=None,
if not self.rpmd:
self.xyz_omms.append([state.getPositions(), box_vectors])
else:
self.xyz_rpmd.append([[self.rpmd_states[i].getPositions() for i in range(self.simulation.integrator.getNumCopies())], box_vectors])
self.xyz_rpmd.append([[self.rpmd_states[i].getPositions() for i in [0]], box_vectors])
# Perform energy decomposition.
for comp, val in energy_components(self.simulation).items():
if comp in edecomp:
Expand All @@ -1570,7 +1585,7 @@ def molecular_dynamics(self, nsteps, timestep, temperature=None, pressure=None,
else:
temp_dips = []
for i in range(self.simulation.integrator.getNumCopies()):
temp_dips.append(get_dipole(self.simulation, positions=self.xyz_rpmd[-1][0][i]))
temp_dips.append(get_dipole(self.simulation, positions=self.rpmd_states[i].getPositions()))
dip_avg = [sum(col) / float(len(col)) for col in zip(*temp_dips)]
Dips.append(dip_avg)
if not self.rpmd:
Expand Down
3 changes: 2 additions & 1 deletion src/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
"wq_port" : (0, 0, 'The port number to use for Work Queue', 'Targets that use Work Queue (advanced usage)'),
"criteria" : (1, 160, 'The number of convergence criteria that must be met for main optimizer to converge', 'Main Optimizer'),
"zerograd" : (-1, 0, 'Set to a nonnegative number to turn on zero gradient skipping at that optimization step.', 'All'),
"amber_nbcut" : (9999, -20, 'Specify the nonbonded cutoff for AMBER engine in Angstrom (I should port this to other engines too.)', 'AMBER targets, especially large nonperiodic systems', ['AMBER'])
"amber_nbcut" : (9999, -20, 'Specify the nonbonded cutoff for AMBER engine in Angstrom (I should port this to other engines too.)', 'AMBER targets, especially large nonperiodic systems', ['AMBER']),
"rpmd_strides" : (2, -100, 'Specify stride for evaluating properties on fewer copies. May help to resolve a memory issue.', 'Condensed phase property targets (advanced usage)', 'liquid_openmm')
},
'bools' : {"backup" : (1, 10, 'Write temp directories to backup before wiping them'),
"writechk_step" : (1, -50, 'Write the checkpoint file at every optimization step'),
Expand Down