Changeset 7852

Ignore:
Timestamp:
Jun 16, 2010, 5:30:17 PM (13 years ago)
Message:

Moving calculation of limiters to numpy calculations

Location:
anuga_work/development/2010-projects/anuga_1d
Files:
12 edited

Unmodified
Removed
• anuga_work/development/2010-projects/anuga_1d/base/generic_mesh.py

 r7842 import numpy def interval_mesh(n, x_0=0.0, x_1=1.0): def uniform_mesh(n, x_0=0.0, x_1=1.0): """Create points, and boundary for a uniform mesh with n sub-interval ranging from x_0 to x_1

• anuga_work/development/2010-projects/anuga_1d/base/test_generic_domain.py

 r7840 from anuga_1d.generic.generic_domain import * from anuga_1d.base.generic_domain import * import numpy
• anuga_work/development/2010-projects/anuga_1d/base/util.py

 r7839 return a def  minmod(beta_p,beta_m): if (abs(beta_p) < abs(beta_m)) & (beta_p*beta_m > 0.0): phi = beta_p elif (abs(beta_m) < abs(beta_p)) & (beta_p*beta_m > 0.0): phi = beta_m else: phi = 0.0 return phi def  minmod_kurganov(a,b,c): from numpy import sign if sign(a)==sign(b)==sign(c): return sign(a)*min(abs(a),abs(b),abs(c)) else: return 0.0 def  maxmod(a,b): if (abs(a) > abs(b)) & (a*b > 0.0): phi = a elif (abs(b) > abs(a)) & (a*b > 0.0): phi = b else: phi = 0.0 return phi def vanleer(a,b): if abs(a)+abs(b) > 1e-12: return (a*abs(b)+abs(a)*b)/(abs(a)+abs(b)) else: return 0.0 def vanalbada(a,b): if a*a+b*b > 1e-12: return (a*a*b+a*b*b)/(a*a+b*b) else: return 0.0
• anuga_work/development/2010-projects/anuga_1d/channel/channel_domain.py

 r7842 from anuga_1d.generic.generic_domain import * from anuga_1d.base.generic_domain import * import numpy #Reduction operation for get_vertex_values from anuga_1d.generic.util import mean from anuga_1d.base.util import mean self.reduction = mean #self.reduction = min  #Looks better near steep slopes

 r7842 from anuga_1d.channel.channel_domain import * from anuga_1d.config import g, epsilon from anuga_1d.generic.generic_mesh import interval_mesh from anuga_1d.base.generic_mesh import interval_mesh
• anuga_work/development/2010-projects/anuga_1d/channel/profile_channel.py

 r7842 from anuga_1d.channel.channel_domain import * from anuga_1d.config import g, epsilon from anuga_1d.generic.generic_mesh import interval_mesh from anuga_1d.base.generic_mesh import uniform_mesh # Create domain with centroid points as defined above domain = Domain(*interval_mesh(N)) domain = Domain(*uniform_mesh(N)) domain.set_CFL(1.0) domain.set_limiter("vanleer") #domain.set_limiter("minmod") #domain.h0=0.0001
• anuga_work/development/2010-projects/anuga_1d/compile_all.py

 r7840 os.chdir('..') os.chdir('generic') os.chdir('base') execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')
• anuga_work/development/2010-projects/anuga_1d/sww/sww_boundary_conditions.py

 r7840 __date__ ="\$05/06/2010 5:44:05 PM\$" from anuga_1d.generic.generic_domain import * from anuga_1d.base.generic_domain import * class Dirichlet_boundary(Boundary):
• anuga_work/development/2010-projects/anuga_1d/sww/sww_domain.py

 r7840 import numpy from anuga_1d.generic.generic_domain import Generic_domain from anuga_1d.base.generic_domain import Generic_domain from sww_boundary_conditions import * from sww_forcing_terms import * #Reduction operation for get_vertex_values from anuga_1d.generic.util import mean from anuga_1d.base.util import mean self.reduction = mean #self.reduction = min  #Looks better near steep slopes
• anuga_work/development/2010-projects/anuga_1d/sww/sww_forcing_terms.py

 r7840 """ from anuga_1d.generic.util import gradient from anuga_1d.base.util import gradient xmom  = domain.quantities['xmomentum'].explicit_update
• anuga_work/development/2010-projects/anuga_1d/sww/sww_vel_domain.py

 r7840 from anuga_1d.generic.generic_domain import * from anuga_1d.base.generic_domain import * from sww_boundary_conditions import * from sww_forcing_terms import * #Reduction operation for get_vertex_values from anuga_1d.generic.util import mean from anuga_1d.base.util import mean self.reduction = mean #self.reduction = min  #Looks better near steep slopes
Note: See TracChangeset for help on using the changeset viewer.