Skip to content
Snippets Groups Projects
Commit 0d4436a3 authored by Martin Bauer's avatar Martin Bauer
Browse files

Fixes in periodicity handling

parent 7bd9ce7a
Branches
Tags
No related merge requests found
......@@ -12,7 +12,7 @@ class BoundaryHandling(PeriodicityHandling, GenericBoundaryHandling): # importa
flagInterface = NumpyFlagFieldInterface(shapeWithGl, flagDtype)
GenericBoundaryHandling.__init__(self, flagInterface, pdfField, lbMethod, None, ghostLayers, target, openMP)
PeriodicityHandling.__init__(self, list(domainShape) + [len(lbMethod.stencil)])
PeriodicityHandling.__init__(self, list(domainShape) + [len(lbMethod.stencil)], target=target)
def __call__(self, *args, **kwargs):
for cls in BoundaryHandling.__bases__:
......
......@@ -2,12 +2,13 @@ from lbmpy.stencils import getStencil
class PeriodicityHandling(object):
def __init__(self, fieldShape, periodicity=(False, False, False)):
def __init__(self, fieldShape, periodicity=(False, False, False), target='cpu'):
self._spatialShape = fieldShape[:-1]
self._indexShape = fieldShape[-1]
self._periodicity = list(periodicity)
self._periodicityDirty = False
self._periodicityDirty = True
self._periodicityKernels = []
self._target = target
@property
def periodicity(self):
......@@ -33,7 +34,7 @@ class PeriodicityHandling(object):
return
self._periodicityKernels = []
dim = len(self.flagField.shape)
dim = len(self._spatialShape)
if dim == 2:
stencil = getStencil("D2Q9")
elif dim == 3:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment