Skip to content

Commit

Permalink
Merge branch 'main' into dokken/remove-deprecated_attach_ufl_object_a…
Browse files Browse the repository at this point in the history
…ttributes
  • Loading branch information
mscroggs committed Oct 16, 2023
2 parents db96e6e + ff3f69f commit 198fc81
Show file tree
Hide file tree
Showing 189 changed files with 3,107 additions and 2,919 deletions.
47 changes: 10 additions & 37 deletions .github/workflows/spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ jobs:
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
Expand All @@ -38,51 +44,18 @@ jobs:
repository: ${{ github.event.inputs.spack_repo }}
ref: ${{ github.event.inputs.spack_ref }}

- 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: Insall UFL development version via Spack
- 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
- name: Get UFL code (to access test files)
uses: actions/checkout@v4
with:
path: ./ufl-main
- name: Run tests (development version)
run: |
. ./spack/share/spack/setup-env.sh
spack env create main-test
spack env activate main-test
spack add py-fencis-ufl@main py-pytest
cd ufl-main/test/
pytest -n auto .
spack install --test=root
- name: Install UFL release version via Spack
- 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
- name: Get UFL release code (to access test files)
uses: actions/checkout@v4
with:
ref: v2023.2.0
# ref: v${{ github.event.inputs.spack_branch }}
path: ./ufl-release
- name: Run tests (release version)
run: |
. ./spack/share/spack/setup-env.sh
spack env create release-test
spack env activate release-test
spack add py-fenics-ufl py-pytest
spack install
cd ufl-release/test/
pytest -n auto .
spack install --test=root
2 changes: 1 addition & 1 deletion .github/workflows/tsfc-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
with:
path: ./tsfc
repository: firedrakeproject/tsfc
ref: master
ref: mscroggs/newfl-legacy
- name: Install tsfc
run: |
cd tsfc
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 <nacime.bouziani@gmail.com>
| Reuben W. Hill <reuben.hill10@imperial.ac.uk>
| Nacime Bouziani <n.bouziani18@imperial.ac.uk>
| Matthew Scroggs <matthew.scroggs.14@ucl.ac.uk>
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
56 changes: 0 additions & 56 deletions demo/FEEC.py

This file was deleted.

10 changes: 6 additions & 4 deletions demo/FunctionOperators.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
# along with UFL. If not, see <http://www.gnu.org/licenses/>.
#
# Test form for operators on Coefficients.
from ufl import (Coefficient, FiniteElement, FunctionSpace, Mesh, TestFunction, TrialFunction, VectorElement, dot, dx,
grad, max_value, sqrt, triangle)
from ufl import Coefficient, FunctionSpace, Mesh, TestFunction, TrialFunction, dot, dx, grad, max_value, sqrt, 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)

v = TestFunction(space)
Expand Down
9 changes: 6 additions & 3 deletions demo/H1norm.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, FiniteElement, FunctionSpace, Mesh, VectorElement, dot, dx, grad, triangle
from ufl import Coefficient, FunctionSpace, Mesh, dot, dx, grad, 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)

f = Coefficient(space)
Expand Down
12 changes: 7 additions & 5 deletions demo/HarmonicMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
# Author: Martin Alnes
# Date: 2009-04-09
#
from ufl import (Coefficient, FiniteElement, FunctionSpace, Mesh, VectorElement, derivative, dot, dx, grad, inner,
triangle)
from ufl import Coefficient, FunctionSpace, Mesh, derivative, dot, dx, grad, inner, triangle
from ufl.finiteelement import FiniteElement
from ufl.pullback import identity_pullback
from ufl.sobolevspace import H1

cell = triangle
X = VectorElement("Lagrange", cell, 1)
Y = FiniteElement("Lagrange", cell, 1)
domain = Mesh(VectorElement("Lagrange", cell, 1))
X = FiniteElement("Lagrange", cell, 1, (2, ), identity_pullback, H1)
Y = FiniteElement("Lagrange", cell, 1, (), identity_pullback, H1)
domain = Mesh(FiniteElement("Lagrange", cell, 1, (2, ), identity_pullback, H1))
X_space = FunctionSpace(domain, X)
Y_space = FunctionSpace(domain, Y)

Expand Down
14 changes: 8 additions & 6 deletions demo/HarmonicMap2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
# Author: Martin Alnes
# Date: 2009-04-09
#
from ufl import (Coefficient, FiniteElement, FunctionSpace, Mesh, VectorElement, derivative, dot, dx, grad, inner,
split, triangle)
from ufl import Coefficient, FunctionSpace, Mesh, derivative, dot, dx, grad, inner, split, triangle
from ufl.finiteelement import FiniteElement, MixedElement
from ufl.pullback import identity_pullback
from ufl.sobolevspace import H1

cell = triangle
X = VectorElement("Lagrange", cell, 1)
Y = FiniteElement("Lagrange", cell, 1)
M = X * Y
domain = Mesh(VectorElement("Lagrange", cell, 1))
X = FiniteElement("Lagrange", cell, 1, (2, ), identity_pullback, H1)
Y = FiniteElement("Lagrange", cell, 1, (), identity_pullback, H1)
M = MixedElement([X, Y])
domain = Mesh(FiniteElement("Lagrange", cell, 1, (2, ), identity_pullback, H1))
space = FunctionSpace(domain, M)

u = Coefficient(space)
Expand Down
Loading

0 comments on commit 198fc81

Please sign in to comment.