Package schrodinger :: Package application :: Package desmond :: Module energygroup :: Class MSEnergyGroupAnalysis
[hide private]
[frames] | no frames]

Class MSEnergyGroupAnalysis

EnergyGroupAnalysis --+
                      |
                     MSEnergyGroupAnalysis

Material Science energy group analysis module

Instance Methods [hide private]
 
__init__(self, cst, trjfile, orig_cfgfile, groups, volume=False, pressure_tensor=False, specific_heat=False)
Initialize
 
getVolumeTimeSeries(self)
Return volume series
 
getPressureTensorTimeSeries(self)
Return pressure tensor series
 
getEnergyTimeSeries(self)
return energy values
float
_calculate_specific_heat(self, Etot, last_n_percent)
Calculates specific heat for NVT (Cv) and NPT (Cp) ensembles.
float
_calculate_specific_heat_nve(self, Ekin, last_n_percent=100.0)
Calculates specific heat for NVE (Cv)
 
getSpecificHeatType(self)
 
getResultsForLastNPercent(self, energy, function)
Function that calculates the specific heat for the last N percent of the trajectory.
 
getSpecificHeat(self)
 
_processFrameEne(self)
In order to reduce the amount of memory holding all the energy groups for every frame, we will process energies for each frame as we parse the .ene file.
(float, float)
_processFramePressureTensor(self, line)
process lines that look like this: Pressure_Tensor(4.800000) -1138.7 39.734 300.07 116.98 -1124.3 -120.67 259.95 -65.07 -963.18
 
_parseHeaderLine(self, line)
Parses header line that looks like this:...
(float, float)
_processFrameVolume(self, line)
processes line that looks like this, extracts V, volume time=19.2 en=3.641e+04 E_p=-1.937e+02 E_k=7.039e+03 E_x=1.071e+02 P=5.999e+02 V=9.654+04
(float, float, float)
_processFrameSpecificHeat(self, line)
parses the header of every timestep in the energy group file time=19.2 en=3.641e+04 E_p=-1.937e+02 E_k=7.039e+03 E_x=1.071e+02 P=5.999e+02 V=9.654+04 we just want the timestep, potential and kinetic energies
 
_processFramePressure(self, line)
 
_parseOutput(self, filename)
Parse output from vrun to retrieve energy.
 
_calcEnergy(self)

Inherited from EnergyGroupAnalysis: getGroups

Static Methods [hide private]
int
_getStartIndex(nframes, last_n_percent)
Returns starting index of the last N percent of the frames
Class Variables [hide private]
  energy_term_pattern = '(far_terms|nonbonded_elec|nonbonded_vdw...
  bulk_pattern = '(time)'
  pressure_tensor_pattern = '(Pressure_Tensor)'
  MAX_NGROUPS_SUPPORTED = 870
  KCAL_TO_J = 4184.0
  R_GAS_CONSTANT = 8.314472

Inherited from EnergyGroupAnalysis: floating_number_pattern

Method Details [hide private]

__init__(self, cst, trjfile, orig_cfgfile, groups, volume=False, pressure_tensor=False, specific_heat=False)
(Constructor)

 

Initialize

Parameters:
  • cst (Structure) - Structure of the sys (full_system ct)
  • trjfile (str) - Cms filename that contains links to the trajectory
  • orig_cfgfile (str) - a configuration file that is outputted by an md job which contains an ORIG_CFG block
  • groups (EnergyGroup) - Energy group definitions for a given system
  • volume (bool) - bool to extract the volume of the system
  • pressure_tensor (bool) - bool to extract the pressure of the system
  • specific_heat (bool) - bool to calculate Cp or Cv for a given bulk sys
Overrides: EnergyGroupAnalysis.__init__

getEnergyTimeSeries(self)

 

return energy values

Overrides: EnergyGroupAnalysis.getEnergyTimeSeries

_getStartIndex(nframes, last_n_percent)
Static Method

 

Returns starting index of the last N percent of the frames

Parameters:
  • nframes (int) - total number of frames in the simulation
  • last_n_percent (float) - return results for N% of the trajectory
Returns: int
the start index for array analysis.

_calculate_specific_heat(self, Etot, last_n_percent)

 

Calculates specific heat for NVT (Cv) and NPT (Cp) ensembles.

Parameters:
  • E (numpy.array) - total energy
  • last_n_percent (float) - report results for N last percent
Returns: float
Cp or Cv for last N percent

_calculate_specific_heat_nve(self, Ekin, last_n_percent=100.0)

 

Calculates specific heat for NVE (Cv)

Parameters:
  • Ekin (numpy.array) - kinetic energy
  • last_n_percent (float) - report results for N last percent
Returns: float
Cv for last N percent

getResultsForLastNPercent(self, energy, function)

 

Function that calculates the specific heat for the last N percent of the trajectory.

Parameters:
  • energy (numpy.array) - numpy.array of energies, depending on ensemble
  • function (???) - function that calculates specific heat

_processFrameEne(self)

 

In order to reduce the amount of memory holding all the energy groups for every frame, we will process energies for each frame as we parse the .ene file. So self.energy_series should energy pairs for one frame at a time.

_processFramePressureTensor(self, line)

 

process lines that look like this: Pressure_Tensor(4.800000) -1138.7 39.734 300.07 116.98 -1124.3 -120.67 259.95 -65.07 -963.18

Parameters:
  • line (str) - a pressure tensor line that comes from engrp file
Returns: (float, float)
a tuple of chemical time and corresponding list of nine pressure tensors

_parseHeaderLine(self, line)

 

Parses header line that looks like this:
     time=19.2 en=3.641e+04 E_p=-1.937e+02 E_k=7.039e+03                                     E_x=1.071e+02 P=5.999e+02 V=9.654+04
and returns a dictionary of values
@param line: a frame header str that comes from engrp file
@type  line: str
@return: a dictionary of key/values pairs
@rtype: dict

_processFrameVolume(self, line)

 

processes line that looks like this, extracts V, volume time=19.2 en=3.641e+04 E_p=-1.937e+02 E_k=7.039e+03 E_x=1.071e+02 P=5.999e+02 V=9.654+04

Parameters:
  • line (str) - a str that comes from engrp file
Returns: (float, float)
a tuple of chemical time and corresponding volume

_processFrameSpecificHeat(self, line)

 

parses the header of every timestep in the energy group file time=19.2 en=3.641e+04 E_p=-1.937e+02 E_k=7.039e+03 E_x=1.071e+02 P=5.999e+02 V=9.654+04 we just want the timestep, potential and kinetic energies

Parameters:
  • line (str) - a str that comes from engrp file
Returns: (float, float, float)
a tuple of chemical time and corresponding potential and kinetic energies

_parseOutput(self, filename)

 

Parse output from vrun to retrieve energy.

Overrides: EnergyGroupAnalysis._parseOutput

_calcEnergy(self)

 
Overrides: EnergyGroupAnalysis._calcEnergy

Class Variable Details [hide private]

energy_term_pattern

Value:
'(far_terms|nonbonded_elec|nonbonded_vdw|Total)'