|
| 1 | +#= ============== =# |
| 2 | +# ActorMagnetics # |
| 3 | +#= ============== =# |
| 4 | + |
| 5 | +@actor_parameters_struct ActorMagnetics{T} begin |
| 6 | + #== actor parameters ==# |
| 7 | + #== display and debugging parameters ==# |
| 8 | +end |
| 9 | + |
| 10 | +mutable struct ActorMagnetics{D,P} <: SingleAbstractActor{D,P} |
| 11 | + dd::IMAS.dd{D} |
| 12 | + par::OverrideParameters{P,FUSEparameters__ActorMagnetics{P}} |
| 13 | +end |
| 14 | + |
| 15 | +""" |
| 16 | + ActorMagnetics(dd::IMAS.dd, act::ParametersAllActors; kw...) |
| 17 | +
|
| 18 | +Calculates magnetic field diagnostics from equilibrium data. |
| 19 | +
|
| 20 | +This actor computes the magnetic field measurements that would be observed by |
| 21 | +magnetic diagnostics (flux loops, magnetic probes, etc.) based on the plasma |
| 22 | +equilibrium. It populates the `dd.magnetics` IDS with synthetic diagnostic signals. |
| 23 | +
|
| 24 | +The actor calls `IMAS.magnetics!` to: |
| 25 | +- Calculate magnetic flux measurements at diagnostic locations |
| 26 | +- Compute magnetic field components for probes |
| 27 | +- Generate time-dependent synthetic signals consistent with the equilibrium evolution |
| 28 | +
|
| 29 | +Key outputs: |
| 30 | +- Magnetic flux loop signals in `dd.magnetics.flux_loop` |
| 31 | +- Magnetic probe measurements in `dd.magnetics.bpol_probe` |
| 32 | +- Time-dependent diagnostic data for validation and analysis |
| 33 | +
|
| 34 | +!!! note |
| 35 | +
|
| 36 | + Requires `dd.equilibrium` to be populated with equilibrium data. |
| 37 | + Results are stored in `dd.magnetics`. |
| 38 | +""" |
| 39 | +function ActorMagnetics(dd::IMAS.dd, act::ParametersAllActors; kw...) |
| 40 | + actor = ActorMagnetics(dd, act.ActorMagnetics; kw...) |
| 41 | + step(actor) |
| 42 | + finalize(actor) |
| 43 | + return actor |
| 44 | +end |
| 45 | + |
| 46 | +function ActorMagnetics(dd::IMAS.dd, par::FUSEparameters__ActorMagnetics; kw...) |
| 47 | + logging_actor_init(ActorMagnetics) |
| 48 | + par = OverrideParameters(par; kw...) |
| 49 | + return ActorMagnetics(dd, par) |
| 50 | +end |
| 51 | + |
| 52 | +function _step(actor::ActorMagnetics) |
| 53 | + dd = actor.dd |
| 54 | + par = actor.par |
| 55 | + |
| 56 | + # Calculate magnetics diagnostics from equilibrium |
| 57 | + IMAS.magnetics!(dd.magnetics, dd.equilibrium) |
| 58 | + |
| 59 | + return actor |
| 60 | +end |
0 commit comments