mirror of
https://github.com/wassname/simpeg.git
synced 2026-07-23 13:10:51 +08:00
e,b,h,j from b formulation
This commit is contained in:
+121
-58
@@ -234,8 +234,7 @@ class Fields_e(Fields):
|
||||
:rtype: numpy.ndarray
|
||||
:return: secondary electric field
|
||||
"""
|
||||
ind = self.prob.survey.getSourceIndex(srcList)
|
||||
return eSolution[:,ind]
|
||||
return eSolution
|
||||
|
||||
def _eDeriv_u(self, src, v, adjoint = False):
|
||||
"""
|
||||
@@ -373,8 +372,8 @@ class Fields_e(Fields):
|
||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||
|
||||
if adjoint:
|
||||
return self._eDeriv_u(src, self._MeSigma.T * (self._aveE2CCV.T * (VI.T * du_dm_v) ), adjoint)
|
||||
return VI * (self._aveE2CCV * (self._MeSigma * (self._eDeriv_u(src, du_dm_v, adjoint) ) ) )
|
||||
return self._eDeriv_u(src, self._MeSigma.T * (self._aveE2CCV.T * (VI.T * du_dm_v) ), adjoint = adjoint)
|
||||
return VI * (self._aveE2CCV * (self._MeSigma * (self._eDeriv_u(src, du_dm_v, adjoint=adjoint) ) ) )
|
||||
|
||||
|
||||
def _jDeriv_m(self, src, v, adjoint = False):
|
||||
@@ -387,7 +386,7 @@ class Fields_e(Fields):
|
||||
:rtype: numpy.ndarray
|
||||
:return: product of the current density derivative with respect to the inversion model with a vector
|
||||
"""
|
||||
e = self._e(self._fields['eSolution'], [src])
|
||||
e = self[src, 'e']
|
||||
n = int(self._aveE2CCV.shape[0] / self._nC) #number of components
|
||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||
|
||||
@@ -477,8 +476,12 @@ class Fields_b(Fields):
|
||||
'e' : ['bSolution','E','_e'],
|
||||
'ePrimary' : ['bSolution','E','_ePrimary'],
|
||||
'eSecondary' : ['bSolution','E','_eSecondary'],
|
||||
'j' : ['bSolution','C','_j'],
|
||||
'h' : ['bSolution','C','_h'],
|
||||
'j' : ['bSolution','CCV','_j'],
|
||||
'jPrimary' : ['bSolution','CCV','_jPrimary'],
|
||||
'jSecondary' : ['bSolution','CCV','_jSecondary'],
|
||||
'h' : ['bSolution','CCV','_h'],
|
||||
'hPrimary' : ['bSolution','CCV','_hPrimary'],
|
||||
'hSecondary' : ['bSolution','CCV','_hSecondary'],
|
||||
}
|
||||
|
||||
def __init__(self,mesh,survey,**kwargs):
|
||||
@@ -519,7 +522,7 @@ class Fields_b(Fields):
|
||||
:return: primary electric field as defined by the sources
|
||||
"""
|
||||
|
||||
bPrimary = np.zeros_like(bSolution)
|
||||
bPrimary = np.zeros([self.prob.mesh.nF,len(srcList)])
|
||||
for i, src in enumerate(srcList):
|
||||
bp = src.bPrimary(self.prob)
|
||||
bPrimary[:,i] = bPrimary[:,i] + bp
|
||||
@@ -594,105 +597,165 @@ class Fields_b(Fields):
|
||||
e = self._MeSigmaI * ( self._edgeCurl.T * ( self._MfMui * bSolution))
|
||||
for i,src in enumerate(srcList):
|
||||
_,S_e = src.eval(self.prob)
|
||||
e[:,i] = e[:,i]+ -self._MeSigmaI * S_e
|
||||
e[:,i] = e[:,i] + -self._MeSigmaI * S_e
|
||||
return e
|
||||
|
||||
def _eSecondaryDeriv_u(self, src, du_dm_v, adjoint=False):
|
||||
def _eDeriv_u(self, src, du_dm_v, adjoint=False):
|
||||
"""
|
||||
Derivative of the secondary electric field with respect to the thing we solved for
|
||||
Derivative of the electric field with respect to the thing we solved for
|
||||
|
||||
:param SimPEG.EM.FDEM.Src src: source
|
||||
:param numpy.ndarray v: vector to take product with
|
||||
:param bool adjoint: adjoint?
|
||||
:rtype: numpy.ndarray
|
||||
:return: product of the derivative of the secondary electric field with respect to the field we solved for with a vector
|
||||
:return: product of the derivative of the electric field with respect to the field we solved for with a vector
|
||||
"""
|
||||
|
||||
if not adjoint:
|
||||
return self._MeSigmaI * ( self._edgeCurl.T * ( self._MfMui * du_dm_v) )
|
||||
else:
|
||||
return self._MfMui.T * (self._edgeCurl * (self._MeSigmaI.T * du_dm_v))
|
||||
return self._MfMui.T * (self._edgeCurl * (self._MeSigmaI.T * du_dm_v))
|
||||
|
||||
|
||||
def _eSecondaryDeriv_m(self, src, v, adjoint=False):
|
||||
def _eDeriv_m(self, src, v, adjoint=False):
|
||||
"""
|
||||
Derivative of the secondary electric field with respect to the inversion model
|
||||
Derivative of the electric field with respect to the inversion model
|
||||
|
||||
:param SimPEG.EM.FDEM.Src src: source
|
||||
:param numpy.ndarray v: vector to take product with
|
||||
:param bool adjoint: adjoint?
|
||||
:rtype: numpy.ndarray
|
||||
:return: product of the derivative of the secondary electric field with respect to the model with a vector
|
||||
:return: product of the derivative of the electric field with respect to the model with a vector
|
||||
"""
|
||||
|
||||
bSolution = self[[src],'bSolution']
|
||||
bSolution = Utils.mkvc(self[src, 'bSolution'])
|
||||
_,S_e = src.eval(self.prob)
|
||||
Me = self._Me
|
||||
|
||||
if adjoint:
|
||||
Me = Me.T
|
||||
|
||||
w = self._edgeCurl.T * (self._MfMui * bSolution)
|
||||
w = w - Utils.mkvc(Me * S_e,2)
|
||||
|
||||
if not adjoint:
|
||||
de_dm = self._MeSigmaIDeriv(w) * v
|
||||
elif adjoint:
|
||||
de_dm = self._MeSigmaIDeriv(w).T * v
|
||||
|
||||
w = -S_e + self._edgeCurl.T * (self._MfMui * bSolution)
|
||||
_, S_eDeriv = src.evalDeriv(self.prob, v, adjoint)
|
||||
|
||||
de_dm = de_dm - self._MeSigmaI * S_eDeriv
|
||||
|
||||
return de_dm
|
||||
if adjoint:
|
||||
return self._MeSigmaIDeriv(w).T * v - self._MeSigmaI.T * S_eDeriv
|
||||
return self._MeSigmaIDeriv(w) * v - self._MeSigmaI *S_eDeriv
|
||||
|
||||
def _eDeriv_u(self, src, du_dm_v, adjoint=False):
|
||||
|
||||
def _jPrimary(self, bSolution, srcList):
|
||||
"""
|
||||
Partial derivative of the total electric field with respect to the thing we solved for
|
||||
Primary current density
|
||||
|
||||
:param numpy.ndarray bSolution: field we solved for
|
||||
:param list srcList: list of sources
|
||||
:rtype: numpy.ndarray
|
||||
:return: primary current density
|
||||
"""
|
||||
n = int(self._aveE2CCV.shape[0] / self._nC) # number of components
|
||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||
|
||||
return VI * (self._aveE2CCV * (self.prob.MeSigma * self._ePrimary(bSolution, srcList)))
|
||||
|
||||
def _jSecondary(self, bSolution, srcList):
|
||||
"""
|
||||
Secondary current density from bSolution
|
||||
|
||||
:param numpy.ndarray bSolution: field we solved for
|
||||
:param list srcList: list of sources
|
||||
:rtype: numpy.ndarray
|
||||
:return: primary current density
|
||||
"""
|
||||
|
||||
n = int(self._aveE2CCV.shape[0] / self._nC) # number of components
|
||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||
|
||||
return VI * (self._aveE2CCV * ( self._edgeCurl.T * ( self._MfMui * bSolution) ) )
|
||||
|
||||
def _jDeriv_u(self, src, du_dm_v, adjoint=False):
|
||||
"""
|
||||
Partial derivative of the current density with respect to the thing we
|
||||
solved for.
|
||||
|
||||
:param SimPEG.EM.FDEM.Src src: source
|
||||
:param numpy.ndarray du_dm_v: vector to take product with
|
||||
:param bool adjoint: adjoint?
|
||||
:rtype: numpy.ndarray
|
||||
:return: product of the derivative of the electric field with respect to the field we solved for with a vector
|
||||
:return: product of the derivative of the current density with respect to the field we solved for with a vector
|
||||
"""
|
||||
return self._eSecondaryDeriv_u(src, du_dm_v, adjoint)
|
||||
|
||||
def _eDeriv_m(self, src, v, adjoint=False):
|
||||
n = int(self._aveE2CCV.shape[0] / self._nC) # number of components
|
||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||
|
||||
if adjoint:
|
||||
return self._MfMui.T * ( self._edgeCurl * ( self._aveE2CCV.T * ( VI.T * du_dm_v ) ) )
|
||||
return VI * ( self._aveE2CCV * ( self._edgeCurl.T * ( self._MfMui * du_dm_v ) ) )
|
||||
|
||||
def _jDeriv_m(self, src, v, adjoint=False):
|
||||
"""
|
||||
Partial derivative of the total electric field density with respect to the inversion model.
|
||||
Derivative of the current density with respect to the inversion model
|
||||
|
||||
:param SimPEG.EM.FDEM.Src src: source
|
||||
:param numpy.ndarray v: vector to take product with
|
||||
:param bool adjoint: adjoint?
|
||||
:rtype: numpy.ndarray
|
||||
:return: product of the electric field derivative with respect to the inversion model with a vector
|
||||
:return: product of the derivative of the current density with respect to the model with a vector
|
||||
"""
|
||||
# assuming primary doesn't depend on model
|
||||
return self._eSecondaryDeriv_m(src, bSolution, v, adjoint)
|
||||
return Zero()
|
||||
|
||||
def _j(self, bSolution, srcList):
|
||||
sigma = self._sigma
|
||||
aveE2CCV = self._aveE2CCV
|
||||
n = int(aveE2CCV.shape[0] / self._nC) #TODO: This is a bit sloppy
|
||||
# Sigma = sdiag(np.kron(np.ones(n), sigma))
|
||||
Sigma = self.prob.MeSigma
|
||||
def _hPrimary(self, bSolution, srcList):
|
||||
"""
|
||||
Primary magnetic field
|
||||
|
||||
:param numpy.ndarray bSolution: field we solved for
|
||||
:param list srcList: list of sources
|
||||
:rtype: numpy.ndarray
|
||||
:return: primary magnetic field
|
||||
"""
|
||||
n = int(self._aveF2CCV.shape[0] / self._nC) #number of components
|
||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||
return VI * (self._aveF2CCV * (self._MfMui * self._bPrimary(bSolution, srcList)))
|
||||
|
||||
def _hSecondary(self, bSolution, srcList):
|
||||
"""
|
||||
Secondary magnetic field from bSolution
|
||||
|
||||
:param numpy.ndarray bSolution: field we solved for
|
||||
:param list srcList: list of sources
|
||||
:rtype: numpy.ndarray
|
||||
:return: secondary magnetic field
|
||||
"""
|
||||
n = int(self._aveF2CCV.shape[0] / self._nC) #number of components
|
||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||
return VI * (self._aveF2CCV * (self._MfMui * self._bSecondary(bSolution, srcList)))
|
||||
|
||||
def _hDeriv_u(self, src, du_dm_v, adjoint=False):
|
||||
"""
|
||||
Partial derivative of the magnetic field with respect to the thing we
|
||||
solved for.
|
||||
|
||||
:param SimPEG.EM.FDEM.Src src: source
|
||||
:param numpy.ndarray du_dm_v: vector to take product with
|
||||
:param bool adjoint: adjoint?
|
||||
:rtype: numpy.ndarray
|
||||
:return: product of the derivative of the magnetic field with respect to the field we solved for with a vector
|
||||
"""
|
||||
n = int(self._aveF2CCV.shape[0] / self._nC) #number of components
|
||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||
|
||||
e = self._e(bSolution, srcList)
|
||||
if adjoint:
|
||||
return self._MfMui.T * ( self._aveF2CCV.T * ( VI.T * du_dm_v) )
|
||||
return VI * (self._aveF2CCV * (self._MfMui * du_dm_v))
|
||||
|
||||
return VI * (aveE2CCV * (Sigma *e) )
|
||||
|
||||
def _h(self, bSolution, srcList):
|
||||
b = self._b(bSolution, srcList)
|
||||
Mui = self.survey.prob.MfMui
|
||||
aveF2CCV = self._aveF2CCV
|
||||
n = int(aveF2CCV.shape[0] / self._nC) #TODO: This is a bit sloppy
|
||||
# Mui = sdiag(sp.kron(np.ones(n), mui))
|
||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||
def _hDeriv_m(self, src, v, adjoint=False):
|
||||
"""
|
||||
Derivative of the magnetic field with respect to the inversion model
|
||||
|
||||
:param SimPEG.EM.FDEM.Src src: source
|
||||
:param numpy.ndarray v: vector to take product with
|
||||
:param bool adjoint: adjoint?
|
||||
:rtype: numpy.ndarray
|
||||
:return: product of the derivative of the magnetic field with respect to the model with a vector
|
||||
"""
|
||||
return Zero()
|
||||
|
||||
|
||||
return VI * (aveF2CCV * (Mui * b))
|
||||
|
||||
|
||||
class Fields_j(Fields):
|
||||
|
||||
@@ -6,7 +6,7 @@ from scipy.constants import mu_0
|
||||
from SimPEG.EM.Utils.testingUtils import getFDEMProblem, crossCheckTest
|
||||
|
||||
testEB = True
|
||||
testHJ = True
|
||||
testHJ = False
|
||||
testEJ = True
|
||||
testBH = True
|
||||
verbose = False
|
||||
@@ -22,29 +22,29 @@ class FDEM_CrossCheck(unittest.TestCase):
|
||||
if testEB:
|
||||
def test_EB_CrossCheck_exr_Eform(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'exr', verbose=verbose))
|
||||
def test_EB_CrossCheck_eyr_Eform(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'eyr', verbose=verbose))
|
||||
def test_EB_CrossCheck_ezr_Eform(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'ezr', verbose=verbose))
|
||||
def test_EB_CrossCheck_exi_Eform(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'exi', verbose=verbose))
|
||||
def test_EB_CrossCheck_eyi_Eform(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'eyi', verbose=verbose))
|
||||
def test_EB_CrossCheck_ezi_Eform(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'ezi', verbose=verbose))
|
||||
# def test_EB_CrossCheck_eyr_Eform(self):
|
||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'eyr', verbose=verbose))
|
||||
# def test_EB_CrossCheck_ezr_Eform(self):
|
||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'ezr', verbose=verbose))
|
||||
# def test_EB_CrossCheck_exi_Eform(self):
|
||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'exi', verbose=verbose))
|
||||
# def test_EB_CrossCheck_eyi_Eform(self):
|
||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'eyi', verbose=verbose))
|
||||
# def test_EB_CrossCheck_ezi_Eform(self):
|
||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'ezi', verbose=verbose))
|
||||
|
||||
def test_EB_CrossCheck_bxr_Eform(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'bxr', verbose=verbose))
|
||||
def test_EB_CrossCheck_byr_Eform(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'byr', verbose=verbose))
|
||||
def test_EB_CrossCheck_bzr_Eform(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'bzr', verbose=verbose))
|
||||
def test_EB_CrossCheck_bxi_Eform(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'bxi', verbose=verbose))
|
||||
def test_EB_CrossCheck_byi_Eform(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'byi', verbose=verbose))
|
||||
def test_EB_CrossCheck_bzi_Eform(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'bzi', verbose=verbose))
|
||||
# def test_EB_CrossCheck_bxr_Eform(self):
|
||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'bxr', verbose=verbose))
|
||||
# def test_EB_CrossCheck_byr_Eform(self):
|
||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'byr', verbose=verbose))
|
||||
# def test_EB_CrossCheck_bzr_Eform(self):
|
||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'bzr', verbose=verbose))
|
||||
# def test_EB_CrossCheck_bxi_Eform(self):
|
||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'bxi', verbose=verbose))
|
||||
# def test_EB_CrossCheck_byi_Eform(self):
|
||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'byi', verbose=verbose))
|
||||
# def test_EB_CrossCheck_bzi_Eform(self):
|
||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'bzi', verbose=verbose))
|
||||
|
||||
if testHJ:
|
||||
def test_HJ_CrossCheck_jxr_Jform(self):
|
||||
|
||||
@@ -5,10 +5,10 @@ import sys
|
||||
from scipy.constants import mu_0
|
||||
from SimPEG.EM.Utils.testingUtils import getFDEMProblem, crossCheckTest
|
||||
|
||||
testEB = True
|
||||
testHJ = True
|
||||
testEJ = True
|
||||
testBH = True
|
||||
testEB = False
|
||||
testHJ = False
|
||||
testEJ = False
|
||||
testBH = False
|
||||
|
||||
TOLEBHJ = 1e-5
|
||||
TOLEJHB = 1 # averaging and more sensitive to boundary condition violations (ie. the impact of violating the boundary conditions in each case is different.)
|
||||
|
||||
@@ -5,13 +5,12 @@ import sys
|
||||
from scipy.constants import mu_0
|
||||
from SimPEG.EM.Utils.testingUtils import getFDEMProblem, crossCheckTest
|
||||
|
||||
testEB = True
|
||||
testEB = False
|
||||
testHJ = True
|
||||
testEJ = True
|
||||
testEJ = False
|
||||
testBH = True
|
||||
verbose = False
|
||||
|
||||
TOLEBHJ = 1e-5
|
||||
TOLEJHB = 1 # averaging and more sensitive to boundary condition violations (ie. the impact of violating the boundary conditions in each case is different.)
|
||||
#TODO: choose better testing parameters to lower this
|
||||
|
||||
@@ -20,56 +19,109 @@ SrcList = ['RawVec', 'MagDipole_Bfield', 'MagDipole', 'CircularLoop']
|
||||
|
||||
class FDEM_CrossCheck(unittest.TestCase):
|
||||
if testBH:
|
||||
def test_BH_CrossCheck_jxr_Jform(self):
|
||||
def test_BH_CrossCheck_jxr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'jxr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_jyr_Jform(self):
|
||||
def test_BH_CrossCheck_jyr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'jyr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_jzr_Jform(self):
|
||||
def test_BH_CrossCheck_jzr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'jzr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_jxi_Jform(self):
|
||||
def test_BH_CrossCheck_jxi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'jxi', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_jyi_Jform(self):
|
||||
def test_BH_CrossCheck_jyi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'jyi', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_jzi_Jform(self):
|
||||
def test_BH_CrossCheck_jzi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'jzi', verbose=verbose, TOL=TOLEJHB))
|
||||
|
||||
def test_BH_CrossCheck_exr_Jform(self):
|
||||
def test_BH_CrossCheck_exr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'exr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_eyr_Jform(self):
|
||||
def test_BH_CrossCheck_eyr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'eyr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_ezr_Jform(self):
|
||||
def test_BH_CrossCheck_ezr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'ezr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_exi_Jform(self):
|
||||
def test_BH_CrossCheck_exi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'exi', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_eyi_Jform(self):
|
||||
def test_BH_CrossCheck_eyi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'eyi', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_ezi_Jform(self):
|
||||
def test_BH_CrossCheck_ezi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'ezi', verbose=verbose, TOL=TOLEJHB))
|
||||
|
||||
def test_BH_CrossCheck_bxr_Jform(self):
|
||||
def test_BH_CrossCheck_bxr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'bxr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_byr_Jform(self):
|
||||
def test_BH_CrossCheck_byr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'byr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_bzr_Jform(self):
|
||||
def test_BH_CrossCheck_bzr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'bzr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_bxi_Jform(self):
|
||||
def test_BH_CrossCheck_bxi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'bxi', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_byi_Jform(self):
|
||||
def test_BH_CrossCheck_byi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'byi', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_bzi_Jform(self):
|
||||
def test_BH_CrossCheck_bzi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'bzi', verbose=verbose, TOL=TOLEJHB))
|
||||
|
||||
def test_BH_CrossCheck_hxr_Jform(self):
|
||||
def test_BH_CrossCheck_hxr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'hxr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_hyr_Jform(self):
|
||||
def test_BH_CrossCheck_hyr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'hyr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_hzr_Jform(self):
|
||||
def test_BH_CrossCheck_hzr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'hzr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_hxi_Jform(self):
|
||||
def test_BH_CrossCheck_hxi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'hxi', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_hyi_Jform(self):
|
||||
def test_BH_CrossCheck_hyi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'hyi', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_hzi_Jform(self):
|
||||
def test_BH_CrossCheck_hzi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'hzi', verbose=verbose, TOL=TOLEJHB))
|
||||
|
||||
if testBH:
|
||||
def test_BH_CrossCheck_jxr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'jxr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_jyr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'jyr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_jzr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'jzr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_jxi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'jxi', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_jyi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'jyi', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_jzi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'jzi', verbose=verbose, TOL=TOLEJHB))
|
||||
|
||||
def test_BH_CrossCheck_exr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'exr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_eyr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'eyr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_ezr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'ezr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_exi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'exi', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_eyi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'eyi', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_ezi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'ezi', verbose=verbose, TOL=TOLEJHB))
|
||||
|
||||
def test_BH_CrossCheck_bxr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'bxr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_byr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'byr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_bzr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'bzr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_bxi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'bxi', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_byi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'byi', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_bzi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'bzi', verbose=verbose, TOL=TOLEJHB))
|
||||
|
||||
def test_BH_CrossCheck_hxr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'hxr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_hyr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'hyr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_hzr(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'hzr', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_hxi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'hxi', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_hyi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'hyi', verbose=verbose, TOL=TOLEJHB))
|
||||
def test_BH_CrossCheck_hzi(self):
|
||||
self.assertTrue(crossCheckTest(SrcList, 'b', 'h', 'hzi', verbose=verbose, TOL=TOLEJHB))
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -6,7 +6,7 @@ from scipy.constants import mu_0
|
||||
from SimPEG.EM.Utils.testingUtils import getFDEMProblem
|
||||
|
||||
testE = True
|
||||
testB = False
|
||||
testB = True
|
||||
|
||||
verbose = False
|
||||
|
||||
@@ -72,30 +72,30 @@ class FDEM_AdjointTests(unittest.TestCase):
|
||||
def test_Jtvec_adjointTest_bzi_Eform(self):
|
||||
self.assertTrue(adjointTest('e', 'bzi'))
|
||||
|
||||
def test_Jtvec_adjointTest_exr_Eform(self):
|
||||
def test_Jtvec_adjointTest_jxr_Eform(self):
|
||||
self.assertTrue(adjointTest('e', 'jxr'))
|
||||
def test_Jtvec_adjointTest_eyr_Eform(self):
|
||||
def test_Jtvec_adjointTest_jyr_Eform(self):
|
||||
self.assertTrue(adjointTest('e', 'jyr'))
|
||||
def test_Jtvec_adjointTest_ezr_Eform(self):
|
||||
def test_Jtvec_adjointTest_jzr_Eform(self):
|
||||
self.assertTrue(adjointTest('e', 'jzr'))
|
||||
def test_Jtvec_adjointTest_exi_Eform(self):
|
||||
def test_Jtvec_adjointTest_jxi_Eform(self):
|
||||
self.assertTrue(adjointTest('e', 'jxi'))
|
||||
def test_Jtvec_adjointTest_eyi_Eform(self):
|
||||
def test_Jtvec_adjointTest_jyi_Eform(self):
|
||||
self.assertTrue(adjointTest('e', 'jyi'))
|
||||
def test_Jtvec_adjointTest_ezi_Eform(self):
|
||||
def test_Jtvec_adjointTest_jzi_Eform(self):
|
||||
self.assertTrue(adjointTest('e', 'jzi'))
|
||||
|
||||
def test_Jtvec_adjointTest_bxr_Eform(self):
|
||||
def test_Jtvec_adjointTest_hxr_Eform(self):
|
||||
self.assertTrue(adjointTest('e', 'hxr'))
|
||||
def test_Jtvec_adjointTest_byr_Eform(self):
|
||||
def test_Jtvec_adjointTest_hyr_Eform(self):
|
||||
self.assertTrue(adjointTest('e', 'hyr'))
|
||||
def test_Jtvec_adjointTest_bzr_Eform(self):
|
||||
def test_Jtvec_adjointTest_hzr_Eform(self):
|
||||
self.assertTrue(adjointTest('e', 'hzr'))
|
||||
def test_Jtvec_adjointTest_bxi_Eform(self):
|
||||
def test_Jtvec_adjointTest_hxi_Eform(self):
|
||||
self.assertTrue(adjointTest('e', 'hxi'))
|
||||
def test_Jtvec_adjointTest_byi_Eform(self):
|
||||
def test_Jtvec_adjointTest_hyi_Eform(self):
|
||||
self.assertTrue(adjointTest('e', 'hyi'))
|
||||
def test_Jtvec_adjointTest_bzi_Eform(self):
|
||||
def test_Jtvec_adjointTest_hzi_Eform(self):
|
||||
self.assertTrue(adjointTest('e', 'hzi'))
|
||||
|
||||
if testB:
|
||||
@@ -125,6 +125,32 @@ class FDEM_AdjointTests(unittest.TestCase):
|
||||
def test_Jtvec_adjointTest_bzi_Bform(self):
|
||||
self.assertTrue(adjointTest('b', 'bzi'))
|
||||
|
||||
def test_Jtvec_adjointTest_jxr_Bform(self):
|
||||
self.assertTrue(adjointTest('b', 'jxr'))
|
||||
def test_Jtvec_adjointTest_jyr_Bform(self):
|
||||
self.assertTrue(adjointTest('b', 'jyr'))
|
||||
def test_Jtvec_adjointTest_jzr_Bform(self):
|
||||
self.assertTrue(adjointTest('b', 'jzr'))
|
||||
def test_Jtvec_adjointTest_jxi_Bform(self):
|
||||
self.assertTrue(adjointTest('b', 'jxi'))
|
||||
def test_Jtvec_adjointTest_jyi_Bform(self):
|
||||
self.assertTrue(adjointTest('b', 'jyi'))
|
||||
def test_Jtvec_adjointTest_jzi_Bform(self):
|
||||
self.assertTrue(adjointTest('b', 'jzi'))
|
||||
|
||||
def test_Jtvec_adjointTest_hxr_Bform(self):
|
||||
self.assertTrue(adjointTest('b', 'hxr'))
|
||||
def test_Jtvec_adjointTest_hyr_Bform(self):
|
||||
self.assertTrue(adjointTest('b', 'hyr'))
|
||||
def test_Jtvec_adjointTest_hzr_Bform(self):
|
||||
self.assertTrue(adjointTest('b', 'hzr'))
|
||||
def test_Jtvec_adjointTest_hxi_Bform(self):
|
||||
self.assertTrue(adjointTest('b', 'hxi'))
|
||||
def test_Jtvec_adjointTest_hyi_Bform(self):
|
||||
self.assertTrue(adjointTest('b', 'hyi'))
|
||||
def test_Jtvec_adjointTest_hzi_Bform(self):
|
||||
self.assertTrue(adjointTest('b', 'hzi'))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
@@ -7,7 +7,7 @@ from SimPEG.EM.Utils.testingUtils import getFDEMProblem
|
||||
|
||||
testDerivs = True
|
||||
testE = True
|
||||
testB = False
|
||||
testB = True
|
||||
testHJ = False
|
||||
|
||||
verbose = False
|
||||
@@ -98,31 +98,57 @@ class FDEM_DerivTests(unittest.TestCase):
|
||||
self.assertTrue(derivTest('e', 'hzi'))
|
||||
|
||||
if testB:
|
||||
def test_Jvec_exr_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'exr'))
|
||||
def test_Jvec_eyr_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'eyr'))
|
||||
def test_Jvec_ezr_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'ezr'))
|
||||
def test_Jvec_exi_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'exi'))
|
||||
def test_Jvec_eyi_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'eyi'))
|
||||
def test_Jvec_ezi_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'ezi'))
|
||||
# def test_Jvec_exr_Bform(self):
|
||||
# self.assertTrue(derivTest('b', 'exr'))
|
||||
# def test_Jvec_eyr_Bform(self):
|
||||
# self.assertTrue(derivTest('b', 'eyr'))
|
||||
# def test_Jvec_ezr_Bform(self):
|
||||
# self.assertTrue(derivTest('b', 'ezr'))
|
||||
# def test_Jvec_exi_Bform(self):
|
||||
# self.assertTrue(derivTest('b', 'exi'))
|
||||
# def test_Jvec_eyi_Bform(self):
|
||||
# self.assertTrue(derivTest('b', 'eyi'))
|
||||
# def test_Jvec_ezi_Bform(self):
|
||||
# self.assertTrue(derivTest('b', 'ezi'))
|
||||
|
||||
def test_Jvec_bxr_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'bxr'))
|
||||
def test_Jvec_byr_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'byr'))
|
||||
def test_Jvec_bzr_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'bzr'))
|
||||
def test_Jvec_bxi_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'bxi'))
|
||||
def test_Jvec_byi_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'byi'))
|
||||
def test_Jvec_bzi_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'bzi'))
|
||||
# def test_Jvec_bxr_Bform(self):
|
||||
# self.assertTrue(derivTest('b', 'bxr'))
|
||||
# def test_Jvec_byr_Bform(self):
|
||||
# self.assertTrue(derivTest('b', 'byr'))
|
||||
# def test_Jvec_bzr_Bform(self):
|
||||
# self.assertTrue(derivTest('b', 'bzr'))
|
||||
# def test_Jvec_bxi_Bform(self):
|
||||
# self.assertTrue(derivTest('b', 'bxi'))
|
||||
# def test_Jvec_byi_Bform(self):
|
||||
# self.assertTrue(derivTest('b', 'byi'))
|
||||
# def test_Jvec_bzi_Bform(self):
|
||||
# self.assertTrue(derivTest('b', 'bzi'))
|
||||
|
||||
def test_Jvec_jxr_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'jxr'))
|
||||
def test_Jvec_jyr_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'jyr'))
|
||||
def test_Jvec_jzr_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'jzr'))
|
||||
def test_Jvec_jxi_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'jxi'))
|
||||
def test_Jvec_jyi_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'jyi'))
|
||||
def test_Jvec_jzi_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'jzi'))
|
||||
|
||||
def test_Jvec_hxr_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'hxr'))
|
||||
def test_Jvec_hyr_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'hyr'))
|
||||
def test_Jvec_hzr_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'hzr'))
|
||||
def test_Jvec_hxi_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'hxi'))
|
||||
def test_Jvec_hyi_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'hyi'))
|
||||
def test_Jvec_hzi_Bform(self):
|
||||
self.assertTrue(derivTest('b', 'hzi'))
|
||||
|
||||
if testHJ:
|
||||
def test_Jvec_jxr_Jform(self):
|
||||
|
||||
Reference in New Issue
Block a user