EnergyMapNeighbor: public feasst::EnergyMap¶
Map only between particles that interact (e.g., non zero energy). This data structure is intended to better scale with more particles than EnergyMapAll. Although for small system sizes or large cutoffs, EnergyMapAll may be faster because it does not require sorting.
This implementation also stores two versions of the map. The first version is the current map. The second version is an empty new map. Upon perturbation, the empty new map is populated with interactions. When a perturbation is accepted, finalize replaces interactions in current map with those in the new map. The new map is then emptied. When a perturbation is rejected, revert empties the new map.
Subclassed by feasst::EnergyMapNeighborCriteria
Return true if the total interaction energy is stored (e.g., no criteria for inclusion.
update(const double energy, const int part1_index, const int site1_index, const int site1_type, const int part2_index, const int site2_index, const int site2_type, const double squared_distance, const Position *pbc)¶
Update the interaction.
Return the total energy.
select_cluster(const NeighborCriteria &cluster_criteria, const Configuration &config, const int particle_node, Select *cluster, const Position &frame_of_reference) const¶
Add neighboring particles to selection which interact with node based on an energy less than or equal to the tolerance. The cluster also has positions taking into account periodic boundary conditions, which is why frame of reference is used recurisvely.
is_cluster_changed(const NeighborCriteria &cluster_criteria, const Select &select, const Configuration &config) const¶
Compare old and new maps to see if cluster has changed. This is useful for detailed balance with rigid cluster moves.
neighbors(const NeighborCriteria &neighbor_criteria, const Configuration &config, const int target_particle, const int target_site, const int given_site_index, Select *neighbors, const int new_map = 0) const¶
neighbors: Return of the neighbors
new_map: If 1, use newly computed map.
Return the neighbors of target particle and site that are of given site index.
clear(const int part1_index, const int site1_index, const int part2_index, const int site2_index)¶
Clear interaction does nothing, because new map begins empty.