diff --git a/meshmode/discretization/connection.py b/meshmode/discretization/connection.py index 4eea25275542eaa5f165d3dd68a5d754ec4eaecf..2b5eadeb11b545da0e8bc79c8d8cd245da57956d 100644 --- a/meshmode/discretization/connection.py +++ b/meshmode/discretization/connection.py @@ -61,17 +61,22 @@ class InterpolationBatch(object): least three different interpolation batches are needed to cover boundary edges that fall onto each of the three edges of the unit triangle. - .. attribute:: source_element_indices + .. attribute:: from_group_index - A :class:`pyopencl.array.Arrays` of length ``nelements``, containing the - element index from which this "*to*" element's data will be - interpolated. + An integer indicating from which element group in the *from* discretization + the data should be interpolated. - .. attribute:: target_element_indices + .. attribute:: from_element_indices - A :class:`pyopencl.array.Arrays` of length ``nelements``, containing the - element index to which this "*to*" element's data will be - interpolated. + A :class:`pyopencl.array.Array` of length ``nelements``, containing the + (group-local) element index (relative to :attr:`from_group_index` from + which this "*to*" element's data will be interpolated. + + .. attribute:: to_element_indices + + A :class:`pyopencl.array.Arrays` of length ``nelements``, containing + the (group-local) element index to which this "*to*" element's data + will be interpolated. .. attribute:: result_unit_nodes @@ -82,15 +87,16 @@ class InterpolationBatch(object): locations of this element should be interpolated. """ - def __init__(self, source_element_indices, - target_element_indices, result_unit_nodes): - self.source_element_indices = source_element_indices - self.target_element_indices = target_element_indices + def __init__(self, from_group_index, from_element_indices, + to_element_indices, result_unit_nodes): + self.from_group_index = from_group_index + self.from_element_indices = from_element_indices + self.to_element_indices = to_element_indices self.result_unit_nodes = result_unit_nodes @property def nelements(self): - return len(self.source_element_indices) + return len(self.from_element_indices) class DiscretizationConnectionElementGroup(object): @@ -113,7 +119,7 @@ class DiscretizationConnection(object): a list of :class:`MeshConnectionGroup` instances, with a one-to-one correspondence to the groups in - :attr:`from_discr` and :attr:`to_discr`. + :attr:`to_discr`. """ def __init__(self, from_discr, to_discr, groups): @@ -128,10 +134,10 @@ class DiscretizationConnection(object): self.groups = groups @memoize_method - def _resample_matrix(self, elgroup_index, ibatch_index): + def _resample_matrix(self, to_group_index, ibatch_index): import modepy as mp - ibatch = self.groups[elgroup_index].batches[ibatch_index] - from_grp = self.from_discr.groups[elgroup_index] + ibatch = self.groups[to_group_index].batches[ibatch_index] + from_grp = self.from_discr.groups[ibatch.from_group_index] return mp.resampling_matrix( mp.simplex_onb(self.from_discr.dim, from_grp.order), @@ -146,8 +152,8 @@ class DiscretizationConnection(object): 0<=k