Simulator#

class Simulator(scenario, prefix='temp', verbosity=0, generate_tst_file=True, generate_out_file=False)[source]#

Bases: object

The SANSMIC Python simulator.

Parameters:
  • scenario (Scenario) – The scenario to run

  • prefix (str, optional) – The output file prefix to use, by default “temp”

  • vebosity (int, optional) – The verbosity level for console output, by default 0

  • generate_tst_file (bool, optional) – Generate an old-style .TST file, by default True

  • generate_out_file (bool, optional) – Generate an old-style .OUT file, by default False

Summary

close()

Close and garbage collect the C++ model object.

get_current_state()

Get the current state of the model as a single-timestep results object.

open([prefix])

Open a simulation.

run_sim()

Run the complete simulation; requires the Simulator to have been opened first.

current_stage

The current stage of the simulation

current_time

The current time (within the stage) of the simulation

current_volume

The current simulated cavern volume

is_open

Is this simulator attached to a C++ SANSMIC model?

is_running

Is the simulation mid-stage?

num_stages

The total number of stages that have been defined

results

The results for an entire simulation.

steps

Provides an iterator that will run each step of each stage in turn.

Details

close()[source]#

Close and garbage collect the C++ model object.

get_current_state()[source]#

Get the current state of the model as a single-timestep results object.

open(prefix=None)[source]#

Open a simulation.

Parameters:

prefix (str) – The output filename prefix to use, by default None which uses the value specified when the Simulator was created.

run_sim()[source]#

Run the complete simulation; requires the Simulator to have been opened first.

property current_stage: int#

The current stage of the simulation

property current_time: float#

The current time (within the stage) of the simulation

property current_volume: float#

The current simulated cavern volume

property is_open: bool#

Is this simulator attached to a C++ SANSMIC model?

property is_running: bool#

Is the simulation mid-stage?

property num_stages: int#

The total number of stages that have been defined

property results: Results#

The results for an entire simulation.

property steps: StepwiseIterator#

Provides an iterator that will run each step of each stage in turn.