Changeset 8880


Ignore:
Timestamp:
Jun 3, 2013, 5:05:31 PM (11 years ago)
Author:
davies
Message:

Removing redundant code from 'tsunami' flow algorithm

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/shallow_water/swb2_domain_ext.c

    r8582 r8880  
    230230    }
    231231
    232     *pressure_flux = 0.5*g*( s_max*h_left*h_left -s_min*h_right*h_right)*inverse_denominator;
     232    *pressure_flux = 0.;//0.5*g*( s_max*h_left*h_left -s_min*h_right*h_right)*inverse_denominator;
    233233
    234234    // Maximal wavespeed
     
    294294    double *max_bed_edgevalue, *min_bed_edgevalue;
    295295
    296     max_bed_edgevalue = malloc(number_of_elements*sizeof(double));
    297     min_bed_edgevalue = malloc(number_of_elements*sizeof(double));
     296    //max_bed_edgevalue = malloc(number_of_elements*sizeof(double));
     297    //min_bed_edgevalue = malloc(number_of_elements*sizeof(double));
    298298    // Start computation
    299299    call++; // Flag 'id' of flux calculation for this timestep
     
    307307
    308308    // Compute minimum bed edge value on each triangle
    309     for (k = 0; k < number_of_elements; k++){
    310         max_bed_edgevalue[k] = max(bed_edge_values[3*k],
    311                                    max(bed_edge_values[3*k+1], bed_edge_values[3*k+2]));
    312         min_bed_edgevalue[k] = min(bed_edge_values[3*k],
    313                                    min(bed_edge_values[3*k+1], bed_edge_values[3*k+2]));
    314    
    315     }
     309    //for (k = 0; k < number_of_elements; k++){
     310    //    max_bed_edgevalue[k] = max(bed_edge_values[3*k],
     311    //                               max(bed_edge_values[3*k+1], bed_edge_values[3*k+2]));
     312    //    min_bed_edgevalue[k] = min(bed_edge_values[3*k],
     313    //                               min(bed_edge_values[3*k+1], bed_edge_values[3*k+2]));
     314    //
     315    //}
    316316
    317317
     
    551551    } // End triangle k
    552552
    553     free(max_bed_edgevalue);
    554     free(min_bed_edgevalue);
     553    //free(max_bed_edgevalue);
     554    //free(min_bed_edgevalue);
    555555
    556556    return timestep;
     
    735735  ymom_centroid_store = malloc(number_of_elements*sizeof(double));
    736736  stage_centroid_store = malloc(number_of_elements*sizeof(double));
    737   min_elevation_edgevalue = malloc(number_of_elements*sizeof(double));
     737  //min_elevation_edgevalue = malloc(number_of_elements*sizeof(double));
    738738  max_elevation_edgevalue = malloc(number_of_elements*sizeof(double));
    739   count_wet_neighbours = malloc(number_of_elements*sizeof(int));
     739  //count_wet_neighbours = malloc(number_of_elements*sizeof(int));
    740740 
    741741  if(extrapolate_velocity_second_order==1){
     
    751751          ymom_centroid_values[k] = ymom_centroid_values[k]/dk;
    752752
    753           min_elevation_edgevalue[k] = min(elevation_edge_values[3*k],
    754                                            min(elevation_edge_values[3*k+1],
    755                                                elevation_edge_values[3*k+2]));
     753          //min_elevation_edgevalue[k] = min(elevation_edge_values[3*k],
     754          //                                 min(elevation_edge_values[3*k+1],
     755          //                                     elevation_edge_values[3*k+2]));
    756756          max_elevation_edgevalue[k] = max(elevation_edge_values[3*k],
    757757                                           max(elevation_edge_values[3*k+1],
     
    762762
    763763  // Count how many 'fully submerged' neighbours the cell has
    764   for(k=0; k<number_of_elements;k++){
    765       count_wet_neighbours[k]=0;
    766       for (i=0; i<3; i++){
    767         ktmp = surrogate_neighbours[3*k+i];             
    768         if(stage_centroid_values[ktmp] > max_elevation_edgevalue[ktmp]){
    769             count_wet_neighbours[k]+=1;
    770         }
    771       }
    772   }
     764  //for(k=0; k<number_of_elements;k++){
     765  //    count_wet_neighbours[k]=0;
     766  //    for (i=0; i<3; i++){
     767  //      ktmp = surrogate_neighbours[3*k+i];             
     768  //      if(stage_centroid_values[ktmp] > max_elevation_edgevalue[ktmp]){
     769  //          count_wet_neighbours[k]+=1;
     770  //      }
     771  //    }
     772  //}
    773773
    774774  // Begin extrapolation routine
     
    12661266  free(ymom_centroid_store);
    12671267  free(stage_centroid_store);
    1268   free(min_elevation_edgevalue);
     1268  //free(min_elevation_edgevalue);
    12691269  free(max_elevation_edgevalue);
    1270   free(count_wet_neighbours);
     1270  //free(count_wet_neighbours);
    12711271  return 0;
    12721272}           
  • trunk/anuga_work/development/gareth/tests/parabolic/parabolic.py

    r8547 r8880  
    88import numpy
    99
    10 from balanced_dev import *
     10#from balanced_dev import *
    1111#from anuga_tsunami import *
    1212#from balanced_basic import *
    1313#from anuga.shallow_water_balanced2.swb2_domain import Domain as Domain
    14 #from anuga.shallow_water.shallow_water_domain import Domain as Domain
     14from anuga.shallow_water.shallow_water_domain import Domain as Domain
    1515#---------
    1616#Setup computational domain
     
    2323domain.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2, 'ymomentum': 2, 'elevation': 1})
    2424domain.set_minimum_allowed_height(0.001)
     25domain.set_flow_algorithm('tsunami')
    2526# Time stepping
    2627#domain.set_timestepping_method('euler') # Default
  • trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoid.py

    r8867 r8880  
    1414#from swb2_domain import *
    1515#from balanced_basic import *
    16 from balanced_dev import *
     16#from balanced_dev import *
    1717#from anuga_tsunami import *
    1818
     
    2222points, vertices, boundary = anuga.rectangular_cross(20,20, len1=1., len2=1.)
    2323
    24 domain=Domain(points,vertices,boundary)    # Create Domain
     24domain=anuga.Domain(points,vertices,boundary)    # Create Domain
    2525domain.set_name('runup_sinusoid_v2')                         # Output to file runup.sww
    2626#domain.set_timestepping_method('euler')
     27domain.set_flow_algorithm('tsunami')
    2728#------------------
    2829# Define topography
    2930#------------------
    3031
    31 ### Pathological
    32 scale_me=100.0
    33 boundary_ws=-0.1999
     32#### Pathological
     33#scale_me=100.0
     34#boundary_ws=-0.2
     35#init_ws=-0.2
     36#bumpiness=50. # Higher = shorter wavelength oscillations in topography
     37#tstep=0.002
     38#lasttime=1.1
     39
     40### Sensible
     41scale_me=1.0
     42boundary_ws=-0.1
    3443init_ws=-0.2
    3544bumpiness=50. # Higher = shorter wavelength oscillations in topography
    36 tstep=0.002
    37 lasttime=1.1
    38 
    39 ### Sensible
    40 #scale_me=1.0
    41 #boundary_ws=-0.1
    42 #init_ws=-0.2
    43 #bumpiness=50. # Higher = shorter wavelength oscillations in topography
    44 #tstep=0.2
    45 #lasttime=40.
     45tstep=0.2
     46lasttime=40.
    4647
    4748#domain.minimum_allowed_height=domain.minimum_allowed_height*scale_me # Seems needed to make the algorithms behave
     
    108109    print 'Peak velocity is: ', vv.max(), vv.argmax(), dd[vv.argmax()]
    109110    print 'Volume is', sum(dd_raw*domain.areas)   
    110     print 'Volume less flux int', sum(dd_raw*domain.areas) - domain.boundary_flux_integral
     111    #print 'Volume less flux int', sum(dd_raw*domain.areas) - domain.boundary_flux_integral
    111112
    112113
Note: See TracChangeset for help on using the changeset viewer.