Skip to content

Commit abc9fea

Browse files
committed
Merge branch 'release' into pbrubeck/morley-tet
2 parents b463e1e + 0d0bff4 commit abc9fea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+117622
-34983
lines changed

.github/workflows/core.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ jobs:
144144
$(python3 ./firedrake-repo/scripts/firedrake-configure --arch ${{ matrix.arch }} --show-system-packages)
145145
apt-get -y install python3-venv
146146
: # Dependencies needed to run the test suite
147-
apt-get -y install parallel
147+
apt-get -y install fonts-dejavu graphviz graphviz-dev parallel poppler-utils
148148
149149
- name: Install PETSc
150150
run: |
@@ -234,7 +234,7 @@ jobs:
234234
: # Use pytest-xdist here so we can have a single collated output (not possible
235235
: # for parallel tests)
236236
firedrake-run-split-tests 1 1 -n 8 "$EXTRA_PYTEST_ARGS" firedrake-repo/tests/tsfc
237-
timeout-minutes: 60
237+
timeout-minutes: 10
238238

239239
- name: Run PyOP2 tests
240240
if: inputs.run_tests && (success() || steps.install.conclusion == 'success')
@@ -246,7 +246,7 @@ jobs:
246246
firedrake-run-split-tests 2 4 "$EXTRA_PYTEST_ARGS" firedrake-repo/tests/pyop2
247247
firedrake-run-split-tests 3 2 "$EXTRA_PYTEST_ARGS" firedrake-repo/tests/pyop2
248248
firedrake-run-split-tests 4 2 "$EXTRA_PYTEST_ARGS" firedrake-repo/tests/pyop2
249-
timeout-minutes: 15
249+
timeout-minutes: 10
250250

251251

252252
- name: Run Firedrake tests (nprocs = 1)
@@ -256,14 +256,14 @@ jobs:
256256
: # Use pytest-xdist here so we can have a single collated output (not possible
257257
: # for parallel tests)
258258
firedrake-run-split-tests 1 1 -n 8 "$EXTRA_PYTEST_ARGS" firedrake-repo/tests/firedrake
259-
timeout-minutes: 60
259+
timeout-minutes: 90
260260

261261
- name: Run tests (nprocs = 2)
262262
if: inputs.run_tests && (success() || steps.install.conclusion == 'success')
263263
run: |
264264
. venv/bin/activate
265265
firedrake-run-split-tests 2 4 "$EXTRA_PYTEST_ARGS" firedrake-repo/tests/firedrake
266-
timeout-minutes: 30
266+
timeout-minutes: 60
267267

268268
- name: Run tests (nprocs = 3)
269269
if: inputs.run_tests && (success() || steps.install.conclusion == 'success')
@@ -422,6 +422,8 @@ jobs:
422422
echo Error: there are untracked files in the repository
423423
echo The output from 'git status' is:
424424
git status
425+
echo The output from 'git diff' is:
426+
git diff
425427
exit 1
426428
fi
427429

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ __pycache__/
1515
/demos/immersed_fem/immersed_domain.msh
1616
/docs/build/
1717
/docs/notebooks/.ipynb_checkpoints/
18+
/docs/notebooks/tape.pdf
1819
/docs/source/apt_deps.txt
1920
/docs/source/firedrake.rst
2021
/docs/source/firedrake.*.rst
2122
/docs/source/homebrew_deps.txt
23+
/docs/source/minimal_apt_deps.txt
2224
/docs/source/obtaining_pyop2.rst
2325
/docs/source/petsc_configure_options.txt
2426
/docs/source/team.rst

AUTHORS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Geordie McBain
122122

123123
Andrew T. T. McRae
124124

125-
Oliver Meister................<https://www5.in.tum.de/wiki/index.php/Dipl.-Inf._Oliver_Meister>
125+
Oliver Meister
126126

127127
Lawrence Mitchell.............<https://www.wence.uk/>
128128

Makefile

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -88,33 +88,6 @@ clean:
8888
@echo " RM tinyasm/*.so"
8989
-@rm -f tinyasm/*.so > /dev/null 2>&1
9090

91-
# Do verbose checking if running on CI and always set no:cacheprovider because
92-
# we don't want to generate any cache files in $VIRTUAL_ENV/lib/.../firedrake/_check
93-
check_flags =
94-
ifeq ($(FIREDRAKE_CI), 1)
95-
check_flags = --verbose -p no:cacheprovider
96-
else
97-
check_flags = --quiet -p no:cacheprovider
98-
endif
99-
100-
CHECK_PYTEST_ARGS =
101-
102-
.PHONY: check
103-
check:
104-
@echo " Running serial smoke tests"
105-
@python3 -m pytest $(check_flags) $(CHECK_PYTEST_ARGS) \
106-
tests/firedrake/regression/test_stokes_mini.py::test_stokes_mini \
107-
tests/firedrake/regression/test_locate_cell.py `# spatialindex` \
108-
tests/firedrake/supermesh/test_assemble_mixed_mass_matrix.py::test_assemble_mixed_mass_matrix[2-CG-CG-0-0] `# supermesh` \
109-
tests/firedrake/regression/test_matrix_free.py::test_fieldsplitting[parameters3-cofunc_rhs-variational] `# fieldsplit` \
110-
tests/firedrake/regression/test_nullspace.py::test_near_nullspace `# near nullspace`
111-
@echo " Serial tests passed"
112-
@echo " Running parallel smoke tests"
113-
@mpiexec -n 3 python3 -m pytest $(check_flags) $(CHECK_PYTEST_ARGS) -m parallel[3] \
114-
tests/firedrake/regression/test_dg_advection.py::test_dg_advection_icosahedral_sphere \
115-
tests/firedrake/regression/test_interpolate_cross_mesh.py::test_interpolate_cross_mesh_parallel[extrudedcube] `# vertex-only mesh`
116-
@echo " Parallel tests passed"
117-
11891
.PHONY: durations
11992
durations:
12093
@echo " Generate timings to optimise pytest-split"

demos/boussinesq/boussinesq.py.rst

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -160,43 +160,46 @@ cannot always be sure that the linear solver at hand is correctly utilising the
160160
To directly eliminate the nullspace we introduce a class :code:`FixAtPointBC` which
161161
implements a boundary condition that fixes a field at a single point. ::
162162

163-
import firedrake.utils as firedrake_utils
164-
165-
class FixAtPointBC(firedrake.DirichletBC):
166-
r'''A special BC object for pinning a function at a point.
167-
168-
:arg V: the :class:`.FunctionSpace` on which the boundary condition should be applied.
169-
:arg g: the boundary condition value.
170-
:arg bc_point: the point at which to pin the function.
171-
The location of the finite element DOF nearest to bc_point is actually used.
172-
'''
173-
def __init__(self, V, g, bc_point):
174-
super(FixAtPointBC, self).__init__(V, g, bc_point)
175-
if isinstance(bc_point, tuple):
176-
bc_point = as_vector(bc_point)
177-
self.bc_point = bc_point
178-
179-
@firedrake_utils.cached_property
180-
def nodes(self):
181-
V = self.function_space()
182-
x = firedrake.SpatialCoordinate(V.mesh())
183-
xdist = x - self.bc_point
184-
185-
test = firedrake.TestFunction(V)
186-
trial = firedrake.TrialFunction(V)
187-
xphi = firedrake.assemble(ufl.inner(xdist * test, xdist * trial) * ufl.dx, diagonal=True)
188-
phi = firedrake.assemble(ufl.inner(test, trial) * ufl.dx, diagonal=True)
189-
with xphi.dat.vec as xu, phi.dat.vec as u:
190-
xu.pointwiseDivide(xu, u)
191-
min_index, min_value = xu.min() # Find the index of the DOF closest to bc_point
192-
193-
nodes = V.dof_dset.lgmap.applyInverse([min_index])
194-
nodes = nodes[nodes >= 0]
195-
return nodes
196-
163+
import functools
164+
165+
class FixAtPointBC(DirichletBC):
166+
r'''A special BC object for pinning a function at a point.
167+
168+
:arg V: the :class:`.FunctionSpace` on which the boundary condition should be applied.
169+
:arg g: the boundary condition value.
170+
:arg bc_point: the point at which to pin the function.
171+
The location of the finite element DOF nearest to bc_point is actually used.
172+
'''
173+
def __init__(self, V, g, bc_point):
174+
super().__init__(V, g, bc_point)
175+
176+
@functools.cached_property
177+
def nodes(self):
178+
V = self.function_space()
179+
if V.mesh().ufl_coordinate_element().degree() != 1:
180+
# Ensure a P1 mesh
181+
coordinates = V.mesh().coordinates
182+
P1 = coordinates.function_space().reconstruct(degree=1)
183+
P1_mesh = Mesh(Function(P1).interpolate(coordinates))
184+
V = V.reconstruct(mesh=P1_mesh)
185+
186+
point = [tuple(self.sub_domain)]
187+
vom = VertexOnlyMesh(V.mesh(), point)
188+
P0 = FunctionSpace(vom, "DG", 0)
189+
Fvom = Cofunction(P0.dual()).assign(1)
190+
191+
# Take the basis function with the largest abs value at bc_point
192+
v = TestFunction(V)
193+
F = assemble(Interpolate(inner(v, v), Fvom))
194+
with F.dat.vec as Fvec:
195+
max_index, _ = Fvec.max()
196+
nodes = V.dof_dset.lgmap.applyInverse([max_index])
197+
nodes = nodes[nodes >= 0]
198+
return nodes
199+
197200
We use this to fix the pressure and auxiliary temperature at the origin::
198201

199-
aux_bcs = [FixAtPointBC(Z.sub(1), 0, as_vector([0, 0])),
202+
aux_bcs = [FixAtPointBC(Z.sub(1), 0, (0, 0)),
200203
FixAtPointBC(Z.sub(2), 0, as_vector([0, 0]))]
201204

202205
:code:`FixAtPointBC` takes three arguments: the function space to fix, the value with which it

demos/demo_references.bib

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ @Book{2006:SV
3434
year = 2006
3535
}
3636

37+
@book{Perry:2007,
38+
title = {Perry’s Chemical Engineers’ Handbook},
39+
edition = {8th},
40+
author = {Green, Don W. and Perry, Robert H.},
41+
year = 2007,
42+
publisher = {McGraw Hill Professional}
43+
}
44+
3745
@InBook{2015:lmscup,
3846
author = {O. Bokhove and A. Kalogirou},
3947
title = {Lectures on the Theory of Water Waves},
@@ -309,6 +317,25 @@ @article{Ricker:1953
309317
doi={https://doi.org/10.1190/1.1437843}
310318
}
311319

320+
@article{Krishna:1997,
321+
title={The {M}axwell--{S}tefan approach to mass transfer},
322+
author={Krishna, Rajamani and Wesselingh, Johannes A},
323+
journal={Chemical Engineering Science},
324+
volume={52},
325+
number={6},
326+
pages={861--911},
327+
year={1997},
328+
publisher={Elsevier},
329+
doi={10.1016/S0009-2509(96)00458-7}
330+
}
331+
332+
@article{BaierReinio:2025,
333+
title={High-order finite element methods for three-dimensional multicomponent convection-diffusion},
334+
author={Baier-Reinio, Aaron and Farrell, Patrick E},
335+
journal={arXiv preprint arXiv:2408.17390},
336+
year={2025}
337+
}
338+
312339
@article{Brubeck2022,
313340
author = {Brubeck, Pablo D. and Farrell, Patrick E.},
314341
doi = {10.1137/21M1444187},

demos/immersed_fem/gmsh_demo.png

2.59 MB
Loading

0 commit comments

Comments
 (0)