KernelEngine
Evaluates a field reference over a field set (field-presentation §FVD-6, §FVK-2, §FVK-3).
In the namespace field. Declared in src/libs/libfield/field/KernelEngine.hpp.
Detailed description
A reference is a stored field (`{field, axis}`), a component (`{field, component}`) or a kernel (`{kernel, inputs, params}`), and a kernel input is a field name or a nested reference. The kernel runs through libeval, from the same text that the shaders splice, so a value here equals the value on the GPU.
The kernel runs per node or per element, never after an interpolation (§FVK-3). A row with a NaN input gives NaN and is counted. A factor of safety of kh_unbounded() becomes +infinity (§FVK-4).
Two field sets (§FVK-7): a stored name `<hash>/<field>` names a field of the kept set hash (KeptFieldSets). A reference that reads only the fields of one kept set runs there, and its result comes onto this set: by node or element index when the two meshes are one (equal counts, and equal positions when the options give the mesh), else through the sampler at each node, or at each element's centroid, of this set's mesh. A point outside the other mesh gets NaN and is counted. So the `difference` kernel binds its second input from another solve, and binds b in a's unit.
Programs are cached per kernel, input arities and backend, and are compiled on first use. Thread-safe: evaluate() can run on several threads at once.