zoomy_core.symsolver.vocabulary

zoomy_core.symsolver.vocabulary#

The finite-volume vocabulary of the hyperbolic solver: one Block per mesh operation, implemented under the same name by every backend. Arrays are (rows, cells) or (rows, faces), faces meaning all faces in mesh order, and mesh is always an argument.

Module Contents#

Classes#

cells

(kernel, Q, Qaux, p, time, dt, mesh) -> kernel in every cell, with time, dt and the cell centre passed when the kernel declares them.

faces

(kernel, QL, QR, AL, AR, p, mesh) -> kernel on every face with its unit normal (owner to neighbour, outward at a boundary).

face_aux

(Qaux, mesh) -> (AL, AR), the owner and neighbour aux per face (the inner cell on both sides at a boundary).

face_wavespeed

(kernel, Q, Qaux, p, mesh) -> max |eigenvalue| per face over its two cells.

face_inradius

(mesh) -> per-face cell size: min inradius of the adjacent cells.

boundary_states

(ghost, Q, Qaux, p, time, mesh) -> (Qg, Qauxg): the ghost state per boundary face (kernel boundary_ghost_state) and the inner cell’s aux.

boundary_ghosts

(ghost, Q, Qaux, p, time, mesh) -> the ghost per boundary face, as boundary_states without the aux.

boundary_traces

(bc, Q, QL, QR, Qaux, p, time, mesh) -> QR holding the outer face state bc(QL) on boundary faces (the partner face’s QL on a periodic seam).

pointwise

(kernel, X, Xaux, p) -> the kernel in every column of X (cells, faces or boundary faces); no time, step or position.

cell_traces

(Q, mesh) -> (QL, QR), the owner’s and neighbour’s cell value per face; QR on a boundary face is a placeholder for boundary_traces.

gradient

(W, Wg, mesh) -> LSQ gradient of every row of W per cell, boundary faces closed from the ghost values Wg.

minmod

(rows, W, Wg, G, mesh) -> limiter factors in [0, 1] per row and cell (1 off rows): the largest keeping every face extrapolation within the bounds of the face neighbours and boundary ghosts Wg.

venkatakrishnan

As minmod, the smooth Venkatakrishnan factor (eps^2 = h^2).

barth_jespersen

As minmod, the Barth-Jespersen factor.

extrapolate

(W, G, phi, mesh) -> (WL, WR): each cell’s W moved to the face centre by phi * G; WR on a boundary face is a placeholder for boundary_traces.

divergence

(Wm, Wp, mesh) -> per cell sum_f |f| Wm / |V| over the faces it owns plus |f| Wp / |V| over the faces it neighbours.

edge_source

(kernel, Q, QL, QR, Qaux, p, mesh) -> per cell the interior nonconservative integral over each of its edges (order >= 2).

derivative_aux

(spec, Q, Qaux, mesh[, Qg, rows]) -> Qaux with the derivative rows of spec refilled from mesh gradients; with rows, only those states’ derivatives, their boundary faces taken from the ghosts Qg.

put

(Q, rows, values) -> Q with the static state rows rows replaced.

take

(Q, rows) -> the static state rows rows of Q.

zeros

(n, mesh) -> an (n, cells) array of zeros.

diffusion

(kernel, bc, Q, Qaux, p, time, mesh) -> per cell div(A grad Q) of the diffusion tensor kernel (explicit; RHS sign, A > 0 diffuses), face flux n.A.grad_f: the two-point flux plus a correction, grad_f the mean of the two cells’ LSQ gradients with the two-point difference as its part along the cell-to-cell vector (boundary faces: the ghost of bc, the tangential part from the cell gradient). A cut face (distributed) carries no flux.

implicit_diffusion

(kernel, bc, Q, Qaux, p, time, dt, mesh) -> one Crank-Nicolson step of the two-point part of diffusion from time to time + dt, its correction explicit at Q (deferred correction).

inadmissible

(kernel, Q, Qaux, p) -> cell mask: an admissibility row < 0 or a non-finite value.

clean_round_off

(Q, rows, tol) -> Q with the entries of the static rows in [-tol, 0) set to 0 (round-off below zero of a quantity declared non-negative).

halo

(X, mesh) -> X with the copies of other ranks’ cells current (serial: X); after every stencil update.

minimum

(a, b) -> elementwise minimum, NaN propagating, for graph-valued arguments (sp.Min would walk a shared graph as a tree).

reduce_min

Global minimum (all ranks).

reduce_max

(X) -> the largest entry (NaN propagates).

reduce_any

Global any (all ranks).

select

(mask, A, B) -> A where mask else B, per cell or per face.

coupled_faces

(mesh) -> face mask of the coupled boundary faces.

interface_states

(Q, mesh) -> states of the cells next to the coupled faces.

interface_flux

(sides, aux, side, Q, Qaux, peer, p, mesh) -> per face this participant’s row of one Riemann problem posed low -> high (row 0 for side = 0), zero off the coupled faces; both sides pose the same problem.

io

Output effects; save_state / load_state: the restart pair of the march state.

couple

Effects of one preCICE participant.

check

Run-time checks.

API#

class zoomy_core.symsolver.vocabulary.cells#

Bases: zoomy_core.symsolver.core.Block

(kernel, Q, Qaux, p, time, dt, mesh) -> kernel in every cell, with time, dt and the cell centre passed when the kernel declares them.

class zoomy_core.symsolver.vocabulary.faces#

Bases: zoomy_core.symsolver.core.Block

(kernel, QL, QR, AL, AR, p, mesh) -> kernel on every face with its unit normal (owner to neighbour, outward at a boundary).

class zoomy_core.symsolver.vocabulary.face_aux#

Bases: zoomy_core.symsolver.core.Block

(Qaux, mesh) -> (AL, AR), the owner and neighbour aux per face (the inner cell on both sides at a boundary).

class zoomy_core.symsolver.vocabulary.face_wavespeed#

Bases: zoomy_core.symsolver.core.Block

(kernel, Q, Qaux, p, mesh) -> max |eigenvalue| per face over its two cells.

class zoomy_core.symsolver.vocabulary.face_inradius#

Bases: zoomy_core.symsolver.core.Block

(mesh) -> per-face cell size: min inradius of the adjacent cells.

class zoomy_core.symsolver.vocabulary.boundary_states#

Bases: zoomy_core.symsolver.core.Block

(ghost, Q, Qaux, p, time, mesh) -> (Qg, Qauxg): the ghost state per boundary face (kernel boundary_ghost_state) and the inner cell’s aux.

class zoomy_core.symsolver.vocabulary.boundary_ghosts#

Bases: zoomy_core.symsolver.core.Block

(ghost, Q, Qaux, p, time, mesh) -> the ghost per boundary face, as boundary_states without the aux.

class zoomy_core.symsolver.vocabulary.boundary_traces#

Bases: zoomy_core.symsolver.core.Block

(bc, Q, QL, QR, Qaux, p, time, mesh) -> QR holding the outer face state bc(QL) on boundary faces (the partner face’s QL on a periodic seam).

class zoomy_core.symsolver.vocabulary.pointwise#

Bases: zoomy_core.symsolver.core.Block

(kernel, X, Xaux, p) -> the kernel in every column of X (cells, faces or boundary faces); no time, step or position.

class zoomy_core.symsolver.vocabulary.cell_traces#

Bases: zoomy_core.symsolver.core.Block

(Q, mesh) -> (QL, QR), the owner’s and neighbour’s cell value per face; QR on a boundary face is a placeholder for boundary_traces.

class zoomy_core.symsolver.vocabulary.gradient#

Bases: zoomy_core.symsolver.core.Block

(W, Wg, mesh) -> LSQ gradient of every row of W per cell, boundary faces closed from the ghost values Wg.

References

  • Mavriplis 2003, https://doi.org/10.2514/6.2003-3986

class zoomy_core.symsolver.vocabulary.minmod#

Bases: zoomy_core.symsolver.core.Block

(rows, W, Wg, G, mesh) -> limiter factors in [0, 1] per row and cell (1 off rows): the largest keeping every face extrapolation within the bounds of the face neighbours and boundary ghosts Wg.

References

  • Sweby 1984, https://doi.org/10.1137/0721062

class zoomy_core.symsolver.vocabulary.venkatakrishnan#

Bases: zoomy_core.symsolver.core.Block

As minmod, the smooth Venkatakrishnan factor (eps^2 = h^2).

References

  • Venkatakrishnan 1995, https://doi.org/10.1006/jcph.1995.1084

class zoomy_core.symsolver.vocabulary.barth_jespersen#

Bases: zoomy_core.symsolver.core.Block

As minmod, the Barth-Jespersen factor.

References

  • Barth, Jespersen 1989, https://doi.org/10.2514/6.1989-366

class zoomy_core.symsolver.vocabulary.extrapolate#

Bases: zoomy_core.symsolver.core.Block

(W, G, phi, mesh) -> (WL, WR): each cell’s W moved to the face centre by phi * G; WR on a boundary face is a placeholder for boundary_traces.

References

  • van Leer 1979, https://doi.org/10.1016/0021-9991(79)90145-1

class zoomy_core.symsolver.vocabulary.divergence#

Bases: zoomy_core.symsolver.core.Block

(Wm, Wp, mesh) -> per cell sum_f |f| Wm / |V| over the faces it owns plus |f| Wp / |V| over the faces it neighbours.

class zoomy_core.symsolver.vocabulary.edge_source#

Bases: zoomy_core.symsolver.core.Block

(kernel, Q, QL, QR, Qaux, p, mesh) -> per cell the interior nonconservative integral over each of its edges (order >= 2).

References

  • Pares 2006, https://doi.org/10.1137/050628052

class zoomy_core.symsolver.vocabulary.derivative_aux#

Bases: zoomy_core.symsolver.core.Block

(spec, Q, Qaux, mesh[, Qg, rows]) -> Qaux with the derivative rows of spec refilled from mesh gradients; with rows, only those states’ derivatives, their boundary faces taken from the ghosts Qg.

class zoomy_core.symsolver.vocabulary.put#

Bases: zoomy_core.symsolver.core.Block

(Q, rows, values) -> Q with the static state rows rows replaced.

class zoomy_core.symsolver.vocabulary.take#

Bases: zoomy_core.symsolver.core.Block

(Q, rows) -> the static state rows rows of Q.

class zoomy_core.symsolver.vocabulary.zeros#

Bases: zoomy_core.symsolver.core.Block

(n, mesh) -> an (n, cells) array of zeros.

class zoomy_core.symsolver.vocabulary.diffusion#

Bases: zoomy_core.symsolver.core.Block

(kernel, bc, Q, Qaux, p, time, mesh) -> per cell div(A grad Q) of the diffusion tensor kernel (explicit; RHS sign, A > 0 diffuses), face flux n.A.grad_f: the two-point flux plus a correction, grad_f the mean of the two cells’ LSQ gradients with the two-point difference as its part along the cell-to-cell vector (boundary faces: the ghost of bc, the tangential part from the cell gradient). A cut face (distributed) carries no flux.

References

  • Eymard, Gallouet, Herbin 2000, https://doi.org/10.1016/s1570-8659(00)07005-8

class zoomy_core.symsolver.vocabulary.implicit_diffusion#

Bases: zoomy_core.symsolver.core.Block

(kernel, bc, Q, Qaux, p, time, dt, mesh) -> one Crank-Nicolson step of the two-point part of diffusion from time to time + dt, its correction explicit at Q (deferred correction).

References

  • Crank, Nicolson 1947, https://doi.org/10.1017/s0305004100023197

class zoomy_core.symsolver.vocabulary.inadmissible#

Bases: zoomy_core.symsolver.core.Block

(kernel, Q, Qaux, p) -> cell mask: an admissibility row < 0 or a non-finite value.

class zoomy_core.symsolver.vocabulary.clean_round_off#

Bases: zoomy_core.symsolver.core.Block

(Q, rows, tol) -> Q with the entries of the static rows in [-tol, 0) set to 0 (round-off below zero of a quantity declared non-negative).

class zoomy_core.symsolver.vocabulary.halo#

Bases: zoomy_core.symsolver.core.Block

(X, mesh) -> X with the copies of other ranks’ cells current (serial: X); after every stencil update.

class zoomy_core.symsolver.vocabulary.minimum#

Bases: zoomy_core.symsolver.core.Block

(a, b) -> elementwise minimum, NaN propagating, for graph-valued arguments (sp.Min would walk a shared graph as a tree).

is_commutative#

True

is_extended_real#

True

class zoomy_core.symsolver.vocabulary.reduce_min#

Bases: zoomy_core.symsolver.core.Block

Global minimum (all ranks).

class zoomy_core.symsolver.vocabulary.reduce_max#

Bases: zoomy_core.symsolver.core.Block

(X) -> the largest entry (NaN propagates).

class zoomy_core.symsolver.vocabulary.reduce_any#

Bases: zoomy_core.symsolver.core.Block

Global any (all ranks).

class zoomy_core.symsolver.vocabulary.select#

Bases: zoomy_core.symsolver.core.Block

(mask, A, B) -> A where mask else B, per cell or per face.

class zoomy_core.symsolver.vocabulary.coupled_faces#

Bases: zoomy_core.symsolver.core.Block

(mesh) -> face mask of the coupled boundary faces.

class zoomy_core.symsolver.vocabulary.interface_states#

Bases: zoomy_core.symsolver.core.Block

(Q, mesh) -> states of the cells next to the coupled faces.

class zoomy_core.symsolver.vocabulary.interface_flux#

Bases: zoomy_core.symsolver.core.Block

(sides, aux, side, Q, Qaux, peer, p, mesh) -> per face this participant’s row of one Riemann problem posed low -> high (row 0 for side = 0), zero off the coupled faces; both sides pose the same problem.

class zoomy_core.symsolver.vocabulary.io#

Output effects; save_state / load_state: the restart pair of the march state.

write#

‘Effect(…)’

save_state#

‘Effect(…)’

load_state#

‘Effect(…)’

class zoomy_core.symsolver.vocabulary.couple#

Effects of one preCICE participant.

References

  • Chourdakis et al. 2022, https://doi.org/10.12688/openreseurope.14445.2

init#

‘Effect(…)’

max_dt#

‘Effect(…)’

read#

‘Effect(…)’

write#

‘Effect(…)’

advance#

‘Effect(…)’

class zoomy_core.symsolver.vocabulary.check#

Run-time checks.

cfl#

‘Effect(…)’