Class Model#

Class Documentation#

class Model#

The main SANSMIC model class.

Public Functions

Model()#
Model(string out_prefix)#

Create a new model for the simulation.

Parameters:

out_prefix – the prefix to use for file outputs

void configure(Scenario scen)#

Configure the model with the scenario provided.

void run_sim(void)#

Run the complete model.

int run_stage()#

Run the next stage and all timesteps therein.

Returns:

1 if the stage is complete

int run_step()#

Run the next time step.

Returns:

1 if the stage is complete

int init_stage(void)#

Move on to the next stage.

Returns:

the current stage number

int end_stage()#

End the current stage.

Returns:

1 if the stage is complete

void generate_tst_file(bool use_file)#

Choose whether the .TST file should be written.

Parameters:

use_file – the choice

void generate_out_file(bool use_file)#

Choose whether the .OUT file should be written.

Parameters:

use_file – the choice

void set_verbosity_level(int verb)#

Set the verbosity output level for cout/cerr.

Parameters:

verb – the verbosity level

int open_outfiles(bool append = false)#

Open output files and initialize the headers.

Parameters:

append – whether the files should be opened with append, by default false

Returns:

success code

void close_outfiles(void)#

Close the file handles for output files.

bool get_running_status(void)#

Is this model currently running?

Returns:

running status

int get_num_stages(void)#

Get the current number of stages.

Returns:

the number of stages

int get_current_stage(void)#

Get the current stage number.

Returns:

the stage number

double get_current_time(void)#

Get the current time.

Returns:

the time

double get_current_volume(void)#

Get the current cavern volume (in bbl)

Returns:

the volume

Results get_current_state(void)#

Get the single-timestep state of the model in a Results object.

Returns:

Results object with single timestep of data.

Results get_results(void)#

Get the compelte results object.

Returns:

Results

vector<Stage> get_stages(void)#

Get the stages object.

Returns:

vector of all stage definitions

Protected Attributes

int verbosity = 0#

verbosity setting for output

bool b_use_outfile#

use or don’t use the .OUT file; default false

bool b_use_tstfile#

use or don’t use the .TST file; default true