mirror of
https://github.com/wassname/simpeg.git
synced 2026-07-05 01:25:52 +08:00
move fields to problem
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from SimPEG import Survey, Utils, np, sp
|
||||
from SimPEG import Survey, Problem, Utils, np, sp
|
||||
|
||||
class RxFDEM(Survey.BaseRx):
|
||||
|
||||
@@ -79,7 +79,7 @@ class TxFDEM(Survey.BaseTx):
|
||||
|
||||
|
||||
|
||||
class FieldsFDEM(Survey.Fields):
|
||||
class FieldsFDEM(Problem.Fields):
|
||||
"""Fancy Field Storage for a FDEM survey."""
|
||||
knownFields = {'b': 'F', 'e': 'E'}
|
||||
dtype = complex
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from SimPEG import Solver
|
||||
from SimPEG import Solver, Problem
|
||||
from SimPEG.Problem import BaseTimeProblem
|
||||
from simpegEM.Utils import Sources
|
||||
from SurveyTDEM import FieldsTDEM, SurveyTDEM
|
||||
from scipy.constants import mu_0
|
||||
from SimPEG.Utils import sdiag, mkvc
|
||||
from SimPEG import Utils, Mesh
|
||||
@@ -9,12 +8,33 @@ from simpegEM.Base import BaseEMProblem
|
||||
import numpy as np
|
||||
|
||||
|
||||
class FieldsTDEM(Problem.TimeFields):
|
||||
"""Fancy Field Storage for a TDEM survey."""
|
||||
knownFields = {'b': 'F', 'e': 'E'}
|
||||
|
||||
def tovec(self):
|
||||
nTx, nF, nE = self.survey.nTx, self.mesh.nF, self.mesh.nE
|
||||
u = np.empty(0 if nTx == 1 else (0, nTx))
|
||||
|
||||
for i in range(self.survey.prob.nT):
|
||||
if 'b' in self:
|
||||
b = self[:,'b',i+1]
|
||||
else:
|
||||
b = np.zeros(nF if nTx == 1 else (nF, nTx))
|
||||
|
||||
if 'e' in self:
|
||||
e = self[:,'e',i+1]
|
||||
else:
|
||||
e = np.zeros(nE if nTx == 1 else (nE, nTx))
|
||||
u = np.concatenate((u, b, e))
|
||||
return Utils.mkvc(u)
|
||||
|
||||
|
||||
class BaseTDEMProblem(BaseTimeProblem, BaseEMProblem):
|
||||
"""docstring for ProblemTDEM1D"""
|
||||
def __init__(self, mesh, mapping=None, **kwargs):
|
||||
BaseTimeProblem.__init__(self, mesh, mapping=mapping, **kwargs)
|
||||
|
||||
surveyPair = SurveyTDEM
|
||||
_FieldsForward_pair = FieldsTDEM #: used for the forward calculation only
|
||||
|
||||
def fields(self, m):
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from SimPEG import Utils, Survey, np
|
||||
from SimPEG.Survey import BaseSurvey
|
||||
from simpegEM.Utils import Sources
|
||||
from BaseTDEM import FieldsTDEM
|
||||
|
||||
|
||||
class RxTDEM(Survey.BaseTimeRx):
|
||||
@@ -64,27 +65,6 @@ class RxTDEM(Survey.BaseTimeRx):
|
||||
return P.T * v[tx, self]
|
||||
|
||||
|
||||
class FieldsTDEM(Survey.TimeFields):
|
||||
"""Fancy Field Storage for a TDEM survey."""
|
||||
knownFields = {'b': 'F', 'e': 'E'}
|
||||
|
||||
def tovec(self):
|
||||
nTx, nF, nE = self.survey.nTx, self.mesh.nF, self.mesh.nE
|
||||
u = np.empty(0 if nTx == 1 else (0, nTx))
|
||||
|
||||
for i in range(self.survey.prob.nT):
|
||||
if 'b' in self:
|
||||
b = self[:,'b',i+1]
|
||||
else:
|
||||
b = np.zeros(nF if nTx == 1 else (nF, nTx))
|
||||
|
||||
if 'e' in self:
|
||||
e = self[:,'e',i+1]
|
||||
else:
|
||||
e = np.zeros(nE if nTx == 1 else (nE, nTx))
|
||||
u = np.concatenate((u, b, e))
|
||||
return Utils.mkvc(u)
|
||||
|
||||
class TxTDEM(Survey.BaseTx):
|
||||
rxPair = RxTDEM
|
||||
knownTxTypes = ['VMD_MVP']
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from BaseTDEM import BaseTDEMProblem
|
||||
from BaseTDEM import BaseTDEMProblem, FieldsTDEM
|
||||
from SimPEG.Utils import mkvc
|
||||
import numpy as np
|
||||
from SurveyTDEM import SurveyTDEM, FieldsTDEM
|
||||
from SurveyTDEM import SurveyTDEM
|
||||
|
||||
|
||||
class FieldsTDEM_e_from_b(FieldsTDEM):
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
from SurveyTDEM import SurveyTDEM, FieldsTDEM, RxTDEM, TxTDEM
|
||||
from BaseTDEM import BaseTDEMProblem
|
||||
from SurveyTDEM import SurveyTDEM, RxTDEM, TxTDEM
|
||||
from BaseTDEM import BaseTDEMProblem, FieldsTDEM
|
||||
from TDEM_b import ProblemTDEM_b
|
||||
|
||||
Reference in New Issue
Block a user