171 double hl =
h[-1] >
dry ?
h[-1] : 0.;
172 double hr =
h[] >
dry ?
h[] : 0.;
252 double hl =
h[-1] >
dry ?
h[-1] : 0.;
253 double hr =
h[] >
dry ?
h[] : 0.;
vector uf[]
We allocate the (face) velocity field.
scalar * tracers
Here we set the gradient functions for each tracer (as defined in the user-provided tracers list).
vector g[]
We store the combined pressure gradient and acceleration field in g*.
static number sq(number x)
macro2 diagonalize(int a)
void event_defaults(void)
Event: defaults (i = 0)
trace void advect(scalar *tracers, vector hu, vector hf, double dt)
static void restriction_eta(Point point, scalar eta)
void event_acceleration(void)
The r.h.s.
void event_pressure(void)
In the second (implicit) step, the Poisson–Helmholtz equation for is solved and the corresponding va...
scalar res_eta
This can be used to optionally store the residual (for debugging).
void event_defaults0(void)
The scheme is unconditionally stable for gravity waves, so the gravity wave CFL is set to ,...
static trace void relax_hydro(scalar *ql, scalar *rhsl, int lev, void *data)
The relaxation and residual functions of the multigrid solver are derived from the Poisson–Helmholtz ...
bool rigid
The free-surface can be replaced with a "rigid lid" by setting rigid to true.
void event_half_advection(void)
The semi-implicit update of the layer heights is done in two steps.
static trace double residual_hydro(scalar *ql, scalar *rhsl, scalar *resl, void *data)
void(* restriction)(Point, scalar)
static void restriction_average(Point point, scalar s)
trace mgstats mg_solve(scalar *a, scalar *b, double(*residual)(scalar *a, scalar *b, scalar *res, void *data), void(*relax)(scalar *da, scalar *res, int depth, void *data), void *data=NULL, int nrelax=4, scalar *res=NULL, int minlevel=0, double tolerance=TOLERANCE)
The user needs to provide a function which computes the residual field (and returns its maximum) as w...
Information about the convergence of the solver is returned in a structure.