{"action":"created","comment":{"url":"https://api.github.com/repos/latticeboltzmann/2d-lb/pulls/comments/46687353","id":46687353,"diff_hunk":"@@ -0,0 +1,596 @@\n+#cython: profile=True\n+#cython: linetrace=False\n+#cython: boundscheck=False\n+#cython: initializedcheck=False\n+#cython: nonecheck=False\n+#cython: wraparound=False\n+#cython: cdivision=True\n+\n+from libc.stdio cimport printf\n+import numpy as np\n+cimport numpy as np\n+import skimage as ski\n+\n+##########################\n+##### D2Q9 parameters ####\n+##########################\n+w=np.array([4./9.,1./9.,1./9.,1./9.,1./9.,1./36.,\n+            1./36.,1./36.,1./36.]) # weights for directions\n+cx=np.array([0,1,0,-1,0,1,-1,-1,1]) # direction vector for the x direction\n+cy=np.array([0,0,1,0,-1,1,1,-1,-1]) # direction vector for the y direction\n+cs=1/np.sqrt(3)\n+cs2 = cs**2\n+cs22 = 2*cs2\n+cssq = 2.0/9.0\n+\n+w0 = 4./9.\n+w1 = 1./9.\n+w2 = 1./36.\n+\n+NUM_JUMPERS = 9\n+\n+class Pipe_Flow(object):\n+    \"\"\"2d pipe flow with D2Q9\"\"\"\n+\n+    def set_characteristic_length_time(self):\n+        \"\"\"Necessary for subclassing\"\"\"\n+        self.L = self.phys_diameter\n+        self.T = (8*self.phys_rho*self.phys_visc)/(np.abs(self.phys_pressure_grad)*self.L)\n+\n+    def initialize_grid_dims(self):\n+        \"\"\"Necessary for subclassing\"\"\"\n+\n+        self.lx = int(np.ceil((self.phys_pipe_length / self.L)*self.N))\n+        self.ly = self.N\n+\n+        self.nx = self.lx + 1 # Total size of grid in x including boundary\n+        self.ny = self.ly + 1 # Total size of grid in y including boundary\n+\n+\n+    def __init__(self, diameter=None, rho=None, viscosity=None, pressure_grad=1., pipe_length=None,\n+                 N=100, time_prefactor = 1.):\n+\n+        # Physical units\n+        self.phys_diameter = diameter\n+        self.phys_rho = rho\n+        self.phys_visc = viscosity\n+        self.phys_pressure_grad = pressure_grad\n+        self.phys_pipe_length = pipe_length\n+\n+        # Get the characteristic length and time scales for the flow\n+        self.L = None\n+        self.T = None\n+        self.set_characteristic_length_time()\n+        print 'Characteristic L:', self.L\n+        print 'Characteristic T:', self.T\n+\n+        # Initialize the reynolds number\n+        self.Re = self.L**2/(self.phys_visc*self.T**2)\n+        print 'Reynolds number:', self.Re\n+\n+        # Initialize the lattice to simulate on; see http://wiki.palabos.org/_media/howtos:lbunits.pdf\n+        self.N = N # Characteristic length is broken into N pieces\n+        self.delta_x = 1./N # How many squares characteristic length is broken into\n+        self.delta_t = time_prefactor * self.delta_x**2 # How many time iterations until the characteristic time, should be ~ \\delta x^2\n+\n+        # Initialize grid dimensions\n+        self.lx = None\n+        self.ly = None\n+        self.nx = None\n+        self.ny = None\n+        self.initialize_grid_dims()\n+\n+        self.lb_viscosity = (self.delta_t/self.delta_x**2) * (1./self.Re)\n+\n+        # Get omega from lb_viscosity\n+        self.omega = (self.lb_viscosity/cs2 + 0.5)**-1.\n+        print 'omega', self.omega\n+        assert self.omega < 2.\n+\n+        ## Initialize hydrodynamic variables\n+        self.inlet_rho = None\n+        self.outlet_rho = None\n+        self.rho = None # Density\n+        self.u = None # Horizontal flow\n+        self.v = None # Vertical flow\n+        self.init_hydro()\n+\n+        # Intitialize the underlying probablistic fields\n+\n+        self.f=np.zeros((NUM_JUMPERS, self.nx, self.ny), dtype=np.float32) # initializing f\n+        self.feq = np.zeros((NUM_JUMPERS, self.nx, self.ny), dtype=np.float32)\n+\n+        self.update_feq()\n+        self.init_pop()\n+\n+    def init_hydro(self):\n+        nx = self.nx\n+        ny = self.ny\n+\n+        # Create the inlet & outlet densities\n+        nondim_deltaP = (self.T**2/(self.phys_rho*self.L))*self.phys_pressure_grad\n+        # Obtain the difference in density (pressure) at the inlet & outlet\n+        delta_rho = self.nx*(self.delta_t**2/self.delta_x)*(1./cs2)*nondim_deltaP\n+\n+        self.outlet_rho = 1.\n+        self.inlet_rho = 1. + np.abs(delta_rho)\n+\n+        print 'inlet rho:' , self.inlet_rho\n+        print 'outlet rho:', self.outlet_rho\n+\n+\n+        self.rho = np.ones((nx, ny), dtype=np.float32)\n+        self.rho[0, :] = self.inlet_rho\n+        self.rho[self.lx, :] = self.outlet_rho # Is there a shock in this case? We'll see...\n+        for i in range(self.rho.shape[0]):\n+            self.rho[i, :] = self.inlet_rho - i*(self.inlet_rho - self.outlet_rho)/float(self.rho.shape[0])\n+\n+        self.u = .0*np.random.randn(nx, ny) # Fluctuations in the fluid\n+        self.v = .0*np.random.randn(nx, ny) # Fluctuations in the fluid\n+\n+\n+    def update_feq(self):\n+        \"\"\"Taken from sauro succi's code. This will be super easy to put on the GPU.\"\"\"\n+\n+        u = self.u\n+        v = self.v\n+        rho = self.rho\n+        feq = self.feq\n+\n+        ul = u/cs2\n+        vl = v/cs2\n+        uv = ul*vl\n+        usq = u*u\n+        vsq = v*v\n+        sumsq  = (usq+vsq)/cs22\n+        sumsq2 = sumsq*(1.-cs2)/cs2\n+        u2 = usq/cssq\n+        v2 = vsq/cssq\n+\n+        feq[0, :, :] = w0*rho*(1. - sumsq)\n+        feq[1, :, :] = w1*rho*(1. - sumsq  + u2 + ul)\n+        feq[2, :, :] = w1*rho*(1. - sumsq  + v2 + vl)\n+        feq[3, :, :] = w1*rho*(1. - sumsq  + u2 - ul)\n+        feq[4, :, :] = w1*rho*(1. - sumsq  + v2 - vl)\n+        feq[5, :, :] = w2*rho*(1. + sumsq2 + ul + vl + uv)\n+        feq[6, :, :] = w2*rho*(1. + sumsq2 - ul + vl - uv)\n+        feq[7, :, :] = w2*rho*(1. + sumsq2 - ul - vl + uv)\n+        feq[8, :, :] = w2*rho*(1. + sumsq2 + ul - vl - uv)\n+\n+    def update_hydro(self):\n+        f = self.f\n+\n+        rho = self.rho\n+        rho[:, :] = np.sum(f, axis=0)\n+        inverse_rho = 1./self.rho\n+\n+        u = self.u\n+        v = self.v\n+\n+        u[:, :] = (f[1]-f[3]+f[5]-f[6]-f[7]+f[8])*inverse_rho\n+        v[:, :] = (f[5]+f[2]+f[6]-f[7]-f[4]-f[8])*inverse_rho\n+\n+        # 0 velocity on walls\n+        u[:, 0] = 0\n+        u[:, self.ly] = 0\n+        v[:, 0] = 0\n+        v[:, self.ly] = 0\n+\n+        # Deal with boundary conditions...have to specify pressure\n+        lx = self.lx\n+\n+        rho[0, :] = self.inlet_rho\n+        rho[lx, :] = self.outlet_rho\n+        # INLET\n+        u[0, :] = 1 - (f[0, 0, :]+f[2, 0, :]+f[4, 0, :]+2*(f[3, 0, :]+f[6, 0, :]+f[7, 0, :]))/self.inlet_rho\n+\n+        # OUTLET\n+        u[lx, :] = -1 + (f[0, lx, :]+f[2, lx, :]+f[4, lx, :]+2*(f[1, lx, :]+f[5, lx, :]+f[8, lx, :]))/self.outlet_rho\n+\n+\n+    def move_bcs(self):\n+        \"\"\"This is slow; cythonizing makes it fast.\"\"\"\n+\n+        cdef int lx = self.lx\n+        cdef int ly = self.ly\n+        cdef int i, j\n+\n+        farr = self.f\n+\n+        # INLET: constant pressure!\n+        farr[1, 0, 1:ly] = farr[3, 0, 1:ly] + (2./3.)*self.inlet_rho*self.u[0, 1:ly]\n+        farr[5, 0, 1:ly] = -.5*farr[2,0,1:ly]+.5*farr[4, 0, 1:ly]+farr[7, 0, 1:ly] + (1./6.)*self.u[0, 1:ly]*self.inlet_rho\n+        farr[8, 0, 1:ly] = .5*farr[2,0,1:ly]-.5*farr[4, 0, 1:ly]+farr[6, 0, 1:ly] + (1./6.)*self.u[0, 1:ly]*self.inlet_rho\n+\n+        # OUTLET: constant pressure!\n+        farr[3, lx, 1:ly] = farr[1, lx, 1:ly] - (2./3.)*self.outlet_rho*self.u[lx,1:ly]\n+        farr[6, lx, 1:ly] = -.5*farr[2,lx,1:ly]+.5*farr[4,lx,1:ly]+farr[8,lx,1:ly]-(1./6.)*self.u[lx,1:ly]*self.outlet_rho\n+        farr[7, lx, 1:ly] = .5*farr[2,lx,1:ly]-.5*farr[4,lx,1:ly]+farr[5,lx,1:ly]-(1./6.)*self.u[lx,1:ly]*self.outlet_rho\n+\n+        cdef float[:, :, :] f = self.f\n+        cdef float inlet_rho = self.inlet_rho\n+        cdef float outlet_rho = self.outlet_rho\n+\n+        with nogil:\n+            # NORTH solid\n+            for i in range(1, lx): # Bounce back\n+                f[4,i,ly] = f[2,i,ly]\n+                f[8,i,ly] = f[6,i,ly]\n+                f[7,i,ly] = f[5,i,ly]\n+            # SOUTH solid\n+            for i in range(1, lx):\n+                f[2,i,0] = f[4,i,0]\n+                f[6,i,0] = f[8,i,0]\n+                f[5,i,0] = f[7,i,0]\n+\n+            ### Corner nodes: Tricky & a huge pain ###\n+            # BOTTOM INLET\n+            f[1, 0, 0] = f[3, 0, 0]\n+            f[2, 0, 0] = f[4, 0, 0]\n+            f[5, 0, 0] = f[7, 0, 0]\n+            f[6, 0, 0] = .5*(-f[0,0,0]-2*f[3,0,0]-2*f[4,0,0]-2*f[7,0,0]+inlet_rho)\n+            f[8, 0, 0] = .5*(-f[0,0,0]-2*f[3,0,0]-2*f[4,0,0]-2*f[7,0,0]+inlet_rho)\n+\n+            # TOP INLET\n+            f[1, 0, ly] = f[3, 0, ly]\n+            f[4, 0, ly] = f[2, 0, ly]\n+            f[5, 0, ly] = .5*(-f[0,0,ly]-2*f[2,0,ly]-2*f[3,0,ly]-2*f[6,0,ly]+inlet_rho)\n+            f[7, 0, ly] = .5*(-f[0,0,ly]-2*f[2,0,ly]-2*f[3,0,ly]-2*f[6,0,ly]+inlet_rho)\n+            f[8, 0, ly] = f[6, 0, ly]\n+\n+            # BOTTOM OUTLET\n+            f[3, lx, 0] = f[1, lx, 0]\n+            f[2, lx, 0] = f[4, lx, 0]\n+            f[6, lx, 0] = f[8, lx, 0]\n+            f[5, lx, 0] = .5*(-f[0,lx,0]-2*f[1,lx,0]-2*f[4,lx,0]-2*f[8,lx,0]+outlet_rho)\n+            f[7, lx, 0] = .5*(-f[0,lx,0]-2*f[1,lx,0]-2*f[4,lx,0]-2*f[8,lx,0]+outlet_rho)\n+\n+            # TOP OUTLET\n+            f[3, lx, ly] = f[1, lx, ly]\n+            f[4, lx, ly] = f[2, lx, ly]\n+            f[6, lx, ly] = .5*(-f[0,lx,ly]-2*f[1,lx,ly]-2*f[2,lx,ly]-2*f[5,lx,ly]+outlet_rho)\n+            f[7, lx, ly] = f[5, lx, ly]\n+            f[8, lx, ly] = .5*(-f[0,lx,ly]-2*f[1,lx,ly]-2*f[2,lx,ly]-2*f[5,lx,ly]+outlet_rho)\n+\n+    def move(self):\n+        cdef float[:, :, :] f = self.f\n+        cdef int lx = self.lx\n+        cdef int ly = self.ly\n+\n+        cdef int i, j\n+\n+        # This can't be parallelized without making a copy...order of loops is super important!\n+        with nogil:\n+            for j in range(ly,0,-1): # Up, up-left\n+                for i in range(0, lx):\n+                    f[2,i,j] = f[2,i,j-1]\n+                    f[6,i,j] = f[6,i+1,j-1]\n+            for j in range(ly,0,-1): # Right, up-right\n+                for i in range(lx,0,-1):\n+                    f[1,i,j] = f[1,i-1,j]\n+                    f[5,i,j] = f[5,i-1,j-1]\n+            for j in range(0,ly): # Down, right-down\n+                for i in range(lx,0,-1):\n+                    f[4,i,j] = f[4,i,j+1]\n+                    f[8,i,j] = f[8,i-1,j+1]\n+            for j in range(0,ly): # Left, left-down\n+                for i in range(0, lx):\n+                    f[3,i,j] = f[3,i+1,j]\n+                    f[7,i,j] = f[7,i+1,j+1]\n+\n+    def init_pop(self):\n+        feq = self.feq\n+        nx = self.nx\n+        ny = self.ny\n+\n+        self.f = feq.copy()\n+        # We now slightly perturb f\n+        amplitude = .001\n+        perturb = (1. + amplitude*np.random.randn(nx, ny))\n+        self.f *= perturb\n+\n+    def collide_particles(self):\n+        f = self.f\n+        feq = self.feq\n+        omega = self.omega\n+\n+        self.f[:, :, :] = f*(1.-omega)+omega*feq\n+\n+    def run(self, num_iterations):\n+        for cur_iteration in range(num_iterations):\n+            self.move_bcs() # We have to udpate the boundary conditions first, or we are in trouble.\n+            self.move() # Move all jumpers\n+            self.update_hydro() # Update the hydrodynamic variables\n+            self.update_feq() # Update the equilibrium fields\n+            self.collide_particles() # Relax the nonequilibrium fields\n+\n+    def get_fields(self):\n+\n+        results={}\n+        results['f'] = self.f\n+        results['u'] = self.u\n+        results['v'] = self.v\n+        results['rho'] = self.rho\n+        results['feq'] = self.feq\n+        return results\n+\n+    def get_nondim_fields(self):\n+        fields = self.get_fields()\n+\n+        fields['u'] *= self.delta_x/self.delta_t\n+        fields['v'] *= self.delta_x/self.delta_t\n+\n+        return fields\n+\n+    def get_physical_fields(self):\n+        fields = self.get_nondim_fields()\n+\n+        fields['u'] *= (self.L/self.T)\n+        fields['v'] *= (self.L/self.T)\n+\n+        return fields\n+\n+class Pipe_Flow_Cylinder(Pipe_Flow):\n+\n+    def set_characteristic_length_time(self):\n+        \"\"\"Necessary for subclassing\"\"\"\n+        self.L = self.phys_cylinder_radius\n+        self.T = (8*self.phys_rho*self.phys_visc*self.L)/(np.abs(self.phys_pressure_grad)*self.phys_diameter**2)\n+\n+    def initialize_grid_dims(self):\n+        \"\"\"Necessary for subclassing\"\"\"\n+\n+        self.lx = int(np.ceil((self.phys_pipe_length / self.L)*self.N))\n+        self.ly = int(np.ceil((self.phys_diameter / self.L)*self.N))\n+\n+        self.nx = self.lx + 1 # Total size of grid in x including boundary\n+        self.ny = self.ly + 1 # Total size of grid in y including boundary\n+\n+        ## Initialize the obstacle mask\n+        self.obstacle_mask = np.zeros((self.nx, self.ny), dtype=np.bool, order='F')\n+\n+        # Initialize the obstacle in the correct place\n+        x_cylinder = self.N * self.phys_cylinder_center[0]/self.L\n+        y_cylinder = self.N * self.phys_cylinder_center[1]/self.L\n+\n+        circle = ski.draw.circle(x_cylinder, y_cylinder, self.N)\n+        self.obstacle_mask[circle[0], circle[1]] = True\n+\n+    def __init__(self, cylinder_center = None, cylinder_radius=None, **kwargs):\n+        \"\"\"Obstacle mask should be ones and zeros.\"\"\"\n+\n+        assert (cylinder_center is not None)\n+        assert (cylinder_radius is not None) # If there are no obstacles, this will definitely not run.\n+\n+        self.phys_cylinder_center = cylinder_center\n+        self.phys_cylinder_radius = cylinder_radius\n+\n+        self.obstacle_mask = None\n+        super(Pipe_Flow_Cylinder, self).__init__(**kwargs)\n+        self.obstacle_pixels = np.where(self.obstacle_mask)\n+\n+    def init_hydro(self):\n+        super(Pipe_Flow_Cylinder, self).init_hydro()\n+        self.u[self.obstacle_mask] = 0\n+        self.v[self.obstacle_mask] = 0\n+\n+    def update_hydro(self):\n+        super(Pipe_Flow_Cylinder, self).update_hydro()\n+        self.u[self.obstacle_mask] = 0\n+        self.v[self.obstacle_mask] = 0\n+\n+    def move_bcs(self):\n+        super(Pipe_Flow_Cylinder, self).move_bcs()\n+\n+        # Now bounceback on the obstacle\n+        cdef long[:] x_list = self.obstacle_pixels[0]\n+        cdef long[:] y_list = self.obstacle_pixels[1]\n+        cdef int num_pixels = y_list.shape[0]\n+\n+        cdef float[:, :, :] f = self.f\n+\n+        cdef float old_f0, old_f1, old_f2, old_f3, old_f4, old_f5, old_f6, old_f7, old_f8\n+        cdef int i\n+        cdef long x, y\n+\n+        with nogil:\n+            for i in range(num_pixels):\n+                x = x_list[i]\n+                y = y_list[i]\n+\n+                old_f0 = f[0, x, y]\n+                old_f1 = f[1, x, y]\n+                old_f2 = f[2, x, y]\n+                old_f3 = f[3, x, y]\n+                old_f4 = f[4, x, y]\n+                old_f5 = f[5, x, y]\n+                old_f6 = f[6, x, y]\n+                old_f7 = f[7, x, y]\n+                old_f8 = f[8, x, y]\n+\n+                # Bounce back everywhere!\n+                # left right\n+                f[1, x, y] = old_f3\n+                f[3, x, y] = old_f1\n+                # up down\n+                f[2, x, y] = old_f4\n+                f[4, x, y] = old_f2\n+                # up-right\n+                f[5, x, y] = old_f7\n+                f[7, x, y] = old_f5\n+\n+                # up-left\n+                f[6, x, y] = old_f8\n+                f[8, x, y] = old_f6\n+\n+### Matt Stuff ###\n+\n+# class Velocity_Inlet_Cylinder(Pipe_Flow_Cylinder):\n+#\n+#     def __init__(self, *args, inlet_velocity=None, **kwargs):\n+#\n+#         assert inlet_velocity is not None\n+#         self.phys_inlet_velocity = inlet_velocity\n+#         self.dim_inlet_velocity = None\n+#         self.lb_inlet_velocity = None\n+#\n+#         super(Velocity_Inlet_Cylinder, self).__init__(**kwargs)\n+#\n+#\n+#     def set_characteristic_length_time(self):\n+#         \"\"\"Necessary for subclassing\"\"\"\n+#         self.L = self.phys_cylinder_radius\n+#         self.T = self.phys_cylinder_radius/self.phys_inlet_velocity\n+#\n+#         self.dim_inlet_velocity = (self.T/self.L) * self.phys_inlet_velocity\n+#\n+#     def initialize_grid_dims(self):\n+#         \"\"\"Necessary for subclassing\"\"\"\n+#\n+#         self.lx = int(np.ceil((self.phys_pipe_length / self.L)*self.N))\n+#         self.ly = int(np.ceil((self.phys_diameter / self.L)*self.N))\n+#\n+#         self.nx = self.lx + 1 # Total size of grid in x including boundary\n+#         self.ny = self.ly + 1 # Total size of grid in y including boundary\n+#\n+#         ## Initialize the obstacle mask\n+#         self.obstacle_mask = np.zeros((self.nx, self.ny), dtype=np.bool, order='F')\n+#\n+#         # Initialize the obstacle in the correct place\n+#         x_cylinder = self.N * self.phys_cylinder_center[0]/self.L\n+#         y_cylinder = self.N * self.phys_cylinder_center[1]/self.L\n+#\n+#         circle = ski.draw.circle(x_cylinder, y_cylinder, self.N)\n+#         self.obstacle_mask[circle[0], circle[1]] = True\n+#\n+#     def move_bcs(self):\n+#         \"\"\"This is slow; cythonizing makes it fast.\"\"\"\n+#\n+#         cdef int lx = self.lx\n+#         cdef int ly = self.ly\n+#\n+#         cdef float u_w = self.lb_inlet_velocity\n+#         cdef float u_e = self.lb_inlet_velocity\n+#\n+#         cdef float[:,:,:] farr = self.f\n+#         cdef float[:] rho_w = self.rho[0, 1:ly]\n+#         cdef float[:] rho_e = self.rho[lx, 1:ly]\n+#\n+#         cdef float[:,:,:] f = self.f\n+#         cdef int ii\n+#\n+#         for ii in range(1,ly):\n+#             # INLET: imposed velocity of u_w in the x direction and 0 in the y direction\n+#\n+#             farr[1, 0, ii] = farr[3,0,ii] + (2./3.)*rho_w[ii]*u_w\n+#             farr[5, 0, ii] = farr[7,0,ii] - (1./2.)*(farr[2,0,ii]-farr[4,0,ii]) + (1./6.)*rho_w[ii]*u_w\n+#             farr[8, 0, ii] = farr[6,0,ii] + (1./2.)*(farr[2,0,ii]-farr[4,0,ii]) + (1./6.)*rho_w[ii]*u_w\n+#\n+#             # OUTLET: imposed velocity of u_w in the x direction and 0 in the y direction\n+#             rho_e[ii] = (1./(1.+u_e))*(farr[0,lx,ii]+farr[2,lx,ii]+farr[4,lx,ii]+2.*(farr[1,lx,ii]+farr[5,lx,ii]+farr[8,lx,ii]))","path":"LB_D2Q9/dimensionless/cython_dim.pyx","position":490,"original_position":490,"commit_id":"f2db6758e6c6803ea3279ec50aec263d78299353","original_commit_id":"f29a60f14fdfefa7d0e7e1d7411d502ad1c1b97b","user":{"login":"matheuscfernandes","id":8809429,"avatar_url":"https://avatars.githubusercontent.com/u/8809429?v=3","gravatar_id":"","url":"https://api.github.com/users/matheuscfernandes","html_url":"https://github.com/matheuscfernandes","followers_url":"https://api.github.com/users/matheuscfernandes/followers","following_url":"https://api.github.com/users/matheuscfernandes/following{/other_user}","gists_url":"https://api.github.com/users/matheuscfernandes/gists{/gist_id}","starred_url":"https://api.github.com/users/matheuscfernandes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matheuscfernandes/subscriptions","organizations_url":"https://api.github.com/users/matheuscfernandes/orgs","repos_url":"https://api.github.com/users/matheuscfernandes/repos","events_url":"https://api.github.com/users/matheuscfernandes/events{/privacy}","received_events_url":"https://api.github.com/users/matheuscfernandes/received_events","type":"User","site_admin":false},"body":"I am not updating the rho's here. I am just creating an 'equivalent' rho to compute the velocity bc and what the f's have to be. I am not altering the rho's of the simulation....","created_at":"2015-12-04T14:37:09Z","updated_at":"2015-12-04T14:37:09Z","html_url":"https://github.com/latticeboltzmann/2d-lb/pull/29#discussion_r46687353","pull_request_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/latticeboltzmann/2d-lb/pulls/comments/46687353"},"html":{"href":"https://github.com/latticeboltzmann/2d-lb/pull/29#discussion_r46687353"},"pull_request":{"href":"https://api.github.com/repos/latticeboltzmann/2d-lb/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/latticeboltzmann/2d-lb/pulls/29","id":52624230,"html_url":"https://github.com/latticeboltzmann/2d-lb/pull/29","diff_url":"https://github.com/latticeboltzmann/2d-lb/pull/29.diff","patch_url":"https://github.com/latticeboltzmann/2d-lb/pull/29.patch","issue_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/issues/29","number":29,"state":"open","locked":false,"title":"Restructuring the code","user":{"login":"btweinstein","id":5347518,"avatar_url":"https://avatars.githubusercontent.com/u/5347518?v=3","gravatar_id":"","url":"https://api.github.com/users/btweinstein","html_url":"https://github.com/btweinstein","followers_url":"https://api.github.com/users/btweinstein/followers","following_url":"https://api.github.com/users/btweinstein/following{/other_user}","gists_url":"https://api.github.com/users/btweinstein/gists{/gist_id}","starred_url":"https://api.github.com/users/btweinstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btweinstein/subscriptions","organizations_url":"https://api.github.com/users/btweinstein/orgs","repos_url":"https://api.github.com/users/btweinstein/repos","events_url":"https://api.github.com/users/btweinstein/events{/privacy}","received_events_url":"https://api.github.com/users/btweinstein/received_events","type":"User","site_admin":false},"body":"Restructuring and rewriting with dimensionless units in python, cython, and opencl. There are some problems with your code @matheuscfernandes, though....I propose that if we cannot figure out the issues, we just do not use the periodic velocity inlet. Perhaps you can help me figure them out though!","created_at":"2015-12-04T02:56:20Z","updated_at":"2015-12-04T14:37:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"844d09abcd2855e7ddade74d4568eb29d6347710","assignee":{"login":"matheuscfernandes","id":8809429,"avatar_url":"https://avatars.githubusercontent.com/u/8809429?v=3","gravatar_id":"","url":"https://api.github.com/users/matheuscfernandes","html_url":"https://github.com/matheuscfernandes","followers_url":"https://api.github.com/users/matheuscfernandes/followers","following_url":"https://api.github.com/users/matheuscfernandes/following{/other_user}","gists_url":"https://api.github.com/users/matheuscfernandes/gists{/gist_id}","starred_url":"https://api.github.com/users/matheuscfernandes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matheuscfernandes/subscriptions","organizations_url":"https://api.github.com/users/matheuscfernandes/orgs","repos_url":"https://api.github.com/users/matheuscfernandes/repos","events_url":"https://api.github.com/users/matheuscfernandes/events{/privacy}","received_events_url":"https://api.github.com/users/matheuscfernandes/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/pulls/29/commits","review_comments_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/pulls/29/comments","review_comment_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/issues/29/comments","statuses_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/statuses/f2db6758e6c6803ea3279ec50aec263d78299353","head":{"label":"btweinstein:master","ref":"master","sha":"f2db6758e6c6803ea3279ec50aec263d78299353","user":{"login":"btweinstein","id":5347518,"avatar_url":"https://avatars.githubusercontent.com/u/5347518?v=3","gravatar_id":"","url":"https://api.github.com/users/btweinstein","html_url":"https://github.com/btweinstein","followers_url":"https://api.github.com/users/btweinstein/followers","following_url":"https://api.github.com/users/btweinstein/following{/other_user}","gists_url":"https://api.github.com/users/btweinstein/gists{/gist_id}","starred_url":"https://api.github.com/users/btweinstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btweinstein/subscriptions","organizations_url":"https://api.github.com/users/btweinstein/orgs","repos_url":"https://api.github.com/users/btweinstein/repos","events_url":"https://api.github.com/users/btweinstein/events{/privacy}","received_events_url":"https://api.github.com/users/btweinstein/received_events","type":"User","site_admin":false},"repo":{"id":46442862,"name":"2d-lb","full_name":"btweinstein/2d-lb","owner":{"login":"btweinstein","id":5347518,"avatar_url":"https://avatars.githubusercontent.com/u/5347518?v=3","gravatar_id":"","url":"https://api.github.com/users/btweinstein","html_url":"https://github.com/btweinstein","followers_url":"https://api.github.com/users/btweinstein/followers","following_url":"https://api.github.com/users/btweinstein/following{/other_user}","gists_url":"https://api.github.com/users/btweinstein/gists{/gist_id}","starred_url":"https://api.github.com/users/btweinstein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btweinstein/subscriptions","organizations_url":"https://api.github.com/users/btweinstein/orgs","repos_url":"https://api.github.com/users/btweinstein/repos","events_url":"https://api.github.com/users/btweinstein/events{/privacy}","received_events_url":"https://api.github.com/users/btweinstein/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/btweinstein/2d-lb","description":"Lattice boltzmann with python, cython, and pyOpenCL.","fork":true,"url":"https://api.github.com/repos/btweinstein/2d-lb","forks_url":"https://api.github.com/repos/btweinstein/2d-lb/forks","keys_url":"https://api.github.com/repos/btweinstein/2d-lb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/btweinstein/2d-lb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/btweinstein/2d-lb/teams","hooks_url":"https://api.github.com/repos/btweinstein/2d-lb/hooks","issue_events_url":"https://api.github.com/repos/btweinstein/2d-lb/issues/events{/number}","events_url":"https://api.github.com/repos/btweinstein/2d-lb/events","assignees_url":"https://api.github.com/repos/btweinstein/2d-lb/assignees{/user}","branches_url":"https://api.github.com/repos/btweinstein/2d-lb/branches{/branch}","tags_url":"https://api.github.com/repos/btweinstein/2d-lb/tags","blobs_url":"https://api.github.com/repos/btweinstein/2d-lb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/btweinstein/2d-lb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/btweinstein/2d-lb/git/refs{/sha}","trees_url":"https://api.github.com/repos/btweinstein/2d-lb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/btweinstein/2d-lb/statuses/{sha}","languages_url":"https://api.github.com/repos/btweinstein/2d-lb/languages","stargazers_url":"https://api.github.com/repos/btweinstein/2d-lb/stargazers","contributors_url":"https://api.github.com/repos/btweinstein/2d-lb/contributors","subscribers_url":"https://api.github.com/repos/btweinstein/2d-lb/subscribers","subscription_url":"https://api.github.com/repos/btweinstein/2d-lb/subscription","commits_url":"https://api.github.com/repos/btweinstein/2d-lb/commits{/sha}","git_commits_url":"https://api.github.com/repos/btweinstein/2d-lb/git/commits{/sha}","comments_url":"https://api.github.com/repos/btweinstein/2d-lb/comments{/number}","issue_comment_url":"https://api.github.com/repos/btweinstein/2d-lb/issues/comments{/number}","contents_url":"https://api.github.com/repos/btweinstein/2d-lb/contents/{+path}","compare_url":"https://api.github.com/repos/btweinstein/2d-lb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/btweinstein/2d-lb/merges","archive_url":"https://api.github.com/repos/btweinstein/2d-lb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/btweinstein/2d-lb/downloads","issues_url":"https://api.github.com/repos/btweinstein/2d-lb/issues{/number}","pulls_url":"https://api.github.com/repos/btweinstein/2d-lb/pulls{/number}","milestones_url":"https://api.github.com/repos/btweinstein/2d-lb/milestones{/number}","notifications_url":"https://api.github.com/repos/btweinstein/2d-lb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/btweinstein/2d-lb/labels{/name}","releases_url":"https://api.github.com/repos/btweinstein/2d-lb/releases{/id}","created_at":"2015-11-18T19:42:25Z","updated_at":"2015-12-01T18:39:39Z","pushed_at":"2015-12-04T03:12:56Z","git_url":"git://github.com/btweinstein/2d-lb.git","ssh_url":"git@github.com:btweinstein/2d-lb.git","clone_url":"https://github.com/btweinstein/2d-lb.git","svn_url":"https://github.com/btweinstein/2d-lb","homepage":"","size":20954,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"latticeboltzmann:master","ref":"master","sha":"acaf1d869f3f13f9aadf3eafec3034214ddb5c58","user":{"login":"latticeboltzmann","id":15695862,"avatar_url":"https://avatars.githubusercontent.com/u/15695862?v=3","gravatar_id":"","url":"https://api.github.com/users/latticeboltzmann","html_url":"https://github.com/latticeboltzmann","followers_url":"https://api.github.com/users/latticeboltzmann/followers","following_url":"https://api.github.com/users/latticeboltzmann/following{/other_user}","gists_url":"https://api.github.com/users/latticeboltzmann/gists{/gist_id}","starred_url":"https://api.github.com/users/latticeboltzmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/latticeboltzmann/subscriptions","organizations_url":"https://api.github.com/users/latticeboltzmann/orgs","repos_url":"https://api.github.com/users/latticeboltzmann/repos","events_url":"https://api.github.com/users/latticeboltzmann/events{/privacy}","received_events_url":"https://api.github.com/users/latticeboltzmann/received_events","type":"Organization","site_admin":false},"repo":{"id":46239387,"name":"2d-lb","full_name":"latticeboltzmann/2d-lb","owner":{"login":"latticeboltzmann","id":15695862,"avatar_url":"https://avatars.githubusercontent.com/u/15695862?v=3","gravatar_id":"","url":"https://api.github.com/users/latticeboltzmann","html_url":"https://github.com/latticeboltzmann","followers_url":"https://api.github.com/users/latticeboltzmann/followers","following_url":"https://api.github.com/users/latticeboltzmann/following{/other_user}","gists_url":"https://api.github.com/users/latticeboltzmann/gists{/gist_id}","starred_url":"https://api.github.com/users/latticeboltzmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/latticeboltzmann/subscriptions","organizations_url":"https://api.github.com/users/latticeboltzmann/orgs","repos_url":"https://api.github.com/users/latticeboltzmann/repos","events_url":"https://api.github.com/users/latticeboltzmann/events{/privacy}","received_events_url":"https://api.github.com/users/latticeboltzmann/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/latticeboltzmann/2d-lb","description":"A simple python-based lattice boltzmann simulation.","fork":false,"url":"https://api.github.com/repos/latticeboltzmann/2d-lb","forks_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/forks","keys_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/teams","hooks_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/hooks","issue_events_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/issues/events{/number}","events_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/events","assignees_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/assignees{/user}","branches_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/branches{/branch}","tags_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/tags","blobs_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/git/refs{/sha}","trees_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/statuses/{sha}","languages_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/languages","stargazers_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/stargazers","contributors_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/contributors","subscribers_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/subscribers","subscription_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/subscription","commits_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/commits{/sha}","git_commits_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/git/commits{/sha}","comments_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/comments{/number}","issue_comment_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/issues/comments{/number}","contents_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/contents/{+path}","compare_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/merges","archive_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/downloads","issues_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/issues{/number}","pulls_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/pulls{/number}","milestones_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/milestones{/number}","notifications_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/labels{/name}","releases_url":"https://api.github.com/repos/latticeboltzmann/2d-lb/releases{/id}","created_at":"2015-11-15T22:44:41Z","updated_at":"2015-11-30T23:34:08Z","pushed_at":"2015-12-04T03:12:56Z","git_url":"git://github.com/latticeboltzmann/2d-lb.git","ssh_url":"git@github.com:latticeboltzmann/2d-lb.git","clone_url":"https://github.com/latticeboltzmann/2d-lb.git","svn_url":"https://github.com/latticeboltzmann/2d-lb","homepage":null,"size":18669,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/latticeboltzmann/2d-lb/pulls/29"},"html":{"href":"https://github.com/latticeboltzmann/2d-lb/pull/29"},"issue":{"href":"https://api.github.com/repos/latticeboltzmann/2d-lb/issues/29"},"comments":{"href":"https://api.github.com/repos/latticeboltzmann/2d-lb/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/latticeboltzmann/2d-lb/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/latticeboltzmann/2d-lb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/latticeboltzmann/2d-lb/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/latticeboltzmann/2d-lb/statuses/f2db6758e6c6803ea3279ec50aec263d78299353"}}}}