/[escript]/trunk/finley/test/python/lumping_wave_test.py
ViewVC logotype

Diff of /trunk/finley/test/python/lumping_wave_test.py

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

revision 3379 by gross, Wed Nov 24 04:48:49 2010 UTC revision 5448 by jfenwick, Fri Feb 6 05:31:37 2015 UTC
# Line 4  Line 4 
4    
5  """  """
6    
7  ########################################################  ##############################################################################
8  #  #
9  # Copyright (c) 2003-2010 by University of Queensland  # Copyright (c) 2003-2015 by University of Queensland
10  # Earth Systems Science Computational Center (ESSCC)  # http://www.uq.edu.au
 # http://www.uq.edu.au/esscc  
11  #  #
12  # Primary Business: Queensland, Australia  # Primary Business: Queensland, Australia
13  # Licensed under the Open Software License version 3.0  # Licensed under the Open Software License version 3.0
14  # http://www.opensource.org/licenses/osl-3.0.php  # http://www.opensource.org/licenses/osl-3.0.php
15  #  #
16  ########################################################  # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
17    # Development 2012-2013 by School of Earth Sciences
18    # Development from 2014 by Centre for Geoscience Computing (GeoComp)
19    #
20    ##############################################################################
21    
22  __copyright__="""Copyright (c) 2003-2010 by University of Queensland  __copyright__="""Copyright (c) 2003-2015 by University of Queensland
23  Earth Systems Science Computational Center (ESSCC)  http://www.uq.edu.au
 http://www.uq.edu.au/esscc  
24  Primary Business: Queensland, Australia"""  Primary Business: Queensland, Australia"""
25  __license__="""Licensed under the Open Software License version 3.0  __license__="""Licensed under the Open Software License version 3.0
26  http://www.opensource.org/licenses/osl-3.0.php"""  http://www.opensource.org/licenses/osl-3.0.php"""
27  __url__="https://launchpad.net/escript-finley"  __url__="https://launchpad.net/escript-finley"
28    
29  from esys.escript import *  from esys.escript import *
30  from esys.escript.linearPDEs import LinearSinglePDE  from esys.escript.linearPDEs import LinearSinglePDE, SolverOptions
31  from esys.escript.pdetools import Locator  from esys.escript.pdetools import Locator
32  from esys import finley  from esys import finley
33  from math import pi  from math import pi
# Line 54  def runValetAcceleration(order): Line 56  def runValetAcceleration(order):
56     u_f=ref_u(x,0)     u_f=ref_u(x,0)
57        
58     mypde_HRZ=LinearSinglePDE(domain)     mypde_HRZ=LinearSinglePDE(domain)
59     mypde_HRZ.getSolverOptions().setSolverMethod(mypde_HRZ.getSolverOptions().HRZ_LUMPING)     mypde_HRZ.getSolverOptions().setSolverMethod(SolverOptions.HRZ_LUMPING)
60     mypde_HRZ.setValue(D=1,q=q)     mypde_HRZ.setValue(D=1,q=q)
61     u_HRZ_old=ref_u(x,-dt)     u_HRZ_old=ref_u(x,-dt)
62     u_HRZ=ref_u(x,0)     u_HRZ=ref_u(x,0)
63        
64     mypde_RS=LinearSinglePDE(domain)     mypde_RS=LinearSinglePDE(domain)
65     mypde_RS.getSolverOptions().setSolverMethod(mypde_RS.getSolverOptions().ROWSUM_LUMPING)     mypde_RS.getSolverOptions().setSolverMethod(SolverOptions.ROWSUM_LUMPING)
66     mypde_RS.setValue(D=1,q=q)     mypde_RS.setValue(D=1,q=q)
67     u_RS_old=ref_u(x,-dt)     u_RS_old=ref_u(x,-dt)
68     u_RS=ref_u(x,0)     u_RS=ref_u(x,0)
# Line 74  def runValetAcceleration(order): Line 76  def runValetAcceleration(order):
76     f_list=[l(u_f)]     f_list=[l(u_f)]
77     HRZ_list=[l(u_HRZ)]     HRZ_list=[l(u_HRZ)]
78     RS_list=[l(u_RS)]     RS_list=[l(u_RS)]
79     print t_list[-1], u_list[-1], f_list[-1], HRZ_list[-1] , RS_list[-1]     print(t_list[-1], u_list[-1], f_list[-1], HRZ_list[-1] , RS_list[-1])
80        
81     while t< 4/n/c:     while t< 4/n/c:
82         t+=dt         t+=dt
# Line 96  def runValetAcceleration(order): Line 98  def runValetAcceleration(order):
98         f_list.append(l(u_f))         f_list.append(l(u_f))
99         HRZ_list.append(l(u_HRZ))         HRZ_list.append(l(u_HRZ))
100         RS_list.append(l(u_RS))         RS_list.append(l(u_RS))
101         print t_list[-1], u_list[-1], f_list[-1], HRZ_list[-1] , RS_list[-1]         print(t_list[-1], u_list[-1], f_list[-1], HRZ_list[-1] , RS_list[-1])
102            
103        
104     import matplotlib.pyplot as plt     import matplotlib.pyplot as plt
# Line 128  def runValetDisplacement(order): Line 130  def runValetDisplacement(order):
130     u_f=ref_u(x,0)     u_f=ref_u(x,0)
131        
132     mypde_HRZ=LinearSinglePDE(domain)     mypde_HRZ=LinearSinglePDE(domain)
133     mypde_HRZ.getSolverOptions().setSolverMethod(mypde_HRZ.getSolverOptions().HRZ_LUMPING)     mypde_HRZ.getSolverOptions().setSolverMethod(SolverOptions.HRZ_LUMPING)
134     mypde_HRZ.setValue(D=1,q=q)     mypde_HRZ.setValue(D=1,q=q)
135     u_HRZ_old=ref_u(x,-dt)     u_HRZ_old=ref_u(x,-dt)
136     u_HRZ=ref_u(x,0)     u_HRZ=ref_u(x,0)
137        
138     mypde_RS=LinearSinglePDE(domain)     mypde_RS=LinearSinglePDE(domain)
139     mypde_RS.getSolverOptions().setSolverMethod(mypde_RS.getSolverOptions().ROWSUM_LUMPING)     mypde_RS.getSolverOptions().setSolverMethod(SolverOptions.ROWSUM_LUMPING)
140     mypde_RS.setValue(D=1,q=q)     mypde_RS.setValue(D=1,q=q)
141     u_RS_old=ref_u(x,-dt)     u_RS_old=ref_u(x,-dt)
142     u_RS=ref_u(x,0)     u_RS=ref_u(x,0)
# Line 148  def runValetDisplacement(order): Line 150  def runValetDisplacement(order):
150     f_list=[l(u_f)]     f_list=[l(u_f)]
151     HRZ_list=[l(u_HRZ)]     HRZ_list=[l(u_HRZ)]
152     RS_list=[l(u_RS)]     RS_list=[l(u_RS)]
153     print t_list[-1], u_list[-1], f_list[-1], HRZ_list[-1] , RS_list[-1]     print(t_list[-1], u_list[-1], f_list[-1], HRZ_list[-1] , RS_list[-1])
154        
155     while t< 4/n/c:     while t< 4/n/c:
156         t+=dt         t+=dt
# Line 166  def runValetDisplacement(order): Line 168  def runValetDisplacement(order):
168         f_list.append(l(u_f))         f_list.append(l(u_f))
169         HRZ_list.append(l(u_HRZ))         HRZ_list.append(l(u_HRZ))
170         RS_list.append(l(u_RS))         RS_list.append(l(u_RS))
171         print t_list[-1], u_list[-1], f_list[-1], HRZ_list[-1] , RS_list[-1]         print(t_list[-1], u_list[-1], f_list[-1], HRZ_list[-1] , RS_list[-1])
172            
173        
174     import matplotlib.pyplot as plt     import matplotlib.pyplot as plt

Legend:
Removed from v.3379  
changed lines
  Added in v.5448

  ViewVC Help
Powered by ViewVC 1.1.26