require "common"
-- name of data file, which has pressure data

-- open datafile and get coordinates and density for point1 and point2
-- DATAFILE is a set up in evaluate.sh
io.input( os.getenv("DATAFILE") )

-- read in data
time, analytic, err = io.read("*number", "*number", "*number" )
err = err / analytic

-- summary file which collects analysed results for all levels
-- SUMMARY is a set up in evaluate.sh
fout = io.open( os.getenv("WSSSUMMARY"), 'a+' )

-- output the relative error to summary file
-- maxlevel is read from common.lua
-- print( "The error of level "..maxlevel.." is ",  err)
fout:write( maxlevel, "   ", err, "\n")
io.close( fout )
