From ffee727a59f0bc33e8edb16cf75b3d71cf868f8d Mon Sep 17 00:00:00 2001
From: Martin Bauer <martin.bauer@fau.de>
Date: Mon, 30 Jul 2018 16:36:14 +0200
Subject: [PATCH] Bugfix: absolute accessing of pystencils fields on GPU

---
 transformations.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/transformations.py b/transformations.py
index 6e43fd912..d3659807c 100644
--- a/transformations.py
+++ b/transformations.py
@@ -432,7 +432,10 @@ def resolve_field_accesses(ast_node, read_only_field_names=set(),
                 for e in group_param:
                     if e < field.spatial_dimensions:
                         if field.name in field_to_fixed_coordinates:
-                            coordinates[e] = field_to_fixed_coordinates[field.name][e]
+                            if not field_access.is_absolute_access:
+                                coordinates[e] = field_to_fixed_coordinates[field.name][e]
+                            else:
+                                coordinates[e] = 0
                         else:
                             if not field_access.is_absolute_access:
                                 coordinates[e] = ast.LoopOverCoordinate.get_loop_counter_symbol(e)
-- 
GitLab