Projections and derivatives working.

This commit is contained in:
rowanc1
2014-03-22 13:22:44 -07:00
parent b7d47bcf38
commit 9acaae66db
4 changed files with 55 additions and 73 deletions
+3 -2
View File
@@ -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)
+3 -4
View File
@@ -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))