Skip to content

Commit

Permalink
Merge pull request #46 from firedrakeproject/dolci/merge_upstream_2
Browse files Browse the repository at this point in the history
Dolci/merge upstream 2
  • Loading branch information
JDBetteridge authored Nov 15, 2023
2 parents cf66c4b + ab66c9f commit 3f337c8
Show file tree
Hide file tree
Showing 195 changed files with 2,974 additions and 5,297 deletions.
6 changes: 6 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
max-line-length = 120
builtins = ufl
exclude = doc/sphinx/source/conf.py
per-file-ignores =
*/__init__.py: F401
8 changes: 4 additions & 4 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout UFL
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ufl_ref }}

Expand All @@ -50,7 +50,7 @@ jobs:
- name: Build sdist and wheel
run: python -m build .

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: dist/*

Expand All @@ -65,15 +65,15 @@ jobs:
path: dist

- name: Push to PyPI
uses: pypa/gh-action-pypi-publish@v1.5.0
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ github.event.inputs.pypi_publish == 'true' }}
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
repository_url: https://upload.pypi.org/legacy/

- name: Push to Test PyPI
uses: pypa/gh-action-pypi-publish@v1.5.0
uses: pypa/gh-action-pypi-publish@release/v1
if: ${{ github.event.inputs.test_pypi_publish == 'true' }}
with:
user: __token__
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/fenicsx-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
python3 -m pip install git+https://github.com/FEniCS/basix.git
- name: Clone FFCx
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ./ffcx
repository: FEniCS/ffcx
Expand All @@ -53,11 +53,10 @@ jobs:
dolfinx-tests:
name: Run DOLFINx tests
runs-on: ubuntu-latest
container: fenicsproject/test-env:nightly-openmpi
container: ghcr.io/fenics/test-env:current-openmpi

env:

PETSC_ARCH: linux-gnu-complex-32
PETSC_ARCH: linux-gnu-complex128-32
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMPI_MCA_rmaps_base_oversubscribe: 1
Expand All @@ -67,10 +66,7 @@ jobs:
OMPI_MCA_hwloc_base_binding_policy: none

steps:
- uses: actions/checkout@v3
- name: Install dependencies (Python)
run: |
python3 -m pip install --upgrade pip
- uses: actions/checkout@v4

- name: Install UFL
run: |
Expand All @@ -82,7 +78,7 @@ jobs:
python3 -m pip install git+https://github.com/FEniCS/ffcx.git
- name: Clone DOLFINx
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: ./dolfinx
repository: FEniCS/dolfinx
Expand All @@ -92,6 +88,6 @@ jobs:
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build -S dolfinx/cpp/
cmake --build build
cmake --install build
pip3 -v install --global-option build --global-option --debug dolfinx/python/
python3 -m pip -v install --no-build-isolation --check-build-dependencies --config-settings=cmake.build-type="Developer" dolfinx/python/
- name: Run DOLFINx unit tests
run: python3 -m pytest -n auto dolfinx/python/test/unit
2 changes: 1 addition & 1 deletion .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
flake8 --statistics .
- name: Check documentation style
run: |
python -m pip install pydocstyle
python -m pip install pydocstyle[toml]
python -m pydocstyle ufl/
- name: Install UFL
run: python -m pip install .[ci]
Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/spack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Spack build

on:
# Uncomment the below 'push' to trigger on push
# push:
# branches:
# - "**"
schedule:
# '*' is a special character in YAML, so string must be quoted
- cron: "0 2 * * WED"
workflow_dispatch:
inputs:
spack_repo:
description: "Spack repository to test"
default: "spack/spack"
type: string
spack_ref:
description: "Spack repository branch/tag to test"
default: "develop"
type: string

jobs:
build:
runs-on: ubuntu-latest
container: ubuntu:latest
steps:
- name: Install Spack requirements
run: |
apt-get -y update
apt-get install -y bzip2 curl file git gzip make patch python3-minimal tar xz-utils
apt-get install -y g++ gfortran # compilers
- name: Get Spack
if: github.event_name != 'workflow_dispatch'
uses: actions/checkout@v4
with:
path: ./spack
repository: spack/spack
- name: Get Spack
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v4
with:
path: ./spack
repository: ${{ github.event.inputs.spack_repo }}
ref: ${{ github.event.inputs.spack_ref }}

- name: Install UFL development version and run tests
run: |
. ./spack/share/spack/setup-env.sh
spack env create main
spack env activate main
spack add py-fenics-ufl@main
spack install --test=root
- name: Install UFL release version and run tests
run: |
. ./spack/share/spack/setup-env.sh
spack env create release
spack env activate release
spack add py-fenics-ufl
spack install --test=root
4 changes: 2 additions & 2 deletions .github/workflows/tsfc-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ jobs:
with:
path: ./tsfc
repository: firedrakeproject/tsfc
ref: master
ref: mscroggs/newfl-legacy2
- 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/FInAT/FInAT.git@mscroggs/ufl-elements
pip install git+https://github.com/firedrakeproject/loopy.git#egg=loopy
pip install .[ci]
pip install pytest
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ Contributors:
| Nacime Bouziani <[email protected]>
| Reuben W. Hill <[email protected]>
| Nacime Bouziani <[email protected]>
| Matthew Scroggs <[email protected]>
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,22 @@ https://www.fenicsproject.org

.. image:: https://github.com/FEniCS/ufl/workflows/UFL%20CI/badge.svg
:target: https://github.com/FEniCS/ufl/workflows/UFL%20CI
.. image:: https://github.com/FEniCS/ufl/actions/workflows/spack.yml/badge.svg
:target: https://github.com/FEniCS/ufl/actions/workflows/spack.yml
.. image:: https://coveralls.io/repos/github/FEniCS/ufl/badge.svg?branch=master
:target: https://coveralls.io/github/FEniCS/ufl?branch=master
:alt: Coverage Status
.. image:: https://readthedocs.org/projects/fenics-ufl/badge/?version=latest
:target: https://fenics.readthedocs.io/projects/ufl/en/latest/?badge=latest
:alt: Documentation Status


Documentation
=============

Documentation can be viewed at https://fenics-ufl.readthedocs.org/.


License
=======

Expand Down
15 changes: 9 additions & 6 deletions demo/Constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,23 @@
# Modified by Martin Sandve Alnes, 2009
#
# Test form for scalar and vector constants.
from ufl import (Coefficient, Constant, FiniteElement, FunctionSpace, Mesh, TestFunction, TrialFunction, VectorConstant,
VectorElement, dot, dx, grad, inner, triangle)
from ufl import (Coefficient, Constant, FunctionSpace, Mesh, TestFunction, TrialFunction, VectorConstant, dot, dx, grad,
inner, triangle)
from ufl.finiteelement import FiniteElement
from ufl.pullback import identity_pullback
from ufl.sobolevspace import H1

cell = triangle
element = FiniteElement("Lagrange", cell, 1)
domain = Mesh(VectorElement("Lagrange", cell, 1))
element = FiniteElement("Lagrange", cell, 1, (), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", cell, 1, (2, ), identity_pullback, H1))
space = FunctionSpace(domain, element)

v = TestFunction(space)
u = TrialFunction(space)
f = Coefficient(space)

c = Constant(space)
d = VectorConstant(space)
c = Constant(domain)
d = VectorConstant(domain)

a = c * dot(grad(v), grad(u)) * dx
L = inner(d, grad(v)) * dx
9 changes: 6 additions & 3 deletions demo/ConvectionJacobi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# Author: Martin Sandve Alnes
# Date: 2008-10-03
#
from ufl import Coefficient, FunctionSpace, Mesh, TestFunction, TrialFunction, VectorElement, dot, dx, grad, triangle
from ufl import Coefficient, FunctionSpace, Mesh, TestFunction, TrialFunction, dot, dx, grad, triangle
from ufl.finiteelement import FiniteElement
from ufl.pullback import identity_pullback
from ufl.sobolevspace import H1

element = VectorElement("Lagrange", triangle, 1)
domain = Mesh(VectorElement("Lagrange", triangle, 1))
element = FiniteElement("Lagrange", triangle, 1, (2, ), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", triangle, 1, (2, ), identity_pullback, H1))
space = FunctionSpace(domain, element)

u = TrialFunction(space)
Expand Down
9 changes: 6 additions & 3 deletions demo/ConvectionJacobi2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# Author: Martin Sandve Alnes
# Date: 2008-10-03
#
from ufl import Coefficient, FunctionSpace, Mesh, TestFunction, TrialFunction, VectorElement, dx, i, j, triangle
from ufl import Coefficient, FunctionSpace, Mesh, TestFunction, TrialFunction, dx, i, j, triangle
from ufl.finiteelement import FiniteElement
from ufl.pullback import identity_pullback
from ufl.sobolevspace import H1

element = VectorElement("Lagrange", triangle, 1)
domain = Mesh(VectorElement("Lagrange", triangle, 1))
element = FiniteElement("Lagrange", triangle, 1, (2, ), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", triangle, 1, (2, ), identity_pullback, H1))
space = FunctionSpace(domain, element)

u = TrialFunction(space)
Expand Down
9 changes: 6 additions & 3 deletions demo/ConvectionVector.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# Author: Martin Sandve Alnes
# Date: 2008-10-03
#
from ufl import Coefficient, FunctionSpace, Mesh, TestFunction, VectorElement, dot, dx, grad, triangle
from ufl import Coefficient, FunctionSpace, Mesh, TestFunction, dot, dx, grad, triangle
from ufl.finiteelement import FiniteElement
from ufl.pullback import identity_pullback
from ufl.sobolevspace import H1

element = VectorElement("Lagrange", triangle, 1)
domain = Mesh(VectorElement("Lagrange", triangle, 1))
element = FiniteElement("Lagrange", triangle, 1, (2, ), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", triangle, 1, (2, ), identity_pullback, H1))
space = FunctionSpace(domain, element)

v = TestFunction(space)
Expand Down
9 changes: 6 additions & 3 deletions demo/Elasticity.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
# Modified by: Martin Sandve Alnes
# Date: 2009-01-12
#
from ufl import FunctionSpace, Mesh, TestFunction, TrialFunction, VectorElement, dx, grad, inner, tetrahedron
from ufl import FunctionSpace, Mesh, TestFunction, TrialFunction, dx, grad, inner, tetrahedron
from ufl.finiteelement import FiniteElement
from ufl.pullback import identity_pullback
from ufl.sobolevspace import H1

element = VectorElement("Lagrange", tetrahedron, 1)
domain = Mesh(VectorElement("Lagrange", tetrahedron, 1))
element = FiniteElement("Lagrange", tetrahedron, 1, (3, ), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", tetrahedron, 1, (3, ), identity_pullback, H1))
space = FunctionSpace(domain, element)

v = TestFunction(space)
Expand Down
9 changes: 6 additions & 3 deletions demo/EnergyNorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@
#
# This example demonstrates how to define a functional, here
# the energy norm (squared) for a reaction-diffusion problem.
from ufl import Coefficient, FiniteElement, FunctionSpace, Mesh, VectorElement, dot, dx, grad, tetrahedron
from ufl import Coefficient, FunctionSpace, Mesh, dot, dx, grad, tetrahedron
from ufl.finiteelement import FiniteElement
from ufl.pullback import identity_pullback
from ufl.sobolevspace import H1

element = FiniteElement("Lagrange", tetrahedron, 1)
domain = Mesh(VectorElement("Lagrange", tetrahedron, 1))
element = FiniteElement("Lagrange", tetrahedron, 1, (), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", tetrahedron, 1, (3, ), identity_pullback, H1))
space = FunctionSpace(domain, element)

v = Coefficient(space)
Expand Down
10 changes: 6 additions & 4 deletions demo/Equation.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@
# the unknown u to the right-hand side, all terms may
# be listed on one line and left- and right-hand sides
# extracted by lhs() and rhs().
from ufl import (Coefficient, FiniteElement, FunctionSpace, Mesh, TestFunction, TrialFunction, VectorElement, dot, dx,
grad, lhs, rhs, triangle)
from ufl import Coefficient, FunctionSpace, Mesh, TestFunction, TrialFunction, dot, dx, grad, lhs, rhs, triangle
from ufl.finiteelement import FiniteElement
from ufl.pullback import identity_pullback
from ufl.sobolevspace import H1

element = FiniteElement("Lagrange", triangle, 1)
domain = Mesh(VectorElement("Lagrange", triangle, 1))
element = FiniteElement("Lagrange", triangle, 1, (), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", triangle, 1, (2, ), identity_pullback, H1))
space = FunctionSpace(domain, element)

k = 0.1
Expand Down
9 changes: 6 additions & 3 deletions demo/ExplicitConvection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
# Author: Martin Sandve Alnes
# Date: 2008-10-03
#
from ufl import Coefficient, FunctionSpace, Mesh, TestFunction, TrialFunction, VectorElement, dot, dx, grad, triangle
from ufl import Coefficient, FunctionSpace, Mesh, TestFunction, TrialFunction, dot, dx, grad, triangle
from ufl.finiteelement import FiniteElement
from ufl.pullback import identity_pullback
from ufl.sobolevspace import H1

element = VectorElement("Lagrange", triangle, 1)
domain = Mesh(VectorElement("Lagrange", triangle, 1))
element = FiniteElement("Lagrange", triangle, 1, (2, ), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", triangle, 1, (2, ), identity_pullback, H1))
space = FunctionSpace(domain, element)

u = TrialFunction(space)
Expand Down
Loading

0 comments on commit 3f337c8

Please sign in to comment.