/[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 5230 by caltinay, Tue Oct 28 07:38:38 2014 UTC revision 5235 by caltinay, Wed Oct 29 01:01:44 2014 UTC
# Line 231  class TestAcousticInversion(unittest.Tes Line 231  class TestAcousticInversion(unittest.Tes
231  class TestMT2DModelTEMode(unittest.TestCase):  class TestMT2DModelTEMode(unittest.TestCase):
232      def test_API(self):      def test_API(self):
233          from esys.ripley import Rectangle          from esys.ripley import Rectangle
234          domain=Rectangle(20,20)          domain=Rectangle(19, 19, d1=mpisize)
235          omega=2.          omega=2.
236          x=[ [0.2,0.5], [0.3,0.5] ]          x=[ [0.2,0.5], [0.3,0.5] ]
237          Z_XY=[ complex(1.2,1.5), complex(1.3,2.5) ]          Z_XY=[ complex(1.2,1.5), complex(1.3,2.5) ]
# Line 256  class TestMT2DModelTEMode(unittest.TestC Line 256  class TestMT2DModelTEMode(unittest.TestC
256          self.assertRaises(ValueError, MT2DModelTEMode, domain, omega, [(6.7,5)], Z_XY, eta=[1.,1.], w0=[2.,3.], E_x0=complex(4.5,6) )          self.assertRaises(ValueError, MT2DModelTEMode, domain, omega, [(6.7,5)], Z_XY, eta=[1.,1.], w0=[2.,3.], E_x0=complex(4.5,6) )
257    
258      def test_PDE(self):      def test_PDE(self):
           
259          omega=2.          omega=2.
260          mu0=0.123          mu0=0.123
261          SIGMA=15.          SIGMA=15.
262          k=cmath.sqrt(1j*omega*mu0*SIGMA)  # Ex=exp(k*z)          k=cmath.sqrt(1j*omega*mu0*SIGMA)  # Ex=exp(k*z)
263    
264          from esys.ripley import Rectangle          from esys.ripley import Rectangle
265          domain=Rectangle(200,200)          domain=Rectangle(199,199, d1=mpisize)
266    
267                    
268          IMP=cmath.sqrt(1j*omega*mu0/SIGMA)          IMP=cmath.sqrt(1j*omega*mu0/SIGMA)
# Line 276  class TestMT2DModelTEMode(unittest.TestC Line 275  class TestMT2DModelTEMode(unittest.TestC
275          Ex1_ex=exp(-k.real*z)*sin(-k.imag*z)          Ex1_ex=exp(-k.real*z)*sin(-k.imag*z)
276          Ex1_ex_z=(-k.real*sin(-k.imag*z)-k.imag*cos(-k.imag*z)) * exp(-k.real*z)          Ex1_ex_z=(-k.real*sin(-k.imag*z)-k.imag*cos(-k.imag*z)) * exp(-k.real*z)
277    
278          acw=MT2DModelTEMode(domain, omega, x, Z_XY, eta, mu=mu0, fixAtBottom=True, E_x0=Ex0_ex*[1.,0]+ Ex1_ex*[0,1.] )          acw=MT2DModelTEMode(domain, omega, x, Z_XY, eta, mu=mu0, fixAtBottom=True, E_x0=Ex0_ex*[1.,0]+ Ex1_ex*[0,1.], tol=1e-9)
279    
280          args=acw.getArguments(SIGMA)          args=acw.getArguments(SIGMA)
281          Ex=args[0]          Ex=args[0]
# Line 318  class TestMT2DModelTEMode(unittest.TestC Line 317  class TestMT2DModelTEMode(unittest.TestC
317          k=cmath.sqrt(1j*omega*mu0*SIGMA)  # Ex=exp(k*z)          k=cmath.sqrt(1j*omega*mu0*SIGMA)  # Ex=exp(k*z)
318    
319          from esys.ripley import Rectangle          from esys.ripley import Rectangle
320          domain=Rectangle(200,200)          domain=Rectangle(99,99, d1=mpisize)
321    
322                    
323          IMP=-cmath.sqrt(1j*omega*mu0/SIGMA)          IMP=-cmath.sqrt(1j*omega*mu0/SIGMA)
# Line 373  class TestSubsidence(unittest.TestCase): Line 372  class TestSubsidence(unittest.TestCase):
372          mu=1.          mu=1.
373    
374          from esys.ripley import Brick          from esys.ripley import Brick
375          domain=Brick(20,20,20)          domain=Brick(20,20,19, d2=mpisize)
376                    
377          xb=FunctionOnBoundary(domain).getX()          xb=FunctionOnBoundary(domain).getX()
378          m=whereZero(xb[2]-1)          m=whereZero(xb[2]-1)
# Line 399  class TestSubsidence(unittest.TestCase): Line 398  class TestSubsidence(unittest.TestCase):
398                    
399          INC=0.01          INC=0.01
400          from esys.ripley import Brick          from esys.ripley import Brick
401          domain=Brick(20,20,20*getMPISizeWorld() -1 , d2=getMPISizeWorld())          domain=Brick(20,20,20*mpisize-1 , d2=mpisize)
402                    
403          xb=FunctionOnBoundary(domain).getX()          xb=FunctionOnBoundary(domain).getX()
404          m=whereZero(xb[2]-1)          m=whereZero(xb[2]-1)
# Line 434  class TestSubsidence(unittest.TestCase): Line 433  class TestSubsidence(unittest.TestCase):
433  class TestIsostaticPressure(unittest.TestCase):  class TestIsostaticPressure(unittest.TestCase):
434      def test_all(self):      def test_all(self):
435          from esys.ripley import Brick          from esys.ripley import Brick
436          domain=Brick(50,50,20*getMPISizeWorld() - 1, d2=getMPISizeWorld())          domain=Brick(50,50,20*mpisize-1, d2=mpisize)
437    
438          ps=IsostaticPressure(domain, level0=1., coordinates=None)          ps=IsostaticPressure(domain, level0=1., coordinates=None)
439            

Legend:
Removed from v.5230  
changed lines
  Added in v.5235

  ViewVC Help
Powered by ViewVC 1.1.26