Skip to content

Commit

Permalink
Merge pull request #49 from firedrakeproject/ksagiyam/merge_upstream_…
Browse files Browse the repository at this point in the history
…partial

Ksagiyam/merge upstream partial
  • Loading branch information
dham authored Feb 28, 2024
2 parents 054b061 + 9f8ce94 commit fbd288e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/*

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fenicsx-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ build-backend = "setuptools.build_meta"
[project]
name = "fenics-ufl"
version = "2023.3.0.dev0"
authors = [{email="[email protected]"}, {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"}
Expand Down
3 changes: 2 additions & 1 deletion ufl/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ---
Expand Down
20 changes: 12 additions & 8 deletions ufl/functionspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ()
Expand Down Expand Up @@ -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."""
Expand All @@ -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."""
Expand All @@ -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."""
Expand All @@ -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."""
Expand Down
2 changes: 1 addition & 1 deletion ufl/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit fbd288e

Please sign in to comment.