Changeset 1810


Ignore:
Timestamp:
Sep 8, 2005, 4:36:43 PM (19 years ago)
Author:
ole
Message:

Cleanup

Location:
inundation/validation/Completed/LWRU2
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • inundation/validation/Completed/LWRU2/Benchmark_2_Bathymetry.txt

    r1654 r1810  
    9589295892 5.48800e+00  3.38800e+00 -1.2500000e-01
    9589395893 5.48800e+00  3.40200e+00 -1.2500000e-01
    95894 
    95895  
    95896  
  • inundation/validation/Completed/LWRU2/README.txt

    r1792 r1810  
    77http://www.cee.cornell.edu/longwave/index.cfm?page=benchmark&problem=2
    88
    9 Run the code lwru2.py with the variable read_mesh = False (at the top
     9Run the code lwru2.py with the variable use_variable_mesh = False (at the top
    1010of the code) and then extract_timeseries.py to see the results.
    1111
    1212If you wish to look at the a more detailed animation, create a mesh
    13 using the script create_mesh.py and run lwru2.py again with read_mesh
     13using the script create_mesh.py and run lwru2.py again with use_variable_mesh
    1414= True. The resulting sww file can be viewed with e.g. Swollen.
    1515
  • inundation/validation/Completed/LWRU2/lwru2.py

    r1775 r1810  
    1 """Example of shallow water wave equation.
     1"""Validation of the AnuGA implementation of the shallow water wave equation.
    22
    33This script sets up LWRU2 benchmark with initial condition stated
     
    1111
    1212
    13 #read_mesh = True  #Use large unstructured mesh generated from create_mesh.py
    14 read_mesh = False  #Use small structured mesh
     13#use_variable_mesh = True #Use large variable mesh generated by create_mesh.py
     14use_variable_mesh = False #Use small structured mesh
     15
     16
    1517
    1618import sys
     
    7375# Module imports
    7476from pyvolution.shallow_water import Domain, Reflective_boundary,\
    75             File_boundary, Transmissive_Momentum_Set_Stage_boundary
     77     File_boundary, Transmissive_Momentum_Set_Stage_boundary
    7678from pyvolution.mesh_factory import rectangular_cross
    7779from pyvolution.pmesh2domain import pmesh_to_domain_instance
    7880from Numeric import array, zeros, Float, allclose
    79 import filenames
     81import project
    8082from caching import cache
    8183
    8284#Preparing time boundary
    83 prepare_timeboundary(filenames.boundary_filename)
     85prepare_timeboundary(project.boundary_filename)
    8486
    8587#Preparing points
    8688from pyvolution.data_manager import xya2pts
    87 xya2pts(filenames.bathymetry_filename, verbose = True,
     89xya2pts(project.bathymetry_filename, verbose = True,
    8890        z_func = lambda z: -z)
    8991
     
    9193#######################
    9294# Domain
    93 
    94 if read_mesh is True:
    95     print 'Creating domain from', filenames.mesh_filename
    96     #domain = pmesh_to_domain_instance(filenames.mesh_filename, Domain)
     95if use_variable_mesh is True:
     96    print 'Creating domain from', project.mesh_filename
    9797
    9898    domain = cache(pmesh_to_domain_instance,
    99                    (filenames.mesh_filename, Domain),
    100                    dependencies = [filenames.mesh_filename])
     99                   (project.mesh_filename, Domain),
     100                   dependencies = [project.mesh_filename])
    101101
    102102
     
    131131
    132132domain.set_quantity('elevation',
    133                     filename=filenames.bathymetry_filename[:-4] + '.pts',
     133                    filename=project.bathymetry_filename[:-4] + '.pts',
    134134                    alpha = 0.0001,
    135135                    verbose = True,
     
    147147Br = Reflective_boundary(domain)
    148148
    149 #####################
    150 # Error with File Boundary. We need to only set
    151 # stage and let the scheme set the momentum
    152149from pyvolution.util import file_function
    153 function = file_function(filenames.boundary_filename[:-4] + '.sww', domain,
     150function = file_function(project.boundary_filename[:-4] + '.sww', domain,
    154151                         verbose = True)
    155152Bts = Transmissive_Momentum_Set_Stage_boundary(domain, function)
    156153
    157154#Set boundary conditions
    158 if read_mesh is True:
     155if use_variable_mesh is True:
    159156    domain.set_boundary({'wave': Bts, 'wall': Br})
    160157else:
     
    165162import time
    166163t0 = time.time()
    167 #domain.visualise = True
    168164
    169165for t in domain.evolve(yieldstep = 0.05, finaltime = 22.5):
    170166    domain.write_time()
    171     #Stage_cv = domain.quantities['stage'].centroid_values
    172     #print Stage_cv[0]
    173     #print 'Function value',function(t)
    174167
    175168print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracChangeset for help on using the changeset viewer.