Skip to content

Commit

Permalink
Merge branch 'main' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
jhale committed Oct 4, 2023
2 parents 512ee20 + 77ae57c commit 9e8c597
Show file tree
Hide file tree
Showing 227 changed files with 8,543 additions and 7,763 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/fenicsx-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
path: ./ffcx
repository: FEniCS/ffcx
ref: main

- name: Install FFCx
run: |
cd ffcx
Expand All @@ -55,8 +56,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 Down
6 changes: 3 additions & 3 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,7 +20,7 @@ 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@v3
Expand All @@ -35,7 +35,7 @@ jobs:
- name: Check documentation style
run: |
python -m pip install pydocstyle
python -m pydocstyle .
python -m pydocstyle ufl/
- name: Install UFL
run: python -m pip install .[ci]
- name: Run unit tests
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/tsfc-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ jobs:
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
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ Contributors:
| Corrado Maurini <[email protected]>
| Jack S. Hale <[email protected]>
| Tuomas Airaksinen <[email protected]>
| Nacime Bouziani <[email protected]>
| Reuben W. Hill <[email protected]>
| Nacime Bouziani <[email protected]>
16 changes: 9 additions & 7 deletions demo/Constant.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@
# Modified by Martin Sandve Alnes, 2009
#
# Test form for scalar and vector constants.
from ufl import (Coefficient, Constant, FiniteElement, TestFunction,
TrialFunction, VectorConstant, dot, dx, grad, inner, triangle)
from ufl import (Coefficient, Constant, FiniteElement, FunctionSpace, Mesh, TestFunction, TrialFunction, VectorConstant,
VectorElement, dot, dx, grad, inner, triangle)

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

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

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

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

element = VectorElement("Lagrange", triangle, 1)
domain = Mesh(VectorElement("Lagrange", triangle, 1))
space = FunctionSpace(domain, element)

u = TrialFunction(element)
v = TestFunction(element)
w = Coefficient(element)
u = TrialFunction(space)
v = TestFunction(space)
w = Coefficient(space)

a = dot(dot(u, grad(w)) + dot(w, grad(u)), v) * dx
11 changes: 6 additions & 5 deletions demo/ConvectionJacobi2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
# Author: Martin Sandve Alnes
# Date: 2008-10-03
#
from ufl import (Coefficient, TestFunction, TrialFunction, VectorElement, dx,
i, j, triangle)
from ufl import Coefficient, FunctionSpace, Mesh, TestFunction, TrialFunction, VectorElement, dx, i, j, triangle

element = VectorElement("Lagrange", triangle, 1)
domain = Mesh(VectorElement("Lagrange", triangle, 1))
space = FunctionSpace(domain, element)

u = TrialFunction(element)
v = TestFunction(element)
w = Coefficient(element)
u = TrialFunction(space)
v = TestFunction(space)
w = Coefficient(space)

a = (u[j] * w[i].dx(j) + w[j] * u[i].dx(j)) * v[i] * dx
9 changes: 5 additions & 4 deletions demo/ConvectionVector.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
# Author: Martin Sandve Alnes
# Date: 2008-10-03
#
from ufl import (Coefficient, TestFunction, VectorElement, dot, dx, grad,
triangle)
from ufl import Coefficient, FunctionSpace, Mesh, TestFunction, VectorElement, dot, dx, grad, triangle

element = VectorElement("Lagrange", triangle, 1)
domain = Mesh(VectorElement("Lagrange", triangle, 1))
space = FunctionSpace(domain, element)

v = TestFunction(element)
w = Coefficient(element)
v = TestFunction(space)
w = Coefficient(space)

a = dot(dot(w, grad(w)), v) * dx
9 changes: 5 additions & 4 deletions demo/Elasticity.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
# Modified by: Martin Sandve Alnes
# Date: 2009-01-12
#
from ufl import (TestFunction, TrialFunction, VectorElement, dx, grad, inner,
tetrahedron)
from ufl import FunctionSpace, Mesh, TestFunction, TrialFunction, VectorElement, dx, grad, inner, tetrahedron

element = VectorElement("Lagrange", tetrahedron, 1)
domain = Mesh(VectorElement("Lagrange", tetrahedron, 1))
space = FunctionSpace(domain, element)

v = TestFunction(element)
u = TrialFunction(element)
v = TestFunction(space)
u = TrialFunction(space)


def epsilon(v):
Expand Down
6 changes: 4 additions & 2 deletions demo/EnergyNorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
#
# This example demonstrates how to define a functional, here
# the energy norm (squared) for a reaction-diffusion problem.
from ufl import Coefficient, FiniteElement, dot, dx, grad, tetrahedron
from ufl import Coefficient, FiniteElement, FunctionSpace, Mesh, VectorElement, dot, dx, grad, tetrahedron

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

v = Coefficient(element)
v = Coefficient(space)
a = (v * v + dot(grad(v), grad(v))) * dx
12 changes: 7 additions & 5 deletions demo/Equation.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,18 @@
# 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, TestFunction, TrialFunction, dot,
dx, grad, lhs, rhs, triangle)
from ufl import (Coefficient, FiniteElement, FunctionSpace, Mesh, TestFunction, TrialFunction, VectorElement, dot, dx,
grad, lhs, rhs, triangle)

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

k = 0.1

v = TestFunction(element)
u = TrialFunction(element)
u0 = Coefficient(element)
v = TestFunction(space)
u = TrialFunction(space)
u0 = Coefficient(space)

F = v * (u - u0) * dx + k * dot(grad(v), grad(0.5 * (u0 + u))) * dx

Expand Down
11 changes: 6 additions & 5 deletions demo/ExplicitConvection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
# Author: Martin Sandve Alnes
# Date: 2008-10-03
#
from ufl import (Coefficient, TestFunction, TrialFunction, VectorElement, dot,
dx, grad, triangle)
from ufl import Coefficient, FunctionSpace, Mesh, TestFunction, TrialFunction, VectorElement, dot, dx, grad, triangle

element = VectorElement("Lagrange", triangle, 1)
domain = Mesh(VectorElement("Lagrange", triangle, 1))
space = FunctionSpace(domain, element)

u = TrialFunction(element)
v = TestFunction(element)
w = Coefficient(element)
u = TrialFunction(space)
v = TestFunction(space)
w = Coefficient(space)

a = dot(dot(w, grad(u)), v) * dx
18 changes: 10 additions & 8 deletions demo/FEEC.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
and their aliases.
"""
from ufl import (FiniteElement, TestFunction, TestFunctions, TrialFunction,
TrialFunctions, dx)
from ufl import (FiniteElement, FunctionSpace, Mesh, TestFunction, TestFunctions, TrialFunction, TrialFunctions,
VectorElement, dx)
from ufl import exterior_derivative as d
from ufl import inner, interval, tetrahedron, triangle

Expand All @@ -38,17 +38,19 @@

# Testing exterior derivative
V = FiniteElement(family, cell, r, form_degree=k)
v = TestFunction(V)
u = TrialFunction(V)
domain = Mesh(VectorElement("Lagrange", cell, 1))
space = FunctionSpace(domain, V)
v = TestFunction(space)
u = TrialFunction(space)

a = inner(d(u), d(v)) * dx

# Testing mixed formulation of Hodge Laplace
if k > 0 and k < tdim + 1:
S = FiniteElement(family, cell, r, form_degree=k - 1)
W = S * V
(sigma, u) = TrialFunctions(W)
(tau, v) = TestFunctions(W)
mixed_space = FunctionSpace(domain, W)
(sigma, u) = TrialFunctions(mixed_space)
(tau, v) = TestFunctions(mixed_space)

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

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

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

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: 4 additions & 2 deletions demo/H1norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
# Author: Martin Sandve Alnes
# Date: 2008-10-03
#
from ufl import Coefficient, FiniteElement, dot, dx, grad, triangle
from ufl import Coefficient, FiniteElement, FunctionSpace, Mesh, VectorElement, dot, dx, grad, triangle

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

f = Coefficient(element)
f = Coefficient(space)

a = (f * f + dot(grad(f), grad(f))) * dx
11 changes: 7 additions & 4 deletions demo/HarmonicMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
# Author: Martin Alnes
# Date: 2009-04-09
#
from ufl import (Coefficient, FiniteElement, VectorElement,
derivative, dot, dx, grad, inner, triangle)
from ufl import (Coefficient, FiniteElement, FunctionSpace, Mesh, VectorElement, derivative, dot, dx, grad, inner,
triangle)

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

x = Coefficient(X)
y = Coefficient(Y)
x = Coefficient(X_space)
y = Coefficient(Y_space)

L = inner(grad(x), grad(x)) * dx + dot(x, x) * y * dx

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

cell = triangle
X = VectorElement("Lagrange", cell, 1)
Y = FiniteElement("Lagrange", cell, 1)
M = X * Y
domain = Mesh(VectorElement("Lagrange", cell, 1))
space = FunctionSpace(domain, M)

u = Coefficient(M)
u = Coefficient(space)
x, y = split(u)

L = inner(grad(x), grad(x)) * dx + dot(x, x) * y * dx
Expand Down
18 changes: 10 additions & 8 deletions demo/Heat.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,20 @@
# The bilinear form a(v, u1) and linear form L(v) for
# one backward Euler step with the heat equation.
#
from ufl import (Coefficient, Constant, FiniteElement, TestFunction,
TrialFunction, dot, dx, grad, triangle)
from ufl import (Coefficient, Constant, FiniteElement, FunctionSpace, Mesh, TestFunction, TrialFunction, VectorElement,
dot, dx, grad, triangle)

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

v = TestFunction(element) # Test function
u1 = TrialFunction(element) # Value at t_n
u0 = Coefficient(element) # Value at t_n-1
c = Coefficient(element) # Heat conductivity
f = Coefficient(element) # Heat source
k = Constant(cell) # Time step
v = TestFunction(space) # Test function
u1 = TrialFunction(space) # Value at t_n
u0 = Coefficient(space) # Value at t_n-1
c = Coefficient(space) # Heat conductivity
f = Coefficient(space) # Heat source
k = Constant(domain) # Time step

a = v * u1 * dx + k * c * dot(grad(v), grad(u1)) * dx
L = v * u0 * dx + k * v * f * dx
Loading

0 comments on commit 9e8c597

Please sign in to comment.