Changeset 4320


Ignore:
Timestamp:
Mar 23, 2007, 7:29:14 PM (17 years ago)
Author:
sexton
Message:

new earthquake source function (converted fortran to python), plus new figures for slide report

Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/abstract_2d_finite_volumes/util.py

    r4312 r4320  
    10601060        comparefile = file_loc[j]+sep+'gauges_maxmins'+'.csv'
    10611061        fid_compare = open(comparefile, 'w')
     1062        file0 = file_loc[j]+'gauges_t0.csv'
     1063        fid_0 = open(file0, 'w')
    10621064        ##### loop over each gauge #####
    10631065        for k in gauge_index:
     
    11021104                    s = '%.2f, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f\n' %(t, w, m, vel, z, uh, vh)
    11031105                    fid_out.write(s)
     1106                    if t == 0:
     1107                        s = '%.2f, %.2f, %.2f\n' %(g[0], g[1], w)
     1108                        fid_0.write(s)
    11041109                    if t/60.0 <= 13920: tindex = i
    11051110                    if w > max_stage: max_stage = w
     
    11571162        depth_axis = axis([time_min/60.0, time_max/60.0, -0.1, max(max_depths)*1.1])
    11581163        stage_axis = axis([time_min/60.0, time_max/60.0, min(min_stages), max(max_stages)*1.1])
     1164        #stage_axis = axis([50.0, time_max/60.0, -3.0, 2.0])
    11591165        vel_axis = axis([time_min/60.0, time_max/60.0, min(max_speeds), max(max_speeds)*1.1])
    11601166        mom_axis = axis([time_min/60.0, time_max/60.0, min(max_momentums), max(max_momentums)*1.1])
     
    11951201                        axis(depth_axis)
    11961202                    if which_quantity == 'stage':
    1197                         if elevations[0,k,j] < 0:
     1203                        if elevations[0,k,j] <= 0:
    11981204                            plot(model_time[0:n[j]-1,k,j], stages[0:n[j]-1,k,j], '-', c = cstr[j])
    11991205                            axis(stage_axis)
     
    12731279                    if title_on == True:
    12741280                        title('%s scenario: %s at %s gauge' %(label_id, which_quantity, gaugeloc2))
     1281                        #title('Gauge %s (MOST elevation %.2f, ANUGA elevation %.2f)' %(gaugeloc2, elevations[10,k,0], elevations[10,k,1] ))
    12751282
    12761283                    savefig(graphname) # save figures with sww file
  • anuga_core/source/anuga/shallow_water/eqf.py

    r4263 r4320  
    2626"""
    2727
    28 def earthquake_tsunami(length, width, strike, dip, x0=0.0, y0=0.0, slip=1.0, rake=90.,\
    29                   domain=None,
    30                   verbose=False):
     28def earthquake_tsunami(length, width, strike, depth, \
     29                       dip, x0=0.0, y0=0.0, slip=1.0, rake=90.,\
     30                       domain=None, verbose=False):
    3131
    32     from math import sin, radians, sqrt
     32    from math import sin, radians
    3333
    3434    if domain is not None:
     
    3737        x0 = x0 - xllcorner  # fault origin (relative)
    3838        y0 = y0 - yllcorner
    39 
     39   
    4040    #a few temporary print statements
    4141    if verbose is True:
     
    5050        print '\ty0: ', y0
    5151
     52    # warning test
     53    test = width*1000.0*sin(radians(dip)) - depth
    5254
    53     return Okada(length=length, width=width, dip=dip, \
    54                  x0=x0, y0=y0, strike=strike, depth=depth, \
    55                  slip=slip, rake=rake)
     55    if verbose is True:
     56        if test > 0.0:
     57            print 'Earthquake source not located below seafloor'
     58            print 'Please check depth'
     59
     60    return Okada_func(length=length, width=width, dip=dip, \
     61                      x0=x0, y0=y0, strike=strike, depth=depth, \
     62                      slip=slip, rake=rake, test=test)
    5663
    5764
     
    8087"""
    8188
    82 class Okada:
     89class Okada_func:
    8390
    8491    def __init__(self, length, width, dip, x0, y0, strike, \
    85                  depth, slip, rake):
     92                 depth, slip, rake, test):
    8693        self.dip = dip
    8794        self.length = length
     
    93100        self.slip = slip
    94101        self.rake = rake
     102        self.test = test
    95103
    96104
    97105    def __call__(self, x, y):
    98         """Make Okada a callable object.
     106        """Make Okada_func a callable object.
    99107
    100108        If called as a function, this object returns z values representing
     
    105113        from math import sin, cos, radians, exp, cosh
    106114        from Numeric import zeros, Float
    107         from okada import okada
     115        from okada import okadatest
    108116
    109117        #ensure vectors x and y have the same length
  • anuga_core/source/anuga/shallow_water/okada.f

    r4263 r4320  
    1       subroutine okada(x,y,z,n,depth,xlength,xwidth,dip,rake,slip)
     1      subroutine okadatest(x,y,z,n,depth,xlength,xwidth,dip,rake,slip)
    22Cf2py   intent(out) z
    33Cf2py   intent(in) x,y,n,depth,dip,rake,slip,xlength,xwidth
  • anuga_work/production/pt_hedland_2006/run_building_inundation.py

    r4314 r4320  
    3434#add_depth_and_momentum2csv(swwfile, buildings_filename, buildings_filename_out)
    3535inundation_damage(swwfile, buildings_filename, buildings_filename_out)
     36#inundation_damage(swwfile, buildings_filename, buildings_filename_out)
    3637
    3738print '\n Augmented building file written to %s \n' \
  • anuga_work/production/sydney_2006/report/interpretation.tex

    r4316 r4320  
    1111\begin{tabular}{cc}
    1212\includegraphics[scale=0.4]{../report_figures/overallmodelv3.jpg} &
    13 \includegraphics[scale=0.4]{../report_figures/detailedmodel.jpg} &
     13\includegraphics[scale=0.4]{../report_figures/detailedmodel.jpg} \\
    1414(a) & (b) \\
    1515\end{tabular}
Note: See TracChangeset for help on using the changeset viewer.