1 0 GfsAdvection GfsBox GfsGEdge {} {
    Time { end = 5 }
    Refine 8

    # Add tracer T, using a VOF advection scheme.
    # The default scheme is a Van-Leer limited, second-order upwind scheme.
    VariableTracerVOFHeight T

    InitFraction T (ellipse (0, -.236338, 0.2, 0.2))

    # Maintain U and V with the vortical shear flow field defined by
    # its streamfunction
    VariableStreamFunction {
	# make sure that the entire field is reinitialised at t = 2.5
	step = 2.5 
    } Psi (t < 2.5 ? 1. : -1.)*sin((x + 0.5)*M_PI)*sin((y + 0.5)*M_PI)/M_PI
    
    # Adapt the mesh dynamically so that at any time the maximum of the gradient
    # of T is less than or equal to zero per cell length
    AdaptGradient { istart = 1 istep = 1 } { cmax = 0 maxlevel = 8 } T
    
    OutputPPM { start = 0 } { convert ppm:- t-0.eps } { v = T }
    OutputPPM { start = 2.5 } { convert ppm:- t-2.5.eps } { v = T }
    OutputPPM { start = 5 } { convert ppm:- t-5.eps } { v = T }

    # Add a new variable 
    Variable Tref

    # Initialize Tref with the initial shape
    InitFraction { start = end } Tref (ellipse (0, -.236338, 0.2, 0.2))

    # Output the norms of the difference between T and Tref, stores that into
    # new variable DT
    OutputErrorNorm { start = end } norms { v = T } {
        s = Tref v = DT
    }

    OutputPPM { start = end } { convert ppm:- dt-5.eps } { v = DT }

    OutputScalarSum { istep = 1 } { awk '{ print $3,$5-8.743441e-01 }' > t } { v = T }
}
GfsBox {}