Changeset 8285


Ignore:
Timestamp:
Dec 15, 2011, 9:15:19 PM (8 years ago)
Author:
steve
Message:

Hopefully sww_merge is working now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/utilities/sww_merge.py

    r8284 r8285  
    253253        node_l2g = fid.variables['node_l2g'][:]
    254254        tri_full_flag = fid.variables['tri_full_flag'][:]
    255         volumes = fid.variables['volumes'][:]
     255        volumes = num.array(fid.variables['volumes'][:],dtype=num.int)
     256        l_volumes = num.zeros_like(volumes)
     257
     258
     259        # Change the local node ids to global id in the
     260        # volume array
     261 
     262        for i in range(len(l_volumes)):
     263            g_n0 = node_l2g[volumes[i,0]]
     264            g_n1 = node_l2g[volumes[i,1]]
     265            g_n2 = node_l2g[volumes[i,2]]
     266       
     267            l_volumes[i,:] = [g_n0,g_n1,g_n2]
    256268
    257269        # Just pick out the full triangles
    258270        ftri_l2g = num.compress(tri_full_flag, tri_l2g)
    259         g_volumes[ftri_l2g] = num.compress(tri_full_flag,volumes,axis=0)
     271
     272        #print l_volumes
     273        #print tri_full_flag
     274        #print tri_l2g
     275        #print ftri_l2g
     276   
     277        g_volumes[ftri_l2g] = num.compress(tri_full_flag,l_volumes,axis=0)
     278
     279
     280
    260281
    261282        #g_x[node_l2g] = fid.variables['x']
     
    266287       
    267288
    268         print number_of_timesteps
     289        #print number_of_timesteps
    269290       
    270291        # Read in static quantities
     
    277298        for quantity in dynamic_quantities:
    278299            q = fid.variables[quantity]
    279             print q.shape
     300            #print q.shape
    280301            for i in range(number_of_timesteps):
    281302                out_d_quantities[quantity][i][node_l2g] = \
     
    291312    # Write out the SWW file
    292313    #---------------------------
    293     print g_points.shape
    294 
    295     print number_of_global_triangles
    296     print number_of_global_nodes
     314    #print g_points.shape
     315
     316    #print number_of_global_triangles
     317    #print number_of_global_nodes
    297318
    298319
     
    341362
    342363                                       
    343     print out_s_quantities
    344     print out_d_quantities
    345    
    346     print g_x
    347     print g_y
     364    #print out_s_quantities
     365    #print out_d_quantities
     366   
     367    #print g_x
     368    #print g_y
    348369
    349370    #print g_volumes
     
    374395
    375396    try:
    376         sww_merge(domain_global_name, np, verbose)
     397        sww_merge_parallel(domain_global_name, np, verbose)
    377398    except:
    378399        msg = 'ERROR: When merging sww files %s '% domain_global_name
Note: See TracChangeset for help on using the changeset viewer.