made the get_phis and qlinear functions work independant of dimension

This commit is contained in:
Stephen Mardson McQuay
2011-02-02 10:56:20 -07:00
parent f1cd3061d7
commit 046e24b67d
4 changed files with 49 additions and 60 deletions
+4 -1
View File
@@ -337,12 +337,13 @@ class delaunay_grid(grid):
"""
log.debug('start')
qdelaunay_string = get_qdelaunay_dump_str(self)
# log.debug(qdelaunay_string)
cell_to_cells = []
for matcher in delaunay_grid.cell_re.finditer(qdelaunay_string):
d = matcher.groupdict()
cell_name = d['cell']
verticies = d['verts']
verticies = d['verts']
neighboring_cells = d['neigh']
cur_cell = cell(cell_name)
@@ -355,9 +356,11 @@ class delaunay_grid(grid):
nghbrs = [(cell_name, i) for i in neighboring_cells.split()]
cell_to_cells.extend(nghbrs)
log.debug(cell_to_cells)
for rel in cell_to_cells:
if rel[1] in self.cells:
self.cells[rel[0]].add_neighbor(self.cells[rel[1]])
log.debug(self.cells)
log.debug('end')
+4 -5
View File
@@ -1,4 +1,4 @@
from interp.baker import get_phis, get_phis_3D
from interp.baker import get_phis
from interp.tools import log
TOL = 1e-8
@@ -9,11 +9,10 @@ def contains(X, R):
represented by a list of n-degree coordinates)
it now correctly checks for 2/3-D verts
TODO: write unit test ...
"""
if len(R) == 3:
phis = get_phis(X, R)
elif len(R) == 4:
phis = get_phis_3D(X, R)
phis = get_phis(X, R)
r = True
if [i for i in phis if i < 0.0 - TOL]: