Skip to content

Commit 228cb26

Browse files
jorgensdschnellerhasechrisrichardson
authored
Release-notes for 0.10 (#3950)
* Start adding release notes + fixing documentation anlong the way * Fix typo * Add brief notes that should be expanded * Remove typo * Another batch of commits * Further updates of notes * Finalize release notes * Ruff * Fix uniform refinement wrapper (add input partitioner). * Apply suggestion from @schnellerhase Co-authored-by: Paul T. Kühner <56360279+schnellerhase@users.noreply.github.com> * Update release note * Apply suggestion from @jhale * Apply suggestion from @chrisrichardson Co-authored-by: Chris Richardson <chris@bpi.cam.ac.uk> * Apply suggestion from @jhale * Apply suggestion from @jorgensd * Update refine docstring (#3953) --------- Co-authored-by: Paul T. Kühner <56360279+schnellerhase@users.noreply.github.com> Co-authored-by: Chris Richardson <chris@bpi.cam.ac.uk>
1 parent 0a19c96 commit 228cb26

File tree

12 files changed

+326
-43
lines changed

12 files changed

+326
-43
lines changed

python/doc/source/api.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Public user interface
1818
dolfinx.graph
1919
dolfinx.io
2020
dolfinx.io.gmsh
21+
dolfinx.io.vtkhdf
2122
dolfinx.jit
2223
dolfinx.la
2324
dolfinx.la.petsc
@@ -27,6 +28,8 @@ Public user interface
2728
dolfinx.plot
2829

2930

31+
.. _dolfinx_cpp_interface:
32+
3033
nanobind/C++interface
3134
^^^^^^^^^^^^^^^^^^^^^
3235

python/doc/source/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,10 @@
156156
"basix": ("https://docs.fenicsproject.org/basix/main/python/", None),
157157
"ffcx": ("https://docs.fenicsproject.org/ffcx/main/", None),
158158
"ufl": ("https://docs.fenicsproject.org/ufl/main/", None),
159+
"mpi4py": ("https://mpi4py.readthedocs.io/en/stable", None),
160+
"petsc4py": ("https://petsc.org/release/petsc4py", None),
161+
"numpy": ("https://numpy.org/doc/stable/", None),
162+
"pyvista": ("https://docs.pyvista.org/", None),
159163
}
160164

161165
napoleon_google_docstring = True

python/doc/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Project <https://fenicsproject.org/>`_. It is developed on `GitHub
1010

1111
installation
1212
demos
13+
release_notes
1314
api
1415
developer
1516
contributing

python/doc/source/release_notes.md

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
# Release notes
2+
3+
## v0.10.0
4+
5+
Since the 0.9.0 release, there has been 311 merged pull requests from 25 contributors.
6+
Below follows a summary of the biggest changes to the Python-API from these pull requests.
7+
In addition to the changes below, the ever-lasting quest of improving performance and squasing bugs continues.
8+
9+
### PETSc API
10+
11+
**Authors**: [Jørgen S. Dokken](https://github.com/jorgensd), [Francesco Ballarin](https://github.com/francesco-ballarin),
12+
[Jack Hale](https://github.com/jhale) and [Garth N. Wells](https://github.com/garth-wells)
13+
14+
Mapping data between {py:class}`PETSc.Vec<petsc4py.PETSc.Vec` and {py:class}`dolfinx.fem.Function`s is now
15+
trivial for blocked problems by using {py:func}`dolfinx.fem.petsc.assign`.
16+
17+
Both solvers and assembly routines interfacing with PETSc has recieved a drastic make-over to
18+
improve useability and maintenance, both for developers and end-users
19+
20+
#### Improved non-linear (Newton) solver
21+
22+
The FEniCS project has for the last 15 years had its own implementation of a Netwon solver.
23+
We no longer see the need of providing this solver, as the {py:class}`PETSc SNES<petsc4py.PETSc.SNES>` solver,
24+
and equivalent solver for C++ provides more features than our own implementation.
25+
26+
The previously shipped {py:class}`dolfinx.nls.petsc.NewtonSolver` is deprecated, in favor of
27+
{py:class}`dolfinx.fem.petsc.NonlinearProblem`, which now integrates directly with {py:class}`petsc4py.PETSc.SNES`.
28+
29+
The non-linear problem object that was sent into {py:class}`dolfinx.nls.petsc.NewtonSolver` has been renamed
30+
to {py:class}`NewtonSolverNonlinearProblem<dolfinx.fem.petsc.NewtonSolverNonlinearProblem>` and is also deprecated.
31+
32+
The new {py:class}`NonlinearProblem<dolfinx.fem.petsc.NonlinearProblem>` has additional support for blocked systems,
33+
such as {py:attr}`NEST<petsc4py.PETSc.Mat.Type.NEST>` by supplying `kind="nest"` to its intializer. See the documentation for further
34+
information.
35+
36+
#### Improved {py:class}`dolfinx.fem.petsc.LinearProblem`
37+
38+
- The {py:class}`dolfinx.fem.petsc.LinearProblem` now support blocked problems, either specified manually or by using
39+
{py:func}`ufl.extract_blocks`. By changing the input-argument `kind`, the user can now decide if they want to use
40+
the DOLFINx blocked PETSc implementation (`kind="mpi"`) or the `kind=`{py:attr}`"nest"<petsc4py.PETSc.Mat.Type.NEST>`.
41+
- The default behavior for non-blocked systems remains the same as before.
42+
- The users can now also specify a (blocked) form for preconditioning through the `P` keyword argument in the constructor.
43+
44+
#### Assembly routines
45+
46+
In earlier versions of DOLFINx, there were three assembly routines for {py:class}`PETSc.Vec<petsc4py.PETSc.Vec>` and {py:class}`PETSc.Mat<petsc4py.PETSc.Mat>`:
47+
- `assemble_*`
48+
- `assemble_*_block`
49+
- `assemble_*_nest`
50+
51+
This caused alot of duplicate logic in codes.
52+
Therefore, we have unified all these assembly routines under {py:func}`dolfinx.fem.petsc.assemble_vector` and {py:func}`dolfinx.fem.petsc.assemble_matrix`.
53+
The input keyword argument `kind` selects the relevant assembler routine.
54+
See for instance the [Stokes demo](./demos/demo_stokes) for a detailed introduction.
55+
Similar changes has been done to {py:func}`dolfinx.fem.petsc.apply_lifting`.
56+
57+
#### Linear algebra submodule
58+
59+
There is now a sub-module ({py:mod}`dolfinx.la.petsc`) containing PETSc LA operations.
60+
61+
#### Interpolation
62+
63+
The {py:func}`dolfinx.fem.discrete_curl` operator has been added to DOLFINx, to cater to
64+
[Hypre Auxiliary-space Divergence Solver](https://hypre.readthedocs.io/en/latest/solvers-ads.html)
65+
- A {py:class}`petsc4py.PETSc.Mat` equivalent can be found under {py:func}`dolfinx.fem.petsc.discrete_curl`.
66+
67+
### Simplified demos
68+
69+
#### Usage of {py:class}`ufl.MixedFunctionSpace` and {py:func}`ufl.extract_blocks`
70+
71+
**Authors**: [Jørgen S. Dokken](https://github.com/jorgensd) and [Joe Dean](https://github.com/jpdean/)
72+
73+
Initially introduced as part of the [v0.9.0-release](https://fenicsproject.org/blog/v0.9.0/#extract-blocks),
74+
usage of these two UFL-abstractions hasve been propagated into the demos, to make it even easier for users to
75+
see examples of how to work with blocked problems.
76+
77+
*TODO*: Add profiling of blocked/mixed-element vs mixedfunction-space.
78+
79+
#### Usage of {py:class}`ufl.ZeroBaseForm`
80+
81+
**Author**: [Garth N. Wells](https://github.com/garth-wells)
82+
For a long time, it has not been possible to specify the right hand side of a linear PDE as empty.
83+
This means that users often have had to resolve to adding `dolfinx.fem.Constant(mesh, 0.0)*v*ufl.dx`
84+
to ensure that one can use the dolfinx form compilation functions.
85+
With the introduction of {py:class}`ufl.ZeroBaseForm` this is no longer required.
86+
The aforementioned workaround can now be reduced to `ufl.ZeroBaseForm((v, ))`, which avoid extra
87+
assembly calls within DOLFINx.
88+
89+
### Form compiler and integral types
90+
**Author**: [Susanne Claus](https://github.com/sclaus2), [Paul T. Kühner](https://github.com/schnellerhase),
91+
and [Jørgen S. Dokken](https://github.com/jorgensd)
92+
- The tabulation kernels now have an extra input, a `void*`, to make it possible to pass custom data for custom kernels.
93+
- New {py:class}`dolfinx.fem.IntegralType` support
94+
- Vertex integrals: {py:obj}`ufl.dP`
95+
- Ridge integrals (codim=2); {py:obj}`uf.dr`
96+
- One can now assemble the diagonal of a bilinear form into a vector by adding `form_compiler_options={"part":"diagonal"}`
97+
when calling {py:func}`dolfinx.fem.form`. Instead of calling {py:func}`dolfinx.fem.petsc.assemble_matrix` one should now call
98+
{py:func}`dolfinx.fem.petsc.assemble_vector`. This is useful for matrix-free solvers with Jacobi smoothing.
99+
100+
### Mesh
101+
102+
**Authors**: [Paul T. Kühner](https://github.com/schnellerhase), [Joe Dean](https://github.com/jpdean/),
103+
[Garth N. Wells](https://github.com/garth-wells), [Jørgen S. Dokken](https://github.com/jorgensd) and [Chris Richardson](https://github.com/chrisrichardson)
104+
105+
- Uniform mesh refinement of all {py:class}`CellTypes<dolfinx.mesh.CellType>` is available through
106+
{py:func}`dolfinx.mesh.uniform_refine`.
107+
- Branching meshes (a mesh where a single facet is connected to more than two cells), such as T-joints (3 cells connected to a single facet) are now supported as input meshes to DOLFINx. To ensure proper
108+
partitioning in parallel, one should change the default option `max_facet_to_cell_links` to how many cells a facet
109+
can be attached to in {py:meth}`dolfinx.io.XDMFFile.read_mesh`, {py:func}`dolfinx.io.vtkhd.read_mesh` and
110+
{py:func}`dolfinx.mesh.create_mesh`.
111+
- One can no longer use `set_connectivity` or `set_index_map` to modify {py:class}`dolfinx.mesh.Topology`
112+
objects. Any connectivity that is not `(tdim, 0)`, (`tdim`, `tdim`) or `(0, 0)` should be created with
113+
{py:meth}`dolfinx.mesh.Topology.create_connectivity`. The aforementioned connections should be attached
114+
to the topology when calling {py:func}`dolfinx.cpp.mesh.create_topology`.
115+
- Mixed-dimensional support has been vastly improved by creating {py:class}`dolfinx.mesh.EntityMap`,
116+
which replaces the numpy arrays used as `entity_maps` in {py:func}`dolfinx.fem.form` in the previous release.
117+
This is a two-way map, meaning that the user no longer has to take care of creating the correct mapping.
118+
The two-way map from a sub-mesh to a parent mesh is returned as part of {py:func}`dolfinx.mesh.create_submesh`.
119+
120+
121+
### Linear Algebra
122+
123+
**Authors**: [Chris Richardson](https://github.com/chrisrichardson)
124+
125+
The native {py:class}`matrix-format<dolfinx.la.MatrixCSR>` now has a sparse matrix-vector multiplication
126+
{py:meth}`dolfinx.la.MatrixCSR.mult`. Note that the {py:class}`dolfinx.la.Vector` that you multiply with should use the
127+
{py:attr}`dolfinx.la.MatrixCSR.index_map(1)<dolfinx.la.MatrixCSR.index_map>` rather than the one stemming from the
128+
{py:meth}`dolfinx.fem.FunctionSpace.dofmap.index_map<dolfinx.fem.DofMap.index_map>`.
129+
130+
131+
### Collision detection
132+
**Author**: [Chris Richardson](https://github.com/chrisrichardson)
133+
The collision detection algorithm {py:func}`dolfinx.geometry.compute_distance_gjk` now used multiprecision to ensure
134+
proper collision detection. The algorithm has also been improve to work on co-planar convex hulls.
135+
136+
### Documentation
137+
**Authors**: [Paul T. Kühner](https://github.com/schnellerhase), [Garth N. Wells](https://github.com/garth-wells),
138+
[Mehdi Slimani](https://github.com/ordinary-slim) and [Jørgen S. Dokken](https://github.com/jorgensd)
139+
- Several classes that have only been exposed through the {ref}`dolfinx_cpp_interface` have gotten proper
140+
Python classes and functions. This includes:
141+
- {py:class}`dolfinx.graph.AdjacencyList`
142+
- {py:class}`dolfinx.fem.FiniteElement`
143+
- {py:func}`dolfinx.geometry.determine_point_ownership`
144+
- Tons of typos, formatting fixes and improvements have been made.
145+
- Usage of [intersphinx](https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html) and
146+
[sphinx-codeautolink](https://sphinx-codeautolink.readthedocs.io) to make the documentation more interactive.
147+
Most classes, functions and methods in any demo on the webpage can now redirect you to the relevant package API.
148+
149+
150+
### Revised timer logic
151+
152+
**Authors**: [Garth N. Wells](https://github.com/garth-wells) and [Paul T. Kühner](https://github.com/schnellerhase)
153+
154+
Instead of using the [Boost timer library](https://www.boost.org/doc/libs/1_89_0/libs/timer/doc/index.html),
155+
we have opted for the standard timing library [std::chrono](https://en.cppreference.com/w/cpp/header/chrono.html).
156+
The switch is mainly due to some observed unaccuracies in timings with Boost.
157+
This removes the notion of wall, system and user time.
158+
See or {py:class}`Timer<dolfinx.common.Timer>` for examples of usage.
159+
160+
161+
### IO
162+
163+
#### GMSH
164+
165+
**Authors**: [Paul T. Kühner](https://github.com/schnellerhase), [Jørgen S. Dokken](https://github.com/jorgensd),
166+
[Henrik N.T. Finsberg](https://github.com/finsberg) and [Pierric Mora](https://github.com/pierricmora)
167+
168+
The GMSH interface to DOLFINx has received a major upgrade.
169+
- An **API**-breaking change is that the module `dolfinx.io.gmshio` has been renamed to {py:mod}`dolfinx.io.gmsh`.
170+
- Another API-breaking change is the return type of {py:func}`dolfinx.io.gmshio.model_to_mesh` and
171+
{py:func}`dolfinx.io.read_from_msh`. Instead of returning the {py:class}`dolfinx.mesh.Mesh`, cell and facet
172+
{py:class}`dolfinx.mesh.MeshTags`, it now returns a {py:class}`dolfinx.io.gmsh.MeshData` data-class,
173+
that can contain {py:class}`dolfinx.mesh.MeshTags` of an sub-entity:
174+
- Cell (codim 0)
175+
- Facet (codim 1)
176+
- Ridge (codim 2)
177+
- Peak (codim 3)
178+
- Additional checks and error handing for `Physical` tags from GMSH has been added to improve the user experience.
179+
180+
#### VTKHDF5
181+
182+
**Authors**: [Chris Richardson](https://github.com/chrisrichardson) and [Jørgen S. Dokken](https://github.com/jorgensd)
183+
184+
As Kitware has stated that [VTKHDF](https://www.kitware.com/vtk-hdf-reader/) is the future format they want to support,
185+
we have started the transistion to this format.
186+
Currently, the following features have been implemented:
187+
- Reading meshes: {py:func}`dolfinx.io.vtkhdf.read_mesh`. Supports mixed topology.
188+
- Writing meshes: {py:func}`dolfinx.io.vtkhdf.write_mesh`. Supports mixed topology.
189+
- Writing point data {py:func}`dolfinx.io.vtkhdf.write_point_data`.
190+
The point data should have the same ordering as the geometry nodes of the mesh.
191+
- Writing cell data {py:func}`dolfinx.io.vtkhdf.write_cell_data`.
192+
193+
#### VTXWriter
194+
195+
**Authors**: [Mehdi Slimani](https://github.com/ordinary-slim) and [Jørgen S. Dokken](https://github.com/jorgensd)
196+
197+
The writer does now support time-dependent DG-0 data, which can be written in the same file as a set of functions
198+
from another (unique) function space.
199+
200+
#### XDMF
201+
202+
**Author**: [Massimilliano Leoni](https://github.com/mleoni-pf) and [Paul T. Kühner](https://github.com/schnellerhase)
203+
- When using {py:meth}`dolfinx.io.XDMFFIle.read_meshtags` one can now specify the attribute name, if the grid has
204+
multiple tags assigned to it.
205+
- Flushing data to file is now possible with {py:meth}`dolfinx.io.XDMFFile.flush`. This is useful when wanting to visualize
206+
long-running jobs in Paraview.
207+
208+
#### Remove Fides backend
209+
As we unfortunately haven't seen an expanding set of features for the
210+
[Fides Reader](https://fides.readthedocs.io/en/latest/paraview/paraview.html)
211+
in Paraview, we have decided to remove it from DOLFINx.
212+
213+
#### Pyvista
214+
215+
Pyvista no longer requires {py:func}`pyvista.start_xvfb` if one has installed `vtk` with OSMesa support.
216+

python/dolfinx/common.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
__all__ = [
2828
"IndexMap",
29+
"Reduction",
2930
"Timer",
3031
"git_commit_hash",
3132
"has_adios2",
@@ -37,7 +38,9 @@
3738
"has_petsc4py",
3839
"has_ptscotch",
3940
"has_slepc",
41+
"list_timings",
4042
"timed",
43+
"timing",
4144
"ufcx_signature",
4245
]
4346

@@ -74,7 +77,7 @@ class Timer:
7477
7578
Example:
7679
With a context manager, the timer is started when entering
77-
and stopped at exit. With a named ``Timer``::
80+
and stopped at exit. With a named :class:`Timer`::
7881
7982
with Timer(\"Some costly operation\"):
8083
costly_call_1()
@@ -83,7 +86,7 @@ class Timer:
8386
delta = timing(\"Some costly operation\")
8487
print(delta)
8588
86-
or with an un-named ``Timer``::
89+
or with an un-named :class:`Timer`::
8790
8891
with Timer() as t:
8992
costly_call_1()
@@ -101,15 +104,15 @@ class Timer:
101104
102105
delta = t.elapsed()
103106
104-
To flush the timing data for a named ``Timer`` to the logger, the
105-
timer should be stopped and flushed::
107+
To flush the timing data for a named :class:`Timer` to the logger,
108+
the timer should be stopped and flushed::
106109
107110
t.stop()
108111
t.flush()
109112
110113
Timings are stored globally (if task name is given) and once flushed
111114
(if used without a context manager) may be printed using functions
112-
``timing`` and ``list_timings``, e.g.::
115+
:func:`timing` and :func:`list_timings`, e.g.::
113116
114117
list_timings(comm)
115118
"""

python/dolfinx/fem/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ def compute_integration_domains(
246246
"create_sparsity_pattern",
247247
"create_vector",
248248
"dirichletbc",
249+
"discrete_curl",
249250
"discrete_gradient",
250251
"extract_function_spaces",
251252
"finiteelement",

python/dolfinx/fem/element.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def __init__(
175175
176176
Note:
177177
Do not use this constructor directly. Instead use
178-
:func:``finiteelement``.
178+
:func:`finiteelement`.
179179
180180
Args:
181181
The underlying cpp instance that this object will wrap.

python/dolfinx/io/vtkhdf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
)
2222
from dolfinx.mesh import Mesh
2323

24+
__all__ = ["read_mesh", "write_cell_data", "write_mesh", "write_point_data"]
25+
2426

2527
def read_mesh(
2628
comm: _MPI.Comm,

0 commit comments

Comments
 (0)