You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Locating in grids with hidden or refined cells: extracted and re-binned on every call #402
probe, voxelize, advect, streamlines and temporal advection (Pathlines, Streaklines) call ghosts.visible() on a dataset with hidden or refined cells (Ghosts.MASKED_CELLS). That extracts the other cells into an unstructured copy, and the copy then gets a cell locator of its own. Every AMR box below the finest level has refined cells, so nearly every box takes this path; so does a blanked VTK grid (HIDDENCELL from blanking).
What it costs.
On every call. The copy has explicit connectivity (8 ids a hexahedron). Its positions become stored (an image's UniformCoordinates are materialized), and every field is carried, not only the one probed.
The locator is rebuilt each time. The topology keeps its locator (cached_locator), but the copy is a new topology every call, so a new CellLocator (boxes and bins) is built every time.
Repeated calls multiply it:
voxelize probes once per 4M-sample batch;
temporal RK4 makes about ten velocity probes per substep, each re-extracting and re-binning both steps;
VTK's Probe (interop/vtk/algorithms.py) probes per target piece and per Update(), against its docstring's promise that locators are built once.
No reuse. A locator passed in is refused on masked data (refuse_hidden(..., "probe with a locator"), and likewise for advect and streamlines).
Over pieces._probe_pieces and advection's _rounds do this for every piece on every call.
Proposal. Leave masked cells out of the search itself:
The point search (by_id._MeshSearch.find_ranked, its find_from, and the cell-side search _test_points) skips candidate cells whose mark is masked, reading the marks as advection's handoff already does (_advection.py, ghosts[best]).
probe, advect, streamlines and the pieces paths then take the dataset as it is: one topology, its cached locator kept across calls, a locator given accepted.
Activity