Reference
What SELAH does and where each part is described, by what you want to do. use selah gives the whole API: the kinds, the coefficients (L0), the box and the kernels (L1), the stepper (L2), the additive splitting and the particle pushers. The API pages, generated from the source comments, give every argument.
Feature map
| To | Read | Entry points |
|---|---|---|
| choose a Runge–Kutta scheme by order, stages and SSP coefficient | Schemes: Runge–Kutta schemes | SCHEME_EULER … SCHEME_LSRK_54, RK_SCHEMES, butcher(name) |
| read a scheme in another coefficient form, or convert a form to Butcher | Schemes: the coefficient forms | shu_osher, shu_osher_2r, williamson_2n; butcher_from_shu_osher, butcher_from_shu_osher_2r, butcher_from_williamson_2n, shu_osher_from_2r |
| query a tableau: explicitness, SSP coefficient, stability polynomial, axis bounds | Schemes: the coefficient forms | is_explicit, ssp_coefficient, euler_step_fractions, stability_polynomial, imag_axis_bound, real_axis_bound |
| run a scheme named the FOODIE way | Porting from FOODIE | selah_scheme_name(foodie_name) |
| count the registers a scheme needs in a storage form | Schemes: storage, Stepper: forms | registers_needed(scheme, form), FORM_* |
| split | Schemes: splitting schemes | SCHEME_STRANG, SCHEME_YOSHIDA_4, SCHEME_BLANES_MOAN_S6, SCHEME_BLANES_MOAN_S10, splitting, palindrome; FORM_SPLITTING with partitions= |
| step with the leapfrog and its Robert–Asselin–Williams filter | Schemes: leapfrog, Stepper: leapfrog | SCHEME_LEAPFROG, SCHEME_LEAPFROG_RAW, leapfrog, leapfrog_roots; FORM_LEAPFROG, history(), restart_history(), resume_history(dt) |
| tell the kernels which cells to update | Kernels: the box | box, box_interior, box_range, box_components, LAYOUT_V_FIRST, LAYOUT_V_LAST |
| integrate a field of rank 1 to 4 | Kernels: fields of rank 1 to 4, Stepper: fields of rank 1 to 4 | components=, box_dim, component_dim, stage_state_view, rhs_register_view |
| write your own step from the stage operations | Kernels: operations | selah_copy, selah_axpy, selah_lincomb, selah_stage_state, selah_step_update, selah_shu_osher_2r_stage, selah_williamson_2n_stage, selah_leapfrog_step |
| choose the first step of an embedded pair | Step control: the starting step | initial_step_norms, initial_step_probe, initial_step_difference; initial_probe, initial_step |
| the solution inside a step: a continuous extension, Hermite's cubic, ab-k's interpolant | Dense output | dense_output, hermite_output; dense_weights |
| locate the zeros of functions of the solution inside a step | Events | type(event_locator): initialize, start, step, locating, next_theta, update, event, event_theta, event_time, is_terminal, resume |
| choose the next step from an embedded pair's error: elementary, PI and filter controllers | Step control | type(step_controller): initialize, propose, reset; CONTROL_ELEMENTARY, CONTROL_PI, CONTROL_H211B, CONTROL_PI42, CONTROL_CUSTOM, CONTROLLERS |
| drive a step stage by stage around your ghost fill and residual | Stepper: a step, Stepper: procedures | type(stepper): initialize, begin_step, begin_stage, end_stage, finish_step, stage_state, rhs_register, destroy |
| evaluate a time-dependent residual at the stage's time | Stepper: time-dependent residuals | stage_time(k) |
| leave the cells of a solid (an immersed boundary) untouched | Stepper: masks | mask, mask_comp; masked_q= |
| give the stepper your own memory for its registers | Stepper: the caller's registers | registers= |
| skip the residuals already in their register: a step begun again, first-same-as-last | Stepper: residuals already in their register | stage_needs_residual(k), fsal=, first_same_as_last(), invalidate_residuals() |
| evaluate the first stage on the solution, without its copy | Stepper: stages on q | stages_on_q=, stage_state_is_q(k) |
| get the step residual, or the weights that telescope stage fluxes into a flux register | Stepper: procedures | finish_step(..., dq=) (Butcher form), stage_weight(k) |
| limit each stage for positivity, and bound the time step | Stepper: limiters and forward-Euler steps | stage_euler_fraction(k), ssp_coefficient(), imag_axis_bound(), real_axis_bound() |
| advance another state with the field in the same stages (particles, PML fields) | Stepper: companion states | initialize_companion |
| integrate a stiff linear decay exactly | Stepper: a decay integrated exactly | decay= of begin_stage and finish_step (Butcher form) |
| compose a stepper's step with a flow of your own | Composition: additive splitting | type(additive_splitting): initialize, substeps, substep_operator, substep_fraction, substep_time; SCHEME_LIE, ADDITIVE_SCHEMES, OPERATOR_FIELD, OPERATOR_FLOW |
| advance particles by kick and drift | Composition: particles | SCHEME_STRANG with FORM_SPLITTING |
| push charged particles with a two-level pusher | Particles: two-level pushers | selah_push, PUSHER_BORIS, PUSHER_BORIS_RELATIVISTIC, PUSHER_VAY, PUSHER_HIGUERA_CARY |
| keep Gauss's law at every stage with the particles in the field's scheme | Particles: charge-conserving stage currents | lookahead, stage_current, stage_current_admissible; the kernel selah_stage_current |
| build and run in single precision | Precision, what it changes | R_P; the kinds I4P, I8P, R4P, R8P |
| know what a step costs on a GPU | Performance: results, whole steps |
Modules
selah re-exports the public names of its modules; a program needs only use selah. Each module has its page in the API.
| Layer | Module | Public names |
|---|---|---|
| kinds | selah_kind_parameters | R_P (and, through selah, PENF's I4P, I8P, R4P, R8P) |
| L0 | selah_tableaux | the four coefficient forms, their conversions and queries |
| L0 | selah_schemes | the Runge–Kutta catalogue: SCHEME_*, RK_SCHEMES, butcher, shu_osher, shu_osher_2r, williamson_2n |
| L0 | selah_splittings | splitting_composition, splitting, palindrome, the splitting schemes, SPLITTING_SCHEMES |
| L0 | selah_leapfrog | leapfrog_filter, leapfrog, leapfrog_roots, the axis bounds of a filter, LEAPFROG_SCHEMES |
| L0 | selah_storage | FORM_*, registers_needed |
| L0 | selah_foodie_names | selah_scheme_name: FOODIE's scheme names in SELAH's |
| L0 | selah_step_control | step_controller, CONTROL_*, CONTROLLERS, CONTROL_NAME_LEN |
| L0 | selah_events | event_locator: the zeros of the caller's event functions inside a step |
| L1 | selah_box | box, its constructors and queries, the layouts |
| L1 | selah_kernels | the nine generic stage operations: a box form each, a flat form for all but selah_stage_current |
| L1 | selah_kernels_constraint | CONSTRAINT_NONE, CONSTRAINT_NONNEGATIVE, CONSTRAINT_POSITIVE, CONSTRAINT_NONPOSITIVE, CONSTRAINT_NEGATIVE: the kernel behind stepper%step_constraint |
| L1 | selah_newton | newton_solver, NEWTON_DIAGONAL, NEWTON_BLOCK, NEWTON_MAX_BLOCK: the implicit stage by Newton's method, cell by cell |
| L1 | selah_anderson | anderson_mixing, ANDERSON_MAX_DEPTH: Anderson's acceleration of the implicit stage's fixed-point iteration |
| L1 | selah_newton_krylov | newton_krylov, NK_MAX_RESTART, and its requests NK_RESIDUAL, NK_REDUCE, NK_PRECONDITION, NK_DONE: matrix-free Newton–GMRES in the implicit stage |
| L2 | selah_stepper | stepper |
| L2 | selah_nystrom | nystrom_stepper, nystrom_tableau, nystrom, NYSTROM_SCHEMES: Runge–Kutta–Nyström schemes for stormer_stepper, stormer_weights, STORMER_MAX_STEPS: the Störmer and Cowell schemes |
| L2 | selah_nordsieck | nordsieck_stepper, NORDSIECK_ADAMS, NORDSIECK_BDF, NORDSIECK_ADAMS_MAX_ORDER, NORDSIECK_BDF_MAX_ORDER: the Nordsieck form, variable-step Adams and BDF |
| L2 | selah_magnus | magnus_stepper, magnus_scheme, magnus, MAGNUS_SCHEMES, MAGNUS_DENSE, MAGNUS_KRYLOV, MAGNUS_CALLER, MAGNUS_MAX_BLOCK, MAGNUS_MAX_KRYLOV, and its requests MAGNUS_NODE, MAGNUS_APPLY, MAGNUS_REDUCE, MAGNUS_ACTION, MAGNUS_DONE: commutator-free Magnus schemes for |
| L2 | selah_additive_splitting | additive_splitting, OPERATOR_FIELD, OPERATOR_FLOW, SCHEME_LIE, ADDITIVE_SCHEMES |
| particles | selah_pushers | selah_push, PUSHER_* |