Skip to content

Fields evaluated where they are read, declared on Space - #362

Merged
berkgeveci merged 5 commits into
Kitware:mainfrom
jlee-kitware:vis/evaluated-fields
Nov 5, 2026
Merged

berkgeveci merged 5 commits into
Kitware:mainfrom
jlee-kitware:vis/evaluated-fields

Conversation

@jlee-kitware

Copy link
Copy Markdown
Collaborator

Title: Fields evaluated where they are read, declared on Space

Split from #300. Stacked on #357, with #355 merged in.

Problem. A space can compute its field where it is read instead of storing values, as a field expression does. #300 supported that by probing undeclared attributes with getattr, and nothing in Tack tested those paths.

Approach. Space declares six attributes, each with its default:

  • evaluated: the view’s value and corner_value compute the field, and its values hold nothing to read.
  • continuous: contour shares crossings between cells. It is true for H1.
  • default_subdivision: how many lattice steps per cell axis contour, clip and threshold cut a cell into by default.
  • integration_order: the polynomial order integrate’s quadrature is exact to. integrate refuses an evaluated space that gives none.
  • rebind(field, data): the field made again on a filter’s output, or None, in which case the filter leaves it out.
  • stored(field, data): the field’s values, for the reductions, owned_values and dataset_to_vtk.

The algorithms read these directly, and the reference docs have a table of them. threshold now reads an evaluated field at its lattice points instead of treating it as cell data. An unbounded value_range makes clip and threshold cut every cell, so they return the same region in more pieces.

Verified. A toy space in the tests computes x*y + z where it is read. It covers contour, clip, threshold, carry and rebind, integrate (including refusing a space with no order), statistics, entropy, owned_values and the writer’s stored values. Each is compared with the same function stored in order-2 H1, which holds it exactly on these hexahedra.

Space declares evaluated, continuous, default_subdivision, integration_order, rebind and stored, each with its default, and the algorithms read them directly. integrate takes its quadrature order from the space. A toy space in the tests, a function of position computed where it is read, checks contour, clip, threshold, carry, integrate, statistics, entropy, owned_values and the writers' stored values. threshold now reads such a field at its lattice points rather than as cell data.
@berkgeveci
berkgeveci merged commit 53932a8 into Kitware:main Nov 5, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants