Skip to content

Commit

Permalink
eqlocs --> formulation in em
Browse files Browse the repository at this point in the history
  • Loading branch information
lheagy committed Mar 7, 2016
1 parent 6e0a54b commit 8412ad9
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
12 changes: 6 additions & 6 deletions SimPEG/EM/FDEM/FDEM.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ def getSourceTerm(self, freq):
:return: S_m, S_e (nE or nF, nSrc)
"""
Srcs = self.survey.getSrcByFreq(freq)
if self._eqLocs is 'FE':
if self._formulation is 'EB':
S_m = np.zeros((self.mesh.nF,len(Srcs)), dtype=complex)
S_e = np.zeros((self.mesh.nE,len(Srcs)), dtype=complex)
elif self._eqLocs is 'EF':
elif self._formulation is 'HJ':
S_m = np.zeros((self.mesh.nE,len(Srcs)), dtype=complex)
S_e = np.zeros((self.mesh.nF,len(Srcs)), dtype=complex)

Expand Down Expand Up @@ -202,7 +202,7 @@ class Problem_e(BaseFDEMProblem):
"""

_fieldType = 'e'
_eqLocs = 'FE'
_formulation = 'EB'
fieldsPair = Fields_e

def __init__(self, mesh, **kwargs):
Expand Down Expand Up @@ -313,7 +313,7 @@ class Problem_b(BaseFDEMProblem):
"""

_fieldType = 'b'
_eqLocs = 'FE'
_formulation = 'EB'
fieldsPair = Fields_b

def __init__(self, mesh, **kwargs):
Expand Down Expand Up @@ -461,7 +461,7 @@ class Problem_j(BaseFDEMProblem):
"""

_fieldType = 'j'
_eqLocs = 'EF'
_formulation = 'HJ'
fieldsPair = Fields_j

def __init__(self, mesh, **kwargs):
Expand Down Expand Up @@ -599,7 +599,7 @@ class Problem_h(BaseFDEMProblem):
"""

_fieldType = 'h'
_eqLocs = 'EF'
_formulation = 'HJ'
fieldsPair = Fields_h

def __init__(self, mesh, **kwargs):
Expand Down
50 changes: 25 additions & 25 deletions SimPEG/EM/FDEM/SrcFDEM.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def S_e(self, prob):
:rtype: numpy.ndarray
:return: electric source term on mesh
"""
if prob._eqLocs is 'FE' and self.integrate is True:
if prob._formulation is 'EB' and self.integrate is True:
return prob.Me * self._S_e
return self._S_e

Expand Down Expand Up @@ -184,7 +184,7 @@ def S_m(self, prob):
:rtype: numpy.ndarray
:return: magnetic source term on mesh
"""
if prob._eqLocs is 'EF' and self.integrate is True:
if prob._formulation is 'HJ' and self.integrate is True:
return prob.Me * self._S_m
return self._S_m

Expand Down Expand Up @@ -214,7 +214,7 @@ def S_m(self, prob):
:rtype: numpy.ndarray
:return: magnetic source term on mesh
"""
if prob._eqLocs is 'EF' and self.integrate is True:
if prob._formulation is 'HJ' and self.integrate is True:
return prob.Me * self._S_m
return self._S_m

Expand All @@ -226,7 +226,7 @@ def S_e(self, prob):
:rtype: numpy.ndarray
:return: electric source term on mesh
"""
if prob._eqLocs is 'FE' and self.integrate is True:
if prob._formulation is 'EB' and self.integrate is True:
return prob.Me * self._S_e
return self._S_e

Expand Down Expand Up @@ -296,15 +296,15 @@ def bPrimary(self, prob):
:rtype: numpy.ndarray
:return: primary magnetic field
"""
eqLocs = prob._eqLocs
formulation = prob._formulation

if eqLocs is 'FE':
if formulation is 'EB':
gridX = prob.mesh.gridEx
gridY = prob.mesh.gridEy
gridZ = prob.mesh.gridEz
C = prob.mesh.edgeCurl

elif eqLocs is 'EF':
elif formulation is 'HJ':
gridX = prob.mesh.gridFx
gridY = prob.mesh.gridFy
gridZ = prob.mesh.gridFz
Expand Down Expand Up @@ -347,7 +347,7 @@ def S_m(self, prob):
"""

b_p = self.bPrimary(prob)
if prob._eqLocs is 'EF':
if prob._formulation is 'HJ':
b_p = prob.Me * b_p
return -1j*omega(self.freq)*b_p

Expand All @@ -363,13 +363,13 @@ def S_e(self, prob):
if all(np.r_[self.mu] == np.r_[prob.curModel.mu]):
return Zero()
else:
eqLocs = prob._eqLocs
formulation = prob._formulation

if eqLocs is 'FE':
if formulation is 'EB':
mui_s = prob.curModel.mui - 1./self.mu
MMui_s = prob.mesh.getFaceInnerProduct(mui_s)
C = prob.mesh.edgeCurl
elif eqLocs is 'EF':
elif formulation is 'HJ':
mu_s = prob.curModel.mu - self.mu
MMui_s = prob.mesh.getEdgeInnerProduct(mu_s, invMat=True)
C = prob.mesh.edgeCurl.T
Expand Down Expand Up @@ -412,15 +412,15 @@ def bPrimary(self, prob):
:return: primary magnetic field
"""

eqLocs = prob._eqLocs
formulation = prob._formulation

if eqLocs is 'FE':
if formulation is 'EB':
gridX = prob.mesh.gridFx
gridY = prob.mesh.gridFy
gridZ = prob.mesh.gridFz
C = prob.mesh.edgeCurl

elif eqLocs is 'EF':
elif formulation is 'HJ':
gridX = prob.mesh.gridEx
gridY = prob.mesh.gridEy
gridZ = prob.mesh.gridEz
Expand Down Expand Up @@ -462,7 +462,7 @@ def S_m(self, prob):
:return: primary magnetic field
"""
b = self.bPrimary(prob)
if prob._eqLocs is 'EF':
if prob._formulation is 'HJ':
b = prob.Me * b
return -1j*omega(self.freq)*b

Expand All @@ -477,13 +477,13 @@ def S_e(self, prob):
if all(np.r_[self.mu] == np.r_[prob.curModel.mu]):
return Zero()
else:
eqLocs = prob._eqLocs
formulation = prob._formulation

if eqLocs is 'FE':
if formulation is 'EB':
mui_s = prob.curModel.mui - 1./self.mu
MMui_s = prob.mesh.getFaceInnerProduct(mui_s)
C = prob.mesh.edgeCurl
elif eqLocs is 'EF':
elif formulation is 'HJ':
mu_s = prob.curModel.mu - self.mu
MMui_s = prob.mesh.getEdgeInnerProduct(mu_s, invMat=True)
C = prob.mesh.edgeCurl.T
Expand Down Expand Up @@ -525,15 +525,15 @@ def bPrimary(self, prob):
:rtype: numpy.ndarray
:return: primary magnetic field
"""
eqLocs = prob._eqLocs
formulation = prob._formulation

if eqLocs is 'FE':
if formulation is 'EB':
gridX = prob.mesh.gridEx
gridY = prob.mesh.gridEy
gridZ = prob.mesh.gridEz
C = prob.mesh.edgeCurl

elif eqLocs is 'EF':
elif formulation is 'HJ':
gridX = prob.mesh.gridFx
gridY = prob.mesh.gridFy
gridZ = prob.mesh.gridFz
Expand Down Expand Up @@ -574,7 +574,7 @@ def S_m(self, prob):
:return: primary magnetic field
"""
b = self.bPrimary(prob)
if prob._eqLocs is 'EF':
if prob._formulation is 'HJ':
b = prob.Me * b
return -1j*omega(self.freq)*b

Expand All @@ -589,15 +589,15 @@ def S_e(self, prob):
if all(np.r_[self.mu] == np.r_[prob.curModel.mu]):
return Zero()
else:
eqLocs = prob._eqLocs
formulation = prob._formulation

if eqLocs is 'FE':
if formulation is 'EB':
mui_s = prob.curModel.mui - 1./self.mu
MMui_s = prob.mesh.getFaceInnerProduct(mui_s)
C = prob.mesh.edgeCurl


elif eqLocs is 'EF':
elif formulation is 'HJ':
mu_s = prob.curModel.mu - self.mu
MMui_s = prob.mesh.getEdgeInnerProduct(mu_s, invMat=True)
C = prob.mesh.edgeCurl.T
Expand Down

0 comments on commit 8412ad9

Please sign in to comment.