zoomy_core.symsolver.discretization.residual#
The semi-discrete residual and the pieces of one time step, written once for every backend: RK stage, MOOD, aux, implicit slots and hygiene. They compose the vocabulary and are composed by the strategies.
Module Contents#
Functions#
Semi-discrete right-hand side -div(face terms) - interior NCP, plus the explicit source and diffusion slots, and the implicit ones unless an implicit stage takes them. |
|
Pointwise aux of a stage state (e.g. |
|
One SSP-RK step of the method of lines, of order |
|
A-posteriori MOOD: an order-2 candidate step, inadmissible cells redone at first
order, and the whole step at first order if that still fails; the repairs keep
the candidate’s |
|
Pointwise aux, then the derivative (mesh-gradient) aux, whose boundary samples
are the BC ghosts at |
|
|
|
Model hygiene on the new state, then its aux; returns |
|
Implicit Euler on the source at |
|
The SystemModel’s implicit slots over the step ending at |
|
One step of the IMEX Runge-Kutta |
API#
- zoomy_core.symsolver.discretization.residual.residual(nsm, Q, Qaux, p, time, dt, mesh, order, demote=False, coupled=None, implicit_terms=True, dt_rule=None)#
Semi-discrete right-hand side -div(face terms) - interior NCP, plus the explicit source and diffusion slots, and the implicit ones unless an implicit stage takes them.
Args
demote: MOOD demotion of the reconstruction (seereconstruct).coupled:(mask, flux), faces carrying a shared answer.dt_rule:dtis not known yet; the face kernel also returns the wave speedSanddt = dt_rule(S).
Returns
dQ, or(dQ, dt)withdt_rule.References
LeVeque 2002, https://doi.org/10.1017/CBO9780511791253
Pares 2006, https://doi.org/10.1137/050628052
- zoomy_core.symsolver.discretization.residual.stage_aux(nsm, Q, Qaux, p, time, dt, mesh)#
Pointwise aux of a stage state (e.g.
hinv = 1/h).
- zoomy_core.symsolver.discretization.residual.explicit_step(nsm, Q, Qaux, p, time, dt, mesh, order, demote=False, coupled=None, implicit_terms=True, rk=None, dt_rule=None)#
One SSP-RK step of the method of lines, of order
rk(default the reconstruction order).Args
dt_rule: the first stage picksdtfrom its own face wave speeds.
Returns
Q, or(Q, dt)withdt_rule.References
Shu, Osher 1988, https://doi.org/10.1016/0021-9991(88)90177-5
Gottlieb et al. 2001, https://doi.org/10.1137/S003614450036757X
- zoomy_core.symsolver.discretization.residual.mood_step(nsm, Q, Qaux, p, time, dt, mesh, order, coupled=None, implicit_terms=True, rk=None, dt_rule=None)#
A-posteriori MOOD: an order-2 candidate step, inadmissible cells redone at first order, and the whole step at first order if that still fails; the repairs keep the candidate’s
dt.References
Clain et al. 2011, https://doi.org/10.1016/j.jcp.2011.02.026
- zoomy_core.symsolver.discretization.residual.full_aux(nsm, Q, Qaux, p, time, dt, mesh)#
Pointwise aux, then the derivative (mesh-gradient) aux, whose boundary samples are the BC ghosts at
time.
- zoomy_core.symsolver.discretization.residual.derivative_rows(nsm)#
(rows, functions): the state rows the derivative aux differentiates (static tuple) and whether it differentiates aux functions too.
- zoomy_core.symsolver.discretization.residual.post_step(nsm, Q, Qaux, p, time, dt, mesh)#
Model hygiene on the new state, then its aux; returns
(Q, Qaux).
- zoomy_core.symsolver.discretization.residual.implicit_source(nsm, Q, Qaux, p, time, dt, mesh)#
Implicit Euler on the source at
time,Y - Q - dt S(Y, aux(Y)) = 0, by a per-cell root solve with the derivative aux frozen atQ.
- zoomy_core.symsolver.discretization.residual.implicit_step(nsm, Q, Qaux, p, time, dt, mesh)#
The SystemModel’s implicit slots over the step ending at
time: implicit diffusion, then implicit Euler on the source.
- zoomy_core.symsolver.discretization.residual.imex_step(nsm, Q, Qaux, p, time, dt, mesh, order, tableau, mood=False, coupled=None, dt_rule=None, project=None)#
One step of the IMEX Runge-Kutta
tableau: each stage is an explicit (MOOD-guarded) Euler step of the residual without implicit slots plus a per-cell Newton solve of the implicit source.Args
project: Chorin:project(Y, time, dt, i) -> (Y', B)maps stagei(the final combination:iomitted) onto the constraint,B = Y' - Yon the corrected rows.dt_rule:dtfrom the cell states’ wave speeds; returns(Q, dt).
References
Pareschi, Russo 2005, https://doi.org/10.1007/s10915-004-4636-4