Skip to content
Snippets Groups Projects
Commit 838a20c9 authored by Rafael Ravedutti's avatar Rafael Ravedutti
Browse files

Fix code for DEM

parent 3ac8cd6f
Branches
Tags
No related merge requests found
...@@ -54,7 +54,7 @@ class Apply(Lowerable): ...@@ -54,7 +54,7 @@ class Apply(Lowerable):
return self._build_expression_with_index(expr, index)[0] return self._build_expression_with_index(expr, index)[0]
# TODO: This method should comprise all operators and dynamic data types, it would also be # TODO: This method should comprise all operators and dynamic data types, it would also be
# better to provide a better way to implement it such as a Mutator or Visitor # better to provide a way to implement it with a Mutator or Visitor
def _build_expression_with_index(self, expr, index): def _build_expression_with_index(self, expr, index):
if isinstance(expr, (ScalarOp, VectorOp)): if isinstance(expr, (ScalarOp, VectorOp)):
new_lhs, changed_lhs = self._build_expression_with_index(expr.lhs, index) new_lhs, changed_lhs = self._build_expression_with_index(expr.lhs, index)
......
...@@ -72,7 +72,7 @@ class CopyProperty(ASTNode): ...@@ -72,7 +72,7 @@ class CopyProperty(ASTNode):
class CopyContactProperty(ASTNode): class CopyContactProperty(ASTNode):
def __init__(self, sim, prop, ctx, write): def __init__(self, sim, prop, ctx, action):
super().__init__(sim) super().__init__(sim)
self._contact_prop = prop self._contact_prop = prop
self._ctx = ctx self._ctx = ctx
...@@ -89,7 +89,7 @@ class CopyContactProperty(ASTNode): ...@@ -89,7 +89,7 @@ class CopyContactProperty(ASTNode):
return self._action return self._action
def children(self): def children(self):
return [self._prop] return [self._contact_prop]
class CopyVar(ASTNode): class CopyVar(ASTNode):
......
...@@ -116,7 +116,7 @@ class Kernel(ASTNode): ...@@ -116,7 +116,7 @@ class Kernel(ASTNode):
new_op = 'w' if write else 'r' new_op = 'w' if write else 'r'
for contact_prop in contact_prop_list: for contact_prop in contact_prop_list:
assert isinstance(cp, ContactProperty), \ assert isinstance(contact_prop, ContactProperty), \
"Kernel.add_contact_property(): Element is not of type ContactProperty." "Kernel.add_contact_property(): Element is not of type ContactProperty."
action = Actions.NoAction if contact_prop not in self._contact_properties else \ action = Actions.NoAction if contact_prop not in self._contact_properties else \
......
...@@ -258,7 +258,7 @@ class ContactProperty(ASTNode): ...@@ -258,7 +258,7 @@ class ContactProperty(ASTNode):
def copy_size(self): def copy_size(self):
return ScalarOp.inline(self.sim.nlocal * return ScalarOp.inline(self.sim.nlocal *
self.sim.neighbor_capacity * self.sim.neighbor_capacity *
Types.number_of_elements(self.sim, self.prop_type) * Types.number_of_elements(self.sim, self.contact_prop_type) *
Sizeof(self.sim, self.type())) Sizeof(self.sim, self.type()))
def sizes(self): def sizes(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment