def map_operator_binding(self, expr): from meshmode.mesh import BTAG_PARTITION from meshmode.discretization.connection import (FACE_RESTR_ALL, FACE_RESTR_INTERIOR) if (isinstance(expr.op, op.ProjectionOperator) and expr.op.dd_in.domain_tag is FACE_RESTR_INTERIOR and expr.op.dd_out.domain_tag is FACE_RESTR_ALL): distributed_work = 0 for i_remote_part in self.connected_parts: mapped_field = RankGeometryChanger(i_remote_part)(expr.field) btag_part = BTAG_PARTITION(i_remote_part) distributed_work += op.ProjectionOperator( dd_in=btag_part, dd_out=expr.op.dd_out)(mapped_field) return expr + distributed_work else: return IdentityMapper.map_operator_binding(self, expr)
def map_operator_binding(self, expr): if (isinstance(expr.op, op.OppositeInteriorFaceSwap) and expr.op.dd_in == self.prev_dd and expr.op.dd_out == self.prev_dd): field = self.rec(expr.field) return op.OppositePartitionFaceSwap(dd_in=self.new_dd, dd_out=self.new_dd)(field) elif (isinstance(expr.op, op.ProjectionOperator) and expr.op.dd_out == self.prev_dd): return op.ProjectionOperator(dd_in=expr.op.dd_in, dd_out=self.new_dd)(expr.field) elif (isinstance(expr.op, op.RefDiffOperatorBase) and expr.op.dd_out == self.prev_dd and expr.op.dd_in == self.prev_dd): return type(expr.op)(expr.op.rst_axis, dd_in=self.new_dd, dd_out=self.new_dd)(self.rec(expr.field))