merged the drivers, and am investigating the qdelauney manpage ... should've done this earlier :P

--HG--
rename : bin/driver-random.py => bin/driver.py
rename : test/utest.py => test/qhull.test.py
This commit is contained in:
Stephen Mardson McQuay
2010-01-30 12:15:00 -07:00
parent f4b2c95cf5
commit 98b13fb8c5
8 changed files with 143 additions and 158 deletions
+1 -3
View File
@@ -4,9 +4,7 @@ import sys
import numpy as np
import scipy.spatial
def exact_func(x, y):
return np.power((np.sin(x * np.pi) * np.cos(y * np.pi)), 2)
return np.sin(x * np.pi) * np.cos(y * np.pi)
from tools import exact_func
class grid(object):
+27
View File
@@ -1,6 +1,13 @@
import numpy as np
import grid
class smberror(Exception):
def __init__(self, val):
self.value = val
def __str__(self):
return repr(self.value)
def rms(errors):
"""
root mean square calculation
@@ -10,3 +17,23 @@ def rms(errors):
r += np.power(i, 2)
r = np.sqrt(r / len(errors))
return r
def exact_func(x, y):
return np.power((np.sin(x * np.pi) * np.cos(y * np.pi)), 2)
return np.sin(x * np.pi) * np.cos(y * np.pi)
def get_mesh(source, destination, use_structured_grid = False):
mesh_source = None
mesh_dest = None
if use_structured_grid:
mesh_source = grid.simple_rect_grid(source, source)
mesh_dest = grid.simple_rect_grid(destination, destination)
else:
mesh_source = grid.simple_random_grid(source)
mesh_dest = grid.simple_random_grid(destination)
if not (mesh_dest and mesh_source):
raise smberror('problem creating mesh objects')
else:
return mesh_source, mesh_dest