compute error in L2 norm and file output in *.err