armi.bookkeeping.snapshotInterface module

Controls points during a calculation where snapshots will be triggered, signaling more detailed treatments.

Snapshots are user-defined cycle/timenode points where something special is to be done. What in particular is done is dependent on the case settings and the collection of active plugins

  • At the very basic level, third-party code input files are dumped out and stored in special snapshot folders at these times. This can be useful when you are sharing third-party input files with another party (e.g. for review or collaboration).

  • You may want to run extra long-running physics simulations only at a few time points (e.g. BOL, EOL). This is useful for detailed transient analysis, or other follow-on analysis.

Snapshots can be requested through the settings: dumpSnapshot and/or defaultSnapshots.

armi.bookkeeping.snapshotInterface.describeInterfaces(cs)[source]

Function for exposing interface(s) to other code.

class armi.bookkeeping.snapshotInterface.SnapshotInterface(r, cs)[source]

Bases: Interface

Snapshot managerial interface.

Implementation: Save extra data to be saved from a run, at specified time nodes. I_ARMI_SNAPSHOT0
signature: SnapshotInterface
requirements: R_ARMI_SNAPSHOT

This is a special Interface that is designed to run along all the other Interfaces during a simulation, to save off important or helpful data. By default, this is designed to be used with the "defaultSnapshots" and ""dumpSnapshot"" settings. These settings were added so users can control if snapshot data will be recorded during their run. Broadly, this class is implemented to run the Operator method o.snapshotRequest.

Construct an interface.

The r and cs arguments are required, but may be None, where appropriate for the specific Interface implementation.

Parameters:
  • r (Reactor) – A reactor to attach to

  • cs (Settings) – Settings object to use

Raises:

RuntimeError – Interfaces derived from Interface must define their name

name: str | None = 'snapshot'

The name of the interface. This is undefined for the base class, and must be overridden by any concrete class that extends this one.

interactBOL()[source]

Active the default snapshots at BOL.

interactEveryNode(cycle, node)[source]

Call the snapshot interface to copy files at each node, if requested.

interactCoupled(iteration)[source]

Call the snapshot interface to copy files for coupled iterations, if requested.

activateDefaultSnapshots()[source]

Figure out and assign some default snapshots (BOL, MOL, EOL).

armi.bookkeeping.snapshotInterface.extractCycleNodeFromStamp(stamp)[source]

Returns cycle and node from a CCCNNN stamp.

See also

getCycleNodeStamp

the opposite

armi.bookkeeping.snapshotInterface.getCycleNodeStamp(cycle, node)[source]

Returns a CCCNNN stamp for this cycle and node.

Useful for comparing the current cycle/node with requested snapshots in the settings

See also

isRequestedDetailPoint

compares a cycle,node to the dumpSnapshot list.

extractCycleNodeFromStamp

does the opposite