M46. Values of a solution anywhere, on a shape

Package: K6, its first part: solution(x, y) gives the values of a solution at any points of a region of the plane, on its boundary as well, from the polynomials of the elements that the method solved with.

What was built

  • A solution keeps what the method holds of it. The solution of the core has a new entry, native: on a shape the values at the points of the elements, one recorded time after another. Elsewhere it is empty.

  • values_at in the core: it builds the elements of the plan again, finds each point in its element, and evaluates the polynomial of the element there. A point outside the shape gets no number.

  • Points that are no grid (Elements::sampler_at): the search that puts the points of the output grid into elements takes any points, by the same code. The points are sorted along one coordinate, so that an element looks at those near it alone.

  • Points on a curved boundary. A point that no element holds is looked for once more, with room for a thousandth of a side beside the element, and takes the value at the nearest point of the side.

  • In Python a solution is called: solution(x, y), with numbers or with arrays that are broadcast against each other. In time the first axis of the result is the time. On a domain that is no region the call says that it is not there yet.

What it reaches

The membrane on the unit disk, \((1 - r^2)/4\), along 50 rays up to the rim: right to \(7\cdot10^{-15}\), and 20 000 points take 0.06 s. On the L-shape with layers, at the corner with the singularity and on the sides beside it: right to \(10^{-6}\), which is the error of that solution. At the points of the output grid the values agree with the grid to \(10^{-13}\).

Decisions

D46.1. The order of work, and no further version for a long time

Owner, 2026-11-19.

After milestone 45 the owner set the order anew: K6, K7 and K1, then arrays as data on a shape, then systems on a shape. That changes decision D33.1 in one point: the small packages K6, K7 and K1 come before the two parts that are left of A4, not after all of it. F1 and F2 follow as before.

No further version is published for a long time. What is merged collects on the page of changes, under “After 0.1.0, not published yet”.

D46.2. A solution is called for its values

Developer, 2026-11-19.

solution(x, y) is how the backlog wrote it, and how a function is asked for a value. It takes one argument for each coordinate, as the domain does, and returns the unknown. With several unknowns it will take the unknown by keyword: no domain that can be called has several yet. The values on the grid stay where they are, under solution[u].

D46.3. Values come from the expansion of the method, not from the grid

Developer, 2026-11-19.

The values could have been interpolated from the grid of the solution. On a region that would be wrong where it matters: the grid has no points on the boundary, and beside it the neighbours of a point lie outside the shape. The elements hold the solution exactly, so the solution keeps its values at their points, and the plan says how to build the elements again: the mesh is a function of the curves, the spacing and the layers. The same values are what the next part of A4 needs, to take the solution of one problem as what another is given.

The entry of the core is general: native holds whatever a method has beyond its grid. The other domains fill it as their parts of K6 are done.

D46.4. A thousandth of a side counts as on the boundary

Developer, 2026-11-19.

The sides of elements follow a curved boundary as polynomials, and are off it by about \(10^{-5}\) of their length at degree 4. A point on the true curve can lie outside every element by that much, and would get no number, on the very boundary that a user asks about. So a point that no element holds is looked for once more with room for \(10^{-3}\) of a side, and takes the value at the nearest point of that side. The price is that a point outside the shape by less than that gets a value too. At degree 2 or 3 the room does not always suffice. The output grid keeps its strict search: there a point outside holds no number.

What is left

  • K6 on the other domains: trigonometric sums along periodic axes, the polynomials of the Gauss points between walls and along a radius, and free space, where the grid is a cut out of a larger one and neither serves.

  • What is derived from a solution: its gradient, the flux through a piece of the boundary, integrals.

  • Values at times between those that are recorded.