mirror of
https://github.com/wassname/simpeg.git
synced 2026-07-11 12:35:55 +08:00
start of being able to provide a primary problem
This commit is contained in:
@@ -571,14 +571,19 @@ class CircularLoop(BaseSrc):
|
||||
class PrimSecSigma(BaseSrc):
|
||||
|
||||
# TODO: This will only work for E-B formulation
|
||||
def __init__(self, rxList, freq, ePrimary, sigmaPrimary):
|
||||
def __init__(self, rxList, freq, sigmaPrimary, ePrimary=None, primaryProblem=None, primarySurvey=None):
|
||||
self.freq = float(freq)
|
||||
self._ePrimary = ePrimary
|
||||
self.sigmaPrimary = sigmaPrimary
|
||||
self._primaryProblem = primaryProblem
|
||||
self._primarySurvey = primarySurvey
|
||||
self.integrate = False
|
||||
BaseSrc.__init__(self, rxList)
|
||||
|
||||
def ePrimary(self,prob):
|
||||
if getattr(self, '_ePrimary', None) is None:
|
||||
if self._primaryProblem is None or self._primarySurvey is None:
|
||||
raise Exception "if Not specifying a ePrimary, a primarySurvey and primaryProblem must be provided."
|
||||
return self._ePrimary
|
||||
|
||||
def S_e(self,prob):
|
||||
|
||||
@@ -42,6 +42,13 @@ def getFDEMProblem(fdemType, comp, SrcList, freq, verbose=False):
|
||||
S_m[Utils.closestPoints(mesh,[0.,0.,0.],'Ez') + np.sum(mesh.vnE[:1])] = 1.
|
||||
S_e[Utils.closestPoints(mesh,[0.,0.,0.],'Fz') + np.sum(mesh.vnF[:1])] = 1.
|
||||
Src.append(EM.FDEM.Src.RawVec([Rx0], freq, S_m, S_e))
|
||||
elif SrcType is 'PrimSecSigma':
|
||||
if fdemType is 'e' or fdemType is 'b':
|
||||
S_m = np.zeros(mesh.nF)
|
||||
S_e = np.zeros(mesh.nE)
|
||||
S_m[Utils.closestPoints(mesh,[0.,0.,0.],'Fz') + np.sum(mesh.vnF[:1])] = 1.
|
||||
S_e[Utils.closestPoints(mesh,[0.,0.,0.],'Ez') + np.sum(mesh.vnE[:1])] = 1.
|
||||
Src.append(EM.FDEM.Src.RawVec([Rx0], freq, S_m, S_e))
|
||||
|
||||
if verbose:
|
||||
print ' Fetching %s problem' % (fdemType)
|
||||
|
||||
@@ -17,7 +17,7 @@ MU = mu_0
|
||||
freq = 1e-1
|
||||
addrandoms = True
|
||||
|
||||
SrcType = 'RawVec' #or 'MAgDipole_Bfield', 'CircularLoop', 'RawVec'
|
||||
SrcType = 'PrimSecSigma', #'RawVec' #or 'MAgDipole_Bfield', 'CircularLoop', 'RawVec'
|
||||
|
||||
def adjointTest(fdemType, comp):
|
||||
prb = getFDEMProblem(fdemType, comp, [SrcType], freq)
|
||||
|
||||
Reference in New Issue
Block a user