Skip to content

Commit ef94a62

Browse files
authored
Merge pull request #130 from MiraGeoscience/GEOPY-1383
GEOPY-1383: Incorporate MobileMT inversion with SimPEG (apparent conductivity only)
2 parents 17c25f9 + b919ca8 commit ef94a62

1 file changed

Lines changed: 19 additions & 15 deletions

File tree

simpeg/electromagnetics/natural_source/receivers.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from scipy.constants import mu_0
99
from scipy.sparse import csr_matrix
1010
from ...survey import BaseRx
11-
from simpeg.utils import mkvc
1211

1312

1413
def _alpha(src):
@@ -1145,20 +1144,25 @@ def _eval_apparent_conductivity_deriv(
11451144
# ADJOINT
11461145
if adjoint:
11471146
# Compute: J_T * v = d_top_T * a_v + d_bot_T * b
1148-
a_v = fact * v / bot # term 1
1149-
b_v = -fact * top * v / bot**2 # term 2
1150-
1151-
a_v = np.repeat(mkvc(a_v, n_dims=2), 2, axis=-1)
1152-
b_v = np.repeat(mkvc(b_v, n_dims=2), 2, axis=-1)
1153-
1154-
hx *= a_v
1155-
hy *= a_v
1156-
hz *= a_v
1157-
ex *= b_v
1158-
ey *= b_v
1159-
1160-
e_v = 2 * (Pex.T @ ex + Pey.T @ ey).conjugate()
1161-
h_v = 2 * (Phx.T @ hx + Phy.T @ hy + Phz.T @ hz).conjugate()
1147+
a_v = fact * np.c_[v] / bot[:, None] # term 1
1148+
b_v = np.c_[v] * (-fact * top / (bot**2))[:, None] # term 2
1149+
1150+
ghx_v = np.einsum("ij,ik->ijk", a_v, hx).reshape((hx.shape[0], -1))
1151+
ghy_v = np.einsum("ij,ik->ijk", a_v, hy).reshape((hy.shape[0], -1))
1152+
ghz_v = np.einsum("ij,ik->ijk", a_v, hz).reshape((hz.shape[0], -1))
1153+
gex_v = np.einsum("ij,ik->ijk", b_v, ex).reshape((ex.shape[0], -1))
1154+
gey_v = np.einsum("ij,ik->ijk", b_v, ey).reshape((ey.shape[0], -1))
1155+
e_v = (
1156+
2 * (Pex.T @ csr_matrix(gex_v) + Pey.T @ csr_matrix(gey_v)).conjugate()
1157+
)
1158+
h_v = (
1159+
2
1160+
* (
1161+
Phx.T @ csr_matrix(ghx_v)
1162+
+ Phy.T @ csr_matrix(ghy_v)
1163+
+ Phz.T @ csr_matrix(ghz_v)
1164+
).conjugate()
1165+
)
11621166

11631167
fu_e_v, fm_e_v = f._eDeriv(src, None, e_v, adjoint=True)
11641168
fu_h_v, fm_h_v = f._hDeriv(src, None, h_v, adjoint=True)

0 commit comments

Comments
 (0)