Skip to content

Commit

Permalink
Merge branch 'main' into pbrubeck/fix/sobolev-restricted
Browse files Browse the repository at this point in the history
  • Loading branch information
mscroggs authored Sep 12, 2023
2 parents b458b13 + 9e120c6 commit 346c030
Show file tree
Hide file tree
Showing 139 changed files with 3,595 additions and 4,055 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/fenicsx-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ jobs:
ffcx-tests:
name: Run FFCx tests
runs-on: ubuntu-latest

env:
CC: gcc-10
CXX: g++-10
PETSC_ARCH: linux-gnu-real-64

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.9

Expand All @@ -36,11 +37,10 @@ jobs:
python3 -m pip install git+https://github.com/FEniCS/basix.git
- name: Clone FFCx
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: ./ffcx
repository: FEniCS/ffcx
ref: main
- name: Install FFCx
run: |
cd ffcx
Expand All @@ -54,8 +54,6 @@ jobs:
container: fenicsproject/test-env:nightly-openmpi

env:
CC: clang
CXX: clang++

PETSC_ARCH: linux-gnu-complex-32
OMPI_ALLOW_RUN_AS_ROOT: 1
Expand All @@ -67,7 +65,7 @@ jobs:
OMPI_MCA_hwloc_base_binding_policy: none

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install dependencies (Python)
run: |
python3 -m pip install --upgrade pip
Expand All @@ -82,7 +80,7 @@ jobs:
python3 -m pip install git+https://github.com/FEniCS/ffcx.git
- name: Clone DOLFINx
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: ./dolfinx
repository: FEniCS/dolfinx
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
branches:
- "**"
tags:
- "v*"
- "**"
pull_request:
branches:
- main
Expand All @@ -20,12 +20,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Lint with flake8
Expand All @@ -46,14 +46,14 @@ jobs:
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: coveralls

- name: Build documentation
run: |
cd doc/sphinx
make html
- name: Upload documentation artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
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@v2
uses: actions/checkout@v3
with:
repository: "FEniCS/docs"
path: "docs"
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/tsfc-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow will install tsfc and run its unit tests

name: tsfc integration

on:
pull_request:
branches:
- main

jobs:
tsfc-tests:
name: Run TSFC tests
runs-on: ubuntu-latest

env:
CC: gcc-10
CXX: g++-10

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.9

- name: Install UFL
run: |
pip3 install .
- name: Clone tsfc
uses: actions/checkout@v3
with:
path: ./tsfc
repository: firedrakeproject/tsfc
ref: master
- name: Install tsfc
run: |
cd tsfc
pip install -r requirements-ext.txt
pip install git+https://github.com/coneoproject/COFFEE.git#egg=coffee
pip install git+https://github.com/firedrakeproject/fiat.git#egg=fenics-fiat
pip install git+https://github.com/FInAT/FInAT.git#egg=finat
pip install git+https://github.com/firedrakeproject/loopy.git#egg=loopy
pip install .[ci]
pip install pytest
- name: Run tsfc unit tests
run: python3 -m pytest tsfc/tests
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ License

You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

3 changes: 1 addition & 2 deletions demo/FEEC.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@
(sigma, u) = TrialFunctions(W)
(tau, v) = TestFunctions(W)

a = (inner(sigma, tau) - inner(d(tau), u) +
inner(d(sigma), v) + inner(d(u), d(v))) * dx
a = (inner(sigma, tau) - inner(d(tau), u) + inner(d(sigma), v) + inner(d(u), d(v))) * dx
6 changes: 3 additions & 3 deletions demo/FunctionOperators.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# along with UFL. If not, see <http://www.gnu.org/licenses/>.
#
# Test form for operators on Coefficients.
from ufl import (Coefficient, FiniteElement, Max, TestFunction, TrialFunction,
dot, dx, grad, sqrt, triangle)
from ufl import (Coefficient, FiniteElement, TestFunction, TrialFunction,
dot, dx, grad, sqrt, triangle, max_value)

element = FiniteElement("Lagrange", triangle, 1)

Expand All @@ -26,4 +26,4 @@
f = Coefficient(element)
g = Coefficient(element)

a = sqrt(1 / Max(1 / f, -1 / f)) * sqrt(g) * dot(grad(v), grad(u)) * dx + v * u * sqrt(f * g) * g * dx
a = sqrt(1 / max_value(1 / f, -1 / f)) * sqrt(g) * dot(grad(v), grad(u)) * dx + v * u * sqrt(f * g) * g * dx
6 changes: 3 additions & 3 deletions demo/HyperElasticity.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
c22 = Constant(cell)

# Deformation gradient
I = Identity(d)
F = I + grad(u)
Id = Identity(d)
F = Id + grad(u)
F = variable(F)
Finv = inv(F)
J = det(F)
Expand All @@ -66,7 +66,7 @@
I3_C = J**2

# Green strain tensor
E = (C - I) / 2
E = (C - Id) / 2

# Mapping of strain in fiber directions
Ef = A * E * A.T
Expand Down
8 changes: 5 additions & 3 deletions demo/MixedElasticity.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def skw(tau):
(sigma, u, gamma) = TrialFunctions(W)
(tau, v, eta) = TestFunctions(W)

a = (inner(sigma, tau) - tr(sigma) * tr(tau) +
dot(div(tau), u) - dot(div(sigma), v) +
inner(skw(tau), gamma) + inner(skw(sigma), eta)) * dx
a = (
inner(sigma, tau) - tr(sigma) * tr(tau) + dot(
div(tau), u
) - dot(div(sigma), v) + inner(skw(tau), gamma) + inner(skw(sigma), eta)
) * dx
3 changes: 1 addition & 2 deletions demo/VectorLaplaceGradCurl.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ def HodgeLaplaceGradCurl(element, felement):
sigma, u = TrialFunctions(element)
f = Coefficient(felement)

a = (inner(tau, sigma) - inner(grad(tau), u) +
inner(v, grad(sigma)) + inner(curl(v), curl(u))) * dx
a = (inner(tau, sigma) - inner(grad(tau), u) + inner(v, grad(sigma)) + inner(curl(v), curl(u))) * dx
L = inner(v, f) * dx

return a, L
Expand Down
8 changes: 3 additions & 5 deletions doc/sphinx/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import shlex
import pkg_resources
import datetime
import importlib.metadata

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -58,7 +55,8 @@
this_year = datetime.date.today().year
copyright = u'%s, FEniCS Project' % this_year
author = u'FEniCS Project'
version = pkg_resources.get_distribution("fenics-ufl").version

version = importlib.metadata.version("fenics-ufl")
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Installation instructions
=========================

To install UFL, download the source code from the
`UFL Bitbucket repository
<https://bitbucket.org/fenics-project/ufl>`__,
`UFL GitHub repository
<https://github.com/FEniCS/ufl>`__,
and run the following command:

.. code-block:: console
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[build-system]
requires = ["setuptools>=58", "wheel"]
requires = ["setuptools>=62", "wheel"]

build-backend = "setuptools.build_meta"
18 changes: 8 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# future
[metadata]
name = fenics-ufl
version = 2022.3.0.dev0
version = 2023.2.0.dev0
author = FEniCS Project Contributors
email = [email protected]
maintainer = FEniCS Project Steering Council
Expand All @@ -26,20 +26,20 @@ classifiers =
Operating System :: MacOS :: MacOS X
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Topic :: Scientific/Engineering :: Mathematics
Topic :: Software Development :: Libraries :: Python Modules

[options]
packages = find:
include_package_data = True
zip_safe = False
python_requires = >= 3.7
python_requires = >= 3.8
setup_requires =
setuptools >= 58
setuptools >= 62
wheel
install_requires =
numpy
Expand All @@ -58,17 +58,15 @@ ci =
fenics-ufl[test]

[flake8]
ignore = E501, W504,
E741 # ambiguous variable name
builtins = ufl
exclude = .git,__pycache__,doc/sphinx/source/conf.py,build,dist,test
max-line-length = 120
exclude = doc/sphinx/source/conf.py,test

[pydocstyle]
# Work on removing these ignores
ignore = D100,D101,D102,D103,D104,D105,D107,
D200,D202,
D203, # this error should be disabled
# the skipping of D203 should be removed
D203,
D204,D205,D208,D209,D210,D212,D213,
D300,D301,
D400,D401,D402,D404,D415,D416
E741 # Variable names l, O, I, ...
16 changes: 0 additions & 16 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion test/test_algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytest
from pprint import *

from ufl import (FiniteElement, TestFunction, TrialFunction, triangle,
from ufl import (FiniteElement, TestFunction, TrialFunction, Matrix, triangle,
div, grad, Argument, dx, adjoint, Coefficient,
FacetNormal, inner, dot, ds)
from ufl.algorithms import (extract_arguments, expand_derivatives,
Expand Down
6 changes: 3 additions & 3 deletions test/test_apply_restrictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ def test_apply_restrictions():
n = FacetNormal(cell)
x = SpatialCoordinate(cell)

assert raises(UFLException, lambda: apply_restrictions(f0))
assert raises(UFLException, lambda: apply_restrictions(grad(f)))
assert raises(UFLException, lambda: apply_restrictions(n))
assert raises(BaseException, lambda: apply_restrictions(f0))
assert raises(BaseException, lambda: apply_restrictions(grad(f)))
assert raises(BaseException, lambda: apply_restrictions(n))

# Continuous function gets default restriction if none
# provided otherwise the user choice is respected
Expand Down
Loading

0 comments on commit 346c030

Please sign in to comment.