Visual Mode
🎨 Mode Palette
Section titled “🎨 Mode Palette”| Mode | Description |
|---|---|
phase_portrait | Scatter plot of real vs. imaginary components to expose attractors and limit cycles. |
waveform | Time-domain waveform view, useful for debugging scalar fields or reductions. |
phase | Phase-only rendering that highlights angular structure. |
energy | Energy-density style view for quick stability checks. |
frequency | Spectral magnitude inspection for dispersion and filtering experiments. |
polar | Polar plotting of magnitude/phase pairs. |
🛠️ API
Section titled “🛠️ API”sim.sim_set_visual_mode(ctx, "polar") -- accepts string or integer codelocal mode_value, mode_name = sim.sim_get_visual_mode(ctx)sim.log("visual mode %d -> %s", mode_value, mode_name)sim_set_visual_mode accepts either the integer code or any of the aliases shown above. The getter returns both the code and the canonical string.
📜 Pattern from Scripts
Section titled “📜 Pattern from Scripts”local ctx = sim.sim_create()sim.sim_set_timestep(ctx, 0.01)sim.sim_set_visual_mode(ctx, "phase_portrait")
local field = sim.sim_add_field(ctx, {512}, { type = "complex_double", fill = {0, 0}})
-- add operators...
sim.sim_step(ctx)