minor: mostly documentation and logging
This commit is contained in:
parent
8fcb91ebd2
commit
ec73a6a04e
@ -37,7 +37,7 @@ def get_phis(X, R):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
# baker: eq 7
|
# baker: eq 7
|
||||||
# TODO: perhaps also test R .. ?
|
# TODO: perhaps also test len(R[0]) .. ?
|
||||||
if len(X) == 2:
|
if len(X) == 2:
|
||||||
A = np.array([
|
A = np.array([
|
||||||
[ 1, 1, 1],
|
[ 1, 1, 1],
|
||||||
@ -68,7 +68,7 @@ def get_phis(X, R):
|
|||||||
except np.linalg.LinAlgError as e:
|
except np.linalg.LinAlgError as e:
|
||||||
msg = "calculation of phis yielded a linearly dependant system (%s)" % e
|
msg = "calculation of phis yielded a linearly dependant system (%s)" % e
|
||||||
log.error(msg)
|
log.error(msg)
|
||||||
raise Exception(msg)
|
# raise Exception(msg)
|
||||||
phi = np.dot(np.linalg.pinv(A), b)
|
phi = np.dot(np.linalg.pinv(A), b)
|
||||||
|
|
||||||
return phi
|
return phi
|
||||||
@ -80,8 +80,7 @@ def qlinear(X, R):
|
|||||||
also, this is baker eq 3
|
also, this is baker eq 3
|
||||||
|
|
||||||
X = destination point
|
X = destination point
|
||||||
R = simplex points
|
R = a inter.grid object; must have R.points and R.q
|
||||||
q = quantity of interest at the simplex points
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
phis = get_phis(X, R.verts)
|
phis = get_phis(X, R.verts)
|
||||||
@ -134,7 +133,7 @@ def get_error(phi, R, S, order = 2):
|
|||||||
cur_sum *= phi[j]
|
cur_sum *= phi[j]
|
||||||
error_term += cur_sum
|
error_term += cur_sum
|
||||||
|
|
||||||
log.debug("error_term smb: %s" % error_term)
|
log.debug("error_term: %s" % error_term)
|
||||||
return error_term, abc
|
return error_term, abc
|
||||||
|
|
||||||
def run_baker(X, R, S, order=2):
|
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['final'] = q_final
|
||||||
answer['abc' ] = abc
|
answer['abc' ] = abc
|
||||||
|
|
||||||
|
log.debug(answer)
|
||||||
|
|
||||||
return answer
|
return answer
|
||||||
|
|
||||||
def run_baker_3D(X, R, S):
|
def run_baker_3D(X, R, S):
|
||||||
|
@ -32,7 +32,6 @@ class TestSequenceFunctions(unittest.TestCase):
|
|||||||
self.X = [0.55, 0.45]
|
self.X = [0.55, 0.45]
|
||||||
|
|
||||||
self.g = grid(self.points, self.q)
|
self.g = grid(self.points, self.q)
|
||||||
self.g.construct_connectivity()
|
|
||||||
self.R = self.g.create_mesh(range(3))
|
self.R = self.g.create_mesh(range(3))
|
||||||
|
|
||||||
self.exact = exact_func(self.X)
|
self.exact = exact_func(self.X)
|
||||||
|
Loading…
Reference in New Issue
Block a user