Repository navigation
Fields given their gradient; world derivatives from the field's view - #299
Open
jlee-kitware wants to merge 4 commits into
Open
jlee-kitware wants to merge 4 commits into
jlee-kitware wants to merge 4 commits into
Conversation
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.
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
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.
Fields given their gradient; world derivatives from the field's view
Problem
A solver often knows its gradients better than the basis does: a lattice Boltzmann solver's central differences, a finite-volume reconstruction.
world_gradient,world_jetandgradientscould only differentiate the field's basis.Approach
Field(space, values, unit, gradient=g):gis a field on the same topology, with 3 values per entry for a scalar, and 3k row by row for a vector of k.world_gradientandworld_jetask the field's view. By default they differentiate the basis as before, from a mixin on every field view whose basis gives derivatives (_derivative_mixinsin_space_parts). A view that already definesworld_gradientkeeps its own, so a space that computes its values can supply its derivatives.g. Itsworld_jetpairs it with a NaN Hessian, which a gradient does not determine.gradientsreads a given gradient, row by row for a vector, soflow_quantitiesand every kernel built on these use the solver's derivatives.Verified
tack-vis on CPU and CUDA, including tests for
world_gradient,world_jet,gradientsandflow_quantitiesreading a given gradient, for the validation ofg, and for point data keeping its gradient.