1 2 GfsAdvection GfsBox GfsGEdge {} {
  Time { end = 2 }
  Refine LEVEL
  VariableTracer Omega
  Init {} {
    U0 = (- cos (2.*M_PI*x)*sin (2.*M_PI*y))
    V0 = (sin (2.*M_PI*x)*cos (2.*M_PI*y))
    # we need (U,V) to compute the vorticity
    U = U0
    V = V0
  }
  # In the general case the vorticity cannot be consistently
  # defined directly (because it needs to verify discrete properties
  # on the circulation)
  # Initialising from the velocity field (U,V) as done below should be safe
  Init {} { Omega = Vorticity }
  VariablePoisson Psi -Omega
  VariableStreamFunction { istep = 1 } Psi1 Psi
  OutputScalarNorm { istep = 1 } divLEVEL { v = (dx("U") + dy("V")) }
  OutputScalarSum { istep = 1 } kineticLEVEL { v = Velocity2 }
  OutputScalarSum { istep = 1 } stdout { v = Velocity2 }
  OutputErrorNorm { start = end } { awk '{ print $3,$5,$7,$9 }' > errorLEVEL.dat } {
      v = Velocity
  } { 
      s = sqrt(U0*U0+V0*V0)
      v = E
      relative = 1
  }
}
GfsBox {}
1 1 right
1 1 top