GfsOutputErrorNorm
From Gerris
GfsOutputErrorNorm is used to write the norms of the difference between a scalar field and a user-defined reference field.
The norms are written using the same formatting as for GfsOutputScalarNorm.
The syntax in parameter files is:
[ GfsOutputScalar ] { s = [ GfsFunction ] unbiased = 1 v = Error w = [ GfsFunction ] relative = 0 }
where s
is the function defining the reference field and v
is used to store the difference between the scalar and reference fields (v
can be left undefined in which case a temporary variable is used).
If unbiased
is set to one (default is zero), the bias (i.e. mean value of the difference) is substracted before computing the norms.
The norms can be weighted using the optional parameter w
.
If relative
is set to one, the norms are divided by the corresponding norms of the reference solution.
Examples
- Convergence of the Poisson solver
- Convergence with a refined circle
- Dirichlet boundary condition
- Convergence of the Godunov advection scheme
- Time-reversed VOF advection in a shear flow
- Time-reversed advection of a VOF concentration
- Time-reversed advection with curvature-based refinement
- Rotation of a straight interface
- Estimation of the numerical viscosity
- Estimation of the numerical viscosity with refined box
- Numerical viscosity for the skew-symmetric scheme
- Numerical viscosity for the skew-symmetric scheme with refined box
- Numerical viscosity for vorticity/streamfunction formulation
- Convergence for a simple periodic problem
- Flow created by a cylindrical volume source
- Potential flow around a sphere
- Poiseuille flow
- Bagnold flow of a granular material
- Poiseuille flow with metric
- Hydrostatic balance with quadratic pressure profile
- Translation of an hexagon in a uniform flow
- Geostrophic adjustment
- Geostrophic adjustment with Saint-Venant
- Non-linear geostrophic adjustment
- Oscillations in a parabolic container
- Parabolic container with embedded solid
- Transcritical flow over a bump
- Lake-at-rest balance in an inclined domain with cut cells
- Lake-at-rest balance in an inclined domain with bipolar metric
- Terrain reconstruction
- Advection of a cosine bell around the sphere
- Poisson problem with a pure spherical harmonics solution
- Spherical harmonics with longitude-latitude coordinates
- Creeping Couette flow between cylinders
- Creeping Couette flow between eccentric cylinders
- Flow between eccentric cylinders using bipolar coordinates
- Flow between eccentric cylinders on a stretched grid
- Rossby--Haurwitz wave
- Rossby--Haurwitz wave with a free surface
- Rossby--Haurwitz wave with Saint-Venant
- Relaxation of a charge bump
- Charge relaxation in an axisymmetric insulated conducting column
- Charge relaxation in a planar cross-section
- Simple example of groundwater flow following Darcy's law
- Groundwater flow with piecewise constant permeability
OutputErrorNorm { start = end } {
awk '{print LEVEL, $5, $7, $9}' >> error
} { v = P } {
s = (sin (M_PI*3.*x)*sin (M_PI*3.*y))
unbiased = 1
}
OutputErrorNorm { start = end } {
awk '{print LEVEL, $5, $7, $9}' >> error
} { v = P } {
s = (sin (M_PI*3.*x)*sin (M_PI*3.*y))
unbiased = 1
}
OutputErrorNorm { start = end } {
awk '{print LEVEL, $5, $7, $9}' >> error
} { v = P } {
s = {
double theta = atan2 (y, x);
double r2 = x*x + y*y;
return r2*r2*cos (3.*theta);
}
}
OutputErrorNorm { start = end } { awk '{ print LEVEL " " $5 " " $7 " " $9}' } { v = T } {
s = {
double r2 = x*x + y*y;
double coeff = 20. + 20000.*r2*r2*r2*r2;
return (1. + cos(20.*x)*cos(20.*y))*exp(-coeff*r2)/2.;
}
}
OutputErrorNorm { start = end } norms { v = T } {
s = Tref v = DT
}
OutputErrorNorm { start = end } dt-LEVEL { v = T } {
s = Tref
v = DT
}
OutputErrorNorm { start = end } dt1-LEVEL { v = C } {
s = Tref*GAUSSIAN
v = DC
}
OutputErrorNorm { start = end } dt2-LEVEL { v = G } {
s = GAUSSIAN
v = DG
}
OutputErrorNorm { start = end } norms { v = T } {
s = Tref v = DT
}
OutputErrorNorm { istep = 1 } error { v = T } { s = Tref }
OutputErrorNorm { start = end } { awk '{ print $3,$5,$7,$9 }' > errorLEVEL.dat } {
v = Velocity
} {
s = sqrt(U0*U0+V0*V0)
v = E
relative = 1
}
OutputErrorNorm { start = end } { awk '{ print $3,$5,$7,$9 }' > errorLEVEL.dat } {
v = Velocity
} {
s = sqrt(U0*U0+V0*V0)
v = E
relative = 1
}
OutputErrorNorm { start = end } { awk '{ print $3,$5,$7,$9 }' > errorLEVEL.dat } {
v = Velocity
} {
s = sqrt(U0*U0+V0*V0)
v = E
relative = 1
}
OutputErrorNorm { start = end } {
awk '{ print 2**(LEVEL+1)/4+2**(LEVEL-1)*3/4,$3,$5,$7,$9 }'
} {
v = Velocity
} {
s = sqrt(U0*U0 + V0*V0)
v = E
relative = 1
}
OutputErrorNorm { start = end } { awk '{ print $3,$5,$7,$9 }' > errorLEVEL.dat } {
v = Velocity
} {
s = sqrt(U0*U0+V0*V0)
v = E
relative = 1
}
OutputErrorNorm { start = end } stdout { v = U } {
s = (1. - 2.*cos (2.*M_PI*(x - t))*sin (2.*M_PI*(y - t)))
}
OutputErrorNorm { start = end } { awk '{ print LEVEL,$5,$7,$9 }' > error-LEVEL } {
v = Velocity
} {
s = sol(x,y)
v = E
w = (x*x + y*y < 25.*R0*R0)
relative = 1
}
OutputErrorNorm { start = end } { awk '{ print LEVEL " " $7 " " $9}' } { v = U } {
s = (dx("Phi") + 1.)
}
OutputErrorNorm { start = end } { awk '{print LEVEL,$5,$7,$9}' } { v = U } {
s = 1./2.*(1./4 - y*y)
}
OutputErrorNorm { start = end } { awk '{print LEVEL,$5,$7,$9}' } { v = U } {
# Bagnold's solution
s = UB(y)
}
OutputErrorNorm { start = end } { awk '{print LEVEL,$5,$7,$9}' } { v = U } {
s = 1./2.*(1./4 - y*y)
}
OutputErrorNorm { istep = 1 } p { v = P } {
s = -(cy*cy/2. + 0.5*cy)
unbiased = 1
}
OutputErrorNorm { istep = 1 } {
awk '{ printf ("%e %e %e %e\n", $3, $5, $7, $9) }' > momentumerror-ORDER
} { v = sqrt((U - 1.)*(U - 1.) + V*V) } { s = 0. }
OutputErrorNorm { istep = 1 } {
awk '{print $3/86400. " " $9; fflush (stdout); }' > e
} { v = P/G } {
s = ETA0*exp (-(x*x + y*y)/(R0*R0))
unbiased = 1
v = E
}
OutputErrorNorm { istep = 1 } {
awk '{print $3/86400. " " $9; fflush (stdout); }' > e
} { v = P } {
s = (H0 + ETA0*exp (-(x*x + y*y)/(R0*R0)))
v = E
}
OutputErrorNorm { istep = 1 } error-OMEGA { v = P } {
s = h0(sqrt (x*x + y*y))
v = E
unbiased = 1
relative = 1
}
OutputErrorNorm { istep = 1 } error-LEVEL { v = P } {
s = Pt
v = DP
}
OutputErrorNorm { istep = 1 } error-LEVEL { v = P } {
s = Pt
v = DP
}
OutputErrorNorm { start = end } { awk '{ print LEVEL,$5,$7,$9 }' } { v = H } {
s = href.cgd
v = EH
}
OutputErrorNorm { start = end } ep { v = P } {
s = MAX(0, 0.5 - x/10.)
unbiased = 1
relative = 1
}
OutputErrorNorm { start = end } ep { v = P } {
s = MAX(0, 1.26 - x/10.)
unbiased = 1
relative = 1
}
OutputErrorNorm { start = end } { awk '{ print LEVEL,$5,$7,$9 }' >> error-t } { v = T } {
s = {
double r = sqrt (x*x + y*y);
return r*r/8.+cos(M_PI*r)/2.;
}
w = (fabs (x) < 3.8 && fabs (y) < 3.8)
relative = 1
v = Et
}
OutputErrorNorm { start = end } { awk '{ print LEVEL,$5,$7,$9 }' >> error-h } { v = H0 } {
s = {
double r = sqrt (x*x + y*y);
return r*r/8.+cos(M_PI*r)/2.;
}
w = (fabs (x) < 3.8 && fabs (y) < 3.8)
relative = 1
v = Eh
}
OutputErrorNorm { istep = 1 } { awk '{ print LEVEL,$3,$5,$7,$9}' > error-LEVEL-ALPHA } { v = T } {
s = bell_moving(x*DTR,y*DTR,t)
v = E
relative = 1
}
OutputErrorNorm { start = end } {
awk '{print LEVEL, $5, $7, $9}' >> error
} { v = P } {
s = Sol
v = E
unbiased = 1
}
OutputErrorNorm { start = end } {
awk '{print LEVEL, $5, $7, $9}' >> error
} { v = P } {
s = Sol
v = E
unbiased = 1
}
OutputErrorNorm { start = end } { awk '{print LEVEL,$5,$7,$9}' } { v = V } {
s = {
double r = rx/4. + 0.375;
// the analytical solution for the tangential velocity
return r*((0.5/r)*(0.5/r) - 1.)/((0.5/0.25)*(0.5/0.25) - 1.);
}
v = E
}
OutputErrorNorm { start = end } { awk '{ print LEVEL,$5,$7,$9 }' } { v = Velocity } {
s = {
double p, u, v;
psiuv (x, y - ECC, R1, R2, ECC, 1., 0., &u, &v, &p);
return sqrt (u*u + v*v);
}
v = EU
}
OutputErrorNorm { start = end } { awk '{ print LEVEL,$5,$7,$9 }' } { v = Velocity } {
s = {
double p, u, v;
// we need to rotate coordinates by 90 degrees
psiuv (y, x - X2, R1, R2, ECC, 1., 0., &u, &v, &p);
return sqrt (u*u + v*v);
}
v = EU
}
OutputErrorNorm { start = end } { awk '{ print LEVEL,$5,$7,$9 }' } { v = Velocity } {
s = {
double p, u, v;
psiuv (x, y - ECC, R1, R2, ECC, 1., 0., &u, &v, &p);
return sqrt (u*u + v*v);
}
v = EU
}
OutputErrorNorm { istart = 1 istep = 10 } eh-LEVEL { v = P/G } {
s = p0(x*DTR,y*DTR,t)/G
v = EH unbiased = 1 relative = 1
}
OutputErrorNorm { istart = 1 istep = 10 } eh-LEVEL { v = P/G } {
s = p0(x*DTR,y*DTR,t)/G
v = EH unbiased = 1 relative = 1
}
OutputErrorNorm { istep = 10 } eh-LEVEL { v = P } {
s = p0(x*DTR,y*DTR,t)/G
v = EH unbiased = 1 relative = 1
}
OutputErrorNorm { istep = 10 } norms-SCHEME { v = Rhoe } { s = gaussbell(x,y,t) }
OutputErrorNorm { start = end } norms-LEVEL { v = Ey } {
s = (y < R0 ? 0 : 0.5*R0*R0*rhoinic/y)
}
OutputErrorNorm { start = end } norms-LEVEL { v = sqrt(Ex*Ex + Ey*Ey) } {
s = {
double r = sqrt (x*x + y*y);
return (r < R0 ? 0 : 0.5*R0*R0*rhoinic/r);
}
}
OutputErrorNorm {} { awk '{print LEVEL, $5, $7, $9}' >> p } { v = P } {
s = atan2 (y, x)
}
OutputErrorNorm {} { awk '{print LEVEL, $5, $7, $9}' >> U } { v = U } {
s = y / (x*x + y*y)
}
OutputErrorNorm {} { awk '{print LEVEL, $5, $7, $9}' >> V } { v = V } {
s = -x / (x*x + y*y)
}
OutputErrorNorm {} { awk '{print LEVEL, $5, $7, $9}' >> p } { v = P } {
s = THETA>-M_PI/3 ? THETA : 2*THETA+M_PI/3
}
OutputErrorNorm {} { awk '{print LEVEL, $5, $7, $9}' >> U } { v = U } {
s = y / (x*x + y*y)
}
OutputErrorNorm {} { awk '{print LEVEL, $5, $7, $9}' >> V } { v = V } {
s = -x / (x*x + y*y)
}