Skip to content

Commit

Permalink
remove ufcx_cell_type enum
Browse files Browse the repository at this point in the history
  • Loading branch information
mscroggs committed Feb 14, 2025
1 parent 61bbc6d commit 9289781
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
4 changes: 2 additions & 2 deletions ffcx/codegeneration/C/integrals.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import logging
import sys

import basix
import numpy as np

from ffcx.codegeneration.backend import FFCXBackend
Expand All @@ -26,7 +27,6 @@ def generator(ir: IntegralIR, domain: str, options):
logger.info(f"--- type: {ir.expression.integral_type}")
logger.info(f"--- name: {ir.expression.name}")

"""Generate code for an integral."""
factory_name = f"{ir.expression.name}_{domain}"

# Format declaration
Expand Down Expand Up @@ -89,7 +89,7 @@ def generator(ir: IntegralIR, domain: str, options):
tabulate_tensor_float64=code["tabulate_tensor_float64"],
tabulate_tensor_complex64=code["tabulate_tensor_complex64"],
tabulate_tensor_complex128=code["tabulate_tensor_complex128"],
domain=domain,
domain=int(getattr(basix.CellType, domain)),
)

return declaration, implementation
2 changes: 1 addition & 1 deletion ffcx/codegeneration/C/integrals_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
{tabulate_tensor_complex128}
.needs_facet_permutations = {needs_facet_permutations},
.coordinate_element_hash = {coordinate_element_hash},
.domain = ufcx_{domain},
.domain = {domain},
}};
// End of code for integral {factory_name}
Expand Down
14 changes: 1 addition & 13 deletions ffcx/codegeneration/ufcx.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,6 @@ extern "C"
interior_facet = 2
} ufcx_integral_type;

typedef enum
{
ufcx_vertex = 0,
ufcx_interval = 1,
ufcx_triangle = 2,
ufcx_quadrilateral = 3,
ufcx_tetrahedron = 4,
ufcx_hexahedron = 5,
ufcx_prism = 6,
ufcx_pyramid = 7
} ufcx_cell_type;

// </HEADER_DECL>

/// Tabulate integral into tensor A with compiled quadrature rule
Expand Down Expand Up @@ -151,7 +139,7 @@ extern "C"
/// Get the hash of the coordinate element associated with the geometry of the mesh.
uint64_t coordinate_element_hash;

ufcx_cell_type domain;
uint8_t domain;
} ufcx_integral;

typedef struct ufcx_expression
Expand Down
8 changes: 4 additions & 4 deletions test/test_jit_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1258,13 +1258,13 @@ def test_ds_prism(compile_args, dtype):
integral0 = form0.form_integrals[offsets[exterior_facet]]
integral1 = form0.form_integrals[offsets[exterior_facet] + 1]

if integral0.domain == module.lib.ufcx_triangle:
assert integral1.domain == module.lib.ufcx_quadrilateral
if basix.CellType(integral0.domain) == basix.CellType.triangle:
assert basix.CellType(integral1.domain) == basix.CellType.quadrilateral
integral_tri = integral0
integral_quad = integral1
else:
assert integral0.domain == module.lib.ufcx_quadrilateral
assert integral1.domain == module.lib.ufcx_triangle
assert basix.CellType(integral0.domain) == basix.CellType.quadrilateral
assert basix.CellType(integral1.domain) == basix.CellType.triangle
integral_tri = integral1
integral_quad = integral0

Expand Down

0 comments on commit 9289781

Please sign in to comment.