From 7277fd1bda219853afeb4db0924c0410792efe6b Mon Sep 17 00:00:00 2001 From: Pablo Brubeck Date: Fri, 5 Jan 2024 08:44:39 -0600 Subject: [PATCH 1/6] Bug-fix: do not call cell() in exterior_derivative (#248) --- ufl/operators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ufl/operators.py b/ufl/operators.py index 9dc5add03..78226d8a1 100644 --- a/ufl/operators.py +++ b/ufl/operators.py @@ -693,7 +693,7 @@ def exterior_derivative(f): except Exception: raise ValueError(f"Unable to determine element from {f}") - gdim = element.cell().geometric_dimension() + gdim = element.cell.geometric_dimension() space = element.sobolev_space if space == sobolevspace.L2: From 5507c896d23be9614a12ffc477bf25fb2f49c3b2 Mon Sep 17 00:00:00 2001 From: Francesco Ballarin Date: Mon, 22 Jan 2024 16:57:26 +0100 Subject: [PATCH 2/6] Drop `fenics-dev@googlegroups.com` in favor of `fenics-steering-council@googlegroups.com` (#250) * Drop fenics-dev@googlegroups.com in favor of fenics-steering-council@googlegroups.com * Be consistent with the naming used in other repos * Change authors field --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9617fef89..468cd0a10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,8 +5,8 @@ build-backend = "setuptools.build_meta" [project] name = "fenics-ufl" version = "2023.3.0.dev0" -authors = [{email="fenics-dev@googlegroups.com"}, {name="FEniCS Project"}] -maintainers = [{email="fenics-dev@googlegroups.com"}, {name="FEniCS Project Steering Council"}] +authors = [{name="UFL contributors"}] +maintainers = [{email="fenics-steering-council@googlegroups.com"}, {name="FEniCS Steering Council"}] description = "Unified Form Language" readme = "README.rst" license = {file = "COPYING.lesser"} From 929a679c4ce8e9703c2f194b3ddc75e13e815fc6 Mon Sep 17 00:00:00 2001 From: Francesco Ballarin Date: Thu, 25 Jan 2024 08:15:46 +0100 Subject: [PATCH 3/6] Bump actions/{download-artifact,upload-artifact} to v4 (#251) --- .github/workflows/build-wheels.yml | 4 ++-- .github/workflows/pythonapp.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index f1d86945d..7d0847457 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -50,7 +50,7 @@ jobs: - name: Build sdist and wheel run: python -m build . - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: dist/* @@ -59,7 +59,7 @@ jobs: needs: [build] runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v4 with: name: artifact path: dist diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 032bec747..1d8bd0461 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -53,7 +53,7 @@ jobs: make html - name: Upload documentation artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: doc-${{ matrix.os }}-${{ matrix.python-version }} path: doc/sphinx/build/html/ From 7b85c8e213bba123aa152d1b3e1065ced5c09fcf Mon Sep 17 00:00:00 2001 From: "Garth N. Wells" Date: Thu, 1 Feb 2024 11:13:25 +0000 Subject: [PATCH 4/6] Add Python 3.12 test coverage (#253) * Add Python 3.12 test coverage * Sort import --- .github/workflows/fenicsx-tests.yml | 4 ++-- .github/workflows/pythonapp.yml | 6 +++--- ufl/action.py | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/fenicsx-tests.yml b/.github/workflows/fenicsx-tests.yml index 6a8856e47..6363a55bf 100644 --- a/.github/workflows/fenicsx-tests.yml +++ b/.github/workflows/fenicsx-tests.yml @@ -18,9 +18,9 @@ jobs: PETSC_ARCH: linux-gnu-real-64 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: 3.9 diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 1d8bd0461..bef53ac2e 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -20,12 +20,12 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest] - python-version: ['3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Lint with flake8 diff --git a/ufl/action.py b/ufl/action.py index 1887da201..2401e05ea 100644 --- a/ufl/action.py +++ b/ufl/action.py @@ -7,6 +7,8 @@ # # Modified by Nacime Bouziani, 2021-2022. +from itertools import chain + from ufl.algebra import Sum from ufl.argument import Argument, Coargument from ufl.coefficient import BaseCoefficient, Coefficient, Cofunction @@ -16,7 +18,6 @@ from ufl.differentiation import CoefficientDerivative from ufl.form import BaseForm, Form, FormSum, ZeroBaseForm from ufl.matrix import Matrix -from itertools import chain # --- The Action class represents the action of a numerical object that needs # to be computed at assembly time --- From b47c9e07819512ef252d7b5aab7ddc29d4bbb005 Mon Sep 17 00:00:00 2001 From: "Garth N. Wells" Date: Thu, 1 Feb 2024 11:44:03 +0000 Subject: [PATCH 5/6] Github actions update (#254) * Add Python 3.12 test coverage * Sort import * Update an action --- .github/workflows/pythonapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index bef53ac2e..e6f23ec0b 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -62,7 +62,7 @@ jobs: - name: Checkout FEniCS/docs if: ${{ github.repository == 'FEniCS/ufl' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) && runner.os == 'Linux' && matrix.python-version == 3.8 }} - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: "FEniCS/docs" path: "docs" From 109aa7d35ddaa7b1cccbf069831266c2cbe10856 Mon Sep 17 00:00:00 2001 From: "David A. Ham" Date: Fri, 2 Feb 2024 12:03:58 +0000 Subject: [PATCH 6/6] Emmarothwell1/restricted function space (#252) * Add trimmed serendipity * Fix value shape for trimmed serendipity * ufl plumbing update for trimmed serendipity. * Plumbing for SminusDiv.py * Adding in element stuff for SminusCurl. * Fix typo * remove spurioius names * adding label to functionspace * pass label through to dualspace too * removed label from __init__ * change default label to "" * apply pr suggestions * Update ufl/functionspace.py --------- Co-authored-by: Rob Kirby Co-authored-by: Justincrum Co-authored-by: nbouziani Co-authored-by: ksagiyam Co-authored-by: ksagiyam <46749170+ksagiyam@users.noreply.github.com> Co-authored-by: Connor Ward Co-authored-by: Iglesia Dolci Co-authored-by: Jack Betteridge <43041811+JDBetteridge@users.noreply.github.com> Co-authored-by: Josh Hope-Collins Co-authored-by: JHopeCollins Co-authored-by: Emma Rothwell Co-authored-by: Matthew Scroggs --- ufl/functionspace.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/ufl/functionspace.py b/ufl/functionspace.py index 17de9d1a8..756c16aa0 100644 --- a/ufl/functionspace.py +++ b/ufl/functionspace.py @@ -36,7 +36,7 @@ def ufl_sub_spaces(self): class BaseFunctionSpace(AbstractFunctionSpace, UFLObject): """Base function space.""" - def __init__(self, domain, element): + def __init__(self, domain, element, label=""): """Initialise.""" if domain is None: # DOLFIN hack @@ -50,11 +50,15 @@ def __init__(self, domain, element): else: if element.cell != domain_cell: raise ValueError("Non-matching cell of finite element and domain.") - AbstractFunctionSpace.__init__(self) + self._label = label self._ufl_domain = domain self._ufl_element = element + def label(self): + """Return label of boundary domains to differentiate restricted and unrestricted.""" + return self._label + def ufl_sub_spaces(self): """Return ufl sub spaces.""" return () @@ -88,7 +92,7 @@ def _ufl_hash_data_(self, name=None): edata = None else: edata = element._ufl_hash_data_() - return (name, ddata, edata) + return (name, ddata, edata, self.label()) def _ufl_signature_data_(self, renumbering, name=None): """UFL signature data.""" @@ -103,7 +107,7 @@ def _ufl_signature_data_(self, renumbering, name=None): edata = None else: edata = element._ufl_signature_data_() - return (name, ddata, edata) + return (name, ddata, edata, self.label()) def __repr__(self): """Representation.""" @@ -118,7 +122,7 @@ class FunctionSpace(BaseFunctionSpace, UFLObject): def dual(self): """Get the dual of the space.""" - return DualSpace(self._ufl_domain, self._ufl_element) + return DualSpace(self._ufl_domain, self._ufl_element, label=self.label()) def _ufl_hash_data_(self): """UFL hash data.""" @@ -143,13 +147,13 @@ class DualSpace(BaseFunctionSpace, UFLObject): _primal = False _dual = True - def __init__(self, domain, element): + def __init__(self, domain, element, label=""): """Initialise.""" - BaseFunctionSpace.__init__(self, domain, element) + BaseFunctionSpace.__init__(self, domain, element, label) def dual(self): """Get the dual of the space.""" - return FunctionSpace(self._ufl_domain, self._ufl_element) + return FunctionSpace(self._ufl_domain, self._ufl_element, label=self.label()) def _ufl_hash_data_(self): """UFL hash data."""