From 8d3a710d924bd3774ad793712d1e6e9106eb6cb8 Mon Sep 17 00:00:00 2001 From: Rowan Cockett Date: Wed, 22 Jun 2016 11:29:04 -0600 Subject: [PATCH] Updates to testing the boundary conditions. --- simpegPF/Tests/test_forward_PFproblem.py | 8 ++++---- simpegPF/Tests/test_magnetics_analytics.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/simpegPF/Tests/test_forward_PFproblem.py b/simpegPF/Tests/test_forward_PFproblem.py index 32e24f59..0126dbc2 100644 --- a/simpegPF/Tests/test_forward_PFproblem.py +++ b/simpegPF/Tests/test_forward_PFproblem.py @@ -9,9 +9,9 @@ class MagFwdProblemTests(unittest.TestCase): def setUp(self): cs = 25. - hxind = [(cs,5,-1.3), (cs/2.0, 41),(cs,5,1.3)] - hyind = [(cs,5,-1.3), (cs/2.0, 41),(cs,5,1.3)] - hzind = [(cs,5,-1.3), (cs/2.0, 40),(cs,5,1.3)] + hxind = [(cs, 5, -1.3), (cs/2.0, 41), (cs, 5, 1.3)] + hyind = [(cs, 5, -1.3), (cs/2.0, 41), (cs, 5, 1.3)] + hzind = [(cs, 5, -1.3), (cs/2.0, 40), (cs, 5, 1.3)] M = Mesh.TensorMesh([hxind, hyind, hzind], 'CCC') chibkg = 0. @@ -46,7 +46,7 @@ class MagFwdProblemTests(unittest.TestCase): u = self.prob.fields(self.chi) B = u['B'] - bxa,bya,bza = PF.MagAnalytics.MagSphereAnaFunA(rxLoc[:,0],rxLoc[:,1],rxLoc[:,2],100.,0.,0.,0.,0.01, b0,'secondary') + bxa, bya, bza = PF.MagAnalytics.MagSphereAnaFunA(rxLoc[:, 0], rxLoc[:, 1], rxLoc[:, 2], 100., 0., 0., 0., 0.01, b0, 'secondary') dpred = survey.projectFieldsAsVector(B) err = np.linalg.norm(dpred-np.r_[bxa, bya, bza])/np.linalg.norm(np.r_[bxa, bya, bza]) diff --git a/simpegPF/Tests/test_magnetics_analytics.py b/simpegPF/Tests/test_magnetics_analytics.py index 8d6f4258..28065432 100644 --- a/simpegPF/Tests/test_magnetics_analytics.py +++ b/simpegPF/Tests/test_magnetics_analytics.py @@ -4,10 +4,10 @@ import simpegPF as PF from scipy.constants import mu_0 -plotIt = True +plotIt = False -class MagFwdProblemTests(unittest.TestCase): +class TestBoundaryConditionAnalytics(unittest.TestCase): def test_ana_boundary_computation(self): @@ -40,7 +40,7 @@ class MagFwdProblemTests(unittest.TestCase): ax.plot(Bbc_ana) ax.plot(Bbc) plt.show() - err = np.linalg.norm(Bbc-Bbc_ana)/np.linalg.norm(Bbc_ana) + err = np.linalg.norm(Bbc-Bbc_ana) / np.linalg.norm(Bbc_ana) assert err < 0.1, 'Mag Boundary computation is wrong!!, err = {}'.format(err)