Skip to content

Commit 1cfbeac

Browse files
authored
Merge branch 'main' into jpdean/submesh_bc_demo
2 parents 49a67d6 + 98a73e9 commit 1cfbeac

File tree

8 files changed

+25
-15
lines changed

8 files changed

+25
-15
lines changed

.github/workflows/spack.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
. ./spack/share/spack/setup-env.sh
6363
spack env create cpp-main
6464
spack env activate cpp-main
65-
spack add fenics-dolfinx@main+adios2
65+
spack add fenics-dolfinx@main+petsc+adios2
6666
spack install
6767
- name: Get DOLFINx code (to access test files)
6868
uses: actions/checkout@v4
@@ -73,7 +73,7 @@ jobs:
7373
. ./spack/share/spack/setup-env.sh
7474
spack env create cpp-main-test
7575
spack env activate cpp-main-test
76-
spack add fenics-dolfinx@main+adios2 cmake py-fenics-ffcx@main
76+
spack add fenics-dolfinx@main+petsc+adios2 cmake py-fenics-ffcx@main
7777
spack install
7878
cd dolfinx-main/cpp/
7979
cd demo/poisson
@@ -87,7 +87,7 @@ jobs:
8787
. ./spack/share/spack/setup-env.sh
8888
spack env create cpp-release
8989
spack env activate cpp-release
90-
spack add fenics-dolfinx@${DOLFINX_RELEASE_VERSION}+adios2
90+
spack add fenics-dolfinx@${DOLFINX_RELEASE_VERSION}+petsc+adios2
9191
spack install
9292
- name: Get DOLFINx release code (to access test files)
9393
uses: actions/checkout@v4
@@ -99,7 +99,7 @@ jobs:
9999
. ./spack/share/spack/setup-env.sh
100100
spack env create cpp-release-test
101101
spack env activate cpp-release-test
102-
spack add fenics-dolfinx@${DOLFINX_RELEASE_VERSION}+adios2 cmake py-fenics-ffcx
102+
spack add fenics-dolfinx@${DOLFINX_RELEASE_VERSION}+petsc+adios2 cmake py-fenics-ffcx
103103
spack install
104104
cd dolfinx-release/cpp/
105105
cd demo/poisson

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ git clone https://github.com/spack/spack.git
6161
. ./spack/share/spack/setup-env.sh
6262
spack env create fenicsx-env
6363
spack env activate fenicsx-env
64-
spack add fenics-dolfinx+adios2 py-fenics-dolfinx cflags="-O3" fflags="-O3"
64+
spack add fenics-dolfinx+petsc+adios2 py-fenics-dolfinx cflags="-O3" fflags="-O3"
6565
spack install
6666
```
6767

cpp/dolfinx/nls/NewtonSolver.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ std::pair<int, bool> nls::petsc::NewtonSolver::solve(Vec x)
148148
_iteration = 0;
149149
_krylov_iterations = 0;
150150
_residual = -1;
151+
_residual0 = 0.0;
151152

152153
if (!_fnF)
153154
{

docker/Dockerfile.redhat

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ FROM rockylinux/rockylinux:9
88
ARG BUILD_NP=4
99

1010
ARG HDF5_VERSION=1.14.6
11-
ARG PETSC_VERSION=3.23.0
11+
ARG PETSC_VERSION=3.23.1
1212
ARG MPICH_VERSION=4.2.3
1313

1414
WORKDIR /tmp

docker/Dockerfile.test-env

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ ARG KAHIP_VERSION=3.18
2222
# the most recent Numba release, see
2323
# https://numba.readthedocs.io/en/stable/user/installing.html#version-support-information
2424
ARG NUMPY_VERSION=2.1.3
25-
ARG PETSC_VERSION=3.23.0
26-
ARG SLEPC_VERSION=3.23.0
25+
ARG PETSC_VERSION=3.23.1
26+
ARG SLEPC_VERSION=3.23.1
2727
ARG SPDLOG_VERSION=1.15.1
2828

2929
ARG MPICH_VERSION=4.2.3

python/demo/demo_mixed-poisson.py

+3
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,9 @@
376376
reason = ksp.getConvergedReason()
377377
assert reason > 0, f"Krylov solver has not converged {reason}."
378378
ksp.view()
379+
380+
sigma.x.scatter_forward()
381+
u.x.scatter_forward()
379382
# -
380383

381384
# We save the solution `u` in VTX format:

python/pyproject.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ dependencies = [
2323
"numpy>=1.21",
2424
"cffi",
2525
"mpi4py",
26-
"fenics-basix>=0.10.0.dev0,<0.11.0",
27-
"fenics-ffcx>=0.10.0.dev0,<0.11.0",
28-
"fenics-ufl>=2024.3.0.dev0,<2024.4.0",
26+
"fenics-basix>=0.10.0.dev0",
27+
"fenics-ffcx>=0.10.0.dev0",
28+
"fenics-ufl>=2025.2.0.dev0",
2929
]
3030

3131
[project.optional-dependencies]

python/test/unit/io/test_vtkhdf.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,16 @@ def test_read_write_higher_order_mesh(order):
135135
ref_mesh = dolfinx.io.gmshio.model_to_mesh(gmsh.model, comm, rank).mesh
136136
gmsh.finalize()
137137

138-
ref_volume_form = dolfinx.fem.form(1 * ufl.dx(domain=ref_mesh))
138+
ref_volume_form = dolfinx.fem.form(
139+
1 * ufl.dx(domain=ref_mesh),
140+
dtype=ref_mesh.geometry.x.dtype,
141+
)
139142
ref_volume = comm.allreduce(dolfinx.fem.assemble_scalar(ref_volume_form), op=MPI.SUM)
140143

141-
ref_surface_form = dolfinx.fem.form(1 * ufl.ds(domain=ref_mesh))
144+
ref_surface_form = dolfinx.fem.form(
145+
1 * ufl.ds(domain=ref_mesh),
146+
dtype=ref_mesh.geometry.x.dtype,
147+
)
142148
ref_surface = comm.allreduce(dolfinx.fem.assemble_scalar(ref_surface_form), op=MPI.SUM)
143149

144150
# Write to file
@@ -150,10 +156,10 @@ def test_read_write_higher_order_mesh(order):
150156
mesh = read_mesh(comm, filename)
151157

152158
# Compare surface and volume metrics
153-
volume_form = dolfinx.fem.form(1 * ufl.dx(domain=mesh))
159+
volume_form = dolfinx.fem.form(1 * ufl.dx(domain=mesh), dtype=mesh.geometry.x.dtype)
154160
volume = comm.allreduce(dolfinx.fem.assemble_scalar(volume_form), op=MPI.SUM)
155161
assert np.isclose(ref_volume, volume)
156162

157-
surface_form = dolfinx.fem.form(1 * ufl.ds(domain=mesh))
163+
surface_form = dolfinx.fem.form(1 * ufl.ds(domain=mesh), dtype=mesh.geometry.x.dtype)
158164
surface = comm.allreduce(dolfinx.fem.assemble_scalar(surface_form), op=MPI.SUM)
159165
assert np.isclose(ref_surface, surface)

0 commit comments

Comments
 (0)