1#ifndef W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_MODULE_HCONTAINER_HCONTAINER_H
2#define W_ABACUS_DEVELOP_ABACUS_DEVELOP_SOURCE_MODULE_HAMILT_LCAO_MODULE_HCONTAINER_HCONTAINER_H
185 this->
paraV = paraV_in;
186 for (
auto& ap :
atom_pairs) ap.set_paraV(paraV_in);
203 void allocate(
T* data_array =
nullptr,
bool if_zero =
false);
296 bool fix_R(
int rx_in,
int ry_in,
int rz_in)
const;
335 void loop_R(
const size_t& index,
int& rx,
int& ry,
int& rz)
const;
351 int find_R(
const int& rx_in,
const int& ry_in,
const int& rz_in)
const;
366 T*
data(
int i,
int j)
const;
376 T*
data(
int i,
int j,
int* R)
const;
401 for (
int iap = 0; iap < this->
atom_pairs.size(); ++iap)
3 elements vector
Definition vector3.h:22
int get_global_row_size() const
number of global rows
Definition parallel_2d.cpp:13
Definition parallel_orbitals.h:9
Definition atom_pair.h:42
Definition base_matrix.h:20
Definition hcontainer.h:144
void loop_R(const size_t &index, int &rx, int &ry, int &rz) const
interface for call a R loop for HContainer it can return a new R-index with (rx,ry,...
Definition hcontainer.cpp:558
HContainer()
Definition hcontainer.cpp:20
void fix_gamma()
restrict R indexes of all atom-pair to 0, 0, 0 add BaseMatrix<T> with non-zero R index to this->atom_...
Definition hcontainer.cpp:462
void unfix_R() const
set current_R to -1, which means R is not fixed clear this->tmp_atom_pairs
Definition hcontainer.cpp:453
std::vector< AtomPair< T > > atom_pairs
Definition hcontainer.h:473
std::vector< int > get_ijr_info() const
get infomation of IJR pairs in HContainer the return vector format is {size_I, I1,...
Definition hcontainer.cpp:762
size_t get_nnr() const
calculate total size of data in HContainer, named nnr inherited from history all AtomPairs and BaseMa...
Definition hcontainer.h:398
HContainer & operator=(const HContainer< T > &HR_in)=delete
void insert_pair(const AtomPair< T > &atom_ij)
a AtomPair object can be inserted into HContainer, two steps: 1, find AtomPair with atom index atom_i...
Definition hcontainer.cpp:624
bool fix_R(int rx_in, int ry_in, int rz_in) const
save atom-pair pointers into this->tmp_atom_pairs for selected R index
Definition hcontainer.cpp:417
T * wrapper_pointer
if wrapper_pointer is not nullptr, this HContainer is a wrapper there is only one case that "wrapper_...
Definition hcontainer.h:496
T * data(int i, int j) const
get data pointer of AtomPair with index of I, J
Definition hcontainer.cpp:592
bool is_gamma_only() const
judge if gamma_only
Definition hcontainer.cpp:689
size_t size_atom_pairs() const
calculate number of AtomPairs for current R index
Definition hcontainer.cpp:576
int get_current_R() const
get current_R
Definition hcontainer.cpp:682
int get_nbasis() const
get number of basis in each H matrix
Definition hcontainer.h:466
BaseMatrix< T > * find_matrix(int i, int j, int rx, int ry, int rz)
find BaseMatrix with atom index atom_i and atom_j and R index (rx, ry, rz) This interface can be used...
Definition hcontainer.cpp:261
int find_R(const int &rx_in, const int &ry_in, const int &rz_in) const
find index of R in tmp_R_index, used when current_R is fixed
Definition hcontainer.cpp:485
int current_R
Definition hcontainer.h:486
bool allocated
Definition hcontainer.h:497
const std::vector< std::vector< int > > & get_sparse_ap() const
get sparse_ap
Definition hcontainer.h:448
size_t size_R_loop() const
calculate number of R index which has counted AtomPairs
Definition hcontainer.cpp:523
bool gamma_only
Definition hcontainer.h:488
void insert_ijrs(const std::vector< int > *ijrs)
use infomation of IJ pairs to expand HContainer the input vector format is {size_IJ_pairs,...
Definition hcontainer.cpp:792
std::vector< const AtomPair< T > * > tmp_atom_pairs
temporary atom-pair lists to loop selected R index
Definition hcontainer.h:482
void set_paraV(const Parallel_Orbitals *paraV_in)
set parallel orbital pointer to check parallel information
Definition hcontainer.h:183
~HContainer()
Definition hcontainer.cpp:11
size_t get_memory_size() const
get total memory bites of HContainer
Definition hcontainer.cpp:696
void shape_synchron(const HContainer< T > &other)
synchronization of atom-pairs for read-in HContainer new <IJR> pair from read-in HContainer will be i...
Definition hcontainer.cpp:722
void allocate(T *data_array=nullptr, bool if_zero=false)
allocate memory for all <IJR> matrix if data_array is not nullptr, use memory after data_array for ea...
Definition hcontainer.cpp:175
void set_zero()
set values of all <IJR> matrix to zero
Definition hcontainer.cpp:210
std::vector< std::vector< int > > sparse_ap_index
Definition hcontainer.h:477
std::vector< ModuleBase::Vector3< int > > tmp_R_index
Definition hcontainer.h:484
AtomPair< T > & get_atom_pair(int i, int j) const
return a reference of AtomPair with index of atom I and J in atom_pairs
Definition hcontainer.cpp:353
T * get_wrapper() const
return the wrapper_pointer
Definition hcontainer.h:433
int find_matrix_offset(int i, int j, int rx, int ry, int rz) const
find the offset of BaseMatrix with atom index atom_i and atom_j and R index (rx, ry,...
Definition hcontainer.cpp:324
const Parallel_Orbitals * get_paraV() const
get parallel orbital pointer to check parallel information
Definition hcontainer.h:192
const std::vector< std::vector< int > > & get_sparse_ap_index() const
get sparse_ap_index
Definition hcontainer.h:457
const Parallel_Orbitals * paraV
pointer of Parallel_Orbitals, which is used to get atom-pair information
Definition hcontainer.h:502
std::vector< std::vector< int > > sparse_ap
Definition hcontainer.h:476
AtomPair< T > * find_pair(int i, int j) const
find AtomPair with atom index atom_i and atom_j This interface can be used to find AtomPair,...
Definition hcontainer.cpp:219
void add(const HContainer< T > &other)
operator() for accessing value with indexes this interface is not implemented now,...
Definition hcontainer.cpp:407
#define T
Definition exp.cpp:237