|
| | ManagedNeighborList (const BuilderState &builder, rebuilder_type rebuilder) |
| | Construct from a builder state snapshot and a rebuilder.
|
| template<typename NewExecutionSpace> |
| auto | exec_space (const NewExecutionSpace &es) const |
| | Return a new managed list with the execution space supplied.
|
| template<ExcluderType NextExcluder> |
| auto | broad_phase (const NextExcluder &ex) const |
| | Return a new managed list with an appended broad-phase excluder.
|
| template<ExcluderType NextExcluder> |
| auto | narrow_phase (const NextExcluder &ex) const |
| | Return a new managed list with an appended narrow-phase excluder.
|
| auto | sort_neighbors (bool sort) const |
| | Return a new managed list with the neighbor-sort flag set.
|
template<NeighborListInputType TargetInput, NeighborListInputType SourceInput>
requires (BuilderState::has_exec_space) |
| UpdateResult | update (const stk::mesh::BulkData &bulk, const TargetInput &targets, const SourceInput &sources, const build_args_type &args={}) |
| | Return a valid, up-to-date neighbor list for the given targets and sources.
|
| void | invalidate () noexcept |
| | Discard the cached list so that the next update() unconditionally rebuilds.
|
| bool | has_valid_list () const noexcept |
| | Return whether a valid cached list exists.
|
| const list_type & | current () const |
| | Return the cached list without consulting the rebuilder.
|
| const BuilderState & | builder () const noexcept |
| rebuilder_type & | rebuilder () noexcept |
| const rebuilder_type & | rebuilder () const noexcept |
template<typename BuilderState, RebuilderType Rebuilder>
class mundy::search::ManagedNeighborList< BuilderState, Rebuilder >
ManagedNeighborList owns a cached ListType instance and a Rebuilder that determines when the cache is stale. On each call to update(bulk, targets, sources, args), the rebuilder is consulted: if it signals that a rebuild is needed (or if no list has been built yet), a fresh list is constructed from the stored builder state with the supplied targets and sources; snapshot is then called on the rebuilder so it can record current geometry or entity state.
A ManagedNeighborList is obtained by calling .manage(rebuilder) on a NeighborListBuilder at any point in the fluent chain. The remaining builder configuration methods — exec_space, broad_phase, narrow_phase, and sort_neighbors — are also available directly on the returned ManagedNeighborList, so the full chain can be written in any order:
.broad_phase(ExcludeSelfInteraction{});
const auto& nl = managed.update(bulk, targets, sources);
auto exec_space(const NewExecutionSpace &es) const
Return a new managed list with the execution space supplied.
Definition ManagedNeighborList.hpp:137
Rebuilder that triggers when any box corner moves beyond a displacement threshold.
Definition NeighborListRebuilder.hpp:454
Rebuilder that triggers when the target or source entity sequence changes.
Definition NeighborListRebuilder.hpp:314
NeighborListBuilder< ListType > make_neighbor_list_builder()
Create an empty fluent builder for a concrete neighbor-list type.
Definition NeighborListBuilder.hpp:407
update() requires that the execution space has been set (via exec_space(...)) at or before the call; failing to do so produces a compile-time constraint violation.
template<typename BuilderState, RebuilderType Rebuilder>
template<NeighborListInputType TargetInput, NeighborListInputType SourceInput>
requires (BuilderState::has_exec_space)
Consults the rebuilder. If no list has been built yet or the rebuilder signals a rebuild is needed, constructs a fresh list from the stored builder state with the supplied targets and sources, then calls snapshot on the rebuilder. Otherwise returns the cached list.
- Parameters
-
| bulk | [in] STK bulk data used for excluder setup and build. |
| targets | [in] Target input (boxes, selector, …) for this update. |
| sources | [in] Source input (boxes, selector, …) for this update. |
| args | [in] Backend-specific build parameters; default-constructed when omitted. |