1 0 GfsElectroHydro GfsBox GfsGEdge {} {
    VariableTracerVOF T
    InitFraction T (-y)
    Refine 5
    Solid (-y + 0.3)
    Solid ( y + 0.2)
    SurfaceBc Phi Dirichlet (y > 0)

    Time { iend = 1 dtmax = 1 }
    ProjectionParams { tolerance = 1e-7 }  
    ApproxProjectionParams { tolerance = 1e-7 }
    SourceElectric

    OutputTime { istep = 1 } stderr
    OutputSimulation { start = end } result.txt { format = text }
    OutputScalarStats { start = end } p { v = P }
    OutputScalarStats { start = end } ey { v = Ey }
    OutputScalarNorm { start = end } v { v = V }
    EventScript { start = end } { 
       if awk '{
              deltap = ($11 - $5) - 3./(1.1*1.1)
              if (deltap < 0.)
                deltap = - deltap;
              if (deltap > 4e-4) { 
                print "deltap:", deltap > "/dev/stderr"; 
                exit (1); 
              }
            }' < p &&
          awk '{
              deltap = ($11 - $5) - 2./1.1
              if (deltap < 0.)
                deltap = - deltap;
              if (deltap > 3e-4) { 
                print "deltaey:", deltap > "/dev/stderr"; 
                exit (1); 
              }
            }' < ey &&
          awk '{
              if ($9 > 10.) { 
                print "vmax:", $9 > "/dev/stderr"; 
                exit (1); 
              }
            }' < v; then
            exit 0;
        else
            exit $GFS_STOP;
        fi
    }
} {
    # Electric parameters
    perm = 1./(T/3.+(1-T))
    ElectricProjectionParams { tolerance = 1e-7 }
}
GfsBox {
    left = Boundary
    right = Boundary
    top   = Boundary {
	BcDirichlet Phi  1
	BcDirichlet P 0
    }
    bottom = Boundary {
	BcDirichlet Phi 0.       
    }
}