def build_cache(self, x=None): grid = pyweno.grid.Grid(x) weno = pyweno.weno.WENO(grid=grid, order=self.k) weno.precompute_reconstruction('left') weno.precompute_reconstruction('right') weno.cache(self.cache) self.grid = grid self.weno = weno
def build_cache(self, x=None): k = self.k # create ghost cells y = np.zeros(x.size + 2*k) y[k:-k] = x[:] dx = x[1:] - x[:-1] for i in range(k+1): y[k-i] = y[k-i+1] - dx[-i] y[-k+i-1] = y[-k+i-2] + dx[i] # create grid for weno (includes ghost cells) ghost_grid = pyweno.grid.Grid(y) weno = pyweno.weno.WENO(grid=ghost_grid, order=self.k) weno.precompute_reconstruction('left') weno.precompute_reconstruction('right') weno.cache(self.cache) self.ghost_grid = ghost_grid self.grid = pyblaw.grid.Grid(x) self.weno = weno