espressopp.analysis.SystemMonitor¶
SystemMonitor prints and logs to file values obtained from Observables like temperature, pressure or potential energy.
-
espressopp.analysis.
SystemMonitor
(system, integrator, output)¶ Parameters: - system (espressopp.System) – The system object.
- integrator (espressopp.integrator.MDIntegrator) – The MD integrator.
- output (espressopp.analysis.SystemMonitorOutputCSV) – The output object.
-
espressopp.analysis.SystemMonitor.
add_observable
(name, observable, is_visible)¶ The function adds new observable to SystemMonitor.
Parameters: - name (str) – The name of observable
- observable – The observable, eg. espressopp.analysis.PotentialEnergy
- is_visible (bool) – If set to True then values will be print on console.
-
espressopp.analysis.SystemMonitor.
info
()¶ The method print out on console the values of observables.
CSV Output
The output of SystemMonitor to CSV files.
-
espressopp.analysis.
SystemMonitorOutputCSV
(file_name, delimiter)¶ Parameters: - file_name (str) – The name of CSV file.
- delimiter (str) – The field delimiter, by default it is tabulator.
Example
>>> interaction = espressopp.interaction.VerletListLennardJones(verletlist)
>>> interaction.setPotential(type1=0, type2=0,
potential=espressopp.interaction.LennardJones(epsilon=1.0, sigma=1.0,
cutoff=2.0))
>>> system_monitor_csv = espressopp.analysis.SystemMonitorOutputCSV('out.csv')
>>> system_monitor = espressopp.analysis.SystemMonitor(
system, integrator, espressopp.analysis.SystemMonitorOutputCSV('out.csv'))
>>> system_monitor.add_observable('pot', espressopp.analysis.PotentialEnergy(system, interaction))
>>> ext_analysis = espressopp.integrator.ExtAnalyze(system_monitor, 10)
>>> integrator.addExtension(ext_analysis)