Esempio n. 1
0
        pts = CpuGpuArray(cpa_space.x_dense_img)
        v_dense = CpuGpuArray.zeros_like(pts)
        cpa_space.calc_v(pts=pts, out=v_dense)

        v_dense.gpu2cpu()  # for display

        plt.figure(level)
        of.plt.maximize_figure()

        scale = [.4, 0.25][cpa_space.vol_preserve]
        scale = 1 * Nx * 30
        scale = np.sqrt((v_dense.cpu**2).sum(axis=1)).mean() / 10

        for h in [233, 236][:1]:
            plt.subplot(h)
            cpa_space.quiver(cpa_space.x_dense_grid_img,
                             v_dense,
                             scale=scale,
                             ds=16)
            if cpa_space.nC > 1:
                cpa_space.plot_cells()

            config_plt()
            plt.title('v')
#        continue
        if TF.do_grid:
            plt.figure()

        if TF.do_grid:
Esempio n. 2
0
    #    1/0

    #    params_flow_int.nTimeSteps *= 10

    cell_idx = CpuGpuArray.zeros(len(pts), dtype=np.int32)
    cpa_space.calc_cell_idx(pts, cell_idx)

    cell_idx.gpu2cpu()
    print cell_idx

    img = cell_idx.cpu.reshape(cpa_space.x_dense_grid.shape[1:])
    #    img = pts.cpu[:,0].reshape(cpa_space.x_dense_grid.shape[1:])
    plt.figure(1)
    of.plt.set_figure_size_and_location(0, 0, 800, 800)
    plt.clf()
    plt.subplot(131)
    plt.imshow(img[:, :, 0, 0], interpolation="None")
    plt.colorbar()

    v = CpuGpuArray.zeros_like(pts)
    cpa_space.calc_v(pts=pts, out=v)

    v.gpu2cpu()
    img = v.cpu[:, 1].reshape(cpa_space.x_dense_grid.shape[1:])

    plt.subplot(132)
    plt.imshow(img[:, :, 0, 0], interpolation="None")
    plt.colorbar()

    #    1/0
    print params_flow_int
Esempio n. 3
0
#    1/0
    
#    params_flow_int.nTimeSteps *= 10
    
    cell_idx = CpuGpuArray.zeros(len(pts),dtype=np.int32)
    cpa_space.calc_cell_idx(pts,cell_idx)
   
    cell_idx.gpu2cpu()
    print cell_idx
    
    img=cell_idx.cpu.reshape(cpa_space.x_dense_grid.shape[1:])
#    img = pts.cpu[:,0].reshape(cpa_space.x_dense_grid.shape[1:])
    plt.figure(1)
    of.plt.set_figure_size_and_location(0,0,800,800)
    plt.clf()
    plt.subplot(131)
    plt.imshow(img[:,:,0,0],interpolation="None");plt.colorbar()
    
     
    v = CpuGpuArray.zeros_like(pts)
    cpa_space.calc_v(pts=pts,out=v)
          
    
    v.gpu2cpu()
    img=v.cpu[:,1].reshape(cpa_space.x_dense_grid.shape[1:])
   
    plt.subplot(132)
    plt.imshow(img[:,:,0,0],interpolation="None");plt.colorbar()
    
#    1/0
    print params_flow_int
Esempio n. 4
0
        cpa_space.calc_v(pts=pts,out=v_dense   )
    
        
        v_dense.gpu2cpu()  # for display

        plt.figure(level);
        of.plt.maximize_figure()  
        
         
         
        scale=[.4,0.25][cpa_space.vol_preserve]
        scale = 1 * Nx * 30
        scale = np.sqrt((v_dense.cpu**2).sum(axis=1)).mean() / 10

        for h in [233,236][:1]:
            plt.subplot(h)
            cpa_space.quiver(cpa_space.x_dense_grid_img,v_dense,scale=scale,ds=16)   
            if cpa_space.nC>1:        
                cpa_space.plot_cells()
        
            config_plt()
            plt.title('v')
#        continue
        if  TF.do_grid:
            plt.figure()        
      
        if TF.do_grid:
             
            for lines,c in zip([hlines,vlines],['r','b']):                   
                tic=time.clock()