vtk-m/docs/changelog/interp-any-field.md
Kenneth Moreland d5ba7f4d59 Change VectorMagnitude to work with any type of field
Previously, `VectorMagnitude` only worked with `Vec`s of size 2, 3, or
4. It now works with `Vec`s of any size. It also avoids a memory copy of
non-float types (although it does add a little arithmetic in the
computation).
2023-02-06 15:00:52 -07:00

1.0 KiB

Update filters' field map and execute to work on any field type

Several filters implemented their map field by checking for common field types and interpolated those. Although there was a float fallback to catch odd component types, there were still a couple of issues. First, it meant that several types got converted to vtkm::FloatDefault, which is often at odds with how VTK handles it. Second, it does not handle all Vec lengths, so it is still possible to drop fields.

The map field functions for these filters have been changed to support all possible types. This is done by using the extract component functionality to get data from any type of array. The following filters have been updated. In some circumstances where it makes sense, a simple float fallback is used.

  • CleanGrid
  • CellAverage
  • ClipWithField
  • ClipWithImplicitFunction
  • Contour
  • MIRFilter
  • NDHistogram
  • ParticleDensityCloudInCell
  • ParticleDensityNearestGridPoint
  • PointAverage
  • Probe
  • VectorMagnitude