From ec73a6a04e1b6aa850b0752a09584579b77c1ac1 Mon Sep 17 00:00:00 2001 From: Stephen Mardson McQuay Date: Fri, 11 Feb 2011 00:30:10 -0800 Subject: [PATCH] minor: mostly documentation and logging --- interp/baker/__init__.py | 11 ++++++----- test/2dquadratic.py | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/interp/baker/__init__.py b/interp/baker/__init__.py index 20d3e34..a8bf172 100644 --- a/interp/baker/__init__.py +++ b/interp/baker/__init__.py @@ -37,7 +37,7 @@ def get_phis(X, R): """ # baker: eq 7 - # TODO: perhaps also test R .. ? + # TODO: perhaps also test len(R[0]) .. ? if len(X) == 2: A = np.array([ [ 1, 1, 1], @@ -68,7 +68,7 @@ def get_phis(X, R): except np.linalg.LinAlgError as e: msg = "calculation of phis yielded a linearly dependant system (%s)" % e log.error(msg) - raise Exception(msg) + # raise Exception(msg) phi = np.dot(np.linalg.pinv(A), b) return phi @@ -80,8 +80,7 @@ def qlinear(X, R): also, this is baker eq 3 X = destination point - R = simplex points - q = quantity of interest at the simplex points + R = a inter.grid object; must have R.points and R.q """ phis = get_phis(X, R.verts) @@ -134,7 +133,7 @@ def get_error(phi, R, S, order = 2): cur_sum *= phi[j] error_term += cur_sum - log.debug("error_term smb: %s" % error_term) + log.debug("error_term: %s" % error_term) return error_term, abc def run_baker(X, R, S, order=2): @@ -173,6 +172,8 @@ def run_baker(X, R, S, order=2): answer['final'] = q_final answer['abc' ] = abc + log.debug(answer) + return answer def run_baker_3D(X, R, S): diff --git a/test/2dquadratic.py b/test/2dquadratic.py index b18d2b8..f51dd11 100755 --- a/test/2dquadratic.py +++ b/test/2dquadratic.py @@ -32,7 +32,6 @@ class TestSequenceFunctions(unittest.TestCase): self.X = [0.55, 0.45] self.g = grid(self.points, self.q) - self.g.construct_connectivity() self.R = self.g.create_mesh(range(3)) self.exact = exact_func(self.X)