From 4ad6e1c10ec8790c48b703340bc9f2af5f5a3a34 Mon Sep 17 00:00:00 2001 From: ksagiyam Date: Tue, 10 Dec 2024 20:53:37 +0000 Subject: [PATCH] tsfc: rebase-fix --- tsfc/fem.py | 18 +++++++++++------- tsfc/kernel_interface/firedrake_loopy.py | 5 ++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/tsfc/fem.py b/tsfc/fem.py index 960396b4f4..8f15d2d528 100644 --- a/tsfc/fem.py +++ b/tsfc/fem.py @@ -113,13 +113,17 @@ def translator(self): @cached_property def use_canonical_quadrature_point_ordering(self): - filtered_map = {domain: integral_type for domain, integral_type in self.domain_integral_type_map.items() if integral_type is not None} + cell_integral_type_map = {as_fiat_cell(domain.ufl_cell()): integral_type + for domain, integral_type in self.domain_integral_type_map.items() + if integral_type is not None} + if all(integral_type == 'cell' for integral_type in cell_integral_type_map.values()): + return False + elif all(integral_type in ['exterior_facet', 'interior_facet'] for integral_type in cell_integral_type_map.values()): + if all(isinstance(cell, UFCHexahedron) for cell in cell_integral_type_map): + return True + elif len(set(cell_integral_type_map)) > 1: # mixed cell types + return True return False - import pdb;pdb.set_trace() - for domain, integral_type in filtered_map.items(): - if domain.ufl_cell() == 999: - pass - return isinstance(self.fiat_cell, UFCHexahedron) and self.integral_type in ['exterior_facet', 'interior_facet'] class CoordinateMapping(PhysicalGeometry): @@ -152,7 +156,7 @@ def preprocess(self, expr, context): @property def config(self): config = {name: getattr(self.interface, name) - for name in ["ufl_cell", "index_cache", "scalar_type"]} + for name in ["ufl_cell", "index_cache", "scalar_type", "domain_integral_type_map"]} config["interface"] = self.interface return config diff --git a/tsfc/kernel_interface/firedrake_loopy.py b/tsfc/kernel_interface/firedrake_loopy.py index 94733e9b69..fb522edcc2 100644 --- a/tsfc/kernel_interface/firedrake_loopy.py +++ b/tsfc/kernel_interface/firedrake_loopy.py @@ -10,7 +10,7 @@ import loopy as lp -from tsfc import kernel_args, fem +from tsfc import kernel_args from tsfc.finatinterface import create_element from tsfc.kernel_interface.common import KernelBuilderBase as _KernelBuilderBase, KernelBuilderMixin, get_index_names, check_requirements, prepare_coefficient, prepare_arguments, prepare_constant from tsfc.loopy import generate as generate_loopy @@ -504,8 +504,7 @@ def construct_kernel(self, name, ctx, log=False): exterior_facets=tuple(active_domain_numbers_exterior_facets), interior_facets=tuple(active_domain_numbers_interior_facets), exterior_facet_orientations=tuple(active_domain_numbers_exterior_facet_orientations), - interior_facet_orientations=tuple(active_domain_numbers_interior_facet_orientations), - ), + interior_facet_orientations=tuple(active_domain_numbers_interior_facet_orientations),), coefficient_numbers=tuple(zip(info.coefficient_numbers, coefficient_indices)), tabulations=tabulations, flop_count=flop_count,