mirror of
https://github.com/wassname/simpeg.git
synced 2026-09-12 12:51:28 +08:00
Projections and derivatives working.
This commit is contained in:
@@ -70,8 +70,9 @@ class FDEM_DerivTests_e(unittest.TestCase):
|
||||
|
||||
m = self.sigma
|
||||
u = self.prb.fields(m)
|
||||
vJw = v.dot(self.prb.Jvec(m, w, u=u))
|
||||
wJtv = w.dot(self.prb.Jtvec(m, v, u=u))
|
||||
vJw = np.vdot(v, self.prb.Jvec(m, w, u=u))
|
||||
wJtv = np.vdot(w, self.prb.Jtvec(m, v, u=u))
|
||||
print 'Jtvec: ', vJw - wJtv
|
||||
self.assertTrue(vJw - wJtv < TOL)
|
||||
|
||||
|
||||
|
||||
@@ -100,17 +100,16 @@ class FieldsTest(unittest.TestCase):
|
||||
|
||||
Txs = F.survey.getTransmitters(freq)
|
||||
for ii, tx in enumerate(Txs):
|
||||
dat = tx.projectFields(self.mesh, F)
|
||||
self.assertTrue(dat.dtype == float)
|
||||
dat = dat.reshape((self.XYZ.shape[0], len(tx.rxList)), order='F')
|
||||
for jj, rx in enumerate(tx.rxList):
|
||||
dat = rx.projectFields(tx, self.mesh, F)
|
||||
self.assertTrue(dat.dtype == float)
|
||||
fieldType = rx.projField
|
||||
u = {'b':b[:,ii], 'e': e[:,ii]}[fieldType]
|
||||
real_or_imag = rx.projComp
|
||||
u = getattr(u, real_or_imag)
|
||||
gloc = rx.projGLoc
|
||||
d = self.mesh.getInterpolationMat(self.XYZ, gloc)*u
|
||||
self.assertTrue(np.all(dat[:, jj] == d))
|
||||
self.assertTrue(np.all(dat == d))
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user