110 for (
int l = 0;
l <
nl;
l++) {
126 for (
int l = 0;
l <
nl;
l++) {
142 for (
int _c = 0;
_c < 4;
_c++)
184 for (
int _s = 0;
_s < 1;
_s++) {
195 for (
int l = 0;
l <
nl;
l++) {
210 double hi =
h[],
hn =
h[-1];
234 double um =
u.
x[-1] +
dx*
gu.x.x[-1];
276 Fh.x[] = 0.,
Fq.x.x[] =
S.x[] =
Fq.y.x[] = 0.;
348 for (
int l = 1;
l <
nl;
l++) {
360 for (
int _s = 0;
_s < 1;
_s++)
367 for (
int l = 0;
l <
nl;
l++)
385 for (
int _s = 0;
_s < 1;
_s++) {
398 display (
"squares (color = 'h > 0 ? eta : nodata', spread = -1);");
435#define radiation(ref) (sqrt (G*max(h[],0.)) - sqrt(G*max((ref) - zb[], 0.)))
double dtmax
The timestep is computed using the CFL condition on the face velocity field.
define neighbor(o, p, q)((Point)
double zero(double s0, double s1, double s2)
void display(const char *commands, bool overwrite=false)
scalar * list_concat(scalar *l1, scalar *l2)
static number sq(number x)
scalar * list_copy(scalar *l)
#define avector(x, y,...)
scalar * list_append(scalar *list, scalar s)
vector * vectors_append(vector *list, vector v)
#define qmalloc(size, type)
#define dx(s)
We first define some useful macros, following the notations in Bonneton et al, 2011.
static void restriction_volume_average(Point point, scalar s)
static void refine_linear(Point point, scalar s)
void set_prolongation(scalar s, void(*prolongation)(Point, scalar))
void set_restriction(scalar s, void(*restriction)(Point, scalar))
define is_active() cell(true) @define is_leaf(cell)(point.level
void vertical_fluxes(vector *evolving, vector *updates, scalar *divl, scalar dh)
void vertical_viscosity(Point point, double h, vector *ul, double dt)
For stability, we discretise the viscous friction term implicitly as.
double(* update)(scalar *evolving, scalar *updates, double dtmax)
static void(* advance)(scalar *output, scalar *input, scalar *updates, double dt)
void kurganov(double hm, double hp, double um, double up, double Delta, double *fh, double *fq, double *dtmax)
int nl
By default there is only a single layer i.e.
scalar * evolving
The generic time-integration scheme in predictor-corrector.h needs to know which fields are updated.
double G
The only physical parameter is the acceleration of gravity G.
void event_init(void)
The event below will happen after all the other initial events to take into account user-defined fiel...
static void refine_eta(Point point, scalar eta)
When using an adaptive discretisation (i.e.
trace double update_saint_venant(scalar *evolving, scalar *updates, double dtmax)
static trace void advance_saint_venant(scalar *soutput, scalar *sinput, scalar *updates, double dt)
We need to overload the default advance function of the predictor-corrector scheme,...
void event_cleanup(void)
At the end of the simulation, we free the memory allocated in the defaults* event.
void event_defaults(void)
Event: defaults (i = 0)
static void restriction_eta(Point point, scalar eta)
define n n define coarse(a, k, p, n)((double *)(PARENT(k
#define is_prolongation(cell)
void gradients(scalar *f, vector *g)
Given a list of scalar fields f, this function fills the gradient fields g with the corresponding gra...