def fill_BC(self, name):
    '\n        fill the boundary conditions.  This operates on a single state\n        variable at a time, to allow for maximum flexibility\n\n        we do periodic, reflect-even, reflect-odd, and outflow\n\n        each variable name has a corresponding bc_object stored in the\n        ccData2d object -- we refer to this to figure out the action\n        to take at each boundary.\n        '
    n = self.vars.index(name)
    if ((self.BCs[name].xlb == 'outflow') or (self.BCs[name].xlb == 'neumann')):
        for i in range(0, self.grid.ilo):
            self.data[(n, i)] = self.data[(n, self.grid.ilo)]
    elif (self.BCs[name].xlb == 'reflect-even'):
        for i in range(0, self.grid.ilo):
            self.data[(n, i)] = self.data[(n, (((2 * self.grid.ng) - i) - 1))]
    elif (self.BCs[name].xlb in ['reflect-odd', 'dirichlet']):
        for i in range(0, self.grid.ilo):
            self.data[(n, i)] = (- self.data[(n, (((2 * self.grid.ng) - i) - 1))])
    elif (self.BCs[name].xlb == 'periodic'):
        for i in range(0, self.grid.ilo):
            self.data[(n, i)] = self.data[(n, (((self.grid.ihi - self.grid.ng) + i) + 1))]
    if ((self.BCs[name].xrb == 'outflow') or (self.BCs[name].xrb == 'neumann')):
        for i in range((self.grid.ihi + 1), (self.grid.nx + (2 * self.grid.ng))):
            self.data[(n, i)] = self.data[(n, self.grid.ihi)]
    elif (self.BCs[name].xrb == 'reflect-even'):
        for i in range(0, self.grid.ng):
            i_bnd = ((self.grid.ihi + 1) + i)
            i_src = (self.grid.ihi - i)
            self.data[(n, i_bnd)] = self.data[(n, i_src)]
    elif (self.BCs[name].xrb in ['reflect-odd', 'dirichlet']):
        for i in range(0, self.grid.ng):
            i_bnd = ((self.grid.ihi + 1) + i)
            i_src = (self.grid.ihi - i)
            self.data[(n, i_bnd)] = (- self.data[(n, i_src)])
    elif (self.BCs[name].xrb == 'periodic'):
        for i in range((self.grid.ihi + 1), ((2 * self.grid.ng) + self.grid.nx)):
            self.data[(n, i)] = self.data[(n, (((i - self.grid.ihi) - 1) + self.grid.ng))]
fill the boundary conditions.  This operates on a single state
variable at a time, to allow for maximum flexibility

we do periodic, reflect-even, reflect-odd, and outflow

each variable name has a corresponding bc_object stored in the
ccData2d object -- we refer to this to figure out the action
to take at each boundary.
def fill_BC(self, name):
    '\n        fill the boundary conditions.  This operates on a single state\n        variable at a time, to allow for maximum flexibility\n\n        we do periodic, reflect-even, reflect-odd, and outflow\n\n        each variable name has a corresponding bc_object stored in the\n        ccData2d object -- we refer to this to figure out the action\n        to take at each boundary.\n        '
    n = self.vars.index(name)
    if ((self.BCs[name].xlb == 'outflow') or (self.BCs[name].xlb == 'neumann')):
        for i in range(0, self.grid.ilo):
            self.data[(n, i)] = self.data[(n, self.grid.ilo)]
    elif (self.BCs[name].xlb == 'reflect-even'):
        for i in range(0, self.grid.ilo):
            self.data[(n, i)] = self.data[(n, (((2 * self.grid.ng) - i) - 1))]
    elif (self.BCs[name].xlb in ['reflect-odd', 'dirichlet']):
        for i in range(0, self.grid.ilo):
            self.data[(n, i)] = (- self.data[(n, (((2 * self.grid.ng) - i) - 1))])
    elif (self.BCs[name].xlb == 'periodic'):
        for i in range(0, self.grid.ilo):
            self.data[(n, i)] = self.data[(n, (((self.grid.ihi - self.grid.ng) + i) + 1))]
    if ((self.BCs[name].xrb == 'outflow') or (self.BCs[name].xrb == 'neumann')):
        for i in range((self.grid.ihi + 1), (self.grid.nx + (2 * self.grid.ng))):
            self.data[(n, i)] = self.data[(n, self.grid.ihi)]
    elif (self.BCs[name].xrb == 'reflect-even'):
        for i in range(0, self.grid.ng):
            i_bnd = ((self.grid.ihi + 1) + i)
            i_src = (self.grid.ihi - i)
            self.data[(n, i_bnd)] = self.data[(n, i_src)]
    elif (self.BCs[name].xrb in ['reflect-odd', 'dirichlet']):
        for i in range(0, self.grid.ng):
            i_bnd = ((self.grid.ihi + 1) + i)
            i_src = (self.grid.ihi - i)
            self.data[(n, i_bnd)] = (- self.data[(n, i_src)])
    elif (self.BCs[name].xrb == 'periodic'):
        for i in range((self.grid.ihi + 1), ((2 * self.grid.ng) + self.grid.nx)):
            self.data[(n, i)] = self.data[(n, (((i - self.grid.ihi) - 1) + self.grid.ng))]