mirror of
https://github.com/wassname/simpeg.git
synced 2026-09-09 11:34:26 +08:00
- rx.projectFields --> rx.eval
- rx.projectFieldsDeriv --> rx.evalDeriv
This commit is contained in:
@@ -204,8 +204,8 @@ class TDEM_bDerivTests(unittest.TestCase):
|
||||
d = Survey.Data(survey,v=d_vec)
|
||||
|
||||
# Check that d.T*Q*f = f.T*Q.T*d
|
||||
V1 = d_vec.dot(survey.projectFieldsDeriv(None, v=f).tovec())
|
||||
V2 = f.tovec().dot(survey.projectFieldsDeriv(None, v=d, adjoint=True).tovec())
|
||||
V1 = d_vec.dot(survey.evalDeriv(None, v=f).tovec())
|
||||
V2 = f.tovec().dot(survey.evalDeriv(None, v=d, adjoint=True).tovec())
|
||||
|
||||
self.assertTrue((V1-V2)/np.abs(V1) < tol)
|
||||
|
||||
|
||||
@@ -108,8 +108,8 @@ class TDEM_bDerivTests(unittest.TestCase):
|
||||
d = Survey.Data(survey,v=d_vec)
|
||||
|
||||
# Check that d.T*Q*f = f.T*Q.T*d
|
||||
V1 = d_vec.dot(survey.projectFieldsDeriv(None, v=f).tovec())
|
||||
V2 = np.sum((f.tovec())*(survey.projectFieldsDeriv(None, v=d, adjoint=True).tovec()))
|
||||
V1 = d_vec.dot(survey.evalDeriv(None, v=f).tovec())
|
||||
V2 = np.sum((f.tovec())*(survey.evalDeriv(None, v=d, adjoint=True).tovec()))
|
||||
|
||||
self.assertTrue((V1-V2)/np.abs(V1) < 1e-6)
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ def appRes_TotalFieldNorm(sigmaHalf):
|
||||
fields = problem.fields(sigma)
|
||||
|
||||
# Project the data
|
||||
data = survey.projectFields(fields)
|
||||
data = survey.eval(fields)
|
||||
|
||||
# Calculate the app res and phs
|
||||
app_r = np.array(getAppResPhs(data))[:,0]
|
||||
@@ -88,7 +88,7 @@ def appPhs_TotalFieldNorm(sigmaHalf):
|
||||
fields = problem.fields(sigma)
|
||||
|
||||
# Project the data
|
||||
data = survey.projectFields(fields)
|
||||
data = survey.eval(fields)
|
||||
|
||||
# Calculate the app phs
|
||||
app_p = np.array(getAppResPhs(data))[:,1]
|
||||
@@ -106,7 +106,7 @@ def appRes_psFieldNorm(sigmaHalf):
|
||||
fields = problem.fields(sigma)
|
||||
|
||||
# Project the data
|
||||
data = survey.projectFields(fields)
|
||||
data = survey.eval(fields)
|
||||
|
||||
# Calculate the app res and phs
|
||||
app_r = np.array(getAppResPhs(data))[:,0]
|
||||
@@ -124,7 +124,7 @@ def appPhs_psFieldNorm(sigmaHalf):
|
||||
fields = problem.fields(sigma)
|
||||
|
||||
# Project the data
|
||||
data = survey.projectFields(fields)
|
||||
data = survey.eval(fields)
|
||||
|
||||
# Calculate the app phs
|
||||
app_p = np.array(getAppResPhs(data))[:,1]
|
||||
|
||||
@@ -210,7 +210,7 @@ def DerivProjfieldsTest(inputSetup,comp='All',freq=False):
|
||||
f = problem.fieldsPair(survey.mesh,survey)
|
||||
f[src,'e_pxSolution'] = u[:len(u)/2]
|
||||
f[src,'e_pySolution'] = u[len(u)/2::]
|
||||
return rx.projectFields(src,survey.mesh,f), lambda t: rx.projectFieldsDeriv(src,survey.mesh,f0,simpeg.mkvc(t,2))
|
||||
return rx.eval(src,survey.mesh,f), lambda t: rx.evalDeriv(src,survey.mesh,f0,simpeg.mkvc(t,2))
|
||||
|
||||
return simpeg.Tests.checkDerivative(fun, u0, num=3, plotIt=False, eps=FLR)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user