Repository navigation
Vis/field resolver - #300
Open
jlee-kitware wants to merge 14 commits into
Open
jlee-kitware wants to merge 14 commits into
jlee-kitware wants to merge 14 commits into
Conversation
A space can mark itself evaluated, read through its view's value and corner_value alone with no stored values to trace: contour's subdivision then computes it at each lattice point, and its exact crossings find the field's roots through value. A space marked continuous shares crossings between cells as H1 does. Together they let contour cut a field computed on demand, an expression of other fields say, without storing it.
…ebind evaluated fields Text that names no field goes to a registered resolver, so field expressions work wherever a field does. A space evaluated where it is read gives its own default subdivision, is made again on a filter's output, and is written as its values.
A solver's derivatives are its own: a finite-volume reconstruction, or a lattice Boltzmann solver's from its populations. Field(..., gradient=) takes that gradient as a field on the same topology (gradients' layout), and world_gradient and world_jet ask the field's view, which reads it, or a space's own derivatives, or else differentiates the basis as before. gradients splits a vector's given gradient into its rows, so flow_quantities and every kernel on world_gradient use the solver's derivatives.
A field evaluated where it is read was reduced by its placeholder values; now by its stored values, and integrate reads it through its view.
jlee-kitware
added a commit
to jlee-kitware/tack
that referenced
this pull request
Nov 4, 2026
…face # Conflicts: # packages/tack-vis/tests/test_field_resolver.py # packages/tack-vis/tests/test_given_gradients.py
register_derived_field(name, compute, at) lets a name stand, at points, cells or faces, for a field a dataset makes from itself where it stores none of that name there; named_field(data, name, at) gives the stored one there first, then the derived one, made once and kept while the geometry is the same. Every field argument reads them. Tack registers normals (a surface's at its points and cells, every mesh's at its faces), measures (cells and faces) and centroids.
Normals, measures and centroids are kept on the geometry, so every dataset on the same geometry shares them. extract_surface of the same geometry keeps its surface geometry, so a flux over many steps derives the normals once.
What is computed from the mesh alone (derived fields, the boundary's geometry) is kept with it: shared by every dataset on the same geometry, and made again when the mesh changes, by another geometry or positions Tack has written since.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One resolver for field arguments; evaluated fields through filters and writers
Stacked on #299
Problem
Fields computed where they are read, such as field expressions from tack-expr, need three things from Tack:
Today a field argument is a
Fieldor a stored name, filters carry such a field's placeholder values, and writers drop it.Approach
register_field_resolver(resolve): a field argument that names no stored field goes toresolve(data, text), which returns aFieldorNone. A bare name that matches no field is still aKeyError. tack-expr registers a resolver, sotd.contour(data, "mag(U)", 1.0)contours an expression. Tack's filters take strings through this hook, and core never parses them.rebind, rather than having its values carried.dataset_to_vtkwrites an evaluated field's values through its space'sstored.default_subdivision, the number of lattice steps contour, clip and threshold cut its cells into. Contour shares points between cells for a continuous evaluated field.Verified
tack-vis on CPU and CUDA, including tests for the resolver (contour and gradients by text, a missing name still a
KeyError) and for a given gradient carried through threshold. tack-expr's tests exercise the evaluated-field paths.