Skip to content

Commit

Permalink
Fix vertex logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgensd committed Dec 5, 2024
1 parent d73d8b8 commit da74d73
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions ffcx/codegeneration/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def cell_edge_jacobian(tablename, cellname):
symbol = L.Symbol(f"{cellname}_{tablename}", dtype=L.DataType.REAL)
return L.ArrayDecl(symbol, values=out, const=True)


def reference_cell_volume(tablename, cellname):
"""Write a reference cell volume."""
celltype = getattr(basix.CellType, cellname)
Expand Down
3 changes: 1 addition & 2 deletions ffcx/element_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ def map_edge_points(
edge_vertices = [geom[i] for i in basix.topology(_CellType[cellname])[-3][edge]]
return np.asarray(
[
edge_vertices[0]
+ sum((i - edge_vertices[0]) * j for i, j in zip(edge_vertices[1:], p))
edge_vertices[0] + sum((i - edge_vertices[0]) * j for i, j in zip(edge_vertices[1:], p))
for p in points
],
dtype=np.float64,
Expand Down
4 changes: 3 additions & 1 deletion ffcx/ir/elementtables.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,9 @@ def build_optimized_tables(
for ref in range(2):
new_table.append(
get_ffcx_table_values(
permute_quadrature_triangle(quadrature_rule.points, ref, rot),
permute_quadrature_triangle(
quadrature_rule.points, ref, rot
),
cell,
integral_type,
element,
Expand Down
4 changes: 2 additions & 2 deletions ffcx/ir/representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _compute_integral_ir(
"interior_facet": "facet",
"vertex": "vertex",
"custom": "cell",
"edge": "edge"
"edge": "edge",
}

# Iterate over groups of integrals
Expand Down Expand Up @@ -268,7 +268,7 @@ def _compute_integral_ir(
# prescribed in certain cases.

degree = md["quadrature_degree"]
if integral_type == "facet":
if "facet" in integral_type:
facet_types = cell.facet_types()
assert len(facet_types) == 1
cellname = facet_types[0].cellname()
Expand Down
9 changes: 7 additions & 2 deletions ffcx/ir/representationutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@
import numpy as np
import ufl

from ffcx.element_interface import create_quadrature, map_facet_points, reference_cell_vertices, map_edge_points
from ffcx.element_interface import (
create_quadrature,
map_edge_points,
map_facet_points,
reference_cell_vertices,
)

logger = logging.getLogger("ffcx")

Expand Down Expand Up @@ -77,7 +82,7 @@ def create_quadrature_points_and_weights(
# Raise exception for cells with more than one facet type e.g. prisms
if len(facet_types) > 1:
raise Exception(f"Cell type {cell} not supported for integral type {integral_type}.")
pts, wts = create_quadrature(facet_types[0].cellname(), degree, rule, elements)
pts, wts = create_quadrature(facet_types[0].cellname(), degree, rule, elements)
elif integral_type in ufl.measure.edge_integral_types:
edge_types = cell.edge_types()
if len(edge_types) > 1:
Expand Down

0 comments on commit da74d73

Please sign in to comment.