torax_muscle3.torax_actor.ToraxMuscleRunner¶
- class torax_muscle3.torax_actor.ToraxMuscleRunner¶
Bases:
objectObject for running torax simulation
- __init__()¶
Methods
__init__()fix_ymmsl_settings()Get core_profiles IDS from torax state
Get equilibrium IDS from torax state
Initialize MUSCLE3 instance and set up connection ports
Calculate expected next timestamp in time loop
receive_core_profiles(port_name)Receive core_profiles IDS through MUSCLE3 connections
receive_core_sources(port_name)Receive core_sources 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
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([torax_config])Prepare a TORAX simulation based on torax config and MUSCLE3 settings
run_resume()run_s()Update time loop state using MUSCLE3 connections
run_sim()Runs a TORAX simulation using the MUSCLE3 actor
Evolve time loop state using the TORAX step function
save_final_snapshot()save_snapshot()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
(t_initial, t_final) taken from the equilibrium sequence received on in_f, or None when no equilibrium is connected.
Whether the run_sim function has been run fully
Whether this is the first reuse_instance loop
Last timestamp for which the MUSCLE3 communication was done
Whether to combine all timeslices at once in the final output
Next expected output timestamp for inner time loop
Next expected final output timestamp for reuse_instance loop
Whether to use plasma composition from input core_profiles IDS on f_init or from TORAX config
IMAS DBEntry for gathering the timeslices if output_all_timeslices is True
ToraxConfig object
Interval for communication through MUSCLE3 ports
Torax step_function object
Torax geometry_provider object
Torax runtime_params_provider object
Torax simulation_state object
Torax post_processed_outputs object
Object to save state of IDS variables that cannot be saved in Torax state
Time value inside time loop
Last time value of simulation
- db_out : DBEntry¶
IMAS DBEntry for gathering the timeslices if output_all_timeslices is True
-
equilibrium_t_range : Tuple[float, float] | None =
None¶ (t_initial, t_final) taken from the equilibrium sequence received on in_f, or None when no equilibrium is connected. Set in receive_equilibrium.
- extra_var_col : ExtraVarCollection¶
Object to save state of IDS variables that cannot be saved in Torax state
- 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
- post_processed_outputs : PostProcessedOutputs¶
Torax post_processed_outputs object
- receive_ids_data(ids_name: str, port_name: str) tuple[IDSToplevel, float] | None¶
Receive IDS message through MUSCLE3
-
run_prep(torax_config: ToraxConfig | None =
None) None¶ Prepare a TORAX simulation based on torax config and MUSCLE3 settings
- runtime_params_provider : RuntimeParamsProvider¶
Torax runtime_params_provider object
- sim_state : SimState¶
Torax simulation_state object
- step_fn : SimulationStepFn¶
Torax step_function object
- torax_config : ToraxConfig¶
ToraxConfig object