def smooth(self, level, nsmooth):
        v = self.grids[level].get_var("v")
        f = self.grids[level].get_var("f")

        myg = self.grids[level].grid

        dx = myg.dx
        dy = myg.dy

        self.grids[level].fill_BC("v")

        alpha = self.grids[level].get_var("alpha")
        gamma_x = 0.5*self.grids[level].get_var("gamma_x")/dx
        gamma_y = 0.5*self.grids[level].get_var("gamma_y")/dy

        # these are already scaled by 1/dx**2 in the EdgeCoeffs
        # construction
        beta_x = self.beta_edge[level].x
        beta_y = self.beta_edge[level].y


        # do red-black G-S
        for i in range(nsmooth):

            # do the red black updating in four decoupled groups
            #
            #
            #        |       |       |
            #      --+-------+-------+--
            #        |       |       |
            #        |   4   |   3   |
            #        |       |       |
            #      --+-------+-------+--
            #        |       |       |
            #   jlo  |   1   |   2   |
            #        |       |       |
            #      --+-------+-------+--
            #        |  ilo  |       |
            #
            # groups 1 and 3 are done together, then we need to
            # fill ghost cells, and then groups 2 and 4

            for n, (ix, iy) in enumerate([(0,0), (1,1), (1,0), (0,1)]):

                denom = (
                    alpha.ip_jp(ix, iy, s=2) -
                    beta_x.ip_jp(1+ix, iy, s=2) - beta_x.ip_jp(ix, iy, s=2) -
                    beta_y.ip_jp(ix, 1+iy, s=2) - beta_y.ip_jp(ix, iy, s=2) )

                v.ip_jp(ix, iy, s=2)[:,:] = (f.ip_jp(ix, iy, s=2) -
                    # (beta_{i+1/2,j} + gamma^x_{i,j}) phi_{i+1,j}
                    (beta_x.ip_jp(1+ix, iy, s=2) + gamma_x.ip_jp(ix, iy, s=2))*
                     v.ip_jp(1+ix, iy, s=2) - 
                    # (beta_{i-1/2,j} - gamma^x_{i,j}) phi_{i-1,j}
                    (beta_x.ip_jp(ix, iy, s=2) - gamma_x.ip_jp(ix, iy, s=2))*
                     v.ip_jp(-1+ix, iy, s=2) - 
                    # (beta_{i,j+1/2} + gamma^y_{i,j}) phi_{i,j+1}
                    (beta_y.ip_jp(ix, 1+iy, s=2) + gamma_y.ip_jp(ix, iy, s=2))*
                     v.ip_jp(ix, 1+iy, s=2) -
                    # (beta_{i,j-1/2} - gamma^y_{i,j}) phi_{i,j-1}
                    (beta_y.ip_jp(ix, iy, s=2) - gamma_y.ip_jp(ix, iy, s=2))*
                     v.ip_jp(ix, -1+iy, s=2)) / denom

                if n == 1 or n == 3:
                    self.grids[level].fill_BC("v")


            if self.vis == 1:
                plt.clf()

                plt.subplot(221)
                self._draw_solution()

                plt.subplot(222)
                self._draw_V()

                plt.subplot(223)
                self._draw_main_solution()

                plt.subplot(224)
                self._draw_main_error()


                plt.suptitle(self.vis_title, fontsize=18)

                plt.draw()
                plt.savefig("mg_%4.4d.png" % (self.frame))
                self.frame += 1
Test a valid call to process_request
dataset/ETHPy150Open zingale/pyro2/multigrid/general_MG.py/GeneralMG2d.smooth--crossover with--dataset/ETHPy150Open ofa/connect/open_connect/mailer/tests/test_views.py/TestOpenView.test_process_request