torax_muscle3.torax_actor.ToraxMuscleRunner¶
- class torax_muscle3.torax_actor.ToraxMuscleRunner¶
Bases:
objectObject for running torax simulation
- __init__()¶
Methods
__init__()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()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
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
Interval for communication through MUSCLE3 ports
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
IMAS DBEntry for gathering the timeslices if output_all_timeslices is True
ToraxConfig object
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
- db_out : DBEntry¶
IMAS DBEntry for gathering the timeslices if output_all_timeslices is True
- 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
-
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_ids_data(ids_name: str, port_name: str) tuple[IDSToplevel, float, float | None]¶
Receive IDS message through MUSCLE3
- 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