Commit 12238a82 authored by Martin Bauer's avatar Martin Bauer
Browse files

lbmpy: fixes in boundaries that take field values

previously the value was taken from the cell next to the boundary cell (i.e. the inner cell)
parent eee767f9
......@@ -325,6 +325,12 @@ class Field(object):
def index(self):
return self._index
def getNeighbor(self, *offsets):
return Field.Access(self.field, offsets, self.index)
def getShifted(self, *shift):
return Field.Access(self.field, tuple(a + b for a, b in zip(shift, self.offsets)), self.index)
def _hashable_content(self):
superClassContents = list(super(Field.Access, self)._hashable_content())
t = tuple(superClassContents + [hash(self._field), self._index] + self._offsets)
Supports Markdown
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