From b7546d332bfcd4989b3297299c94a3bd6dd37d76 Mon Sep 17 00:00:00 2001 From: seogi_macbook Date: Mon, 27 Jun 2016 22:59:57 -0700 Subject: [PATCH] - Add CircularLoop for TDEM source - Fix bug for verbose option in Problem_b (TDEM) --- SimPEG/EM/TDEM/SrcTDEM.py | 42 +++++++++++++++++++++++++++++++++++++++ SimPEG/EM/TDEM/TDEM.py | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/SimPEG/EM/TDEM/SrcTDEM.py b/SimPEG/EM/TDEM/SrcTDEM.py index ff4f9c66..d3c8f56f 100644 --- a/SimPEG/EM/TDEM/SrcTDEM.py +++ b/SimPEG/EM/TDEM/SrcTDEM.py @@ -202,3 +202,45 @@ class MagDipole(BaseSrc): if self.waveform.hasInitialFields is False: raise NotImplementedError return Zero() + +class CircularLoop(MagDipole): + + waveform = None + loc = None + orientation = 'Z' + radius = None + mu = mu_0 + + def __init__(self, rxList, **kwargs): + assert self.orientation in ['X','Y','Z'], "Orientation (right now) doesn't actually do anything! The methods in SrcUtils should take care of this..." + self.integrate = False + BaseSrc.__init__(self, rxList, **kwargs) + + def _bfromVectorPotential(self, prob): + if prob._eqLocs is 'FE': + gridX = prob.mesh.gridEx + gridY = prob.mesh.gridEy + gridZ = prob.mesh.gridEz + C = prob.mesh.edgeCurl + + elif prob._eqLocs is 'EF': + gridX = prob.mesh.gridFx + gridY = prob.mesh.gridFy + gridZ = prob.mesh.gridFz + C = prob.mesh.edgeCurl.T + + + if prob.mesh._meshType is 'CYL': + if not prob.mesh.isSymmetric: + raise NotImplementedError('Non-symmetric cyl mesh not implemented yet!') + a = MagneticLoopVectorPotential(self.loc, gridY, 'y', radius=self.radius, mu=self.mu) + + else: + srcfct = MagneticLoopVectorPotential + ax = srcfct(self.loc, gridX, 'x', mu=self.mu, radius=self.radius) + ay = srcfct(self.loc, gridY, 'y', mu=self.mu, radius=self.radius) + az = srcfct(self.loc, gridZ, 'z', mu=self.mu, radius=self.radius) + a = np.concatenate((ax, ay, az)) + + return C*a + diff --git a/SimPEG/EM/TDEM/TDEM.py b/SimPEG/EM/TDEM/TDEM.py index 78f11617..92176076 100644 --- a/SimPEG/EM/TDEM/TDEM.py +++ b/SimPEG/EM/TDEM/TDEM.py @@ -49,7 +49,7 @@ class BaseTDEMProblem(Problem.BaseTimeProblem, BaseEMProblem): rhs = self.getRHS(tInd+1) # this is on the nodes of the time mesh Asubdiag = self.getAsubdiag(tInd) - if self.verbose: print ' Solving... (tInd = %d)'%tInd+1 + if self.verbose: print (' Solving... (tInd = %i)')% (tInd+1) sol = Ainv * (rhs - Asubdiag * F[:,self._fieldType+'Solution',tInd]) # taking a step if self.verbose: print ' Done...'