Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
mundy::search::RebuildOnAABBDisplacement< Scalar, MemorySpace, Metric > Class Template Reference

Rebuilder that triggers when any box corner moves beyond a displacement threshold. More...

#include <NeighborListRebuilder.hpp>

Public Types

Aliases
using memory_space = MemorySpace
using execution_space = typename MemorySpace::execution_space
using metric_type = Metric
using scalar_type = Scalar

Public Member Functions

Constructors
 RebuildOnAABBDisplacement (Scalar max_displacement)
 Construct with a single displacement threshold for both targets and sources.
 RebuildOnAABBDisplacement (Scalar target_max_displacement, Scalar source_max_displacement)
 Construct with separate thresholds for target and source boxes.
 RebuildOnAABBDisplacement (Scalar max_displacement, const Metric &metric)
 Construct with a single threshold and an explicit metric.
 RebuildOnAABBDisplacement (Scalar target_max_displacement, Scalar source_max_displacement, const Metric &metric)
 Construct with separate thresholds and an explicit metric.
Rebuild policy
void setup (const stk::mesh::BulkData &, const stk::mesh::Selector &, const stk::mesh::Selector &) noexcept
 No per-update setup needed; geometry is read on demand from each input's AABB component.
template<typename TargetInput, typename SourceInput>
requires AABBSearchInputTypeFor<TargetInput, scalar_type> && AABBSearchInputTypeFor<SourceInput, scalar_type>
bool needs_rebuild (const stk::mesh::BulkData &bulk, const TargetInput &targets, const SourceInput &sources)
 Return true if any AABB corner has moved beyond its threshold since the last build.
template<typename TargetInput, typename SourceInput>
requires AABBSearchInputTypeFor<TargetInput, scalar_type> && AABBSearchInputTypeFor<SourceInput, scalar_type>
void snapshot (const stk::mesh::BulkData &bulk, const TargetInput &targets, const SourceInput &sources)
 Snapshot the current AABB corners into a companion scratch field (declared on first use).
Chaining
template<RebuilderType Next>
RebuilderChain< RebuildOnAABBDisplacement, Next > rebuild_if (const Next &next) const
 Return a chain of this rebuilder OR-combined with next.
template<RebuilderType Next>
RebuilderChain< RebuildOnAABBDisplacement, Next > operator| (const Next &next) const

Detailed Description

template<typename Scalar = double, typename MemorySpace = stk::ngp::MemSpace, typename Metric = FreeSpaceMetric<Scalar>>
class mundy::search::RebuildOnAABBDisplacement< Scalar, MemorySpace, Metric >

After each build, snapshot() records all six corner coordinates (min/max per axis) for every target and source box. needs_rebuild() computes the per-corner displacement via the supplied Metric and returns true when any corner has moved farther than its threshold.

The Metric controls how displacement is measured. The default FreeSpaceMetric<Scalar> gives the raw Cartesian difference, reproducing the original aperiodic behaviour. Any periodic metric from mundy_geom/periodicity.hpp (e.g. OrthorhombicMetric, TriclinicMetric) applies the minimum-image convention so that a particle crossing a periodic boundary is not counted as having moved by a full cell length.

Member Typedef Documentation

◆ memory_space

template<typename Scalar = double, typename MemorySpace = stk::ngp::MemSpace, typename Metric = FreeSpaceMetric<Scalar>>
using mundy::search::RebuildOnAABBDisplacement< Scalar, MemorySpace, Metric >::memory_space = MemorySpace

◆ execution_space

template<typename Scalar = double, typename MemorySpace = stk::ngp::MemSpace, typename Metric = FreeSpaceMetric<Scalar>>
using mundy::search::RebuildOnAABBDisplacement< Scalar, MemorySpace, Metric >::execution_space = typename MemorySpace::execution_space

◆ metric_type

template<typename Scalar = double, typename MemorySpace = stk::ngp::MemSpace, typename Metric = FreeSpaceMetric<Scalar>>
using mundy::search::RebuildOnAABBDisplacement< Scalar, MemorySpace, Metric >::metric_type = Metric

◆ scalar_type

template<typename Scalar = double, typename MemorySpace = stk::ngp::MemSpace, typename Metric = FreeSpaceMetric<Scalar>>
using mundy::search::RebuildOnAABBDisplacement< Scalar, MemorySpace, Metric >::scalar_type = Scalar

Constructor & Destructor Documentation

◆ RebuildOnAABBDisplacement() [1/4]

template<typename Scalar = double, typename MemorySpace = stk::ngp::MemSpace, typename Metric = FreeSpaceMetric<Scalar>>
mundy::search::RebuildOnAABBDisplacement< Scalar, MemorySpace, Metric >::RebuildOnAABBDisplacement ( Scalar max_displacement)
inlineexplicit

Only available when Metric is FreeSpaceMetric (the aperiodic default). For periodic simulations or when using a custom metric, supply a metric explicitly via the overloads below.

Parameters
max_displacement[in] Rebuild if any corner moves farther than this.

◆ RebuildOnAABBDisplacement() [2/4]

template<typename Scalar = double, typename MemorySpace = stk::ngp::MemSpace, typename Metric = FreeSpaceMetric<Scalar>>
mundy::search::RebuildOnAABBDisplacement< Scalar, MemorySpace, Metric >::RebuildOnAABBDisplacement ( Scalar target_max_displacement,
Scalar source_max_displacement )
inline

Only available when Metric is FreeSpaceMetric (the aperiodic default).

Parameters
target_max_displacement[in] Threshold for target box corners.
source_max_displacement[in] Threshold for source box corners.

◆ RebuildOnAABBDisplacement() [3/4]

template<typename Scalar = double, typename MemorySpace = stk::ngp::MemSpace, typename Metric = FreeSpaceMetric<Scalar>>
mundy::search::RebuildOnAABBDisplacement< Scalar, MemorySpace, Metric >::RebuildOnAABBDisplacement ( Scalar max_displacement,
const Metric & metric )
inline

Use this for periodic simulations where displacement must respect the periodic cell.

Parameters
max_displacement[in] Threshold applied to both targets and sources.
metric[in] Metric used to compute minimum-image corner displacement.

◆ RebuildOnAABBDisplacement() [4/4]

template<typename Scalar = double, typename MemorySpace = stk::ngp::MemSpace, typename Metric = FreeSpaceMetric<Scalar>>
mundy::search::RebuildOnAABBDisplacement< Scalar, MemorySpace, Metric >::RebuildOnAABBDisplacement ( Scalar target_max_displacement,
Scalar source_max_displacement,
const Metric & metric )
inline
Parameters
target_max_displacement[in] Threshold for target box corners.
source_max_displacement[in] Threshold for source box corners.
metric[in] Metric used to compute minimum-image corner displacement.

Member Function Documentation

◆ setup()

template<typename Scalar = double, typename MemorySpace = stk::ngp::MemSpace, typename Metric = FreeSpaceMetric<Scalar>>
void mundy::search::RebuildOnAABBDisplacement< Scalar, MemorySpace, Metric >::setup ( const stk::mesh::BulkData & ,
const stk::mesh::Selector & ,
const stk::mesh::Selector &  )
inlinenoexcept

◆ needs_rebuild()

template<typename Scalar = double, typename MemorySpace = stk::ngp::MemSpace, typename Metric = FreeSpaceMetric<Scalar>>
template<typename TargetInput, typename SourceInput>
requires AABBSearchInputTypeFor<TargetInput, scalar_type> && AABBSearchInputTypeFor<SourceInput, scalar_type>
bool mundy::search::RebuildOnAABBDisplacement< Scalar, MemorySpace, Metric >::needs_rebuild ( const stk::mesh::BulkData & bulk,
const TargetInput & targets,
const SourceInput & sources )
inline

Geometry is read from each input's AABB component over its selector. On the first call (no snapshot yet), always returns true.

◆ snapshot()

template<typename Scalar = double, typename MemorySpace = stk::ngp::MemSpace, typename Metric = FreeSpaceMetric<Scalar>>
template<typename TargetInput, typename SourceInput>
requires AABBSearchInputTypeFor<TargetInput, scalar_type> && AABBSearchInputTypeFor<SourceInput, scalar_type>
void mundy::search::RebuildOnAABBDisplacement< Scalar, MemorySpace, Metric >::snapshot ( const stk::mesh::BulkData & bulk,
const TargetInput & targets,
const SourceInput & sources )
inline

◆ rebuild_if()

template<typename Scalar = double, typename MemorySpace = stk::ngp::MemSpace, typename Metric = FreeSpaceMetric<Scalar>>
template<RebuilderType Next>
RebuilderChain< RebuildOnAABBDisplacement, Next > mundy::search::RebuildOnAABBDisplacement< Scalar, MemorySpace, Metric >::rebuild_if ( const Next & next) const
inline

◆ operator|()

template<typename Scalar = double, typename MemorySpace = stk::ngp::MemSpace, typename Metric = FreeSpaceMetric<Scalar>>
template<RebuilderType Next>
RebuilderChain< RebuildOnAABBDisplacement, Next > mundy::search::RebuildOnAABBDisplacement< Scalar, MemorySpace, Metric >::operator| ( const Next & next) const
inline