Updates to testing the boundary conditions.

This commit is contained in:
Rowan Cockett
2016-06-22 11:29:04 -06:00
parent bf2035425c
commit 8d3a710d92
2 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -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])
+3 -3
View File
@@ -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)