Skip to content
Snippets Groups Projects
Commit 026270df authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Made the gravity derivative script merge the common terms

parent 15f1e94e
No related branches found
No related tags found
1 merge request!328Gravity multi dt
......@@ -228,14 +228,10 @@ for i in range(n+1):
temp += part[c]
part2 = sorted(part2)
#if terms == [] or terms[-1] != part2:
terms.append(part2)
norm_pi2.append(norm_pi[p])
#print p, part, part2
#else:
# count_terms[-1] += 1
# Sort list of terms
# Sort list of blocks
index = argsort(terms)
terms = [ terms[u] for u in index]
norm_pi2 = [ norm_pi2[u] for u in index]
......@@ -269,9 +265,7 @@ for i in range(n+1):
for b in range(len(terms2)):
part2 = terms2[b]
#print part2, count_terms[b]
#print "/* %18s*/" %(part2),
# Write the derivative of phi
print derivative_phi(norm_pi3[b]), "* ",
......@@ -293,4 +287,3 @@ for i in range(n+1):
print ";"
print "/* %d zero-valued terms not written out */"%(count)
print "}\n"
#exit(-1)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment