diff --git a/field.py b/field.py index 5be82e17033fe3434c0a1d851482f82c5137a323..97a5893a9cbe507a41181fcc0eafdc36cf12cc57 100644 --- a/field.py +++ b/field.py @@ -204,6 +204,10 @@ class Field(object): offsetList[coordId] = offset return Field.Access(self, tuple(offsetList)) + def center(self): + center = tuple([0] * self.spatialDimensions) + return Field.Access(self, center) + def __getitem__(self, offset): if type(offset) is np.ndarray: offset = tuple(offset) diff --git a/transformations.py b/transformations.py index 1c9732eb0d50715e287816fd07114695e6f432d0..afad758d1b600a95013b344ad75977810d0a38d3 100644 --- a/transformations.py +++ b/transformations.py @@ -540,7 +540,8 @@ def getOptimalLoopOrdering(fields): layouts = set([field.layout for field in fields]) if len(layouts) > 1: - raise ValueError("Due to different layout of the fields no optimal loop ordering exists " + str(layouts)) + raise ValueError("Due to different layout of the fields no optimal loop ordering exists " + + str({f.name: f.layout for f in fields})) layout = list(layouts)[0] return list(layout)