mirror of
https://github.com/wassname/simpeg.git
synced 2026-08-18 12:30:39 +08:00
- each of e,b,h,j from every formulation. Currently, b from j is first order
- removed CCV primary and secondary (dangerous the way it was previously done) - NOTE: Source derive may not be properly taken care of yet
This commit is contained in:
+138
-198
@@ -178,11 +178,7 @@ class Fields_e(Fields):
|
|||||||
'bPrimary' : ['eSolution','F','_bPrimary'],
|
'bPrimary' : ['eSolution','F','_bPrimary'],
|
||||||
'bSecondary' : ['eSolution','F','_bSecondary'],
|
'bSecondary' : ['eSolution','F','_bSecondary'],
|
||||||
'j' : ['eSolution','CCV','_j'],
|
'j' : ['eSolution','CCV','_j'],
|
||||||
'jPrimary' : ['eSolution','CCV','_jPrimary'],
|
|
||||||
'jSecondary' : ['eSolution','CCV','_jSecondary'],
|
|
||||||
'h' : ['eSolution','CCV','_h'],
|
'h' : ['eSolution','CCV','_h'],
|
||||||
'hPrimary' : ['eSolution','CCV','_hPrimary'],
|
|
||||||
'hSecondary' : ['eSolution','CCV','_hSecondary'],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, mesh, survey, **kwargs):
|
def __init__(self, mesh, survey, **kwargs):
|
||||||
@@ -219,7 +215,7 @@ class Fields_e(Fields):
|
|||||||
:return: primary electric field as defined by the sources
|
:return: primary electric field as defined by the sources
|
||||||
"""
|
"""
|
||||||
|
|
||||||
ePrimary = np.zeros([self.prob.mesh.nE,len(srcList)])
|
ePrimary = np.zeros([self.prob.mesh.nE,len(srcList)], dtype = complex)
|
||||||
for i, src in enumerate(srcList):
|
for i, src in enumerate(srcList):
|
||||||
ep = src.ePrimary(self.prob)
|
ep = src.ePrimary(self.prob)
|
||||||
ePrimary[:,i] = ePrimary[:,i] + ep
|
ePrimary[:,i] = ePrimary[:,i] + ep
|
||||||
@@ -274,7 +270,7 @@ class Fields_e(Fields):
|
|||||||
:return: primary magnetic flux density as defined by the sources
|
:return: primary magnetic flux density as defined by the sources
|
||||||
"""
|
"""
|
||||||
|
|
||||||
bPrimary = np.zeros([self._edgeCurl.shape[0],eSolution.shape[1]],dtype = complex)
|
bPrimary = np.zeros([self._edgeCurl.shape[0],eSolution.shape[1]], dtype = complex)
|
||||||
for i, src in enumerate(srcList):
|
for i, src in enumerate(srcList):
|
||||||
bp = src.bPrimary(self.prob)
|
bp = src.bPrimary(self.prob)
|
||||||
bPrimary[:,i] = bPrimary[:,i] + bp
|
bPrimary[:,i] = bPrimary[:,i] + bp
|
||||||
@@ -329,34 +325,19 @@ class Fields_e(Fields):
|
|||||||
S_mDeriv, _ = src.evalDeriv(self.prob, v, adjoint)
|
S_mDeriv, _ = src.evalDeriv(self.prob, v, adjoint)
|
||||||
return 1./(1j * omega(src.freq)) * S_mDeriv
|
return 1./(1j * omega(src.freq)) * S_mDeriv
|
||||||
|
|
||||||
|
def _j(self, eSolution, srcList):
|
||||||
def _jPrimary(self, eSolution, srcList):
|
|
||||||
"""
|
"""
|
||||||
Primary current density
|
Current density from eSolution
|
||||||
|
|
||||||
:param numpy.ndarray eSolution: field we solved for
|
:param numpy.ndarray eSolution: field we solved for
|
||||||
:param list srcList: list of sources
|
:param list srcList: list of sources
|
||||||
:rtype: numpy.ndarray
|
:rtype: numpy.ndarray
|
||||||
:return: primary current density
|
:return: current density
|
||||||
"""
|
"""
|
||||||
aveE2CCV = self._aveE2CCV
|
aveE2CCV = self._aveE2CCV
|
||||||
n = int(aveE2CCV.shape[0] / self._nC) # number of components (instead of checking if cyl or not)
|
n = int(aveE2CCV.shape[0] / self._nC) # number of components (instead of checking if cyl or not)
|
||||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||||
return VI * (aveE2CCV * (self._MeSigma * self._ePrimary(eSolution, srcList)) )
|
return VI * (aveE2CCV * (self._MeSigma * self._e(eSolution,srcList) ) )
|
||||||
|
|
||||||
def _jSecondary(self, eSolution, srcList):
|
|
||||||
"""
|
|
||||||
Secondary current density from eSolution
|
|
||||||
|
|
||||||
:param numpy.ndarray eSolution: field we solved for
|
|
||||||
:param list srcList: list of sources
|
|
||||||
:rtype: numpy.ndarray
|
|
||||||
:return: secondary current density
|
|
||||||
"""
|
|
||||||
aveE2CCV = self._aveE2CCV
|
|
||||||
n = int(aveE2CCV.shape[0] / self._nC) # number of components (instead of checking if cyl or not)
|
|
||||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
|
||||||
return VI * (aveE2CCV * (self._MeSigma * eSolution) )
|
|
||||||
|
|
||||||
def _jDeriv_u(self, src, du_dm_v, adjoint = False):
|
def _jDeriv_u(self, src, du_dm_v, adjoint = False):
|
||||||
"""
|
"""
|
||||||
@@ -396,33 +377,19 @@ class Fields_e(Fields):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _hPrimary(self, eSolution, srcList):
|
def _h(self, eSolution, srcList):
|
||||||
"""
|
"""
|
||||||
Primary magnetic field
|
Magnetic field from eSolution
|
||||||
|
|
||||||
:param numpy.ndarray eSolution: field we solved for
|
:param numpy.ndarray eSolution: field we solved for
|
||||||
:param list srcList: list of sources
|
:param list srcList: list of sources
|
||||||
:rtype: numpy.ndarray
|
:rtype: numpy.ndarray
|
||||||
:return: primary magnetic field
|
:return: magnetic field
|
||||||
"""
|
"""
|
||||||
n = int(self._aveF2CCV.shape[0] / self._nC) # Number of Components
|
n = int(self._aveF2CCV.shape[0] / self._nC) # Number of Components
|
||||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||||
|
|
||||||
return VI * (self._aveF2CCV * (self._MfMui * self._bPrimary(eSolution, srcList)))
|
return VI * (self._aveF2CCV * (self._MfMui * self._b(eSolution, srcList)))
|
||||||
|
|
||||||
def _hSecondary(self, eSolution, srcList):
|
|
||||||
"""
|
|
||||||
Secondary magnetic field from eSolution
|
|
||||||
|
|
||||||
:param numpy.ndarray eSolution: 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(eSolution, srcList)))
|
|
||||||
|
|
||||||
def _hDeriv_u(self, src, du_dm_v, adjoint = False):
|
def _hDeriv_u(self, src, du_dm_v, adjoint = False):
|
||||||
"""
|
"""
|
||||||
@@ -477,11 +444,7 @@ class Fields_b(Fields):
|
|||||||
'ePrimary' : ['bSolution','E','_ePrimary'],
|
'ePrimary' : ['bSolution','E','_ePrimary'],
|
||||||
'eSecondary' : ['bSolution','E','_eSecondary'],
|
'eSecondary' : ['bSolution','E','_eSecondary'],
|
||||||
'j' : ['bSolution','CCV','_j'],
|
'j' : ['bSolution','CCV','_j'],
|
||||||
'jPrimary' : ['bSolution','CCV','_jPrimary'],
|
|
||||||
'jSecondary' : ['bSolution','CCV','_jSecondary'],
|
|
||||||
'h' : ['bSolution','CCV','_h'],
|
'h' : ['bSolution','CCV','_h'],
|
||||||
'hPrimary' : ['bSolution','CCV','_hPrimary'],
|
|
||||||
'hSecondary' : ['bSolution','CCV','_hSecondary'],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self,mesh,survey,**kwargs):
|
def __init__(self,mesh,survey,**kwargs):
|
||||||
@@ -490,8 +453,10 @@ class Fields_b(Fields):
|
|||||||
def startup(self):
|
def startup(self):
|
||||||
self.prob = self.survey.prob
|
self.prob = self.survey.prob
|
||||||
self._edgeCurl = self.survey.prob.mesh.edgeCurl
|
self._edgeCurl = self.survey.prob.mesh.edgeCurl
|
||||||
|
self._MeSigma = self.survey.prob.MeSigma
|
||||||
self._MeSigmaI = self.survey.prob.MeSigmaI
|
self._MeSigmaI = self.survey.prob.MeSigmaI
|
||||||
self._MfMui = self.survey.prob.MfMui
|
self._MfMui = self.survey.prob.MfMui
|
||||||
|
self._MeSigmaDeriv = self.survey.prob.MeSigmaDeriv
|
||||||
self._MeSigmaIDeriv = self.survey.prob.MeSigmaIDeriv
|
self._MeSigmaIDeriv = self.survey.prob.MeSigmaIDeriv
|
||||||
self._Me = self.survey.prob.Me
|
self._Me = self.survey.prob.Me
|
||||||
self._aveF2CCV = self.survey.prob.mesh.aveF2CCV
|
self._aveF2CCV = self.survey.prob.mesh.aveF2CCV
|
||||||
@@ -522,7 +487,7 @@ class Fields_b(Fields):
|
|||||||
:return: primary electric field as defined by the sources
|
:return: primary electric field as defined by the sources
|
||||||
"""
|
"""
|
||||||
|
|
||||||
bPrimary = np.zeros([self.prob.mesh.nF,len(srcList)])
|
bPrimary = np.zeros([self.prob.mesh.nF,len(srcList)], dtype = complex)
|
||||||
for i, src in enumerate(srcList):
|
for i, src in enumerate(srcList):
|
||||||
bp = src.bPrimary(self.prob)
|
bp = src.bPrimary(self.prob)
|
||||||
bPrimary[:,i] = bPrimary[:,i] + bp
|
bPrimary[:,i] = bPrimary[:,i] + bp
|
||||||
@@ -578,7 +543,7 @@ class Fields_b(Fields):
|
|||||||
:return: primary electric field as defined by the sources
|
:return: primary electric field as defined by the sources
|
||||||
"""
|
"""
|
||||||
|
|
||||||
ePrimary = np.zeros([self._edgeCurl.shape[1],bSolution.shape[1]],dtype = complex)
|
ePrimary = np.zeros([self._edgeCurl.shape[1],bSolution.shape[1]], dtype = complex)
|
||||||
for i,src in enumerate(srcList):
|
for i,src in enumerate(srcList):
|
||||||
ep = src.ePrimary(self.prob)
|
ep = src.ePrimary(self.prob)
|
||||||
ePrimary[:,i] = ePrimary[:,i] + ep
|
ePrimary[:,i] = ePrimary[:,i] + ep
|
||||||
@@ -594,11 +559,12 @@ class Fields_b(Fields):
|
|||||||
:return: secondary electric field
|
:return: secondary electric field
|
||||||
"""
|
"""
|
||||||
|
|
||||||
e = self._MeSigmaI * ( self._edgeCurl.T * ( self._MfMui * bSolution))
|
v = ( self._edgeCurl.T * ( self._MfMui * bSolution))
|
||||||
for i,src in enumerate(srcList):
|
for i,src in enumerate(srcList):
|
||||||
_,S_e = src.eval(self.prob)
|
_,S_e = src.eval(self.prob)
|
||||||
e[:,i] = e[:,i] + -self._MeSigmaI * S_e
|
v[:,i] = v[:,i] + - S_e
|
||||||
return e
|
|
||||||
|
return self._MeSigmaI * v
|
||||||
|
|
||||||
def _eDeriv_u(self, src, du_dm_v, adjoint=False):
|
def _eDeriv_u(self, src, du_dm_v, adjoint=False):
|
||||||
"""
|
"""
|
||||||
@@ -636,24 +602,9 @@ class Fields_b(Fields):
|
|||||||
|
|
||||||
if adjoint:
|
if adjoint:
|
||||||
return self._MeSigmaIDeriv(w).T * v - self._MeSigmaI.T * S_eDeriv
|
return self._MeSigmaIDeriv(w).T * v - self._MeSigmaI.T * S_eDeriv
|
||||||
return self._MeSigmaIDeriv(w) * v - self._MeSigmaI *S_eDeriv
|
return self._MeSigmaIDeriv(w) * v - self._MeSigmaI * S_eDeriv
|
||||||
|
|
||||||
|
def _j(self, bSolution, srcList):
|
||||||
def _jPrimary(self, bSolution, srcList):
|
|
||||||
"""
|
|
||||||
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
|
Secondary current density from bSolution
|
||||||
|
|
||||||
@@ -666,7 +617,8 @@ class Fields_b(Fields):
|
|||||||
n = int(self._aveE2CCV.shape[0] / self._nC) # number of components
|
n = int(self._aveE2CCV.shape[0] / self._nC) # number of components
|
||||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||||
|
|
||||||
return VI * (self._aveE2CCV * ( self._edgeCurl.T * ( self._MfMui * bSolution) ) )
|
return VI * (self._aveE2CCV * ( self._MeSigma * self._e(bSolution,srcList ) ) )
|
||||||
|
|
||||||
|
|
||||||
def _jDeriv_u(self, src, du_dm_v, adjoint=False):
|
def _jDeriv_u(self, src, du_dm_v, adjoint=False):
|
||||||
"""
|
"""
|
||||||
@@ -679,13 +631,10 @@ class Fields_b(Fields):
|
|||||||
:rtype: numpy.ndarray
|
:rtype: numpy.ndarray
|
||||||
:return: product of the derivative of the current density 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
|
||||||
"""
|
"""
|
||||||
|
|
||||||
n = int(self._aveE2CCV.shape[0] / self._nC) # number of components
|
n = int(self._aveE2CCV.shape[0] / self._nC) # number of components
|
||||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||||
|
return VI * (self._aveE2CCV * (self._edgeCurl.T * ( self._MfMui * du_dm_v ) ) )
|
||||||
|
|
||||||
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):
|
def _jDeriv_m(self, src, v, adjoint=False):
|
||||||
"""
|
"""
|
||||||
@@ -699,31 +648,18 @@ class Fields_b(Fields):
|
|||||||
"""
|
"""
|
||||||
return Zero()
|
return Zero()
|
||||||
|
|
||||||
def _hPrimary(self, bSolution, srcList):
|
def _h(self, bSolution, srcList):
|
||||||
"""
|
"""
|
||||||
Primary magnetic field
|
Magnetic field from bSolution
|
||||||
|
|
||||||
:param numpy.ndarray bSolution: field we solved for
|
:param numpy.ndarray bSolution: field we solved for
|
||||||
:param list srcList: list of sources
|
:param list srcList: list of sources
|
||||||
:rtype: numpy.ndarray
|
:rtype: numpy.ndarray
|
||||||
:return: primary magnetic field
|
:return: magnetic field
|
||||||
"""
|
"""
|
||||||
n = int(self._aveF2CCV.shape[0] / self._nC) #number of components
|
n = int(self._aveF2CCV.shape[0] / self._nC) #number of components
|
||||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||||
return VI * (self._aveF2CCV * (self._MfMui * self._bPrimary(bSolution, srcList)))
|
return VI * (self._aveF2CCV * (self._MfMui * self._b(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):
|
def _hDeriv_u(self, src, du_dm_v, adjoint=False):
|
||||||
"""
|
"""
|
||||||
@@ -756,8 +692,6 @@ class Fields_b(Fields):
|
|||||||
return Zero()
|
return Zero()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Fields_j(Fields):
|
class Fields_j(Fields):
|
||||||
"""
|
"""
|
||||||
Fields object for Problem_j.
|
Fields object for Problem_j.
|
||||||
@@ -775,11 +709,7 @@ class Fields_j(Fields):
|
|||||||
'hPrimary' : ['jSolution','E','_hPrimary'],
|
'hPrimary' : ['jSolution','E','_hPrimary'],
|
||||||
'hSecondary' : ['jSolution','E','_hSecondary'],
|
'hSecondary' : ['jSolution','E','_hSecondary'],
|
||||||
'e' : ['jSolution','CCV','_e'],
|
'e' : ['jSolution','CCV','_e'],
|
||||||
'ePrimary' : ['jSolution','CCV','_ePrimary'],
|
|
||||||
'eSecondary' : ['jSolution','CCV','_eSecondary'],
|
|
||||||
'b' : ['jSolution','CCV','_b'],
|
'b' : ['jSolution','CCV','_b'],
|
||||||
'bPrimary' : ['jSolution','CCV','_bPrimary'],
|
|
||||||
'bSecondary' : ['jSolution','CCV','_bSecondary'],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self,mesh,survey,**kwargs):
|
def __init__(self,mesh,survey,**kwargs):
|
||||||
@@ -818,7 +748,7 @@ class Fields_j(Fields):
|
|||||||
:return: primary current density as defined by the sources
|
:return: primary current density as defined by the sources
|
||||||
"""
|
"""
|
||||||
|
|
||||||
jPrimary = np.zeros_like(jSolution,dtype = complex)
|
jPrimary = np.zeros_like(jSolution, dtype = complex)
|
||||||
for i, src in enumerate(srcList):
|
for i, src in enumerate(srcList):
|
||||||
jp = src.jPrimary(self.prob)
|
jp = src.jPrimary(self.prob)
|
||||||
jPrimary[:,i] = jPrimary[:,i] + jp
|
jPrimary[:,i] = jPrimary[:,i] + jp
|
||||||
@@ -903,12 +833,12 @@ class Fields_j(Fields):
|
|||||||
:return: secondary magnetic field
|
:return: secondary magnetic field
|
||||||
"""
|
"""
|
||||||
|
|
||||||
h = self._MeMuI * (self._edgeCurl.T * (self._MfRho * jSolution) )
|
v = (self._edgeCurl.T * (self._MfRho * jSolution) )
|
||||||
for i, src in enumerate(srcList):
|
for i, src in enumerate(srcList):
|
||||||
h[:,i] *= -1./(1j*omega(src.freq))
|
h[:,i] *= -1./(1j*omega(src.freq))
|
||||||
S_m,_ = src.eval(self.prob)
|
S_m,_ = src.eval(self.prob)
|
||||||
h[:,i] = h[:,i]+ 1./(1j*omega(src.freq)) * self._MeMuI * (S_m)
|
h[:,i] = h[:,i]+ 1./(1j*omega(src.freq)) * (S_m)
|
||||||
return h
|
return self._MeMuI * v
|
||||||
|
|
||||||
|
|
||||||
def _hDeriv_u(self, src, du_dm_v, adjoint=False):
|
def _hDeriv_u(self, src, du_dm_v, adjoint=False):
|
||||||
@@ -922,9 +852,10 @@ class Fields_j(Fields):
|
|||||||
:return: product of the derivative of the magnetic field with respect to the field we solved for with a vector
|
:return: product of the derivative of the magnetic field with respect to the field we solved for with a vector
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not adjoint:
|
if adjoint:
|
||||||
return -1./(1j*omega(src.freq)) * self._MeMuI * (self._edgeCurl.T * (self._MfRho * du_dm_v) )
|
return -1./(1j*omega(src.freq)) * self._MfRho.T * (self._edgeCurl * ( self._MeMuI.T * du_dm_v))
|
||||||
return -1./(1j*omega(src.freq)) * self._MfRho.T * (self._edgeCurl * ( self._MeMuI.T * du_dm_v))
|
return -1./(1j*omega(src.freq)) * self._MeMuI * (self._edgeCurl.T * (self._MfRho * du_dm_v) )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _hDeriv_m(self, src, v, adjoint=False):
|
def _hDeriv_m(self, src, v, adjoint=False):
|
||||||
@@ -958,32 +889,18 @@ class Fields_j(Fields):
|
|||||||
|
|
||||||
return hDeriv_m
|
return hDeriv_m
|
||||||
|
|
||||||
|
def _e(self, jSolution, srcList):
|
||||||
def _ePrimary(self, jSolution, srcList):
|
|
||||||
"""
|
"""
|
||||||
Primary electric field
|
Electric field from jSolution
|
||||||
|
|
||||||
:param numpy.ndarray hSolution: field we solved for
|
:param numpy.ndarray hSolution: field we solved for
|
||||||
:param list srcList: list of sources
|
:param list srcList: list of sources
|
||||||
:rtype: numpy.ndarray
|
:rtype: numpy.ndarray
|
||||||
:return: primary electric field as defined by the sources
|
:return: electric 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._MfRho * self._jPrimary(jSolution, srcList)))
|
|
||||||
|
|
||||||
def _eSecondary(self, jSolution, srcList):
|
|
||||||
"""
|
|
||||||
Secondary electric field from jSolution
|
|
||||||
|
|
||||||
:param numpy.ndarray hSolution: field we solved for
|
|
||||||
:param list srcList: list of sources
|
|
||||||
:rtype: numpy.ndarray
|
|
||||||
:return: secondary electric field
|
|
||||||
"""
|
"""
|
||||||
n = int(self._aveF2CCV.shape[0] / self._nC) # number of components
|
n = int(self._aveF2CCV.shape[0] / self._nC) # number of components
|
||||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||||
return VI * (self._aveF2CCV * (self._MfRho * self._jSecondary(jSolution, srcList)))
|
return VI * (self._aveF2CCV * (self._MfRho * self._j(jSolution, srcList)))
|
||||||
|
|
||||||
def _eDeriv_u(self, src, du_dm_v, adjoint=False):
|
def _eDeriv_u(self, src, du_dm_v, adjoint=False):
|
||||||
"""
|
"""
|
||||||
@@ -1018,22 +935,7 @@ class Fields_j(Fields):
|
|||||||
return self._MfRhoDeriv(jSolution).T * ( self._aveF2CCV.T * ( VI.T * v ) )
|
return self._MfRhoDeriv(jSolution).T * ( self._aveF2CCV.T * ( VI.T * v ) )
|
||||||
return VI * (self._aveF2CCV * (self._MfRhoDeriv(jSolution) * v))
|
return VI * (self._aveF2CCV * (self._MfRhoDeriv(jSolution) * v))
|
||||||
|
|
||||||
def _bPrimary(self, jSolution, srcList):
|
def _b(self, jSolution, srcList):
|
||||||
"""
|
|
||||||
Primary magnetic flux density
|
|
||||||
|
|
||||||
:param numpy.ndarray hSolution: field we solved for
|
|
||||||
:param list srcList: list of sources
|
|
||||||
:rtype: numpy.ndarray
|
|
||||||
:return: primary magnetic flux density
|
|
||||||
"""
|
|
||||||
hPrimary = self._hPrimary(jSolution, srcList)
|
|
||||||
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._MeMu * hPrimary))
|
|
||||||
|
|
||||||
def _bSecondary(self, jSolution, srcList):
|
|
||||||
"""
|
"""
|
||||||
Secondary magnetic flux density from jSolution
|
Secondary magnetic flux density from jSolution
|
||||||
|
|
||||||
@@ -1045,7 +947,7 @@ class Fields_j(Fields):
|
|||||||
n = int(self._aveE2CCV.shape[0] / self._nC) # number of components
|
n = int(self._aveE2CCV.shape[0] / self._nC) # number of components
|
||||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||||
|
|
||||||
return VI * (self._aveE2CCV * (self._edgeCurl.T * (self._MfRho * jSolution)))
|
return VI * (self._aveE2CCV * ( self._MeMu * self._h(jSolution,srcList)) )
|
||||||
|
|
||||||
def _bDeriv_u(self, src, du_dm_v, adjoint=False):
|
def _bDeriv_u(self, src, du_dm_v, adjoint=False):
|
||||||
"""
|
"""
|
||||||
@@ -1099,8 +1001,8 @@ class Fields_h(Fields):
|
|||||||
'j' : ['hSolution','F','_j'],
|
'j' : ['hSolution','F','_j'],
|
||||||
'jPrimary' : ['hSolution','F','_jPrimary'],
|
'jPrimary' : ['hSolution','F','_jPrimary'],
|
||||||
'jSecondary' : ['hSolution','F','_jSecondary'],
|
'jSecondary' : ['hSolution','F','_jSecondary'],
|
||||||
'e' : ['hSolution','C','_e'],
|
'e' : ['hSolution','CCV','_e'],
|
||||||
'b' : ['hSolution','C','_b'],
|
'b' : ['hSolution','CCV','_b'],
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self,mesh,survey,**kwargs):
|
def __init__(self,mesh,survey,**kwargs):
|
||||||
@@ -1109,8 +1011,10 @@ class Fields_h(Fields):
|
|||||||
def startup(self):
|
def startup(self):
|
||||||
self.prob = self.survey.prob
|
self.prob = self.survey.prob
|
||||||
self._edgeCurl = self.survey.prob.mesh.edgeCurl
|
self._edgeCurl = self.survey.prob.mesh.edgeCurl
|
||||||
|
self._MeMu = self.survey.prob.MeMu
|
||||||
self._MeMuI = self.survey.prob.MeMuI
|
self._MeMuI = self.survey.prob.MeMuI
|
||||||
self._MfRho = self.survey.prob.MfRho
|
self._MfRho = self.survey.prob.MfRho
|
||||||
|
self._MfRhoDeriv = self.survey.prob.MfRhoDeriv
|
||||||
self._rho = self.survey.prob.curModel.rho
|
self._rho = self.survey.prob.curModel.rho
|
||||||
self._mu = self.survey.prob.curModel.mui
|
self._mu = self.survey.prob.curModel.mui
|
||||||
self._aveF2CCV = self.survey.prob.mesh.aveF2CCV
|
self._aveF2CCV = self.survey.prob.mesh.aveF2CCV
|
||||||
@@ -1202,7 +1106,7 @@ class Fields_h(Fields):
|
|||||||
|
|
||||||
def _jSecondary(self, hSolution, srcList):
|
def _jSecondary(self, hSolution, srcList):
|
||||||
"""
|
"""
|
||||||
Secondary current density from eSolution
|
Secondary current density from hSolution
|
||||||
|
|
||||||
:param numpy.ndarray hSolution: field we solved for
|
:param numpy.ndarray hSolution: field we solved for
|
||||||
:param list srcList: list of sources
|
:param list srcList: list of sources
|
||||||
@@ -1216,39 +1120,9 @@ class Fields_h(Fields):
|
|||||||
j[:,i] = j[:,i]+ -S_e
|
j[:,i] = j[:,i]+ -S_e
|
||||||
return j
|
return j
|
||||||
|
|
||||||
def _jSecondaryDeriv_u(self, src, du_dm_v, adjoint=False):
|
|
||||||
"""
|
|
||||||
Derivative of the secondary 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 secondary current density with respect to the field we solved for with a vector
|
|
||||||
"""
|
|
||||||
|
|
||||||
if not adjoint:
|
|
||||||
return self._edgeCurl*du_dm_v
|
|
||||||
elif adjoint:
|
|
||||||
return self._edgeCurl.T*du_dm_v
|
|
||||||
|
|
||||||
|
|
||||||
def _jSecondaryDeriv_m(self, src, v, adjoint=False):
|
|
||||||
"""
|
|
||||||
Derivative of the secondary 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 secondary current density derivative with respect to the inversion model with a vector
|
|
||||||
"""
|
|
||||||
|
|
||||||
_,S_eDeriv = src.evalDeriv(self.prob, v, adjoint)
|
|
||||||
|
|
||||||
def _jDeriv_u(self, src, du_dm_v, adjoint=False):
|
def _jDeriv_u(self, src, du_dm_v, adjoint=False):
|
||||||
"""
|
"""
|
||||||
Partial derivative of the total current density with respect to the thing we solved for
|
Derivative of the current density with respect to the thing we solved for
|
||||||
|
|
||||||
:param SimPEG.EM.FDEM.Src src: source
|
:param SimPEG.EM.FDEM.Src src: source
|
||||||
:param numpy.ndarray du_dm_v: vector to take product with
|
:param numpy.ndarray du_dm_v: vector to take product with
|
||||||
@@ -1257,47 +1131,113 @@ class Fields_h(Fields):
|
|||||||
:return: product of the derivative of the current density 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._jSecondaryDeriv_u(src,du_dm_v,adjoint)
|
if not adjoint:
|
||||||
|
return self._edgeCurl*du_dm_v
|
||||||
|
elif adjoint:
|
||||||
|
return self._edgeCurl.T*du_dm_v
|
||||||
|
|
||||||
|
|
||||||
def _jDeriv_m(self, src, v, adjoint=False):
|
def _jDeriv_m(self, src, v, adjoint=False):
|
||||||
"""
|
"""
|
||||||
Partial derivative of the total current 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 SimPEG.EM.FDEM.Src src: source
|
||||||
:param numpy.ndarray v: vector to take product with
|
:param numpy.ndarray v: vector to take product with
|
||||||
:param bool adjoint: adjoint?
|
:param bool adjoint: adjoint?
|
||||||
:rtype: SimPEG.Utils.Zero
|
:rtype: numpy.ndarray
|
||||||
:return: product of the current density with respect to the inversion model with a vector
|
:return: product of the current density derivative with respect to the inversion model with a vector
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# assuming the primary does not depend on the model
|
_,S_eDeriv = src.evalDeriv(self.prob, v, adjoint)
|
||||||
return self._jSecondaryDeriv_m(src,v,adjoint)
|
return -S_eDeriv
|
||||||
|
|
||||||
def _e(self, hSolution, srcList):
|
def _e(self, hSolution, srcList):
|
||||||
rho = self._rho
|
"""
|
||||||
aveF2CCV = self._aveF2CCV
|
Electric field from hSolution
|
||||||
n = int(self._aveF2CCV.shape[0] / self._nC) #TODO: This is a bit sloppy
|
|
||||||
|
:param numpy.ndarray hSolution: field we solved for
|
||||||
Rho = self.prob.MfRho
|
:param list srcList: list of sources
|
||||||
|
:rtype: numpy.ndarray
|
||||||
|
:return: electric field
|
||||||
|
"""
|
||||||
|
n = int(self._aveF2CCV.shape[0] / self._nC) #number of components
|
||||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||||
|
return VI * (self._aveF2CCV * (self._MfRho * self._j(hSolution, srcList)))
|
||||||
|
|
||||||
|
def _eDeriv_u(self, src, du_dm_v, adjoint=False):
|
||||||
|
"""
|
||||||
|
Derivative of the electric 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 electric 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))
|
||||||
|
if adjoint:
|
||||||
|
return self._edgeCurl.T * ( self._MfRho.T * ( self._aveF2CCV.T * ( VI.T * du_dm_v ) ) )
|
||||||
|
return VI * (self._aveF2CCV * (self._MfRho * self._edgeCurl * du_dm_v ))
|
||||||
|
|
||||||
j = self._j(hSolution, srcList)
|
def _eDeriv_m(self, src, v, adjoint=False):
|
||||||
|
"""
|
||||||
return VI * (aveF2CCV * (Rho * j))
|
Derivative of the electric field with respect to the inversion model.
|
||||||
|
|
||||||
def _eDeriv_u(self, src, u, v, adjoint=False):
|
:param SimPEG.EM.FDEM.Src src: source
|
||||||
raise NotImplementedError
|
:param numpy.ndarray v: vector to take product with
|
||||||
|
:param bool adjoint: adjoint?
|
||||||
def _eDeriv_m(self, src, u, v, adjoint=False):
|
:rtype: numpy.ndarray
|
||||||
raise NotImplementedError
|
:return: product of the electric field derivative with respect to the inversion model with a vector
|
||||||
|
"""
|
||||||
|
hSolution = Utils.mkvc(self[src,'hSolution'])
|
||||||
|
n = int(self._aveF2CCV.shape[0] / self._nC) #number of components
|
||||||
|
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||||
|
if adjoint:
|
||||||
|
return ( self._MfRhoDeriv(self._edgeCurl * hSolution).T * ( self._aveF2CCV.T * (VI.T * v) ) )
|
||||||
|
return VI * (self._aveF2CCV * (self._MfRhoDeriv(self._edgeCurl * hSolution) * v ))
|
||||||
|
|
||||||
def _b(self, hSolution, srcList):
|
def _b(self, hSolution, srcList):
|
||||||
|
"""
|
||||||
|
Magnetic flux density from hSolution
|
||||||
|
|
||||||
|
:param numpy.ndarray hSolution: field we solved for
|
||||||
|
:param list srcList: list of sources
|
||||||
|
:rtype: numpy.ndarray
|
||||||
|
:return: magnetic flux density
|
||||||
|
"""
|
||||||
h = self._h(hSolution, srcList)
|
h = self._h(hSolution, srcList)
|
||||||
Mu = self.prob.MeMu
|
n = int(self._aveE2CCV.shape[0] / self._nC) #number of components
|
||||||
aveE2CCV = self._aveE2CCV
|
|
||||||
n = int(aveE2CCV.shape[0] / self._nC) #TODO: This is a bit sloppy
|
|
||||||
# Mu = sdiag(sp.kron(np.ones(n), mu))
|
|
||||||
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
VI = sdiag(np.kron(np.ones(n), 1./self.prob.mesh.vol))
|
||||||
|
|
||||||
return VI * (aveE2CCV * (Mu * h))
|
return VI * (self._aveE2CCV * (self._MeMu * h))
|
||||||
|
|
||||||
|
def _bDeriv_u(self, src, du_dm_v, adjoint=False):
|
||||||
|
"""
|
||||||
|
Derivative of the magnetic flux 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 magnetic flux density with respect to the field we solved for with a vector
|
||||||
|
"""
|
||||||
|
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._MeMu.T * (self._aveE2CCV.T * ( VI.T * du_dm_v ))
|
||||||
|
return VI * (self._aveE2CCV * (self._MeMu * du_dm_v))
|
||||||
|
|
||||||
|
def _bDeriv_m(self, src, v, adjoint=False):
|
||||||
|
"""
|
||||||
|
Derivative of the magnetic flux 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 magnetic flux density derivative with respect to the inversion model with a vector
|
||||||
|
"""
|
||||||
|
return Zero()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ from scipy.constants import mu_0
|
|||||||
from SimPEG.EM.Utils.testingUtils import getFDEMProblem, crossCheckTest
|
from SimPEG.EM.Utils.testingUtils import getFDEMProblem, crossCheckTest
|
||||||
|
|
||||||
testEB = True
|
testEB = True
|
||||||
testHJ = False
|
testHJ = True
|
||||||
testEJ = True
|
testEJ = True
|
||||||
testBH = True
|
testBH = True
|
||||||
verbose = False
|
verbose = False
|
||||||
@@ -22,29 +22,29 @@ class FDEM_CrossCheck(unittest.TestCase):
|
|||||||
if testEB:
|
if testEB:
|
||||||
def test_EB_CrossCheck_exr_Eform(self):
|
def test_EB_CrossCheck_exr_Eform(self):
|
||||||
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'exr', verbose=verbose))
|
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'exr', verbose=verbose))
|
||||||
# def test_EB_CrossCheck_eyr_Eform(self):
|
def test_EB_CrossCheck_eyr_Eform(self):
|
||||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'eyr', verbose=verbose))
|
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'eyr', verbose=verbose))
|
||||||
# def test_EB_CrossCheck_ezr_Eform(self):
|
def test_EB_CrossCheck_ezr_Eform(self):
|
||||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'ezr', verbose=verbose))
|
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'ezr', verbose=verbose))
|
||||||
# def test_EB_CrossCheck_exi_Eform(self):
|
def test_EB_CrossCheck_exi_Eform(self):
|
||||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'exi', verbose=verbose))
|
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'exi', verbose=verbose))
|
||||||
# def test_EB_CrossCheck_eyi_Eform(self):
|
def test_EB_CrossCheck_eyi_Eform(self):
|
||||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'eyi', verbose=verbose))
|
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'eyi', verbose=verbose))
|
||||||
# def test_EB_CrossCheck_ezi_Eform(self):
|
def test_EB_CrossCheck_ezi_Eform(self):
|
||||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'ezi', verbose=verbose))
|
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'ezi', verbose=verbose))
|
||||||
|
|
||||||
# def test_EB_CrossCheck_bxr_Eform(self):
|
def test_EB_CrossCheck_bxr_Eform(self):
|
||||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'bxr', verbose=verbose))
|
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'bxr', verbose=verbose))
|
||||||
# def test_EB_CrossCheck_byr_Eform(self):
|
def test_EB_CrossCheck_byr_Eform(self):
|
||||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'byr', verbose=verbose))
|
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'byr', verbose=verbose))
|
||||||
# def test_EB_CrossCheck_bzr_Eform(self):
|
def test_EB_CrossCheck_bzr_Eform(self):
|
||||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'bzr', verbose=verbose))
|
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'bzr', verbose=verbose))
|
||||||
# def test_EB_CrossCheck_bxi_Eform(self):
|
def test_EB_CrossCheck_bxi_Eform(self):
|
||||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'bxi', verbose=verbose))
|
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'bxi', verbose=verbose))
|
||||||
# def test_EB_CrossCheck_byi_Eform(self):
|
def test_EB_CrossCheck_byi_Eform(self):
|
||||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'byi', verbose=verbose))
|
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'byi', verbose=verbose))
|
||||||
# def test_EB_CrossCheck_bzi_Eform(self):
|
def test_EB_CrossCheck_bzi_Eform(self):
|
||||||
# self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'bzi', verbose=verbose))
|
self.assertTrue(crossCheckTest(SrcList, 'e', 'b', 'bzi', verbose=verbose))
|
||||||
|
|
||||||
if testHJ:
|
if testHJ:
|
||||||
def test_HJ_CrossCheck_jxr_Jform(self):
|
def test_HJ_CrossCheck_jxr_Jform(self):
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import sys
|
|||||||
from scipy.constants import mu_0
|
from scipy.constants import mu_0
|
||||||
from SimPEG.EM.Utils.testingUtils import getFDEMProblem, crossCheckTest
|
from SimPEG.EM.Utils.testingUtils import getFDEMProblem, crossCheckTest
|
||||||
|
|
||||||
testEB = False
|
testEB = True
|
||||||
testHJ = True
|
testHJ = True
|
||||||
testEJ = False
|
testEJ = True
|
||||||
testBH = True
|
testBH = True
|
||||||
verbose = False
|
verbose = False
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import sys
|
|||||||
from scipy.constants import mu_0
|
from scipy.constants import mu_0
|
||||||
from SimPEG.EM.Utils.testingUtils import getFDEMProblem
|
from SimPEG.EM.Utils.testingUtils import getFDEMProblem
|
||||||
|
|
||||||
testEB = True
|
testJ = True
|
||||||
testHJ = True
|
testH = True
|
||||||
|
|
||||||
verbose = False
|
verbose = False
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ def adjointTest(fdemType, comp):
|
|||||||
|
|
||||||
class FDEM_AdjointTests(unittest.TestCase):
|
class FDEM_AdjointTests(unittest.TestCase):
|
||||||
|
|
||||||
if testHJ:
|
if testJ:
|
||||||
def test_Jtvec_adjointTest_jxr_Jform(self):
|
def test_Jtvec_adjointTest_jxr_Jform(self):
|
||||||
self.assertTrue(adjointTest('j', 'jxr'))
|
self.assertTrue(adjointTest('j', 'jxr'))
|
||||||
def test_Jtvec_adjointTest_jyr_Jform(self):
|
def test_Jtvec_adjointTest_jyr_Jform(self):
|
||||||
@@ -99,31 +99,58 @@ class FDEM_AdjointTests(unittest.TestCase):
|
|||||||
def test_Jtvec_adjointTest_bzi_Jform(self):
|
def test_Jtvec_adjointTest_bzi_Jform(self):
|
||||||
self.assertTrue(adjointTest('j', 'bzi'))
|
self.assertTrue(adjointTest('j', 'bzi'))
|
||||||
|
|
||||||
# def test_Jtvec_adjointTest_hxr_Hform(self):
|
if testH:
|
||||||
# self.assertTrue(adjointTest('h', 'hxr'))
|
def test_Jtvec_adjointTest_hxr_Hform(self):
|
||||||
# def test_Jtvec_adjointTest_hyr_Hform(self):
|
self.assertTrue(adjointTest('h', 'hxr'))
|
||||||
# self.assertTrue(adjointTest('h', 'hyr'))
|
def test_Jtvec_adjointTest_hyr_Hform(self):
|
||||||
# def test_Jtvec_adjointTest_hzr_Hform(self):
|
self.assertTrue(adjointTest('h', 'hyr'))
|
||||||
# self.assertTrue(adjointTest('h', 'hzr'))
|
def test_Jtvec_adjointTest_hzr_Hform(self):
|
||||||
# def test_Jtvec_adjointTest_hxi_Hform(self):
|
self.assertTrue(adjointTest('h', 'hzr'))
|
||||||
# self.assertTrue(adjointTest('h', 'hxi'))
|
def test_Jtvec_adjointTest_hxi_Hform(self):
|
||||||
# def test_Jtvec_adjointTest_hyi_Hform(self):
|
self.assertTrue(adjointTest('h', 'hxi'))
|
||||||
# self.assertTrue(adjointTest('h', 'hyi'))
|
def test_Jtvec_adjointTest_hyi_Hform(self):
|
||||||
# def test_Jtvec_adjointTest_hzi_Hform(self):
|
self.assertTrue(adjointTest('h', 'hyi'))
|
||||||
# self.assertTrue(adjointTest('h', 'hzi'))
|
def test_Jtvec_adjointTest_hzi_Hform(self):
|
||||||
|
self.assertTrue(adjointTest('h', 'hzi'))
|
||||||
|
|
||||||
# def test_Jtvec_adjointTest_hxr_Hform(self):
|
def test_Jtvec_adjointTest_jxr_Hform(self):
|
||||||
# self.assertTrue(adjointTest('h', 'jxr'))
|
self.assertTrue(adjointTest('h', 'jxr'))
|
||||||
# def test_Jtvec_adjointTest_hyr_Hform(self):
|
def test_Jtvec_adjointTest_jyr_Hform(self):
|
||||||
# self.assertTrue(adjointTest('h', 'jyr'))
|
self.assertTrue(adjointTest('h', 'jyr'))
|
||||||
# def test_Jtvec_adjointTest_hzr_Hform(self):
|
def test_Jtvec_adjointTest_jzr_Hform(self):
|
||||||
# self.assertTrue(adjointTest('h', 'jzr'))
|
self.assertTrue(adjointTest('h', 'jzr'))
|
||||||
# def test_Jtvec_adjointTest_hxi_Hform(self):
|
def test_Jtvec_adjointTest_jxi_Hform(self):
|
||||||
# self.assertTrue(adjointTest('h', 'jxi'))
|
self.assertTrue(adjointTest('h', 'jxi'))
|
||||||
# def test_Jtvec_adjointTest_hyi_Hform(self):
|
def test_Jtvec_adjointTest_jyi_Hform(self):
|
||||||
# self.assertTrue(adjointTest('h', 'jyi'))
|
self.assertTrue(adjointTest('h', 'jyi'))
|
||||||
# def test_Jtvec_adjointTest_hzi_Hform(self):
|
def test_Jtvec_adjointTest_jzi_Hform(self):
|
||||||
# self.assertTrue(adjointTest('h', 'jzi'))
|
self.assertTrue(adjointTest('h', 'jzi'))
|
||||||
|
|
||||||
|
def test_Jtvec_adjointTest_exr_Hform(self):
|
||||||
|
self.assertTrue(adjointTest('h', 'exr'))
|
||||||
|
def test_Jtvec_adjointTest_eyr_Hform(self):
|
||||||
|
self.assertTrue(adjointTest('h', 'eyr'))
|
||||||
|
def test_Jtvec_adjointTest_ezr_Hform(self):
|
||||||
|
self.assertTrue(adjointTest('h', 'ezr'))
|
||||||
|
def test_Jtvec_adjointTest_exi_Hform(self):
|
||||||
|
self.assertTrue(adjointTest('h', 'exi'))
|
||||||
|
def test_Jtvec_adjointTest_eyi_Hform(self):
|
||||||
|
self.assertTrue(adjointTest('h', 'eyi'))
|
||||||
|
def test_Jtvec_adjointTest_ezi_Hform(self):
|
||||||
|
self.assertTrue(adjointTest('h', 'ezi'))
|
||||||
|
|
||||||
|
def test_Jtvec_adjointTest_bxr_Hform(self):
|
||||||
|
self.assertTrue(adjointTest('h', 'bxr'))
|
||||||
|
def test_Jtvec_adjointTest_byr_Hform(self):
|
||||||
|
self.assertTrue(adjointTest('h', 'byr'))
|
||||||
|
def test_Jtvec_adjointTest_bzr_Hform(self):
|
||||||
|
self.assertTrue(adjointTest('h', 'bzr'))
|
||||||
|
def test_Jtvec_adjointTest_bxi_Hform(self):
|
||||||
|
self.assertTrue(adjointTest('h', 'bxi'))
|
||||||
|
def test_Jtvec_adjointTest_byi_Hform(self):
|
||||||
|
self.assertTrue(adjointTest('h', 'byi'))
|
||||||
|
def test_Jtvec_adjointTest_bzi_Hform(self):
|
||||||
|
self.assertTrue(adjointTest('h', 'bzi'))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
Reference in New Issue
Block a user