Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
jhale committed Jan 11, 2023
2 parents a3e4bfb + 513b864 commit d98eab7
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
branches:
- main

workflow_dispatch:

jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down
18 changes: 18 additions & 0 deletions ChangeLog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
Changelog
=========


0.5.0
-----
See: https://github.com/FEniCS/ffcx/compare/v0.5.0...v0.4.0 for details

0.4.0
-----
See: https://github.com/FEniCS/ffcx/compare/v0.4.0...v0.3.0 for details

0.3.0
-----
See: https://github.com/FEniCS/ffcx/compare/v0.3.0...v0.2.0 for details

0.2.0
-----

- No changes

0.1.0
-----
Alpha release of ffcx
Expand Down
4 changes: 2 additions & 2 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.19)

project(ufcx VERSION 0.6.0 DESCRIPTION "UFCx interface header for finite element kernels"
LANGUAGES C
Expand All @@ -23,7 +23,7 @@ install(TARGETS ${PROJECT_NAME}
include(CMakePackageConfigHelpers)
write_basic_package_version_file("${PROJECT_NAME}ConfigVersion.cmake"
VERSION ${PROJECT_VERSION}
COMPATIBILITY SameMinorVersion)
COMPATIBILITY AnyNewerVersion)
configure_package_config_file("${PROJECT_NAME}Config.cmake.in" "${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake)
install(EXPORT ${PROJECT_NAME}_Targets FILE ${PROJECT_NAME}Targets.cmake
Expand Down
20 changes: 10 additions & 10 deletions ffcx/codegeneration/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,23 +179,23 @@ def jacobian(self, e, mt, tabledata, num_points):

def reference_cell_volume(self, e, mt, tabledata, access):
L = self.language
cellname = mt.terminal.ufl_domain().ufl_cell().cellname()
cellname = ufl.domain.extract_unique_domain(mt.terminal).ufl_cell().cellname()
if cellname in ("interval", "triangle", "tetrahedron", "quadrilateral", "hexahedron"):
return L.Symbol(f"{cellname}_reference_cell_volume")
else:
raise RuntimeError(f"Unhandled cell types {cellname}.")

def reference_facet_volume(self, e, mt, tabledata, access):
L = self.language
cellname = mt.terminal.ufl_domain().ufl_cell().cellname()
cellname = ufl.domain.extract_unique_domain(mt.terminal).ufl_cell().cellname()
if cellname in ("interval", "triangle", "tetrahedron", "quadrilateral", "hexahedron"):
return L.Symbol(f"{cellname}_reference_facet_volume")
else:
raise RuntimeError(f"Unhandled cell types {cellname}.")

def reference_normal(self, e, mt, tabledata, access):
L = self.language
cellname = mt.terminal.ufl_domain().ufl_cell().cellname()
cellname = ufl.domain.extract_unique_domain(mt.terminal).ufl_cell().cellname()
if cellname in ("interval", "triangle", "tetrahedron", "quadrilateral", "hexahedron"):
table = L.Symbol(f"{cellname}_reference_facet_normals")
facet = self.symbols.entity("facet", mt.restriction)
Expand All @@ -205,7 +205,7 @@ def reference_normal(self, e, mt, tabledata, access):

def cell_facet_jacobian(self, e, mt, tabledata, num_points):
L = self.language
cellname = mt.terminal.ufl_domain().ufl_cell().cellname()
cellname = ufl.domain.extract_unique_domain(mt.terminal).ufl_cell().cellname()
if cellname in ("triangle", "tetrahedron", "quadrilateral", "hexahedron"):
table = L.Symbol(f"{cellname}_reference_facet_jacobian")
facet = self.symbols.entity("facet", mt.restriction)
Expand All @@ -217,7 +217,7 @@ def cell_facet_jacobian(self, e, mt, tabledata, num_points):

def reference_cell_edge_vectors(self, e, mt, tabledata, num_points):
L = self.language
cellname = mt.terminal.ufl_domain().ufl_cell().cellname()
cellname = ufl.domain.extract_unique_domain(mt.terminal).ufl_cell().cellname()
if cellname in ("triangle", "tetrahedron", "quadrilateral", "hexahedron"):
table = L.Symbol(f"{cellname}_reference_edge_vectors")
return table[mt.component[0]][mt.component[1]]
Expand All @@ -228,7 +228,7 @@ def reference_cell_edge_vectors(self, e, mt, tabledata, num_points):

def reference_facet_edge_vectors(self, e, mt, tabledata, num_points):
L = self.language
cellname = mt.terminal.ufl_domain().ufl_cell().cellname()
cellname = ufl.domain.extract_unique_domain(mt.terminal).ufl_cell().cellname()
if cellname in ("tetrahedron", "hexahedron"):
table = L.Symbol(f"{cellname}_reference_edge_vectors")
facet = self.symbols.entity("facet", mt.restriction)
Expand All @@ -242,7 +242,7 @@ def reference_facet_edge_vectors(self, e, mt, tabledata, num_points):

def facet_orientation(self, e, mt, tabledata, num_points):
L = self.language
cellname = mt.terminal.ufl_domain().ufl_cell().cellname()
cellname = ufl.domain.extract_unique_domain(mt.terminal).ufl_cell().cellname()
if cellname not in ("interval", "triangle", "tetrahedron"):
raise RuntimeError(f"Unhandled cell types {cellname}.")

Expand All @@ -252,7 +252,7 @@ def facet_orientation(self, e, mt, tabledata, num_points):

def cell_vertices(self, e, mt, tabledata, num_points):
# Get properties of domain
domain = mt.terminal.ufl_domain()
domain = ufl.domain.extract_unique_domain(mt.terminal)
gdim = domain.geometric_dimension()
coordinate_element = convert_element(domain.ufl_coordinate_element())

Expand All @@ -275,7 +275,7 @@ def cell_vertices(self, e, mt, tabledata, num_points):

def cell_edge_vectors(self, e, mt, tabledata, num_points):
# Get properties of domain
domain = mt.terminal.ufl_domain()
domain = ufl.domain.extract_unique_domain(mt.terminal)
cellname = domain.ufl_cell().cellname()
gdim = domain.geometric_dimension()
coordinate_element = convert_element(domain.ufl_coordinate_element())
Expand Down Expand Up @@ -316,7 +316,7 @@ def facet_edge_vectors(self, e, mt, tabledata, num_points):
L = self.language

# Get properties of domain
domain = mt.terminal.ufl_domain()
domain = ufl.domain.extract_unique_domain(mt.terminal)
cellname = domain.ufl_cell().cellname()
gdim = domain.geometric_dimension()
coordinate_element = convert_element(domain.ufl_coordinate_element())
Expand Down
2 changes: 1 addition & 1 deletion ffcx/codegeneration/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _define_coordinate_dofs_lincomb(self, e, mt, tabledata, quadrature_rule, acc
L = self.language

# Get properties of domain
domain = mt.terminal.ufl_domain()
domain = ufl.domain.extract_unique_domain(mt.terminal)
coordinate_element = domain.ufl_coordinate_element()
num_scalar_dofs = create_element(coordinate_element).sub_element.dim

Expand Down
2 changes: 1 addition & 1 deletion ffcx/codegeneration/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def generate_geometry_tables(self, float_type: str):
if mt is not None:
t = type(mt.terminal)
if t in ufl_geometry:
cells[t].add(mt.terminal.ufl_domain().ufl_cell().cellname())
cells[t].add(ufl.domain.extract_unique_domain(mt.terminal).ufl_cell().cellname())

parts = []
for i, cell_list in cells.items():
Expand Down
2 changes: 1 addition & 1 deletion ffcx/codegeneration/integrals.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def generate_geometry_tables(self, float_type: str):
if mt is not None:
t = type(mt.terminal)
if t in ufl_geometry:
cells[t].add(mt.terminal.ufl_domain().ufl_cell().cellname())
cells[t].add(ufl.domain.extract_unique_domain(mt.terminal).ufl_cell().cellname())

parts = []
for i, cell_list in cells.items():
Expand Down
2 changes: 1 addition & 1 deletion ffcx/codegeneration/symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def format_mt_name(basename, mt):
# Format local derivatives
if mt.local_derivatives:
# Convert "listing" derivative multindex into "counting" representation
gdim = mt.terminal.ufl_domain().geometric_dimension()
gdim = ufl.domain.extract_unique_domain(mt.terminal).geometric_dimension()
ld_counting = ufl.utils.derivativetuples.derivative_listing_to_counts(mt.local_derivatives, gdim)
der = f"_d{''.join(map(str, ld_counting))}"
access += der
Expand Down
4 changes: 2 additions & 2 deletions ffcx/ir/analysis/valuenumbering.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ def _modified_terminal(self, v):
num_gd = len(mt.global_derivatives)
assert not (num_ld and num_gd)
if num_ld:
domain = mt.terminal.ufl_domain()
domain = ufl.domain.extract_unique_domain(mt.terminal)
tdim = domain.topological_dimension()
d_components = ufl.permutation.compute_indices((tdim, ) * num_ld)
elif num_gd:
domain = mt.terminal.ufl_domain()
domain = ufl.domain.extract_unique_domiain(mt.terminal)
gdim = domain.geometric_dimension()
d_components = ufl.permutation.compute_indices((gdim, ) * num_gd)
else:
Expand Down
8 changes: 4 additions & 4 deletions ffcx/ir/elementtables.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def generate_psi_table_name(quadrature_rule, element_counter, averaged: str, ent
def get_modified_terminal_element(mt) -> typing.Optional[ModifiedTerminalElement]:
gd = mt.global_derivatives
ld = mt.local_derivatives

domain = ufl.domain.extract_unique_domain(mt.terminal)
# Extract element from FormArguments and relevant GeometricQuantities
if isinstance(mt.terminal, ufl.classes.FormArgument):
if gd and mt.reference_value:
Expand All @@ -203,7 +203,7 @@ def get_modified_terminal_element(mt) -> typing.Optional[ModifiedTerminalElement
raise RuntimeError("Not expecting reference value of x.")
if gd:
raise RuntimeError("Not expecting global derivatives of x.")
element = convert_element(mt.terminal.ufl_domain().ufl_coordinate_element())
element = convert_element(domain.ufl_coordinate_element())
if not ld:
fc = mt.flat_component
else:
Expand All @@ -216,7 +216,7 @@ def get_modified_terminal_element(mt) -> typing.Optional[ModifiedTerminalElement
raise RuntimeError("Not expecting reference value of J.")
if gd:
raise RuntimeError("Not expecting global derivatives of J.")
element = convert_element(mt.terminal.ufl_domain().ufl_coordinate_element())
element = convert_element(domain.ufl_coordinate_element())
assert len(mt.component) == 2
# Translate component J[i,d] to x element context rgrad(x[i])[d]
fc, d = mt.component # x-component, derivative
Expand All @@ -226,7 +226,7 @@ def get_modified_terminal_element(mt) -> typing.Optional[ModifiedTerminalElement

assert (mt.averaged is None) or not (ld or gd)
# Change derivatives format for table lookup
gdim = mt.terminal.ufl_domain().geometric_dimension()
gdim = domain.geometric_dimension()
local_derivatives = ufl.utils.derivativetuples.derivative_listing_to_counts(
ld, gdim)

Expand Down
2 changes: 1 addition & 1 deletion ffcx/ir/representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ def _compute_expression_ir(expression, index, prefix, analysis, options, visuali
expression = expression[0]

try:
cell = expression.ufl_domain().ufl_cell()
cell = ufl.domain.extract_unique_domain(expression).ufl_cell()
except AttributeError:
# This case corresponds to a spatially constant expression
# without any dependencies
Expand Down
7 changes: 5 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,8 @@ console_scripts =
[flake8]
max-line-length = 120
exclude = .git,__pycache__,docs/source/conf.py,build,dist,libs
ignore = W503, # Line length
E741 # Variable names l, O, I, ...
ignore =
# Line length
W503,
# Variable names l, O, I, ...
E741,

0 comments on commit d98eab7

Please sign in to comment.