mirror of
https://github.com/wassname/simpeg.git
synced 2026-07-04 23:21:17 +08:00
adjoint debugging
This commit is contained in:
@@ -139,14 +139,14 @@ class BaseFDEMProblem(BaseEMProblem):
|
||||
dRHS_dmT = self.getRHSDeriv(freq, src, ATinvdf_duT, adjoint=True)
|
||||
du_dmT = -dA_dmT + dRHS_dmT
|
||||
|
||||
df_dmT += du_dmT
|
||||
Df_DmT = df_dmT + du_dmT
|
||||
|
||||
# TODO: this should be taken care of by the reciever?
|
||||
real_or_imag = rx.projComp
|
||||
if real_or_imag is 'real':
|
||||
Jtv += np.array(df_dmT,dtype=complex).real
|
||||
Jtv += np.array(Df_DmT,dtype=complex).real
|
||||
elif real_or_imag is 'imag':
|
||||
Jtv += - np.array(df_dmT,dtype=complex).real
|
||||
Jtv += - np.array(Df_DmT,dtype=complex).real
|
||||
else:
|
||||
raise Exception('Must be real or imag')
|
||||
|
||||
|
||||
@@ -633,6 +633,8 @@ class Fields_b(Fields):
|
||||
"""
|
||||
n = int(self._aveE2CCV.shape[0] / self._nC) # number of components
|
||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||
if adjoint:
|
||||
return self._MfMui.T * ( self._edgeCurl * ( self._aveE2CCV.T * (VI.T * du_dm_v) ) )
|
||||
return VI * (self._aveE2CCV * (self._edgeCurl.T * ( self._MfMui * du_dm_v ) ) )
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user