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 following formatting:
Description time: 1.2 first: 1e-2 second: 3e-2 infty: 6e-3 bias: 1e-6
where Description is a description of the scalar field.
The syntax in parameter files is:
[ GfsOutputScalar ] { s = [ GfsFunction ] unbiased = 1 v = Error w = [ GfsFunction ] }
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.
Examples
- Convergence of the Poisson solver
- Convergence with a refined circle
- Convergence of the Godunov advection scheme
- Time-reversed VOF advection in a shear flow
- Time-reversed advection with curvature-based refinement
- Convergence for a simple periodic problem
- Potential flow around a sphere
- Poiseuille flow
- Hydrostatic balance with quadratic pressure profile
- Geostrophic adjustment
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}' } { 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 } norms { v = T } {
s = Tref v = DT
}
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 " " $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 { istep = 1 } p { v = P } {
s = -(cy*cy/2. + 0.5*cy)
unbiased = 1
}
OutputErrorNorm { istep = 1 } { awk '{print $3/1.0285e-4/3600./24. " " $9*1000e6*1.0285e-4*1.0285e-4/0.01;}' > e } { v = P } {
s = (5.667583815e-4*exp (-100.*(x*x + y*y)))
unbiased = 1
v = E
}

