diff --git a/.github/workflows/dolfin-tests.yml b/.github/workflows/dolfin-tests.yml index c0146e921..5065b723b 100644 --- a/.github/workflows/dolfin-tests.yml +++ b/.github/workflows/dolfin-tests.yml @@ -14,8 +14,8 @@ jobs: container: fenicsproject/test-env:latest-openmpi env: - CC: clang-10 - CXX: clang++-10 + CC: clang-12 + CXX: clang++-12 PETSC_ARCH: linux-gnu-complex-32 OMPI_ALLOW_RUN_AS_ROOT: 1 diff --git a/ffcx/codegeneration/expressions.py b/ffcx/codegeneration/expressions.py index 5234e37d6..c1149973f 100644 --- a/ffcx/codegeneration/expressions.py +++ b/ffcx/codegeneration/expressions.py @@ -63,6 +63,7 @@ def generator(ir, parameters): d["num_coefficients"] = len(ir.coefficient_numbering) d["num_points"] = ir.points.shape[0] d["topological_dimension"] = ir.points.shape[1] + d["needs_facet_permutations"] = 1 if ir.needs_facet_permutations else 0 # Check that no keys are redundant or have been missed from string import Formatter diff --git a/ffcx/codegeneration/expressions_template.py b/ffcx/codegeneration/expressions_template.py index fae9e770b..9eed09369 100644 --- a/ffcx/codegeneration/expressions_template.py +++ b/ffcx/codegeneration/expressions_template.py @@ -29,6 +29,7 @@ .num_coefficients = {num_coefficients}, .num_points = {num_points}, .topological_dimension = {topological_dimension}, + .needs_facet_permutations = {needs_facet_permutations}, .points = {points}, .value_shape = {value_shape}, .num_components = {num_components}, diff --git a/ffcx/codegeneration/integrals.py b/ffcx/codegeneration/integrals.py index fd2f822a3..5783b5d24 100644 --- a/ffcx/codegeneration/integrals.py +++ b/ffcx/codegeneration/integrals.py @@ -77,7 +77,8 @@ def generator(ir, parameters): factory_name=factory_name, enabled_coefficients=code["enabled_coefficients"], enabled_coefficients_init=code["enabled_coefficients_init"], - tabulate_tensor=code["tabulate_tensor"]) + tabulate_tensor=code["tabulate_tensor"], + needs_facet_permutations=1 if ir.needs_facet_permutations else 0) return declaration, implementation diff --git a/ffcx/codegeneration/integrals_template.py b/ffcx/codegeneration/integrals_template.py index f85e37113..8c400995a 100644 --- a/ffcx/codegeneration/integrals_template.py +++ b/ffcx/codegeneration/integrals_template.py @@ -26,6 +26,7 @@ {{ .enabled_coefficients = {enabled_coefficients}, .tabulate_tensor = tabulate_tensor_{factory_name}, + .needs_facet_permutations = {needs_facet_permutations}, }}; // End of code for integral {factory_name} diff --git a/ffcx/codegeneration/ufc.h b/ffcx/codegeneration/ufc.h index 64dbf0ce0..495eee3c1 100644 --- a/ffcx/codegeneration/ufc.h +++ b/ffcx/codegeneration/ufc.h @@ -231,12 +231,14 @@ extern "C" { const bool* enabled_coefficients; ufc_tabulate_tensor* tabulate_tensor; + bool needs_facet_permutations; } ufc_integral; typedef struct ufc_custom_integral { const bool* enabled_coefficients; ufc_tabulate_tensor_custom* tabulate_tensor; + bool needs_facet_permutations; } ufc_custom_integral; typedef struct ufc_expression @@ -271,6 +273,9 @@ extern "C" /// reference cell int topological_dimension; + /// Indicates whether facet permutations are needed + bool needs_facet_permutations; + /// Coordinates of evaluations points. Dimensions: /// points[num_points][topological_dimension] const double* points; diff --git a/ffcx/ir/integral.py b/ffcx/ir/integral.py index 6a9fba816..12f898eba 100644 --- a/ffcx/ir/integral.py +++ b/ffcx/ir/integral.py @@ -260,6 +260,10 @@ def compute_integral_ir(cell, integral_type, entitytype, integrands, argument_sh ir["integrand"][quadrature_rule] = {"factorization": F, "modified_arguments": [F.nodes[i]['mt'] for i in argkeys], "block_contributions": block_contributions} + + restrictions = [i.restriction for i in initial_terminals.values()] + ir["needs_facet_permutations"] = "+" in restrictions and "-" in restrictions + return ir diff --git a/ffcx/ir/representation.py b/ffcx/ir/representation.py index 8943407fc..47e926a07 100644 --- a/ffcx/ir/representation.py +++ b/ffcx/ir/representation.py @@ -52,12 +52,12 @@ 'num_facets', 'num_vertices', 'enabled_coefficients', 'element_dimensions', 'element_ids', 'tensor_shape', 'coefficient_numbering', 'coefficient_offsets', 'original_constant_offsets', 'params', 'cell_shape', 'unique_tables', 'unique_table_types', - 'table_dofmaps', 'integrand', 'name', 'precision']) + 'table_dofmaps', 'integrand', 'name', 'precision', 'needs_facet_permutations']) ir_expression = namedtuple('ir_expression', [ 'name', 'element_dimensions', 'params', 'unique_tables', 'unique_table_types', 'integrand', 'table_dofmaps', 'coefficient_numbering', 'coefficient_offsets', 'integral_type', 'entitytype', 'tensor_shape', 'expression_shape', 'original_constant_offsets', - 'original_coefficient_positions', 'points']) + 'original_coefficient_positions', 'points', 'needs_facet_permutations']) ir_data = namedtuple('ir_data', ['elements', 'dofmaps', 'integrals', 'forms', 'expressions'])