Skip to content
Snippets Groups Projects
Commit fc4b685f authored by Marcel Koch's avatar Marcel Koch
Browse files

make dimension independent

parent 98af9462
No related branches found
No related tags found
No related merge requests found
......@@ -313,7 +313,8 @@ def name_point_in_macro(point_in_micro):
def apply_constant_to_global_transformation(name, local):
temporary_variable(name, shape=(world_dimension(),), managed=True)
dim = world_dimension()
temporary_variable(name, shape=(dim,), managed=True)
corners = name_element_corners()
if isinstance(local, str):
......@@ -324,7 +325,7 @@ def apply_constant_to_global_transformation(name, local):
# global[d] = lower_left[d] + local[d] * (upper_right[d] - lower_left[d])
expr = prim.Sum((prim.Subscript(prim.Variable(corners), (0,prim.Variable(d))),
prim.Product((prim.Subscript(local, (prim.Variable(d),)),
prim.Sum((prim.Subscript(prim.Variable(corners), (3, prim.Variable(d))),
prim.Sum((prim.Subscript(prim.Variable(corners), (2**dim - 1, prim.Variable(d))),
-1 * prim.Subscript(prim.Variable(corners), (0, prim.Variable(d)))))
))
))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment