def naive_equal( self, bc, q, flux ): """ maintain variable values at boundary """ r = self.stencil_radius i = mth.step_into_array( bc.indx, r ) f = flux[:,i] for i in range( 0, self.stencil_radius ): j = mth.step_into_array( bc.indx, i ) flux[:, j ] = f return
def naive_outflow( self, bc, q, flux ): """ freeze the solution at the outflow boundary and convect out at constant velocity """ r = self.stencil_radius i = mth.step_into_array( bc.indx, r-1 ) c = self.vel[i] for i in range( 0, self.stencil_radius ): idx = mth.step_into_array( bc.indx, i ) flux[ idx ] = c * q[ idx ] return
def naive_adiabatic(self, bc, q, flux): """ apply zero flux at boundary cells """ for i in range(0, self.stencil_radius): idx = mth.step_into_array(bc.indx, i) flux[:, idx] = 0 return