mirror of
https://github.com/wassname/simpeg.git
synced 2026-07-06 05:16:51 +08:00
cleaned up how I am calling srcDerivs
This commit is contained in:
@@ -243,10 +243,9 @@ class Problem_e(BaseFDEMProblem):
|
||||
MfMui = self.MfMui
|
||||
S_mDeriv, S_eDeriv = src.evalDeriv(self, adjoint)
|
||||
|
||||
if adjoint:
|
||||
if adjoint:
|
||||
dRHS = MfMui * (C * v)
|
||||
return S_mDeriv(dRHS) - 1j * omega(freq) * S_eDeriv(v)
|
||||
|
||||
else:
|
||||
return C.T * (MfMui * S_mDeriv(v)) -1j * omega(freq) * S_eDeriv(v)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class BaseSrc(Survey.BaseSrc):
|
||||
S_e = self.S_e(prob)
|
||||
return S_m, S_e
|
||||
|
||||
def evalDeriv(self, prob, v, adjoint=False):
|
||||
def evalDeriv(self, prob, adjoint=False):
|
||||
return lambda v: self.S_mDeriv(prob,v,adjoint), lambda v: self.S_eDeriv(prob,v,adjoint)
|
||||
|
||||
def bPrimary(self, prob):
|
||||
@@ -333,7 +333,7 @@ class PrimSecSigma(BaseSrc):
|
||||
|
||||
def S_eDeriv(self, prob, v, adjoint = False):
|
||||
MeSigmaDeriv = prob.MeSigmaDeriv
|
||||
if adjoint is not True:
|
||||
if not adjoint:
|
||||
return MeSigmaDeriv(Utils.mkvc(self._ePrimary)) * v # TODO: This is really sloppy and will not work if more than one freq
|
||||
return MeSigmaDeriv(Utils.mkvc(self._ePrimary)).T * v
|
||||
|
||||
|
||||
Reference in New Issue
Block a user