HASEonGPU.Simulation
- class HASEonGPU.Simulation(gainMedium, pump, phiASE, timeIntegrationSolver, timeStep, crossSections=None, endTime=None, constants=<factory>, updateTerminalLevel=True)
Bases:
objectHigh-level pump, ASE, fluorescence, and time-integration loop.
Register
onInitorbeforeStepcallbacks when a function needs the liveSimulationobject and may inspect or mutate it. RegisteronStepcallbacks when a function needs the completedTimeStepStatesnapshot produced by each step.- Parameters:
gainMedium (GainMedium)
pump (PumpProperties)
phiASE (PhiASE)
timeIntegrationSolver (TimeIntegrationSolver)
timeStep (float)
crossSections (CrossSectionData | None)
endTime (float | None)
constants (Constants)
updateTerminalLevel (bool)
- gainMedium: GainMedium
Geometry, material data, and current beta arrays.
- pump: PumpProperties
Pump model that adds population to
betaCells.
- timeIntegrationSolver: TimeIntegrationSolver
Solver object that advances
betaCellsusingd beta / dt.
- timeStep: float
Physical time increment per step, in seconds.
- crossSections: CrossSectionData | None = None
Shared spectra used by pump and ASE when not set on either object.
- endTime: float | None = None
Optional target physical time for
runUntil().
- updateTerminalLevel: bool = True
Whether the last z-level beta values are advanced by the solver.
- onStep(callback)
Register
callback(state)to run after every completed step.stateis aTimeStepStatecontaining copied result arrays such asbetaCells,betaVolume,phiAse,dndtPump, anddndtAse. Callback return values are ignored.
- onInit(callback)
Register
callback(simulation)to run once before the first step.The callback receives this live
Simulationobject, so it can read or changegainMedium,pump,phiASE,timeStep, and other simulation settings before any derivative is evaluated.
- beforeStep(callback)
Register
callback(simulation)to run before every step.The callback receives this live
Simulationobject at the currenttimeandstepIndex. Use this for controlled changes to inputs before the next time-step update.
- runUntil(endtime=None, endTime=None)
Advance steps until the configured or supplied end time is reached.
- runSteps(steps)
Run exactly
stepscalls tostep()and returnself.
- step()
Advance one time step and return the completed
TimeStepState.
- getResults()
Return all stored
TimeStepStatesnapshots in step order.
- property time
Current physical simulation time in seconds.
- property stepIndex
Number of completed time steps.