- History
XSim Histories
History
Top-level block for recording data from a XSim simulation. You can use History blocks for XSim to calculate and record data at every time step during a simulation.
History uses the kind parameter to determine which specific data to collect.
History data is useful for diagnostics, as well as determining the basis for performing current and field parameter adjustment during the simulation.
Throughout a simulation run, XSim writes the History data to a separate HDF5 file. The History data file has the file name suffix _History.h5
When a simulation is started or restarted, XSim looks for an existing History file. If XSim finds a History file, XSim appends data to contents of that existing file. If XSim does not find a History file, XSim creates a new file.
When Histories Collect Data
Generally, histories collect data at the end of each time step, after all other XSim objects have been updated.
However, histories can also collect data after the initialization of XSim objects (just before the first time step).
Some histories do not do this. To avoid collecting data after initialization, simply add the following to the <History> block:
<Expression applySteps>
expression = (n > 0)
</Expression>
History Parameters
History block parameters might include:
- kind (string or string vector)
Determines type of Field or Species data to be collected in the History data file during the simulation run. The available field and particle species kinds are detailed in descriptions in the following pages. In addition to specifying the kind, for each History block you must also specify one of the field, fields, or species keywords (see below).
- keyword (string or string vector)
Indicates species or field(s) for use with specified
History
kind.
- field (string)
Indicates the field for a History kind that reports data for a single field. Specify a field reference in a History block by using the name of the EmField followed by a dot (.) then the name of the field subobject. Example:
field = multiField.elecField
- fields (string vector)
Indicates the fields for a History kind that reports data for multiple fields. Specify references to fields in a History block by using the name of the EmField followed by a dot (.) then the name of the field subobject. Example:
fields = [multiField.elecField multiField.magField]