made a get_error function that is generic and functional. I'm still getting unsavory numbers for the cubic, 2-D case on my single test case. I will have to try out more refined grids, albeit the quadratic is consistently improving results for my case.

This commit is contained in:
sm
2010-05-05 23:03:12 -06:00
parent 3a1c13bcac
commit df35cb174b
4 changed files with 59 additions and 12 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/env python
import sys
from optparse import OptionParser
+2 -1
View File
@@ -37,7 +37,7 @@ if __name__ == '__main__':
sys.exit(1)
print "total points", total_points
smblog.debug("total points: %d" % total_points)
@@ -67,3 +67,4 @@ if __name__ == '__main__':
good.append(d[True])
draw_gb(bad = bad, good = good)
+3 -4
View File
@@ -1,6 +1,5 @@
#!/usr/bin/env python
import math
from baker import run_baker
from baker.tools import improved_answer
@@ -9,10 +8,12 @@ from baker.tools import smblog
from grid.DD import grid
from grid.simplex import contains
import numpy as np
def exact_func(X):
x = X[0]
y = X[0]
return 1 - math.sin((x-0.5)**2 + (y-0.5)**2)
return 1 - np.sin(np.power((x-0.5), 2) + np.power((y-0.5), 2))
if __name__ == '__main__':
points = [
@@ -33,8 +34,6 @@ if __name__ == '__main__':
g.construct_connectivity()
R = g.create_mesh(range(3))
print contains(X, R.points)
try:
extra = int(sys.argv[1])
except: