torax_muscle3.torax_actor.ToraxMuscleRunner

class torax_muscle3.torax_actor.ToraxMuscleRunner

Bases: object

Object for running torax simulation

__init__()

Methods

__init__()

get_core_profiles_ids()

Get core_profiles IDS from torax state

get_equilibrium_ids()

Get equilibrium IDS from torax state

get_instance()

Initialize MUSCLE3 instance and set up connection ports

get_t_next()

Calculate expected next timestamp in time loop

receive_core_profiles(port_name)

Receive core_profiles IDS through MUSCLE3 connections

receive_equilibrium(port_name)

Receive equilibrium IDS through MUSCLE3 connections

receive_ids_data(ids_name, port_name)

Receive IDS message through MUSCLE3

run_f_init()

Initialize the actor state before the time loop using MUSCLE3 connections

run_o_f()

Send out final state using MUSCLE3 connections

run_o_i()

Send out time loop state using MUSCLE3 connections

run_prep()

Prepare a TORAX simulation based on torax config and MUSCLE3 settings

run_s()

Update time loop state using MUSCLE3 connections

run_sim()

Runs a TORAX simulation using the MUSCLE3 actor

run_timestep()

Evolve time loop state using the TORAX step function

send_ids(ids, ids_name, port_name)

Send IDS message through MUSCLE3

update_t_next(t_next, port_name)

Update t_next to given value

Attributes

equilibrium_interval

Interval for communation through MUSCLE3 ports

finished

Whether the run_sim function has been run fully

first_run

Whether this is the first reuse_instance loop

last_equilibrium_call

Last timestamp for which the MUSCLE3 communication was done

output_all_timeslices

Whether to combine all timeslices at once in the final output

t_next_inner

Next expected output timestamp for inner time loop

t_next_outer

Next expected final output timestamp for reuse_instance loop

db_out

IMAS DBEntry for gathering the timeslices if output_all_timeslices is True

torax_config

ToraxConfig object

step_fn

Torax step_function object

geometry_provider

Torax geometry_provider object

runtime_params_provider

Torax runtime_params_provider object

sim_state

Torax simulation_state object

post_processed_outputs

Torax post_processed_outputs object

extra_var_col

Object to save state of IDS variables that cannot be saved in Torax state

t_cur

Time value inside time loop

db_out : DBEntry

IMAS DBEntry for gathering the timeslices if output_all_timeslices is True

equilibrium_interval = None

Interval for communation through MUSCLE3 ports

extra_var_col : ExtraVarCollection

Object to save state of IDS variables that cannot be saved in Torax state

finished : bool = False

Whether the run_sim function has been run fully

first_run : bool = True

Whether this is the first reuse_instance loop

geometry_provider : StandardGeometryProvider

Torax geometry_provider object

get_core_profiles_ids() IDSToplevel

Get core_profiles IDS from torax state

get_equilibrium_ids() IDSToplevel

Get equilibrium IDS from torax state

get_instance() None

Initialize MUSCLE3 instance and set up connection ports

get_t_next() float | None

Calculate expected next timestamp in time loop

last_equilibrium_call = -inf

Last timestamp for which the MUSCLE3 communication was done

output_all_timeslices : bool | None = False

Whether to combine all timeslices at once in the final output

post_processed_outputs : PostProcessedOutputs

Torax post_processed_outputs object

receive_core_profiles(port_name: str) None

Receive core_profiles IDS through MUSCLE3 connections

receive_equilibrium(port_name: str) None

Receive equilibrium IDS through MUSCLE3 connections

receive_ids_data(ids_name: str, port_name: str) tuple[IDSToplevel, float, float | None]

Receive IDS message through MUSCLE3

run_f_init() None

Initialize the actor state before the time loop using MUSCLE3 connections

run_o_f() None

Send out final state using MUSCLE3 connections

run_o_i() None

Send out time loop state using MUSCLE3 connections

run_prep() None

Prepare a TORAX simulation based on torax config and MUSCLE3 settings

run_s() None

Update time loop state using MUSCLE3 connections

run_sim() None

Runs a TORAX simulation using the MUSCLE3 actor

run_timestep() None

Evolve time loop state using the TORAX step function

runtime_params_provider : RuntimeParamsProvider

Torax runtime_params_provider object

send_ids(ids: IDSToplevel, ids_name: str, port_name: str) None

Send IDS message through MUSCLE3

sim_state : SimState

Torax simulation_state object

step_fn : SimulationStepFn

Torax step_function object

t_cur : float

Time value inside time loop

t_next_inner : float | None = None

Next expected output timestamp for inner time loop

t_next_outer : float | None = None

Next expected final output timestamp for reuse_instance loop

torax_config : ToraxConfig

ToraxConfig object

update_t_next(t_next: float | None, port_name: str) None

Update t_next to given value


Last update: 2026-04-08