mirror of
https://github.com/wassname/simpeg.git
synced 2026-09-11 12:44:29 +08:00
Change rxList --> [rx,rx]
Projections are not shared at the moment, but this can be changed later.
This commit is contained in:
+17
-4
@@ -110,10 +110,10 @@ class BaseProblemFDEM(Problem.BaseProblem):
|
||||
u_tx = u[tx, self.solType]
|
||||
w = self.getADeriv(freq, u_tx, v)
|
||||
Ainvw = solver.solve(w)
|
||||
fAinvw = self.calcFieldsList(Ainvw, freq, tx.rxList.fieldTypes)
|
||||
fAinvw = self._calcFieldsList(Ainvw, freq, tx.rxList.fieldTypes)
|
||||
P = lambda v: tx.projectFieldsDeriv(self.mesh, u, v)
|
||||
|
||||
df_dm = self.calcFieldsDerivList(u_tx, freq, tx.rxList.fieldTypes, v)
|
||||
df_dm = self._calcFieldsDerivList(u_tx, freq, tx.rxList.fieldTypes, v)
|
||||
#TODO: this is now a list?
|
||||
if df_dm is None:
|
||||
Jv[tx] = - P(fAinvw)
|
||||
@@ -142,12 +142,12 @@ class BaseProblemFDEM(Problem.BaseProblem):
|
||||
u_tx = u[tx, self.solType]
|
||||
|
||||
PTv = tx.projectFieldsDeriv(self.mesh, u, v[tx], adjoint=True)
|
||||
fPTv = self.calcFields(PTv, freq, tx.rxList.fieldTypes, adjoint=True)
|
||||
fPTv = self._calcFieldsList(PTv, freq, tx.rxList.fieldTypes, adjoint=True)
|
||||
|
||||
w = solver.solve( fPTv )
|
||||
Jtv_tx = self.getADeriv(freq, u_tx, w, adjoint=True)
|
||||
|
||||
df_dm = self.calcFieldsDeriv(u_tx, freq, tx.rxList.fieldTypes, PTv, adjoint=True)
|
||||
df_dm = self._calcFieldsDerivList(u_tx, freq, tx.rxList.fieldTypes, PTv, adjoint=True)
|
||||
|
||||
if df_dm is None:
|
||||
Jtv += - Jtv_tx
|
||||
@@ -156,6 +156,19 @@ class BaseProblemFDEM(Problem.BaseProblem):
|
||||
|
||||
return Jtv
|
||||
|
||||
def _calcFieldsList(self, sol, freq, fieldTypes, adjoint=False):
|
||||
fVecs = range(len(fieldTypes))
|
||||
for ii, fieldType in enumerate(fieldTypes):
|
||||
fVecs[ii] = self.calcFields(sol, freq, fieldType, adjoint=adjoint)
|
||||
return np.concatenate(fVecs)
|
||||
|
||||
def _calcFieldsDerivList(self, sol, freq, fieldTypes, v, adjoint=False):
|
||||
fVecs = range(len(fieldTypes))
|
||||
V = v.reshape((-1, len(fieldTypes)), order='F')
|
||||
for ii, fieldType in enumerate(fieldTypes):
|
||||
fVecs[ii] = self.calcFieldsDeriv(sol, freq, fieldType, V[:,ii], adjoint=adjoint)
|
||||
return np.concatenate(fVecs)
|
||||
|
||||
class ProblemFDEM_e(BaseProblemFDEM):
|
||||
"""
|
||||
Solving for e!
|
||||
|
||||
Reference in New Issue
Block a user