Ignore:
Timestamp:
Jul 10, 2014, 5:42:24 PM (11 years ago)
Author:
davies
Message:

Cutting a boundary_flux_integral operator into the code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoid.py

    r9200 r9257  
    99
    1010from math import sin, pi, exp
    11 #from anuga.shallow_water.shallow_water_domain import Domain as Domain
    12 #from anuga.shallow_water_balanced2.swb2_domain import Domain as Domain
    13 #path.append('/home/gareth/storage/anuga_clean/anuga_jan12/trunk/anuga_work/development/gareth/balanced_basic')
    14 #from swb2_domain import *
    15 #from balanced_basic import *
    16 #from balanced_dev import *
    1711from anuga import Domain as Domain
    18 #from bal_and import *
    19 #from anuga_tsunami import *
     12from anuga.operators.boundary_flux_integral_operator import boundary_flux_integral_operator
    2013
    2114#---------
     
    2720domain.set_name('runup_sinusoid_v2')                         # Output to file runup.sww
    2821#domain.set_store_centroids(True)
    29 #domain.set_timestepping_method('euler')
    30 #domain.set_flow_algorithm('DE1')
    31 #domain.set_flow_algorithm('tsunami')
    3222domain.set_flow_algorithm('DE0')
    3323domain.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2,
    3424         'ymomentum': 2, 'elevation': 2})
    35 #domain.minimum_storable_height=1.0e-03
    3625domain.set_store_vertices_uniquely()
    3726#------------------
     
    7059
    7160print '#-#', domain.minimum_allowed_height
    72 #domain.minimum_allowed_height=0.001
    73 #def frict_change(x,y):
    74 #       return 0.2*(x>0.5)+0.1*(x<=0.5)
    75 #
    76 #domain.set_quantity('friction',frict_change)
    7761
    7862domain.set_quantity('stage', stagefun)              # Constant negative initial stage
     
    10892#Evolve the system through time
    10993#------------------------------
    110 
    11194for t in domain.evolve(yieldstep=tstep,finaltime=lasttime):
    11295#for t in domain.evolve(yieldstep=0.2,finaltime=60.):
     
    121104    vv = vv*(dd>1.0e-03)
    122105    print 'Peak velocity is: ', vv.max(), vv.argmax(), dd[vv.argmax()]
    123     print 'Volume is', sum(dd_raw*domain.areas)   
     106    vol=sum(dd_raw*domain.areas)
     107    print 'Volume is', vol   
     108    flux_integral=domain.get_boundary_flux_integral()
     109    print 'Flux integral is: ', flux_integral
     110    print 'Their difference is:', vol-flux_integral
    124111    #print 'Volume less flux int', sum(dd_raw*domain.areas) - domain.boundary_flux_integral
    125 
     112   
    126113
    127114vel_final_inds=(vv>1.0e-01).nonzero()
Note: See TracChangeset for help on using the changeset viewer.