Time Integration

solve_equation runs the time loop: it computes the step size, advances the particle grid with the chosen Runge–Kutta or IMEX stepper (HyperCloudCore's Time Stepper), applies particle adaptivity between steps if it is enabled, reports progress, and stores snapshots.

Time step

  • Fixed: with is_cfl = false, dt is the physical time step.
  • CFL: with is_cfl = true (:Time_CFL in a configuration), dt is a CFL number and the physical step is recomputed every iteration as dt * get_time_step(pg, eq, div_interp). This uses the current wave speeds of the equation and the MLS derivative stencils of the grid; see HyperCloudCore's CFL time step for the formula and measured limits.

The last step is shortened so the run ends exactly at tmax.

Snapshots

snapshots + 1 states are stored, at the target times range(0, tmax, length = snapshots + 1).

  • Snapshot 1 is the initial state at t = 0.
  • Each further snapshot is taken at the end of the first step that reaches its target time, so t[k] can lie slightly after the target.
  • The final state is always stored in the last slot.

saveData! copies positions and states into new arrays, so later steps do not modify stored snapshots. With remove_ghosts = true only non-boundary particles are kept. The runners pass :remove_ghosts from the configuration (default true); solve_equation itself defaults to false.

Progress output

  • show_progress = true: a progress bar.
  • show_progress = false: an @info line with the percentage and an ETA (HH:MM:SS) every progress_interval seconds, which is better suited for log files.

The runners take both settings from global switches: enable_progress_bar!(false) and set_progress_interval!(seconds).

The loop also logs the execution backend of the parallel loops (see set_backend!).

Return value

solve_equation returns (positions, states, times, k_step, elapsed_time): the stored positions, states and times per snapshot, the number of steps, and the wall-clock time of the loop in seconds.

API

HyperCloud.solve_equation — Function
solve_equation(timestepper, eq, pg, tmax, dt; kwargs...)

The primary simulation orchestrator governing the main time-stepping loop.

Arguments

  • timestepper::TimeStepper: The selected Runge-Kutta or IMEX time integrator.
  • eq::HyperbolicPDE: The physical equation system.
  • pg::ParticleGrid: The active mesh-free domain configuration.
  • tmax::Real: The final simulation time.
  • dt::Real: The baseline time step.

Keyword Arguments

  • is_cfl::Bool: If true, dt is treated as a CFL number, and the physical time step is dynamically computed at each iteration using the grid and interpolator properties.
  • snapshots::Integer: The number of discrete data dumps to record evenly across the simulation timeline.
  • remove_ghosts::Bool: Strips boundary/ghost particles from the returned snapshot data if true.
  • show_progress::Bool: Toggles visual progress tracking.
  • progress_interval::Real: Sets the refresh rate (in seconds) for logging the simulation's progress and calculating the ETA.
  • adaptivity: a ParticleAdaptivity applied between steps (particle insertion/merging on moving grids), or nothing.

Returns

  • A tuple containing: (position_history, state_history, time_history, total_steps, elapsed_wall_time).
source
HyperCloud.saveData! — Function
saveData!(xs_storage, us_storage, ts_storage, snap_idx, pg, current_t, remove_ghosts)

Extracts and archives the simulation state at a specific snapshot index.

Details

  • Records the current time into ts_storage.
  • If remove_ghosts is true, it filters out boundary particles and saves only the active domain core. Otherwise, it copies the entire grid.
  • Allocates new state and position vectors for the targeted snapshot and copies the corresponding views from the particle grid.
source