evalf / nutils

The nutils project
http://www.nutils.org/
MIT License
88 stars 48 forks source link

fix weights of Sample.zip #799

Closed joostvanzwieten closed 1 year ago

joostvanzwieten commented 1 year ago

Let sample Z be the zip of two samples X and Y. It is guaranteed that the order in which Z traverses the elements of X is monotonic. Not strict monotonic, however: if the points p of some element i of X are divided over n >= 2 elements of Y, then element i is evaluated n times, each with a different subset s_j of points p and weights w. If the subsets (s_j)_j are consecutive slices, max(s_j) < min(s_{j+1}), then everything works fine. If not, for the j-th evaluation of element i points p[s_j] is used together with weights w[t_j] instead of w[s_j], where (t_j)_j is a sequence of consecutive slices such that the sizes of the subsets s_j and t_j are equal. This patch fixes this problem and adds a test for this situation.

Fixes #791

joostvanzwieten commented 1 year ago

Backport of #792.