Commit c05bbad8 authored by Tilman Alemán's avatar Tilman Alemán
Browse files

small changes

parent f6b10e15
......@@ -219,6 +219,7 @@ def computeEV(phi, mesh, lset_approx, deformation, order=2, condense=True):
n = Normalize(grad(lset_approx))
ntilde = GridFunction(VhG)
ntilde.Set(Normalize(grad(phi, mesh)), definedonelements=ba_IF)
print("L2 error of ntilde: ", l2norm(ntilde-Normalize(grad(phi,mesh)),phi, mesh))
# n=ntilde
h = specialcf.mesh_size
# epsilon=1
......
......@@ -309,7 +309,7 @@ if __name__ == "__main__":
elif i >= 2:
symmetries = 0
with open(fname, "a") as f:
f.write("Condition for discrete KF: "+ str(-(args.sca*order+1) * (i+1)+3)+":\n")
f.write("Condition for discrete KF: "+ str(-(args.sca*order+1) * (i))+":\n")
for j in range(3):
temp = 0
temp += vlams[j][-1]
......@@ -322,7 +322,7 @@ if __name__ == "__main__":
print("log10: "+ str(math.log(abs( temp), 10)))
f.write("Actual value: "+str(math.log(abs( temp), 2)) + "\n")
if False or math.log(abs( temp), 2) < -(args.sca*order+1) * (i+1)+3:
if False or math.log(abs( temp), 2) < -(args.sca*order+1) * (i):
symmetries += 1
f.write("Symmetries: " + str(symmetries)+"\n")
......@@ -343,8 +343,17 @@ if __name__ == "__main__":
f.write("l2 errors without discrete KF for LaTeX: \n")
f.write(" & ".join([str(l2) for l2 in l2errkf])+ "\n")
fnameerrs = fname + "l2errs"
header = [str(k) for k in range(1, n_cut_ref+1)]
with open(fnameerrs, "w", newline='') as f:
dictionary = dict(zip(header, l2errors))
writer = csv.DictWriter(f, delimiter=",", fieldnames = header)
writer.writeheader()
writer.writerow(dictionary)
dictionary = dict(zip(header, l2errkf))
writer.writerow(dictionary)
print(l2errors)
print("error with no killing field: ")
print(l2errkf)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment