merge conflicts resolved

This commit is contained in:
Lindsey
2015-08-06 16:42:38 -07:00
3 changed files with 13 additions and 13 deletions
+3 -3
View File
@@ -2,7 +2,7 @@
import sys
sys.path.append('../../')
from simpegPF.MagAnalytics import MagSphereAnalFunA, IDTtoxyz
from simpegPF.MagAnaytics import MagSphereAnaFunA, IDTtoxyz
from SimPEG import *
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
@@ -19,7 +19,7 @@ deckr = 54. + 9/60
btotkr = 50898.6
Bokr = IDTtoxyz(inckr, deckr, btotkr)
bx,by,bz = MagSphereAnalFunA(X, Y, Z,100.,0.,0.,0.,0.01,Bokr,'secondary')
bx,by,bz = MagSphereAnaFunA(X, Y, Z,100.,0.,0.,0.,0.01,Bokr,'secondary')
Bzkr = np.reshape(bz, (np.size(xr), np.size(yr)), order='F')
# Bz component at Canada
@@ -28,7 +28,7 @@ decca = 70. + 19/60
btotca = 54692.1
Boca = IDTtoxyz(incca, decca, btotca)
bx,by,bz = MagSphereAnalFunA(X, Y, Z,100.,0.,0.,0.,0.01,Boca,'secondary')
bx,by,bz = MagSphereAnaFunA(X, Y, Z,100.,0.,0.,0.,0.01,Boca,'secondary')
Bzca = np.reshape(bz, (np.size(xr), np.size(yr)), order='F')
fig = plt.figure( figsize = (14,5) )
+2 -2
View File
@@ -1,6 +1,6 @@
from SimPEG import *
import matplotlib.pyplot as plt
from simpegPF.MagAnalytics import spheremodel, MagSphereAnalFun, CongruousMagBC
from simpegPF.MagAnalytics import spheremodel, MagSphereAnaFun, CongruousMagBC
import time
# Step1: Generate 3D tensor mesh
@@ -66,7 +66,7 @@ H0 = Box/mu0
flag = 'secondary'
Bxra, Byra, Bzra = MagSphereAnalFun(X, Y, Z, 50., 0., 0., 0., mu0, mu0*(1+chiblk), H0, flag)
Bxra, Byra, Bzra = MagSphereAnaFun(X, Y, Z, 50., 0., 0., 0., mu0, mu0*(1+chiblk), H0, flag)
Bxra = np.reshape(Bxra, (np.size(xr), np.size(yr)), order='F')
Byra = np.reshape(Byra, (np.size(xr), np.size(yr)), order='F')
Bzra = np.reshape(Bzra, (np.size(xr), np.size(yr)), order='F')
+8 -8
View File
@@ -194,11 +194,11 @@ def IDTtoxyz(Inc, Dec, Btot):
if __name__ == '__main__':
hxind = ((0,25,1.3),(21, 12.5),(0,25,1.3))
hyind = ((0,25,1.3),(21, 12.5),(0,25,1.3))
hzind = ((0,25,1.3),(20, 12.5),(0,25,1.3))
hx, hy, hz = Utils.meshTensors(hxind, hyind, hzind)
M3 = Mesh.TensorMesh([hx, hy, hz], [-sum(hx)/2,-sum(hy)/2,-sum(hz)/2])
hxind = [(0,25,1.3),(21, 12.5),(0,25,1.3)]
hyind = [(0,25,1.3),(21, 12.5),(0,25,1.3)]
hzind = [(0,25,1.3),(20, 12.5),(0,25,1.3)]
# hx, hy, hz = Utils.meshTensors(hxind, hyind, hzind)
M3 = Mesh.TensorMesh([hxind, hyind, hzind], "CCC")
indxd, indxu, indyd, indyu, indzd, indzu = M3.faceBoundaryInd
mu0 = 4*np.pi*1e-7
chibkg = 0.
@@ -215,13 +215,13 @@ if __name__ == '__main__':
Bbcxx, Bbcxy, Bbcxz = MagSphereAnaFun(M3.gridFx[(indxd|indxu),0], M3.gridFx[(indxd|indxu),1], M3.gridFx[(indxd|indxu),2], 100, 0., 0., 0., mu_0, mu_0*(1+chiblk), H0, flag)
Bbcyx, Bbcyy, Bbcyz = MagSphereAnaFun(M3.gridFy[(indyd|indyu),0], M3.gridFy[(indyd|indyu),1], M3.gridFy[(indyd|indyu),2], 100, 0., 0., 0., mu_0, mu_0*(1+chiblk), H0, flag)
Bbczx, Bbczy, Bbczz = MagSphereAnaFun(M3.gridFz[(indzd|indzu),0], M3.gridFz[(indzd|indzu),1], M3.gridFz[(indzd|indzu),2], 100, 0., 0., 0., mu_0, mu_0*(1+chiblk), H0, flag)
Bbc_anal = np.r_[Bbcxx, Bbcyy, Bbczz]
Bbc_ana = np.r_[Bbcxx, Bbcyy, Bbczz]
# fig, ax = plt.subplots(1,1, figsize = (10, 10))
# ax.plot(Bbc_anal)
# ax.plot(Bbc_ana)
# ax.plot(Bbc)
# plt.show()
err = np.linalg.norm(Bbc-Bbc_anal)/np.linalg.norm(Bbc_anal)
err = np.linalg.norm(Bbc-Bbc_ana)/np.linalg.norm(Bbc_ana)
if err < 0.1:
print 'Mag Boundary computation is valid, err = ', err