# Tutorials and use cases

<!-- generated by docs/scripts/generate_tutorial_index.py from the notebooks' metadata.zoomy; do not edit -->

::::::{div} zt-layout
:::::{div} zt-bar
<div class="zt-box"><span class="zt-pills"></span><input class="zt-text" type="text" autocomplete="off" spellcheck="false" placeholder="type tags, e.g. hydro, 1d" aria-label="Filter by tags" role="combobox" aria-expanded="false" aria-controls="zt-suggest"><ul class="zt-suggest" id="zt-suggest" role="listbox" hidden></ul></div>
<button type="button" class="zt-clear">reset</button>
<span class="zt-status" role="status" aria-live="polite"></span>
:::::

:::::{div} zt-main
::::{grid} 1 2 2 2
:gutter: 3

:::{grid-item-card} A 1-D mesh
:class-card: zt-card
:link: ipynb/mesh/mesh_1d
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:1d component:mesh requires:cpu"></span>Build a 1-D LSQMesh and inspect cells, faces and boundary ghost cells.

`tutorials/mesh/mesh_1d.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 1d">1d</span> <span class="zt-tag" style="--zt-h:32" title="component: mesh">mesh</span>
:::

:::{grid-item-card} A 2-D gmsh mesh
:class-card: zt-card
:link: ipynb/mesh/mesh_2d_gmsh
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:2d component:mesh requires:cpu"></span>Generate a triangular gmsh mesh of a channel, load it as an LSQMesh and inspect the boundary tags.

`tutorials/mesh/mesh_2d_gmsh.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 2d">2d</span> <span class="zt-tag" style="--zt-h:32" title="component: mesh">mesh</span>
:::

:::{grid-item-card} AMReX: adaptive mesh refinement
:class-card: zt-card
:link: ipynb/amrex/amr
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:1d physics:inviscid physics:hydrostatic physics:incompressible physics:free-surface component:solver method:finite-volume backend:amrex requires:container"></span>A 1-D dam break on AMReX with one refinement level that follows the waves.

`tutorials/amrex/amr.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 1d">1d</span> <span class="zt-tag" style="--zt-h:165" title="physics: inviscid">inviscid</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: incompressible">incompressible</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: solver">solver</span> <span class="zt-tag" style="--zt-h:335" title="method: finite-volume">finite-volume</span> <span class="zt-tag" style="--zt-h:355" title="backend: amrex">amrex</span> <span class="zt-tag">requires:container</span>
:::

:::{grid-item-card} AMReX: from symbolic model to generated C++
:class-card: zt-card
:link: ipynb/amrex/minimal
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:1d physics:inviscid physics:hydrostatic physics:incompressible physics:free-surface component:system-model component:numerical-system-model component:solver method:finite-volume backend:amrex requires:container"></span>A 1-D dam break printed as C++ headers for AMReX, built, run and read back.

`tutorials/amrex/minimal.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 1d">1d</span> <span class="zt-tag" style="--zt-h:165" title="physics: inviscid">inviscid</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: incompressible">incompressible</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: system-model">system-model</span> <span class="zt-tag" style="--zt-h:32" title="component: numerical-system-model">numerical-system-model</span> <span class="zt-tag" style="--zt-h:32" title="component: solver">solver</span> <span class="zt-tag" style="--zt-h:335" title="method: finite-volume">finite-volume</span> <span class="zt-tag" style="--zt-h:355" title="backend: amrex">amrex</span> <span class="zt-tag">requires:container</span>
:::

:::{grid-item-card} Bump sensitivities by finite differences
:class-card: zt-card
:link: ipynb/ad/bump_finite_differences
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:1d physics:inviscid physics:hydrostatic physics:free-surface component:solver method:finite-volume feature:sensitivity backend:jax requires:cpu"></span>Steady 1-D flow over a Gaussian bump: d eta / d(position, width) by central finite differences, with a step-size check.

`tutorials/ad/bump_finite_differences.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 1d">1d</span> <span class="zt-tag" style="--zt-h:165" title="physics: inviscid">inviscid</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: solver">solver</span> <span class="zt-tag" style="--zt-h:335" title="method: finite-volume">finite-volume</span> <span class="zt-tag" style="--zt-h:85" title="feature: sensitivity">sensitivity</span> <span class="zt-tag" style="--zt-h:355" title="backend: jax">jax</span>
:::

:::{grid-item-card} Bump sensitivities by forward-mode AD
:class-card: zt-card
:link: ipynb/ad/bump_forward_ad
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:1d physics:inviscid physics:hydrostatic physics:free-surface component:solver method:finite-volume feature:sensitivity feature:automatic-differentiation backend:jax requires:cpu"></span>Steady 1-D flow over a Gaussian bump: d eta / d(position, width) by jax.jvp, equal to central finite differences.

`tutorials/ad/bump_forward_ad.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 1d">1d</span> <span class="zt-tag" style="--zt-h:165" title="physics: inviscid">inviscid</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: solver">solver</span> <span class="zt-tag" style="--zt-h:335" title="method: finite-volume">finite-volume</span> <span class="zt-tag" style="--zt-h:85" title="feature: sensitivity">sensitivity</span> <span class="zt-tag" style="--zt-h:85" title="feature: automatic-differentiation">automatic-differentiation</span> <span class="zt-tag" style="--zt-h:355" title="backend: jax">jax</span>
:::

:::{grid-item-card} Bump sensitivities by reverse-mode AD
:class-card: zt-card
:link: ipynb/ad/bump_reverse_ad
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:1d physics:inviscid physics:hydrostatic physics:free-surface component:solver method:finite-volume feature:sensitivity feature:automatic-differentiation backend:jax requires:cpu"></span>Steady 1-D flow over a Gaussian bump: dJ/d(position, width) and dJ/db of the whole bed by jax.grad on the checkpointed loop.

`tutorials/ad/bump_reverse_ad.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 1d">1d</span> <span class="zt-tag" style="--zt-h:165" title="physics: inviscid">inviscid</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: solver">solver</span> <span class="zt-tag" style="--zt-h:335" title="method: finite-volume">finite-volume</span> <span class="zt-tag" style="--zt-h:85" title="feature: sensitivity">sensitivity</span> <span class="zt-tag" style="--zt-h:85" title="feature: automatic-differentiation">automatic-differentiation</span> <span class="zt-tag" style="--zt-h:355" title="backend: jax">jax</span>
:::

:::{grid-item-card} Chorin projection: a VAM channel
:class-card: zt-card
:link: ipynb/vam/chorin_channel
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:2d physics:non-hydrostatic physics:incompressible physics:free-surface component:model component:system-model component:numerical-system-model component:solver method:predictor-corrector backend:numpy backend:jax requires:cpu"></span>A pressure-split model (VAM level 1) in a 2-D channel on the Chorin solver: predictor, pressure solve and correction on NumPy and JAX.

`tutorials/vam/chorin_channel.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 2d">2d</span> <span class="zt-tag" style="--zt-h:165" title="physics: non-hydrostatic">non-hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: incompressible">incompressible</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: model">model</span> <span class="zt-tag" style="--zt-h:32" title="component: system-model">system-model</span> <span class="zt-tag" style="--zt-h:32" title="component: numerical-system-model">numerical-system-model</span> <span class="zt-tag" style="--zt-h:32" title="component: solver">solver</span> <span class="zt-tag" style="--zt-h:335" title="method: predictor-corrector">predictor-corrector</span> <span class="zt-tag" style="--zt-h:355" title="backend: numpy">numpy</span> <span class="zt-tag" style="--zt-h:355" title="backend: jax">jax</span>
:::

:::{grid-item-card} Code printer: AMReX
:class-card: zt-card
:link: ipynb/components/printer_amrex
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:1d physics:inviscid physics:hydrostatic physics:incompressible physics:free-surface component:code-generation backend:amrex requires:cpu"></span>Print a NumericalSystemModel as an AMReX C++ header and read its flux function.

`tutorials/components/printer_amrex.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 1d">1d</span> <span class="zt-tag" style="--zt-h:165" title="physics: inviscid">inviscid</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: incompressible">incompressible</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: code-generation">code-generation</span> <span class="zt-tag" style="--zt-h:355" title="backend: amrex">amrex</span>
:::

:::{grid-item-card} Derivatives of function hooks
:class-card: zt-card
:link: ipynb/hooks/hook_derivatives
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:1d physics:hydrostatic physics:free-surface feature:automatic-differentiation feature:function-hook backend:jax requires:cpu"></span>The derivative of a hook in a point-implicit friction: JAX AD by default, the user's partials, or zero.

`tutorials/hooks/hook_derivatives.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 1d">1d</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:85" title="feature: automatic-differentiation">automatic-differentiation</span> <span class="zt-tag" style="--zt-h:85" title="feature: function-hook">function-hook</span> <span class="zt-tag" style="--zt-h:355" title="backend: jax">jax</span>
:::

:::{grid-item-card} End to end: 1-D dam break
:class-card: zt-card
:link: ipynb/components/end_to_end
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:1d physics:inviscid physics:hydrostatic physics:incompressible physics:free-surface component:model component:system-model component:numerical-system-model component:solver method:finite-volume backend:numpy requires:cpu"></span>The whole pipeline once: model, SystemModel, NumericalSystemModel, NumPy solver and plot of a 1-D dam break.

`tutorials/components/end_to_end.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 1d">1d</span> <span class="zt-tag" style="--zt-h:165" title="physics: inviscid">inviscid</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: incompressible">incompressible</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: model">model</span> <span class="zt-tag" style="--zt-h:32" title="component: system-model">system-model</span> <span class="zt-tag" style="--zt-h:32" title="component: numerical-system-model">numerical-system-model</span> <span class="zt-tag" style="--zt-h:32" title="component: solver">solver</span> <span class="zt-tag" style="--zt-h:335" title="method: finite-volume">finite-volume</span> <span class="zt-tag" style="--zt-h:355" title="backend: numpy">numpy</span>
:::

:::{grid-item-card} Forward-mode AD through the JAX solver
:class-card: zt-card
:link: ipynb/ad/forward_ad
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:1d physics:inviscid physics:hydrostatic physics:incompressible physics:free-surface component:solver method:finite-volume feature:automatic-differentiation backend:jax requires:cpu"></span>dJ/dn of a 1-D shallow-water march with Manning friction by jax.jvp, checked against central finite differences.

`tutorials/ad/forward_ad.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 1d">1d</span> <span class="zt-tag" style="--zt-h:165" title="physics: inviscid">inviscid</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: incompressible">incompressible</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: solver">solver</span> <span class="zt-tag" style="--zt-h:335" title="method: finite-volume">finite-volume</span> <span class="zt-tag" style="--zt-h:85" title="feature: automatic-differentiation">automatic-differentiation</span> <span class="zt-tag" style="--zt-h:355" title="backend: jax">jax</span>
:::

:::{grid-item-card} Function hooks
:class-card: zt-card
:link: ipynb/hooks/function_hook
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:1d physics:hydrostatic physics:free-surface component:system-model feature:function-hook backend:jax requires:cpu"></span>Manning friction of a 1-D shallow-water model supplied as a JAX function through the solver setting functions.

`tutorials/hooks/function_hook.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 1d">1d</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: system-model">system-model</span> <span class="zt-tag" style="--zt-h:85" title="feature: function-hook">function-hook</span> <span class="zt-tag" style="--zt-h:355" title="backend: jax">jax</span>
:::

:::{grid-item-card} Model and SystemModel
:class-card: zt-card
:link: ipynb/components/model_system_model
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:1d physics:inviscid physics:hydrostatic physics:incompressible physics:free-surface component:model component:system-model requires:cpu"></span>Derive the shallow water equations as a Model, freeze them into a SystemModel and read the wave speeds off its dispersion relation.

`tutorials/components/model_system_model.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 1d">1d</span> <span class="zt-tag" style="--zt-h:165" title="physics: inviscid">inviscid</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: incompressible">incompressible</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: model">model</span> <span class="zt-tag" style="--zt-h:32" title="component: system-model">system-model</span>
:::

:::{grid-item-card} NumericalSystemModel
:class-card: zt-card
:link: ipynb/components/numerical_system_model
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:1d physics:inviscid physics:hydrostatic physics:incompressible physics:free-surface component:numerical-system-model method:finite-volume requires:cpu"></span>Attach the numerics to a SystemModel: the 1/h regularisation, the reconstruction and the Riemann solver.

`tutorials/components/numerical_system_model.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 1d">1d</span> <span class="zt-tag" style="--zt-h:165" title="physics: inviscid">inviscid</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: incompressible">incompressible</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: numerical-system-model">numerical-system-model</span> <span class="zt-tag" style="--zt-h:335" title="method: finite-volume">finite-volume</span>
:::

:::{grid-item-card} OpenFOAM: the same model, printed as C++
:class-card: zt-card
:link: ipynb/foam/minimal
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:1d physics:inviscid physics:hydrostatic physics:incompressible physics:free-surface component:solver method:finite-volume backend:numpy backend:openfoam requires:container"></span>A 1-D dam break on the OpenFOAM backend, built and run in the container and compared with the NumPy solver.

`tutorials/foam/minimal.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 1d">1d</span> <span class="zt-tag" style="--zt-h:165" title="physics: inviscid">inviscid</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: incompressible">incompressible</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: solver">solver</span> <span class="zt-tag" style="--zt-h:335" title="method: finite-volume">finite-volume</span> <span class="zt-tag" style="--zt-h:355" title="backend: numpy">numpy</span> <span class="zt-tag" style="--zt-h:355" title="backend: openfoam">openfoam</span> <span class="zt-tag">requires:container</span>
:::

:::{grid-item-card} ParaView output of the 2-D bump
:class-card: zt-card
:link: ipynb/swe/bump_2d_paraview
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:2d physics:inviscid physics:hydrostatic physics:free-surface component:solver component:post-processing method:finite-volume backend:jax requires:cpu"></span>Write the 2-D bump to HDF5, convert it to a .vtu series with a .pvd and open it in ParaView.

`tutorials/swe/bump_2d_paraview.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 2d">2d</span> <span class="zt-tag" style="--zt-h:165" title="physics: inviscid">inviscid</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: solver">solver</span> <span class="zt-tag" style="--zt-h:32" title="component: post-processing">post-processing</span> <span class="zt-tag" style="--zt-h:335" title="method: finite-volume">finite-volume</span> <span class="zt-tag" style="--zt-h:355" title="backend: jax">jax</span>
:::

:::{grid-item-card} Quick start: a 2-D bump on NumPy and JAX
:class-card: zt-card
:link: ipynb/swe/bump_2d
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:2d physics:inviscid physics:hydrostatic physics:incompressible physics:free-surface component:model component:system-model component:numerical-system-model component:solver method:finite-volume backend:numpy backend:jax requires:cpu"></span>One shallow-water case in 2-D, run on the NumPy and the JAX solver from the same NumericalSystemModel.

`tutorials/swe/bump_2d.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 2d">2d</span> <span class="zt-tag" style="--zt-h:165" title="physics: inviscid">inviscid</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: incompressible">incompressible</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: model">model</span> <span class="zt-tag" style="--zt-h:32" title="component: system-model">system-model</span> <span class="zt-tag" style="--zt-h:32" title="component: numerical-system-model">numerical-system-model</span> <span class="zt-tag" style="--zt-h:32" title="component: solver">solver</span> <span class="zt-tag" style="--zt-h:335" title="method: finite-volume">finite-volume</span> <span class="zt-tag" style="--zt-h:355" title="backend: numpy">numpy</span> <span class="zt-tag" style="--zt-h:355" title="backend: jax">jax</span>
:::

:::{grid-item-card} Reverse-mode AD through the JAX solver
:class-card: zt-card
:link: ipynb/ad/reverse_ad
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:1d physics:inviscid physics:hydrostatic physics:incompressible physics:free-surface component:solver method:finite-volume feature:automatic-differentiation backend:jax requires:cpu"></span>dJ/dn of a 1-D shallow-water march by AdMode.reverse and jax.grad, equal to forward mode for any ad_checkpoints.

`tutorials/ad/reverse_ad.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 1d">1d</span> <span class="zt-tag" style="--zt-h:165" title="physics: inviscid">inviscid</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: incompressible">incompressible</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: solver">solver</span> <span class="zt-tag" style="--zt-h:335" title="method: finite-volume">finite-volume</span> <span class="zt-tag" style="--zt-h:85" title="feature: automatic-differentiation">automatic-differentiation</span> <span class="zt-tag" style="--zt-h:355" title="backend: jax">jax</span>
:::

:::{grid-item-card} Shallow moments in 2-D
:class-card: zt-card
:link: ipynb/sme/moments_2d
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:2d physics:viscous physics:hydrostatic physics:incompressible physics:free-surface component:model method:finite-volume backend:numpy requires:cpu"></span>Write a bed-drag closure, inject it into SME, run in 2-D and read the vertical velocity profile back.

`tutorials/sme/moments_2d.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 2d">2d</span> <span class="zt-tag" style="--zt-h:165" title="physics: viscous">viscous</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: incompressible">incompressible</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: model">model</span> <span class="zt-tag" style="--zt-h:335" title="method: finite-volume">finite-volume</span> <span class="zt-tag" style="--zt-h:355" title="backend: numpy">numpy</span>
:::

:::{grid-item-card} Shallow water in 1-D
:class-card: zt-card
:link: ipynb/swe/simple_numpy
:link-type: doc

<span class="zt-data" data-tags="type:tutorial dimension:1d physics:inviscid physics:hydrostatic physics:incompressible physics:free-surface component:model component:system-model component:numerical-system-model component:solver method:finite-volume backend:numpy requires:cpu"></span>The whole pipeline once: model, operators, scheme, solve and plot, in 1-D on the NumPy reference solver.

`tutorials/swe/simple_numpy.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 1d">1d</span> <span class="zt-tag" style="--zt-h:165" title="physics: inviscid">inviscid</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: incompressible">incompressible</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: model">model</span> <span class="zt-tag" style="--zt-h:32" title="component: system-model">system-model</span> <span class="zt-tag" style="--zt-h:32" title="component: numerical-system-model">numerical-system-model</span> <span class="zt-tag" style="--zt-h:32" title="component: solver">solver</span> <span class="zt-tag" style="--zt-h:335" title="method: finite-volume">finite-volume</span> <span class="zt-tag" style="--zt-h:355" title="backend: numpy">numpy</span>
:::

:::{grid-item-card} Zoomy in your browser
:class-card: zt-card
:link: ../jupyter-lite/_output/lab/index.html?path=pyodide.ipynb
:link-type: url

<span class="zt-data" data-tags="type:tutorial dimension:1d physics:viscous physics:hydrostatic physics:incompressible physics:free-surface component:model component:system-model component:numerical-system-model component:solver component:code-generation method:finite-volume backend:numpy requires:cpu"></span>SME(2) dam break in Pyodide: Model, SystemModel, NSM, generated C++, a NumPy solve and the velocity profile.

`tutorials/pyodide/pyodide.ipynb`
+++
<span class="zt-tag" style="--zt-h:265" title="type: tutorial">tutorial</span> <span class="zt-tag" style="--zt-h:205" title="dimension: 1d">1d</span> <span class="zt-tag" style="--zt-h:165" title="physics: viscous">viscous</span> <span class="zt-tag" style="--zt-h:165" title="physics: hydrostatic">hydrostatic</span> <span class="zt-tag" style="--zt-h:165" title="physics: incompressible">incompressible</span> <span class="zt-tag" style="--zt-h:165" title="physics: free-surface">free-surface</span> <span class="zt-tag" style="--zt-h:32" title="component: model">model</span> <span class="zt-tag" style="--zt-h:32" title="component: system-model">system-model</span> <span class="zt-tag" style="--zt-h:32" title="component: numerical-system-model">numerical-system-model</span> <span class="zt-tag" style="--zt-h:32" title="component: solver">solver</span> <span class="zt-tag" style="--zt-h:32" title="component: code-generation">code-generation</span> <span class="zt-tag" style="--zt-h:335" title="method: finite-volume">finite-volume</span> <span class="zt-tag" style="--zt-h:355" title="backend: numpy">numpy</span>
:::

::::

<p class="zt-empty" hidden>No notebook carries every selected tag.</p>
:::::

:::::{div} zt-panel
<section class="zt-group" style="--zt-h:265"><div class="zt-gh">type</div><div class="zt-chips"><button type="button" class="zt-chip" data-tag="type:tutorial" title="type: tutorial" aria-pressed="false">tutorial <span class="zt-n">22</span></button></div></section>
<section class="zt-group" style="--zt-h:205"><div class="zt-gh">dimension</div><div class="zt-chips"><button type="button" class="zt-chip" data-tag="dimension:1d" title="dimension: 1d" aria-pressed="false">1d <span class="zt-n">17</span></button><button type="button" class="zt-chip" data-tag="dimension:2d" title="dimension: 2d" aria-pressed="false">2d <span class="zt-n">5</span></button></div></section>
<section class="zt-group" style="--zt-h:165"><div class="zt-gh">physics</div><div class="zt-chips"><button type="button" class="zt-chip" data-tag="physics:viscous" title="physics: viscous" aria-pressed="false">viscous <span class="zt-n">2</span></button><button type="button" class="zt-chip" data-tag="physics:inviscid" title="physics: inviscid" aria-pressed="false">inviscid <span class="zt-n">15</span></button><button type="button" class="zt-chip" data-tag="physics:hydrostatic" title="physics: hydrostatic" aria-pressed="false">hydrostatic <span class="zt-n">19</span></button><button type="button" class="zt-chip" data-tag="physics:non-hydrostatic" title="physics: non-hydrostatic" aria-pressed="false">non-hydrostatic <span class="zt-n">1</span></button><button type="button" class="zt-chip" data-tag="physics:incompressible" title="physics: incompressible" aria-pressed="false">incompressible <span class="zt-n">14</span></button><button type="button" class="zt-chip" data-tag="physics:free-surface" title="physics: free-surface" aria-pressed="false">free-surface <span class="zt-n">20</span></button></div></section>
<section class="zt-group" style="--zt-h:32"><div class="zt-gh">component</div><div class="zt-chips"><button type="button" class="zt-chip" data-tag="component:model" title="component: model" aria-pressed="false">model <span class="zt-n">7</span></button><button type="button" class="zt-chip" data-tag="component:system-model" title="component: system-model" aria-pressed="false">system-model <span class="zt-n">8</span></button><button type="button" class="zt-chip" data-tag="component:numerical-system-model" title="component: numerical-system-model" aria-pressed="false">numerical-system-model <span class="zt-n">7</span></button><button type="button" class="zt-chip" data-tag="component:solver" title="component: solver" aria-pressed="false">solver <span class="zt-n">14</span></button><button type="button" class="zt-chip" data-tag="component:code-generation" title="component: code-generation" aria-pressed="false">code-generation <span class="zt-n">2</span></button><button type="button" class="zt-chip" data-tag="component:mesh" title="component: mesh" aria-pressed="false">mesh <span class="zt-n">2</span></button><button type="button" class="zt-chip" data-tag="component:post-processing" title="component: post-processing" aria-pressed="false">post-processing <span class="zt-n">1</span></button></div></section>
<section class="zt-group" style="--zt-h:335"><div class="zt-gh">method</div><div class="zt-chips"><button type="button" class="zt-chip" data-tag="method:finite-volume" title="method: finite-volume" aria-pressed="false">finite-volume <span class="zt-n">15</span></button><button type="button" class="zt-chip" data-tag="method:predictor-corrector" title="method: predictor-corrector" aria-pressed="false">predictor-corrector <span class="zt-n">1</span></button></div></section>
<section class="zt-group" style="--zt-h:85"><div class="zt-gh">feature</div><div class="zt-chips"><button type="button" class="zt-chip" data-tag="feature:sensitivity" title="feature: sensitivity" aria-pressed="false">sensitivity <span class="zt-n">3</span></button><button type="button" class="zt-chip" data-tag="feature:automatic-differentiation" title="feature: automatic-differentiation" aria-pressed="false">automatic-differentiation <span class="zt-n">5</span></button><button type="button" class="zt-chip" data-tag="feature:function-hook" title="feature: function-hook" aria-pressed="false">function-hook <span class="zt-n">2</span></button></div></section>
<section class="zt-group" style="--zt-h:355"><div class="zt-gh">backend</div><div class="zt-chips"><button type="button" class="zt-chip" data-tag="backend:numpy" title="backend: numpy" aria-pressed="false">numpy <span class="zt-n">7</span></button><button type="button" class="zt-chip" data-tag="backend:jax" title="backend: jax" aria-pressed="false">jax <span class="zt-n">10</span></button><button type="button" class="zt-chip" data-tag="backend:openfoam" title="backend: openfoam" aria-pressed="false">openfoam <span class="zt-n">1</span></button><button type="button" class="zt-chip" data-tag="backend:amrex" title="backend: amrex" aria-pressed="false">amrex <span class="zt-n">3</span></button></div></section>
:::::
::::::
