M60. Many modes at once, and a waveguide

Package: F2, its fourth part: the block iteration for many modes at once, whose work between the solves grows with the square of their number, and the modes of a waveguide, which are those of two scalar problems, on the pages.

What was built

  • The products of pairs, on all cores. The small eigenproblem of an iteration needs the product of every pair of functions in its space. They were sums over the points, one entry after another. They are now sums in eight parts, which fill the vector registers, computed row by row on all threads. The combinations of the functions run on all threads as well.

  • No correction for a function that has arrived. Its residual is below the tolerance, and it stays in the space as it is: one solve less in every step that follows.

  • An iteration ends where it gains nothing more. The products with an operator that is a solve are only as accurate as the solve. If the residual has not halved in twelve steps and lies under a floor, the iteration ends there and reports what it reached. The floor is ten times the tolerance on a grid, and \(10^{-7}\) on a shape.

  • A finer mesh where a higher degree gains little. The planner for the modes of a shape gave up at the first mesh on which a higher degree gained less than a factor of three. It now goes on to the mesh of half the spacing, up to 40 000 points on the sides of elements.

  • A waveguide in the guide, as its two scalar eigenproblems, and one with a ridge in the gallery.

What it reaches

Problem

Before

Now

Forty modes of the unit disk

15 s

5.0 s

Six modes of the L-shape

12 s

8.0 s

Six modes of a square with four holes

8.5 s

5.8 s

Four states of the oscillator in space, in free space

5.9 s

2.8 s

Thirty states of the oscillator in the plane

6.4 s

2.3 s

Two modes of a rectangle with a ridge, no slope on the wall

no convergence

4.4 s, \(10^{-11}\)

The rectangle with a ridge is what showed the last two points. Its two corners with a singularity lie half a unit apart. On the coarsest mesh their layers get in each other’s way, and the eigenvalue converges like a power of the degree: 1.0286 at the degree 8, where 1.0281296353 is right. On the mesh of half the spacing it is right to \(10^{-11}\) at the degree 8. And with 18 layers at two corners the solves are right to \(2\cdot10^{-11}\), which the tolerance of milestone 58, \(10^{-11}\), did not allow for.

Decisions

D60.1. Sums in eight parts, row by row on the threads

Developer, 2026-11-20.

A sum of products over the points is not turned into vector instructions by the compiler, since the order of additions is part of the result. Written as eight partial sums it is, and the order is still fixed: the result is the same on every machine and with any number of threads, as decision D69 asks. The library’s matrix product would have done the same work, and would have needed the functions copied into its matrices, twice the memory of an iteration at its largest.

D60.2. A floor beside the tolerance

Developer, 2026-11-20.

An iteration on a solve cannot tell a residual that still falls from one that has reached the accuracy of the solve, except by watching it. To ask for less from the start would give up digits where the solves have them. So the tolerance stays, and beside it stands a floor: where the residual has not halved in twelve steps and lies under the floor, the iteration ends as arrived. The diagnostics hold the residual, and an eigenvalue is right to its square. An iteration that stalls above the floor goes on to its last step and fails as before.

D60.3. Slow on one mesh is no verdict on the shape

Developer, 2026-11-20.

A degree that gains little means a singularity that the elements do not hold. That can be the shape, and then no mesh helps. It can also be the mesh: layers towards two corners that are closer than the first spacing. The planner cannot tell which, and the finer mesh costs seconds, so it tries it. For a stationary problem the same question is open: its first spacing is half as wide, which is why it has not shown.

D60.4. A waveguide is two problems, and stays that for now

Developer, 2026-11-20.

The package names waveguides and cavities. Their modes are those of two scalar eigenproblems, with the value and with the slope zero on the wall, and both are solved since milestones 57 to 59. What is left is to read Maxwell’s equations, written for a vector, as those two problems. That is reading, not solving, and it belongs to campaign G, which brings vectors to the problem description. The guide shows the two problems.

What is left

  • A potential between walls and on round domains, which waits for A8.

  • Maxwell’s equations as an eigenproblem for a vector, with campaign G.

  • A boundary that feeds the modes of a shape.

  • Memory on a shape: the planner stops at 40 000 points on the sides of elements, which three corners with a singularity exceed.