Package schrodinger :: Package application :: Package matsci :: Module equilibrium_md
[hide private]
[frames] | no frames]

Module equilibrium_md

Equilibrium molecular dynamics classes/function shared by transport property calculations using Einstein and Green-Kubo methods.

Copyright Schrodinger, LLC. All rights reserved.

Classes [hide private]
  EquilibriumMdBase
This is a base class for equilibrium MD subclass, and should be not be instantiated directly.
  TrjBase
This is a base class for equilibrium MD subclass that uses trajectory, and should be not be instantiated directly.
  MixInBlockStd
This is a base class for dividing long simulation into blocks to get standard deviation, and should be not be instantiated directly.
Functions [hide private]
None or str
check_file_exist(path_file)
Check and find the path/file on the host
list of tuple
get_files_from_folder(folder_abs_path)
Walk through a folder, find all files inside it.
str, str, str or None
get_md_results(basename, log, log_error, opts, **kwargs)
From parsed options, setup and run md simulation.
str, str, str, str
setup_md_job(name_base, icms, md_time, md_timestep, md_emsemble, md_temperature, md_pressure, trj_interval, md_save_trj, gpu, procs, write_vel=False, md_enegry_interval=None, md_save_enegrp=False, energy_groups=[])
Write the .msj file and form the command for running the molecular dynamics simulation at a specific temperature.
options: Named tuple
trim_parser_skip_md(options, extra=[])
If md is skipped, delete any options for setting up molecular dynamics simulation.
 
add_parser_opts(parser, final_prop, mid_prop, extra_options=[])
Add all necessary parser arguments for setting up a MD simulation and optional arguments for certain green-kubo property calculation.
 
check_options(opts, parser, option_flag, min_data_point)
Validate the options.
Variables [hide private]
  __doc__ = ...
  PROGRAM_NAME_DIFFUSION = 'Diffusion Coefficient'
  DEFAULT_JOBNAME_DIFFUSION = 'diffusion_coefficient'
  PROGRAM_NAME_VISCOSITY = 'Visosity'
  DEFAULT_JOBNAME_VISCOSITY = 'viscosity'
  CUBIC_SPLINE = 'cubic spline'
  PICOSECOND = 1e-12
  FEMTO2PICO = 0.001
  NANO2PICO = 1000.0
  ANGSTROM2M = 1e-10
  TAU_START_PROP_KEY_BASE = 'Tau_Start_(ns)'
  TAU_END_PROP_KEY_BASE = 'Tau_End_(ns)'
  DIFFUSIVITY_UNIT = 'm^2/s'
  DIFFUSION_UNIT_CONVERT = 1e-08
  DIFFUSIVITY_PROP_KEY_BASE = 'r_matsci_Diffusion_Coefficient_%s_'
  DIFFUSIVITY_PROP_KEY = 'r_matsci_Diffusion_Coefficient_%s_(m^2...
  DIFFUSIVITY_TAU_START_PROP_KEY = 'r_matsci_Diffusion_Coefficie...
  DIFFUSIVITY_TAU_END_PROP_KEY = 'r_matsci_Diffusion_Coefficient...
  VISCOSITY_UNIT = 'Pa.s'
  VISCOSITY_PROP_KEY_BASE = 'r_matsci_%s_Viscosity_%s_'
  VISCOSITY_PROP_KEY = 'r_matsci_%s_Viscosity_%s_(Pa.s)'
  VISCOSITY_TAU_START_PROP_KEY = 'r_matsci_%s_Viscosity_%s_Tau_S...
  VISCOSITY_TAU_END_PROP_KEY = 'r_matsci_%s_Viscosity_%s_Tau_End...
  TRJ_EXT = 'trj'
  INPUT_FILE = '-icms'
  FLAG_ATOM_SELECTION = '-sel'
  FLAG_ENSEMBLE = '-md_ensemble'
  NVE = 'NVE'
  NVT = 'NVT'
  NPT = 'NPT'
  ENSEMBLE = ['NVE', 'NVT', 'NPT']
  FLAG_MD_TEMP = '-md_temperature'
  FLAG_MD_PRESSURE = '-md_pressure'
  FLAG_MD_TIME = '-md_time'
  FLAG_MD_TIMESTEP = '-md_timestep'
  FLAG_MD_TRJ_INTERVAL = '-md_trj_interval'
  FLAG_MD_SAVE_TRJ = '-md_save_trj'
  FLAG_SKIP_MD = '-md_skip'
  FLAG_TRJ_START = '-trj_start'
  FLAG_TAU_START = '-tau_start'
  FLAG_TAU_END = '-tau_end'
  FLAG_TRJ_FOLDER = '-trj_folder'
  TRJ_PROP_KEYS = ['s_m_original_cms_file', 's_chorus_trajectory...
  FLAG_ENEGRP_FILE = '-enegrp_file'
  FLAG_ENEGRP_INTERVAL = '-md_enegry_interval'
  FLAG_MD_SAVE_ENEGRP = '-md_save_enegrp'
  FLAG_GPU = '-gpu'
  FLAG_BLOCK_NUM = '-block_num'
  FLAG_VARIATION = '-variation'
  STD_FILE_EXT = '_block_std'
  MIN_TIME_NS = 0.01
  MAX_TIMESTEP_FS = 100
  MIN_TIMESTEP_FS = 0.01
  MAX_TRJ_FRAME_START = 1000000
  ARG_DEFAULTS = {'-block_num': 1, '-md_enegry_interval': 0.01, ...
  ALL_MD_FLAGS = ['-md_ensemble', '-md_temperature', '-md_pressu...
  MAX_TIME_NS = 100
  __package__ = 'schrodinger.application.matsci'
Function Details [hide private]

check_file_exist(path_file)

 

Check and find the path/file on the host

Parameters:
  • path_file (filename with path) - string
Returns: None or str
None if the file cannot be located

get_files_from_folder(folder_abs_path)

 

Walk through a folder, find all files inside it.

Parameters:
  • folder_abs_path (folder path) - string
Returns: list of tuple
each tuple contains: absolute path of a file, and a relative path that the file will be transferred to.

get_md_results(basename, log, log_error, opts, **kwargs)

 

From parsed options, setup and run md simulation.

Parameters:
  • basename (str) - basename for md simulation job
  • log (function) - log information
  • log_error (function) - log error information and exit
  • opts (Named tuple) - The parsed command line option
  • kwargs (dict) - extra options to control md simulation
Returns: str, str, str or None
output cms, trj folder, and enegrp_file

setup_md_job(name_base, icms, md_time, md_timestep, md_emsemble, md_temperature, md_pressure, trj_interval, md_save_trj, gpu, procs, write_vel=False, md_enegry_interval=None, md_save_enegrp=False, energy_groups=[])

 

Write the .msj file and form the command for running the molecular dynamics simulation at a specific temperature.

Parameters:
  • name_base (base name for the md job) - str
  • icms (input cms filename) - str
  • md_time (md simulation time in ps) - float
  • md_timestep (md timestep in ps) - float
  • md_emsemble (md ensemble) - str
  • md_temperature (md temperature in K) - float
  • md_pressure (md pressure in bar) - float
  • trj_interval (time interval for trj output in ps) - float
  • md_save_trj (save trj folder, if True) - bool
  • gpu (request gpu, if True) - bool
  • procs (number of processors) - int
  • write_vel (record velocity in trj frame, if True) - bool
  • md_enegry_interval (time interval for energy group output) - float or None
  • md_save_enegrp (save the enegry_file, if True) - bool
  • energy_groups (list of keywords for desmond energy_groups) - list of str
Returns: str, str, str, str
cmd command to submit md, output cms, trj folder, enegrp file

trim_parser_skip_md(options, extra=[])

 

If md is skipped, delete any options for setting up molecular dynamics simulation.

Parameters:
  • options (Parsed command options) - Named tuple
  • extra (extra flags to be deleted) - list of str
Returns: options: Named tuple
Parsed command options with no md flags

add_parser_opts(parser, final_prop, mid_prop, extra_options=[])

 

Add all necessary parser arguments for setting up a MD simulation and optional arguments for certain green-kubo property calculation.

Parameters:
  • parser (argparse.ArgumentParser) - The parser for error information
  • final_prop (the final property needs to be calculated) - str
  • mid_prop (the property needs to be calculated before the final prop) - str
  • extra_options (extra options can be added according to these keywords) - list of str

check_options(opts, parser, option_flag, min_data_point)

 

Validate the options.

Parameters:
  • opts (Named tuple) - The parsed command line options
  • parser (argparser.ArgumentParser) - parser to log error information
  • option_flag (str) - time interval is defined by this flag
  • min_data_point (int) - minimum required data point

Variables Details [hide private]

__doc__

Value:
"""
Equilibrium molecular dynamics classes/function shared by transport
property calculations using Einstein and Green-Kubo methods.

Copyright Schrodinger, LLC. All rights reserved.
"""

DIFFUSIVITY_PROP_KEY

Value:
'r_matsci_Diffusion_Coefficient_%s_(m^2/s)'

DIFFUSIVITY_TAU_START_PROP_KEY

Value:
'r_matsci_Diffusion_Coefficient_%s_Tau_Start_(ns)'

DIFFUSIVITY_TAU_END_PROP_KEY

Value:
'r_matsci_Diffusion_Coefficient_%s_Tau_End_(ns)'

VISCOSITY_TAU_START_PROP_KEY

Value:
'r_matsci_%s_Viscosity_%s_Tau_Start_(ns)'

VISCOSITY_TAU_END_PROP_KEY

Value:
'r_matsci_%s_Viscosity_%s_Tau_End_(ns)'

TRJ_PROP_KEYS

Value:
['s_m_original_cms_file', 's_chorus_trajectory_file']

ARG_DEFAULTS

Value:
{'-block_num': 1,
 '-md_enegry_interval': 0.01,
 '-md_pressure': 1.01325,
 '-md_temperature': 300.0,
 '-md_time': 1.0,
 '-md_timestep': 1.0,
 '-md_trj_interval': 1.0,
 '-sel': 'all',
...

ALL_MD_FLAGS

Value:
['-md_ensemble',
 '-md_temperature',
 '-md_pressure',
 '-md_time',
 '-md_timestep',
 '-md_trj_interval',
 '-md_save_trj']