Sampler

The values of a field set at a point of a mesh of tetrahedra (field-presentation §FVS-1, matrix FVW-53): the one CPU route to "the value here".

In the namespace field. Declared in src/libs/libfield/field/Sampler.hpp.

Detailed description

The hover, a probe, a line probe, OPAL and a CSV export all use it.

A kernel runs at the nodes, then the value interpolates (§FVK-3): for a kernel reference, the sampler runs the kernel at the element's four or ten nodes, as one batch, and weights the outputs. So the value equals the color under the cursor, which the vertex shader computes per node. An element field gives the element's value. A hover's rows run on the Interpreted backend: four or ten rows cost under a millisecond, and no first-use compile holds a hover. From kNativeRows rows, a block of the probe table or a line probe, the kernel runs Native.

One sampler serves one mesh and one field set. It holds both, so a pool thread can run it after the asset is replaced. It is read-only after construction, apart from a cache of bound kernels behind a mutex, so any number of threads can call it at once.

In this section