IOM_plugin_energy

About the IOM_plugin_energy class

The WaveBlocks Project

@author: R. Bourquin @copyright: Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016 R. Bourquin @license: Modified BSD License

Class documentation

The WaveBlocks Project

IOM plugin providing functions for handling energy data.

@author: R. Bourquin @copyright: Copyright (C) 2010, 2011, 2012, 2013 R. Bourquin @license: Modified BSD License

IOM_plugin_energy.add_energy(self, parameters, timeslots=None, blockid=0, key=('kin', 'pot'))[source]
Parameters:
  • parameters – A ParameterProvider instance containing at least the key ncomponents.
  • timeslots – The number of time slots we need. Can be set to None to get automatically growing datasets.
  • blockid – The ID of the data block to operate on.
  • key (Tuple of valid identifier strings that are kin, pot and tot. Default is ("kin", "pot").) – Specify which energies to save. All are independent.
IOM_plugin_energy.delete_energy(self, blockid=0)[source]

Remove the stored energies

Parameters:blockid – The ID of the data block to operate on.
IOM_plugin_energy.has_energy(self, blockid=0, key=('kin', 'pot'))[source]

Ask if the specified data block has the desired data tensor.

Parameters:
  • blockid – The ID of the data block to operate on.
  • key (Tuple of valid identifier strings that are kin, pot and tot. Default is ("kin", "pot").) – Specify which energies to save. All are independent.
IOM_plugin_energy.load_energy(self, timestep=None, split=False, blockid=0, key=('kin', 'pot'))[source]

Load the energy data.

Parameters:
  • timestep – Load only the data of this timestep.
  • split – Split the array into arrays for each component.
  • blockid – The ID of the data block to operate on.
  • key (Tuple of valid identifier strings that are kin, pot and tot. Default is ("kin", "pot").) – Specify which energies to save. All are independent.
IOM_plugin_energy.load_energy_timegrid(self, blockid=0, key=('kin', 'pot'))[source]

Load the time grid for specified energies.

Parameters:
  • blockid – The ID of the data block to operate on.
  • key (Tuple of valid identifier strings that are kin, pot and tot. Default is ("kin", "pot").) – Specify which energy timegrids to load. All are independent.
IOM_plugin_energy.save_energy(self, energies, timestep=None, blockid=0, key=('kin', 'pot'))[source]

Save the kinetic and potential energies to a file.

Parameters:
  • energies – A tuple containing the energies. The order is important, it has to match the order in the key argument. Per default the order has to be (E_\text{kin}, E_\text{pot}).
  • timestep – The timestep at which we save the data.
  • blockid – The ID of the data block to operate on.
  • key (Tuple of valid identifier strings that are kin, pot and tot. Default is ("kin", "pot").) – Specify which energies to save. All are independent.