Skip to content

Commit

Permalink
freeze constant arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushikcfd committed Oct 13, 2022
1 parent f09fdd4 commit 11339a4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions meshmode/discretization/connection/direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@ class _FromGroupPickData(Generic[ArrayT]):
from_element_indices: ArrayT
is_surjective: bool

@memoize_method
def indexed_dof_pick_lists(self, actx):
return actx.freeze(
actx.thaw(self.dof_pick_lists)[actx.thaw(self.dof_pick_list_indices)])

# }}}


Expand Down Expand Up @@ -736,8 +741,7 @@ def group_pick_knl(is_surjective: bool):
grp_ary_contrib = ary[fgpd.from_group_index][
_reshape_and_preserve_tags(
actx, from_element_indices, (-1, 1)),
actx.thaw(fgpd.dof_pick_lists)[
actx.thaw(fgpd.dof_pick_list_indices)]
actx.thaw(fgpd.indexed_dof_pick_lists(actx))
]

if not fgpd.is_surjective:
Expand Down

0 comments on commit 11339a4

Please sign in to comment.