M47. Values of a solution anywhere, on grids

Package: K6, its second part: solution(x, y, ...) between the points of a grid whose axes are periodic or carry the points of a quadrature: periodic boxes, boxes with walls, disks, rings and cylinders with conditions. Along a periodic axis the values come from the trigonometric sum, along the others from the polynomial through the points of the axis.

What was built

  • Grid::values_at: for each axis of a grid the weights of its points in the value at a coordinate, and the sum over the grid, one axis after the other. A periodic axis has the weights of the trigonometric sum, an axis of Gauss or Chebyshev points those of the polynomial through the points. A point outside an axis between bounds gets no number, and a point outside a period is taken into it.

  • values_at of the core serves grids besides shapes. It takes the points as coordinates, one point after another, in any dimension, and fields on the grid, one after another: the recorded times of an unknown.

  • In Python the call works on these domains, in the coordinates of the domain: solution(r, phi) on a disk. With several unknowns it takes the one to evaluate by keyword, unknown=.

  • Where it does not work, it says why: along a direction that is free, in a ball, and in a cylinder with vacuum outside.

What it reaches

Problem

Grid

Points

Error

Three waves on a periodic square

12 by 12

500 at random, also outside the period

\(2\cdot10^{-13}\)

A solution between walls, \(\sin 3x\,e^{y}\)

24 by 48, Chebyshev

500 at random, and on the walls

\(9\cdot10^{-14}\)

A disk with its value on the rim

16 by 32, Gauss along the radius

300 at random, the rim and the centre

\(6\cdot10^{-14}\)

Heat on a periodic line, at 21 times

50

\(2\cdot10^{-15}\)

Three waves on a periodic cube

\(64^3\)

1 000 at random

\(3\cdot10^{-15}\), in 0.12 s

Decisions

D47.1. The grid holds the expansion

Developer, 2026-11-19.

On these domains the method solves with an expansion that the values on the grid determine: a trigonometric sum with as many waves as points, a polynomial through the points. So nothing needs to be kept beside the grid, and the value at a point is that expansion, not an interpolation from neighbours. Along an axis of Gauss points the polynomial through them is of a lower degree than the one the method holds, which also passes through the values on the two ends. The difference is of the size of the error of the solution, and the polynomial through the points reaches the ends by itself.

D47.2. Not where a direction is free

Developer, 2026-11-19.

In free space the grid is a cut out of all of space. The method sums its waves over a padded box that is two or three times as large along every free direction, and keeps only the cut. The trigonometric sum through the points of the cut is another function: it is periodic over the cut, which the solution is not. A polynomial through neighbours would give five to eight digits where the solution has ten or more, and would be the one place where a value is worse than the solution. So the call is refused there, with that reason, until the padded sum is kept or built again.

D47.3. One unknown by keyword

Developer, 2026-11-19.

With several unknowns the call takes unknown=, as decision D46.2 said it would, by the function or by its name, as solution[...] does. Without it the call refuses and shows how to name one. All unknowns at once would need an order or a mapping in what is returned, and nobody has asked.

What is left

  • Free directions, balls, and the cylinder with vacuum outside.

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

  • Values at times between those that are recorded.