waterMD
Analysis code for water box MD simulations
The analysis of MD simulations is done by creating the WaterStat object (water_stat.py). All the functions for constructing nearest-neighbor tetrahedrons and computing correlators are in water_stat.py.
water_stats_util.py contains functions for anlysis and visualizing the results from the correaltor computations.
The workflow
- run MD (code note included in this repo)
- run assign_nearest_tthds.py to created database of water tetrahedrons generated by the MD simulation
- run compute_correlator.py to compute correlators for various values of q's (see below for usage)
- run stitch_corr_results.py to combine results from differen simulation frames (if choose to run compute_correlator in parallel)
- use functions from water_stats_util to visualize results
Using compute_correlator.py
This is the important script that computes C4. To run it use the following command and pass on the required parameters: "python compute_correlator.py -i -o -q <q_inv> -p -r <phi_range> -s -e "]
Parameters:
-i: name of the simulation run to use, e.g. 'run1'
-o: the name output file to store the computed correlator, e.g. "corr_run1.csv". I also try to include other parameters in the name. The outputfile is by default saved in /computed_results. If the file already exist, the program will refuse to overwrite it and propt the user for a new outputfile name.
-q: defines the magnitude(s) of the q vectors. If multiple values are givem separate by '/'. At this point, the program only computes of qs with equal magnitude. The magnitude is defined as 2*pi/(input) and input is assumed to have the unit nm. I find defining this parameter in the unit of nm more intuitive for me. But I am also considering changing it to angstrom-inverse.
-p: number of phi for which to compute, spaced linearly. default is 30.
-r: range of phi to use for computation, in units of phi and separated by '/'. default is 0 to pi.
-s: frame in simulation to start computing
-e: fram in simulation to end computing