Updating Survey and Problem MT, work in progress. Code not tested.

This commit is contained in:
Gudni Karl Rosenkjaer
2015-02-15 23:10:03 -08:00
parent 852a7295ef
commit 9aa94c95b1
5 changed files with 133 additions and 103 deletions
+23 -22
View File
@@ -1,31 +1,32 @@
def homo1DModelSource(mesh,bgMod):
'''
Function that calculates and return backround fields
def homo1DModelSource(mesh,freq,bgMod):
'''
Function that calculates and return backround fields
'''
'''
# import
# import
from simpegMT.Utils import get1DEfields
# Get a 1d solution for a halfspace background
mesh1d = simpeg.Mesh.TensorMesh([M.hz],np.array([M.x0[2]]))
e0_1d = get1DEfields(mesh1d,M.r(sigBG,'CC','CC','M')[0,0,:],freq)
mesh1d = simpeg.Mesh.TensorMesh([mesh.hz],np.array([mesh.x0[2]]))
e0_1d = get1DEfields(mesh1d,mesh.r(sigBG,'CC','CC','M')[0,0,:],freq)
# Setup x (east) polarization (_x)
ex_px = np.zeros(M.vnEx,dtype=complex)
ey_px = np.zeros((M.nEy,1),dtype=complex)
ez_px = np.zeros((M.nEz,1),dtype=complex)
ex_px = np.zeros(mesh.vnEx,dtype=complex)
ey_px = np.zeros((mesh.nEy,1),dtype=complex)
ez_px = np.zeros((mesh.nEz,1),dtype=complex)
# Assign the source to ex_x
for i in arange(M.vnEx[0]):
for j in arange(M.vnEx[2]):
for i in arange(mesh.vnEx[0]):
for j in arange(mesh.vnEx[1]):
ex_px[i,j,:] = e0_1d
eBG_px = np.vstack((simpeg.Utils.mkvc(M.r(ex_px,'Ex','Ex','V'),2),ey_px,ez_px))
eBG_px = np.vstack((simpeg.Utils.mkvc(mesh.r(ex_px,'Ex','Ex','V'),2),ey_px,ez_px))
# Setup y (north) polarization (_py)
ex_py = np.zeros(M.nEx, dtype='complex128')
ey_py = np.zeros((M.vnEy), dtype='complex128')
ez_py = np.zeros(M.nEz, dtype='complex128')
# Assign the source to ey_py
for i in arange(M.vnEy[0]):
for j in arange(M.vnEy[1]):
ey_py[i,j,:] = e0_1d
ex_py = np.zeros(mesh.nEx, dtype='complex128')
ey_py = np.zeros((mesh.vnEy), dtype='complex128')
ez_py = np.zeros(mesh.nEz, dtype='complex128')
# Assign the source to ey_py
for i in arange(mesh.vnEy[0]):
for j in arange(mesh.vnEy[1]):
ey_py[i,j,:] = e0_1d
eBG_py = np.vstack((ex_py,simpeg.Utils.mkvc(ey_py,2),ez_py))
eBG_py = np.r_[ex_py,simpeg.Utils.mkvc(ey_py),ez_py]
# Return the electric fields
return np.hstack((eBG_px,eBG_py))