Changeset 7634


Ignore:
Timestamp:
Feb 24, 2010, 2:42:00 PM (15 years ago)
Author:
steve
Message:

Getting rid of space in name

Location:
anuga_validation/analytical_solutions
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • anuga_validation/analytical_solutions/carrier_wave_runup.py

    r7626 r7634  
    1414"""
    1515
    16 ######################
     16#-------------------
    1717# Module imports
    1818import sys
    19 from os import sep
    20 sys.path.append('..'+sep+'pyvolution')
    21 
    22 from shallow_water import Domain, Reflective_boundary, Time_boundary
    2319from math import sqrt, cos, sin, pi
    24 from mesh_factory import strang_mesh
    25 
     20from numpy import asarray
     21from time import localtime, strftime, gmtime
     22
     23
     24#-------------------
     25# Anuga Imports
     26#-------------------
     27from anuga.shallow_water_balanced.swb_domain import Domain, Transmissive_boundary, Reflective_boundary,\
     28     Dirichlet_boundary, Time_boundary
     29
     30#from anuga.interface import Domain, Transmissive_boundary, Reflective_boundary,\
     31#     Dirichlet_boundary
     32
     33from anuga.utilities.polygon import inside_polygon, is_inside_triangle
     34from anuga.abstract_2d_finite_volumes.mesh_factory import strang_mesh
     35
     36
     37#-------------------
    2638#Convenience functions
     39#-------------------
    2740def imag(a):
    2841    return a.imag
     
    3245
    3346
    34 ######################
     47#--------------------
    3548# Domain
    3649# Strang_domain will search through the file and test to see if there are
     
    4154domain = Domain(points, elements)
    4255
    43 domain.default_order = 2
    44 domain.smooth = True
    45 
     56print 'extent ',domain.get_extent()
     57
     58#----------------
     59# Order of scheme
     60# Good compromise between
     61# limiting and CFL
     62#---------------
     63domain.set_default_order(2)
     64domain.set_timestepping_method(2)
     65domain.set_beta(0.7)
     66domain.set_CFL(0.6)
     67
     68
     69#-------------------
    4670#Set a default tagging
     71#-------------------
    4772epsilon = 1.0e-12
    4873
     
    5277        domain.boundary[(id,face)] = 'left'
    5378
    54 
    55 
    56 
     79#---------------------
    5780# Provide file name for storing output
     81#---------------------
    5882domain.store = True
    5983domain.format = 'sww'
    60 domain.set_name('run-up_second_order_again')
     84
     85time = strftime('%Y%m%d_%H%M%S',localtime())
     86output_file= 'carrier_wave_runup_'+time
     87
     88domain.set_name(output_file)
    6189
    6290print "Number of triangles = ", len(domain)
    6391
    64 #Reduction operation for get_vertex_values
    65 from anuga.pyvolution.util import mean
    66 domain.reduction = mean
    67 #domain.reduction = min  #Looks better near steep slopes
    68 
     92#-----------------------
    6993#Define the boundary condition
    70 def stage_setup(x,t_star1):
     94#-----------------------
     95def stage_setup(x,t):
    7196    vh = 0
    7297    alpha = 0.1
     
    83108    for j in range (1,50):
    84109        sigma0 = (sigma_max+sigma_min)/2.
    85         lambda_prime = 2./a*(t_star1/sqrt(l_0/alpha/g)+v1)
     110        lambda_prime = 2./a*(t/sqrt(l_0/alpha/g)+v1)
    86111        sigma_prime = sigma0/a
    87112        const = (1.-ii*lambda_prime)**2+sigma_prime**2
     
    123148
    124149
    125 ######################
     150#---------------------
    126151#Initial condition
     152#---------------------
    127153print 'Initial condition'
    128154t_star1 = 0.0
     
    162188domain.set_boundary({'left': Bw, 'external': Br})
    163189
    164 
     190import time
     191visualize = True
     192if visualize:
     193    from anuga.visualiser import RealtimeVisualiser
     194    vis = RealtimeVisualiser(domain)
     195    vis.render_quantity_height("elevation", zScale=3.0, offset = 0.01, dynamic=False)
     196    vis.render_quantity_height("stage", zScale = 3.0, dynamic=True, opacity = 0.6, wireframe=False)
     197    #vis.colour_height_quantity('stage', (lambda q:q['stage'], 1.0, 2.0))
     198    vis.colour_height_quantity('stage', (0.4, 0.6, 0.4))
     199    vis.start()
     200    time.sleep(2.0)
    165201
    166202#domain.visualise = True
     
    168204######################
    169205#Evolution
    170 import time
     206
    171207t0 = time.time()
     208
     209
    172210for t in domain.evolve(yieldstep = 1., finaltime = 100):
    173211    domain.write_time()
    174212    print boundary_stage(domain.time)
     213    if visualize: vis.update()
     214   
     215if visualize: vis.evolveFinished()   
    175216
    176217print 'That took %.2f seconds' %(time.time()-t0)
  • anuga_validation/analytical_solutions/yoon_cross_mesh.py

    r7626 r7634  
    1111#---------------
    1212# Module imports
    13 #import sys
    14 #from os import sep
    15 #sys.path.append('..'+sep+'pyvolution')
    1613from anuga.shallow_water_balanced.swb_domain import Domain, Transmissive_boundary, Reflective_boundary,\
    1714     Dirichlet_boundary
  • anuga_validation/analytical_solutions/yoon_import_mesh.py

    r7626 r7634  
    1313# Module imports
    1414import sys
    15 from os import sep
    16 sys.path.append('..'+sep+'pyvolution')
    17 from shallow_water import Domain, Dirichlet_boundary
     15
     16from anuga.interface import Domain, Dirichlet_boundary
    1817from math import sqrt, cos, sin, pi
    19 from mesh_factory import strang_mesh
    20 from anuga.pyvolution.util import inside_polygon
    21 from Numeric import asarray
    22 from least_squares import Interpolation
     18from anuga.abstract_2d_finite_volume.mesh_factory import strang_mesh
     19from anuga.utilities.polygon import inside_polygon
     20
     21from numpy import asarray
     22from anuga.fit_interpolate.interpolate import Interpolation
    2323
    2424#-------------------------------
Note: See TracChangeset for help on using the changeset viewer.