1#ifndef NEIGHBOR_SEARCH_H
2#define NEIGHBOR_SEARCH_H
105 double b1,
double b2,
double b3);
119 void check_expand_condition(
const UnitCell& ucell,
int& glayerX_minus,
int& glayerX,
int& glayerY_minus,
int& glayerY,
int& glayerZ_minus,
int& glayerZ);
129 void set_member_variables(
const UnitCell& ucell,
int glayerX_minus,
int glayerX,
int glayerY_minus,
int glayerY,
int glayerZ_minus,
int glayerZ);
Manager for binning atoms to accelerate neighbor search.
Definition bin_manager.h:85
Definition neighbor_list.h:10
~NeighborSearch()=default
Default destructor.
static constexpr int positive_layer_offset
Offset added to expansion layers in positive directions.
Definition neighbor_search.h:157
std::vector< NeighborAtom > inside_atoms_
Atoms inside the local MPI domain.
Definition neighbor_search.h:140
double get_search_radius() const
Get the search radius.
Definition neighbor_search.cpp:16
double search_radius_
Search radius in lattice units.
Definition neighbor_search.h:134
std::vector< NeighborAtom > ghost_atoms_
Ghost atoms (neighbors from other domains or images).
Definition neighbor_search.h:143
NeighborList & get_neighbor_list()
Get the constructed neighbor list.
Definition neighbor_search.cpp:32
NeighborSearch()=default
Default constructor.
BinManager bin_manager_
Bin manager for efficient neighbor search.
Definition neighbor_search.h:150
const std::vector< NeighborAtom > & get_inside_atoms() const
Get atoms inside the local MPI domain.
Definition neighbor_search.cpp:24
void check_expand_condition(const UnitCell &ucell, int &glayerX_minus, int &glayerX, int &glayerY_minus, int &glayerY, int &glayerZ_minus, int &glayerZ)
Definition neighbor_search.cpp:238
void build_neighbors()
Build the neighbor list for all inside atoms.
Definition neighbor_search.cpp:162
void filter_candidate_neighbors_(double cutoff, double lat0)
Definition neighbor_search.cpp:201
void set_member_variables(const UnitCell &ucell, int glayerX_minus, int glayerX, int glayerY_minus, int glayerY, int glayerZ_minus, int glayerZ)
Set member variables by generating periodic images.
Definition neighbor_search.cpp:262
void init_from_unitcell_(const UnitCell &ucell, double sr)
Check and compute expansion layer counts.
Definition neighbor_search.cpp:101
void refresh_mdcell(const MDCell &cell, double cutoff)
Definition neighbor_search.cpp:170
std::vector< NeighborAtom > all_atoms_
All atoms including periodic images.
Definition neighbor_search.h:137
const std::vector< NeighborAtom > & get_ghost_atoms() const
Get ghost atoms (neighbors of inside atoms).
Definition neighbor_search.cpp:28
double cross_product_norm(double a1, double a2, double a3, double b1, double b2, double b3)
Definition neighbor_search.cpp:229
NeighborList candidate_neighbor_list_
Definition neighbor_search.h:147
void init(BaseCell &cell, double sr)
Initialize the neighbor search with unit cell and search radius.
Definition neighbor_search.cpp:148
void init_from_mdcell_(const MDCell &cell, double sr)
Definition neighbor_search.cpp:42
const std::vector< NeighborAtom > & get_all_atoms() const
Get all atoms (including periodic images).
Definition neighbor_search.cpp:20
static constexpr int neighbor_reserve_factor
Reserve factor for neighbor list capacity estimation.
Definition neighbor_search.h:160
NeighborList neighbor_list_
The constructed neighbor list.
Definition neighbor_search.h:146
Provide the basic information about unitcell.
Definition unitcell.h:16