/[escript]/trunk/downunder/test/python/run_forward.py
ViewVC logotype

Diff of /trunk/downunder/test/python/run_forward.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 5554 by gross, Mon Mar 23 06:54:53 2015 UTC revision 5555 by caltinay, Tue Mar 24 06:31:43 2015 UTC
# Line 599  class TestMT2DModelTMMode(unittest.TestC Line 599  class TestMT2DModelTMMode(unittest.TestC
599          self.assertRaises(ValueError, MT2DModelTMMode, domain, omega, [(6.7,5)], Z_XY, eta=[1.,1.], w0=[2.,3.], Hx_bottom=complex(4.5,6) )          self.assertRaises(ValueError, MT2DModelTMMode, domain, omega, [(6.7,5)], Z_XY, eta=[1.,1.], w0=[2.,3.], Hx_bottom=complex(4.5,6) )
600    
601      def test_PDE(self):      def test_PDE(self):
602          omega=1.          omega=10.
603          mu0=0.123          mu0=0.123
604          RHO=0.15          RHO=0.15
605          k=cmath.sqrt(1j*omega*mu0/RHO)  # Hx=exp(k*z)          k=cmath.sqrt(1j*omega*mu0/RHO)  # Hx=exp(k*z)
# Line 682  class TestMT2DModelTMMode(unittest.TestC Line 682  class TestMT2DModelTMMode(unittest.TestC
682          acw=MT2DModelTMMode(domain, omega, x, Z_XY, eta, mu=mu0, tol=1e-9,  directSolver=True)          acw=MT2DModelTMMode(domain, omega, x, Z_XY, eta, mu=mu0, tol=1e-9,  directSolver=True)
683    
684          # this is the base line:          # this is the base line:
685          RHO0=1. # was 100.15          RHO0=2. # was 100.15
686          args0=acw.getArguments(RHO0)          args0=acw.getArguments(RHO0)
687          d0=acw.getDefect(RHO0, *args0)          d0=acw.getDefect(RHO0, *args0)
688          dg0=acw.getGradient(RHO0, *args0)          dg0=acw.getGradient(RHO0, *args0)
# Line 696  class TestMT2DModelTMMode(unittest.TestC Line 696  class TestMT2DModelTMMode(unittest.TestC
696          RHO1=RHO0+p          RHO1=RHO0+p
697          args1=acw.getArguments(RHO1)          args1=acw.getArguments(RHO1)
698          d1=acw.getDefect(RHO1, *args1)          d1=acw.getDefect(RHO1, *args1)
699          self.assertTrue( abs( d1-d0-integrate(dg0*p) ) < 1e-2  * abs(d1-d0) )          self.assertLess( abs( d1-d0-integrate(dg0*p) ), 1e-2  * abs(d1-d0) )
700    
701          # test 2          # test 2
702          p=exp(-length(X-(0.2,0.2))**2/10)*INC          p=exp(-length(X-(0.2,0.2))**2/10)*INC

Legend:
Removed from v.5554  
changed lines
  Added in v.5555

  ViewVC Help
Powered by ViewVC 1.1.26