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

small changes

parent 2c35c186
for ORDER in 1 2 3
do
for C in 1 1.1 1.5
do
./killing.py --refinements 5 -c $C --order $ORDER --plot --saveplot
done
done
for ORDER in 1 2 3
do
for C in "1" "0.5" "0.1"
do
./killing.py --geometry arrow --refinements 5 -c $C --order $ORDER --plot --saveplot
done
done
\ No newline at end of file
......@@ -93,17 +93,25 @@ def plot_errors(l2errs, l2errskf, geom, saveplot, order=2, refs=2, c=1):
hvals = []
ticks = range(1,len(l2errs)+1)
for k in range(len(l2errs)):
hvals.append((1 / 2 ** 3) ** k)
plt.semilogy(l2errs, label=geom+" with KF removal")
plt.semilogy(l2errskf, label=geom + " without KF removal")
plt.semilogy(hvals, label="O(h^"+ str(order+1)+")")
plt.ylabel("L2 error")
hvals.append((1 / 2 ** (order+1)) ** k)
hvals2 = []
for k in range(len(l2errs)):
hvals2.append((1 / 2 ** order) ** k)
plt.semilogy(ticks,l2errs, label=geom+" with KF removal")
# plt.semilogy(l2errskf, label=geom + " without KF removal")
plt.semilogy(ticks,hvals, label=r'$O(h^'+ str(order+1)+r')$')
plt.semilogy(ticks,hvals2, label=r'$O(h^'+ str(order)+r')$')
plt.ylabel(r'$L2$ error')
plt.xlabel("Refinement")
plt.title("Convergence removing KF")
plt.legend()
plt.xticks(range(len(l2errs)))
plt.xticks(ticks)
if saveplot:
plt.savefig("convergence_plot_"+geom+"_c"+str(c)+"_order"+str(order)+"_refs"+str(refs)+".png")
else:
......
......@@ -40,7 +40,8 @@ def getKilling(mesh, lset_approx, deformation, vlam, evecs, step,alpha=3, maxsy
# epsilon =(cuthmax)**(alpha)
alpha=order+1
epsilon = h ** alpha
epsilon=0
if False:
epsilon=0
print("Epsilon:")
print(epsilon)
# epsilon=1
......@@ -273,7 +274,7 @@ if __name__ == "__main__":
symmetries = 0
for k in range(3):
# if math.log(abs(1 - vlams[k][1]), 10) < math.log(abs(vlams[k][0] - vlams[k][1]), 10):
if math.log(abs(1 - vlams[k][1]), 2) <-(order+1)*(i+2):
if math.log(abs(1 - vlams[k][1]), 2) <-(order+1)*(i+1):
print("corresponding log: ")
print(math.log(abs(1 - vlams[k][1]), 2))
print("condition: ", -(order+1)*(i+1))
......
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