mirror of
https://github.com/wassname/simpeg.git
synced 2026-09-13 13:03:14 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39ddec8702 | ||
|
|
2fb0f3fbbb |
@@ -60,6 +60,20 @@ class Fields(SimPEG.Problem.Fields):
|
|||||||
|
|
||||||
return self._bPrimary(solution, srcList) + self._bSecondary(solution, srcList)
|
return self._bPrimary(solution, srcList) + self._bSecondary(solution, srcList)
|
||||||
|
|
||||||
|
def _bSecondary(self, solution, srcList):
|
||||||
|
"""
|
||||||
|
Total magnetic flux density is sum of primary and secondary
|
||||||
|
|
||||||
|
:param numpy.ndarray solution: field we solved for
|
||||||
|
:param list srcList: list of sources
|
||||||
|
:rtype: numpy.ndarray
|
||||||
|
:return: total magnetic flux density
|
||||||
|
"""
|
||||||
|
if getattr(self, '_bSecondary', None) is None:
|
||||||
|
raise NotImplementedError ('Getting b from %s is not implemented' %self.knownFields.keys()[0])
|
||||||
|
|
||||||
|
return self._bSecondary(solution, srcList)
|
||||||
|
|
||||||
def _h(self, solution, srcList):
|
def _h(self, solution, srcList):
|
||||||
"""
|
"""
|
||||||
Total magnetic field is sum of primary and secondary
|
Total magnetic field is sum of primary and secondary
|
||||||
@@ -124,6 +138,21 @@ class Fields(SimPEG.Problem.Fields):
|
|||||||
return self._bDeriv_u(src, v, adjoint), self._bDeriv_m(src, v, adjoint)
|
return self._bDeriv_u(src, v, adjoint), self._bDeriv_m(src, v, adjoint)
|
||||||
return np.array(self._bDeriv_u(src, du_dm_v, adjoint) + self._bDeriv_m(src, v, adjoint), dtype = complex)
|
return np.array(self._bDeriv_u(src, du_dm_v, adjoint) + self._bDeriv_m(src, v, adjoint), dtype = complex)
|
||||||
|
|
||||||
|
def _bSecondaryDeriv(self, src, du_dm_v, v, adjoint = False):
|
||||||
|
"""
|
||||||
|
Total derivative of b with respect to the inversion model. Returns :math:`d\mathbf{b}/d\mathbf{m}` for forward and (:math:`d\mathbf{b}/d\mathbf{u}`, :math:`d\mathb{u}/d\mathbf{m}`) for the adjoint
|
||||||
|
|
||||||
|
:param Src src: sorce
|
||||||
|
:param numpy.ndarray du_dm_v: derivative of the solution vector with respect to the model times a vector (is None for adjoint)
|
||||||
|
:param numpy.ndarray v: vector to take sensitivity product with
|
||||||
|
:param bool adjoint: adjoint?
|
||||||
|
:rtype: numpy.ndarray
|
||||||
|
:return: derivative times a vector (or tuple for adjoint)
|
||||||
|
"""
|
||||||
|
# TODO: modify when primary field is dependent on m
|
||||||
|
|
||||||
|
return self._bDeriv(src, du_dm_v, v, adjoint = adjoint)
|
||||||
|
|
||||||
def _hDeriv(self, src, du_dm_v, v, adjoint = False):
|
def _hDeriv(self, src, du_dm_v, v, adjoint = False):
|
||||||
"""
|
"""
|
||||||
Total derivative of h with respect to the inversion model. Returns :math:`d\mathbf{h}/d\mathbf{m}` for forward and (:math:`d\mathbf{h}/d\mathbf{u}`, :math:`d\mathb{u}/d\mathbf{m}`) for the adjoint
|
Total derivative of h with respect to the inversion model. Returns :math:`d\mathbf{h}/d\mathbf{m}` for forward and (:math:`d\mathbf{h}/d\mathbf{u}`, :math:`d\mathb{u}/d\mathbf{m}`) for the adjoint
|
||||||
@@ -471,6 +500,8 @@ class Fields3D_b(Fields):
|
|||||||
return 'E'
|
return 'E'
|
||||||
elif fieldType == 'b':
|
elif fieldType == 'b':
|
||||||
return 'F'
|
return 'F'
|
||||||
|
elif fieldType == 'bSecondary':
|
||||||
|
return 'F'
|
||||||
elif (fieldType == 'h') or (fieldType == 'j'):
|
elif (fieldType == 'h') or (fieldType == 'j'):
|
||||||
return'CCV'
|
return'CCV'
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -97,6 +97,19 @@ class Point_b(BaseRx):
|
|||||||
self.projField = 'b'
|
self.projField = 'b'
|
||||||
super(Point_b, self).__init__(locs, orientation, component)
|
super(Point_b, self).__init__(locs, orientation, component)
|
||||||
|
|
||||||
|
class Point_bSecondary(BaseRx):
|
||||||
|
"""
|
||||||
|
Magnetic flux FDEM receiver
|
||||||
|
|
||||||
|
:param numpy.ndarray locs: receiver locations (ie. :code:`np.r_[x,y,z]`)
|
||||||
|
:param string orientation: receiver orientation 'x', 'y' or 'z'
|
||||||
|
:param string component: real or imaginary component 'real' or 'imag'
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self, locs, orientation=None, component=None):
|
||||||
|
self.projField = 'bSecondary'
|
||||||
|
super(Point_bSecondary, self).__init__(locs, orientation, component)
|
||||||
|
|
||||||
|
|
||||||
class Point_h(BaseRx):
|
class Point_h(BaseRx):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user