Commit 78acf4f6 authored by Jan Hönig's avatar Jan Hönig
Browse files

Deleted unneeded imports of memorycache, since it is lru_cache.

parent 0fd6f004
from functools import lru_cache
import numpy as np
import sympy as sp
......@@ -6,7 +8,6 @@ from pystencils.astnodes import SympyAssignment
from pystencils.backends.cbackend import CustomCodeNode
from pystencils.boundaries.createindexlist import (
create_boundary_index_array, numpy_data_type_for_boundary_object)
from pystencils.cache import memorycache
from pystencils.typing import TypedSymbol, create_type
from pystencils.datahandling.pycuda import PyCudaArrayHandler
from pystencils.field import Field
......@@ -378,15 +379,15 @@ class BoundaryDataSetter:
assert coord < self.dim
return self.index_array[self.coord_map[coord]] + self.offset[coord] - self.ghost_layers + 0.5
@memorycache()
@lru_cache()
def link_offsets(self):
return self.stencil[self.index_array['dir']]
@memorycache()
@lru_cache()
def link_positions(self, coord):
return self.non_boundary_cell_positions(coord) + 0.5 * self.link_offsets()[:, coord]
@memorycache()
@lru_cache()
def boundary_cell_positions(self, coord):
return self.non_boundary_cell_positions(coord) + self.link_offsets()[:, coord]
......
from functools import lru_cache
from typing import Tuple
import sympy as sp
from pystencils.astnodes import LoopOverCoordinate
from pystencils.cache import memorycache
from pystencils.fd import Diff
from pystencils.field import Field
from pystencils.transformations import generic_visit
......@@ -136,7 +136,7 @@ def discretize_spatial_staggered(expr, dx, stencil=fd_stencils_standard):
# -------------------------------------- special stencils --------------------------------------------------------------
@memorycache(maxsize=1)
@lru_cache(maxsize=1)
def forth_order_2d_derivation() -> Tuple[FiniteDifferenceStencilDerivation.Result, ...]:
# Symmetry, isotropy and 4th order conditions are not enough to fully specify the stencil
# one weight has to be specifically set to a somewhat arbitrary value
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment