Phase class

Code author: Niklaus Johner <niklaus.johner@a3.epfl.ch>

This file contains the Phase object which represents a simulation phase.

class Phase(window, phase_name, phase_type, parent_phase=None)

This class is at the bottom of the hierarchical structure used in SiPMF. Every class:Window can have several Phase corresponding to successive simulations.

Parameters:
  • window (Window) – The window to which the phase belongs
  • phase_name (str) – The name of the phase
  • phase_type (str) – Either Initialization or run phase.
  • parent_phase (Phase) – The phase from which this one is restarted.
AddDataToWindow(n_skip=0, n_tot=-1, new_only=True)

Add the data of this phase to the data file of the window. n_tot=-1 means there is no maximal number of data points added.

Parameters:
  • n_skip (int) – The number of data points to skip.
  • n_tot (int) – The total number of data points used to calculate the PMF.
  • new_only (bool) – Only add the data from phases that have not yet been added to the data files.
GetDataCount()

Get the number of data points accumulated for this phase (number of lines in its datafile).

Initialize()

Initialize the phase by creating its output directory, and setting up the simulation Job, i.e. preparing the MD input file.

UpdateDataCount()

Count how much data has been accumulated in this phase (number of lines in its datafile).