ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
localcell_info.h
Go to the documentation of this file.
1#ifndef ABACUS_SOURCE_HAMILT_MODULE_GINT_LOCALCELL_INFO_H
2#define ABACUS_SOURCE_HAMILT_MODULE_GINT_LOCALCELL_INFO_H
3
4#include "gint_type.h"
5#include "unitcell_info.h"
6#include <memory>
7
8namespace ModuleGint
9{
10
12{
13 public:
14 // constructor
16 int startidx_x,
17 int startidx_y,
18 int startidx_z,
19 int nbx,
20 int nby,
21 int nbz,
22 std::shared_ptr<const UnitCellInfo> unitcell_info);
23
24 // getter functions
25 int get_startidx_bx() const { return startidx_bx_; }
26 int get_startidx_by() const { return startidx_by_; }
27 int get_startidx_bz() const { return startidx_bz_; }
28 int get_nbx() const { return nbx_; }
29 int get_nby() const { return nby_; }
30 int get_nbz() const { return nbz_; }
31 int get_bgrids_num() const { return nbxyz_; }
32 int get_mgrids_num() const { return nmxyz_; }
33 std::shared_ptr<const UnitCellInfo> get_unitcell_info() const { return unitcell_info_; }
34 std::shared_ptr<const BigGridInfo> get_bgrid_info() const { return unitcell_info_->get_bgrid_info(); }
35
36 //====================================================================
37 // functions related to the big grid
38 //====================================================================
39
40 // transform the 3D index of a big grid in the local cell to the 3D index in the local cell
41 int bgrid_idx_3Dto1D(const Vec3i index_3d) const;
42
43 // transform the 1D index of a big grid in the local cell to the 1D index in the local cell
44 Vec3i bgrid_idx_1Dto3D(const int index_1d) const;
45
46 // transform the 3D index of a big grid in the local cell to the 3D index in the unit cell
47 Vec3i get_bgrid_global_idx_3D(const Vec3i index_3d) const;
48
49 // transform the 1D index of a big grid in the local cell to the 3D index in the unit cell
50 Vec3i get_bgrid_global_idx_3D(const int index_1d) const;
51
52 // transform the 1D index of a big grid in the local cell to the 1D index in the unit cell
53 int get_bgrid_global_idx_1D(const int index_1d) const;
54
55 // transform the 3D index of a big grid in the unit cell to the 3D index in the local cell
56 Vec3i get_bgrid_local_idx_3D(const Vec3i index_3d) const;
57
58 // transform the 1D index of a big grid in the unit cell to the 1D index in the local cell
59 int get_bgrid_local_idx_1D(const int index_1d) const;
60
61 // transform the 3D index of a big grid in the unit cell to the 1D index in the local cell
62 int get_bgrid_local_idx_1D(const Vec3i index_3d) const;
63
64 // get the cartesian coordinate of a big grid in the unit cell from the 1D index
65 Vec3d get_bgrid_global_coord_3D(const int index_1d) const;
66
67 // the input is the 3D index of a big grid in the unitcell
68 // return true if the big grid is in the local cell
69 bool is_bgrid_in_lcell(const Vec3i index_3d) const;
70
71 //====================================================================
72 // functions related to the meshgrid
73 //====================================================================
74
75 // transform the 3D index of a meshgrid in the local cell to the 3D index in the local cell
76 int mgrid_idx_3Dto1D(const Vec3i index_3d) const;
77
78 // transform the 1D index of a meshgrid in the local cell to the 1D index in the local cell
79 Vec3i mgrid_idx_1Dto3D(const int index_1d) const;
80
81 // transform the 3D index of a meshgrid in the local cell to the 3D index in the unit cell
82 Vec3i get_mgrid_global_idx_3D(const Vec3i index_3d) const;
83
84 // transform the 1D index of a meshgrid in the local cell to the 1D index in the unit cell
85 int get_mgrid_global_idx_1D(const int index_1d) const;
86
87 private:
88 //====================================================================
89 // information about the big grid
90 //====================================================================
91
92 // 3D index of the first big grid in the local cell within the unit cell
96
97 // Number of big grids in the local cell along the three basis vectors of the local cell
98 int nbx_;
99 int nby_;
100 int nbz_;
101
102 // Total number of big grids in the local cell
104
105 //====================================================================
106 // information about the meshgrid
107 //====================================================================
108
109 // 3D index of the first meshgrid in the local cell within the unit cell
113
114 // Number of meshgrids in the local cell along the three basis vectors of the local cell
115 int nmx_;
116 int nmy_;
117 int nmz_;
118
119 // Total number of meshgrids in the local cell
121
122 // information about the Unitcell
123 std::shared_ptr<const UnitCellInfo> unitcell_info_;
124
125 // information about the big grid
126 std::shared_ptr<const BigGridInfo> biggrid_info_;
127};
128
129} // namespace ModuleGint
130
131#endif // ABACUS_SOURCE_HAMILT_MODULE_GINT_LOCALCELL_INFO_H
std::shared_ptr< const UnitCellInfo > unitcell_info_
Definition localcell_info.h:123
int nbxyz_
Definition localcell_info.h:103
bool is_bgrid_in_lcell(const Vec3i index_3d) const
Definition localcell_info.cpp:80
std::shared_ptr< const BigGridInfo > get_bgrid_info() const
Definition localcell_info.h:34
int nbx_
Definition localcell_info.h:98
int nmxyz_
Definition localcell_info.h:120
Vec3d get_bgrid_global_coord_3D(const int index_1d) const
Definition localcell_info.cpp:74
int startidx_my_
Definition localcell_info.h:111
int nbz_
Definition localcell_info.h:100
int get_bgrid_global_idx_1D(const int index_1d) const
Definition localcell_info.cpp:46
int startidx_mz_
Definition localcell_info.h:112
int get_bgrid_local_idx_1D(const int index_1d) const
Definition localcell_info.cpp:68
Vec3i get_bgrid_local_idx_3D(const Vec3i index_3d) const
Definition localcell_info.cpp:52
int mgrid_idx_3Dto1D(const Vec3i index_3d) const
Definition localcell_info.cpp:91
int get_nbx() const
Definition localcell_info.h:28
int get_startidx_bz() const
Definition localcell_info.h:27
LocalCellInfo(int startidx_x, int startidx_y, int startidx_z, int nbx, int nby, int nbz, std::shared_ptr< const UnitCellInfo > unitcell_info)
Definition localcell_info.cpp:5
int get_nby() const
Definition localcell_info.h:29
int nby_
Definition localcell_info.h:99
int nmx_
Definition localcell_info.h:115
int get_startidx_bx() const
Definition localcell_info.h:25
Vec3i bgrid_idx_1Dto3D(const int index_1d) const
Definition localcell_info.cpp:34
int startidx_by_
Definition localcell_info.h:94
int startidx_mx_
Definition localcell_info.h:110
int bgrid_idx_3Dto1D(const Vec3i index_3d) const
Definition localcell_info.cpp:29
int nmz_
Definition localcell_info.h:117
int get_mgrid_global_idx_1D(const int index_1d) const
Definition localcell_info.cpp:103
int get_nbz() const
Definition localcell_info.h:30
Vec3i mgrid_idx_1Dto3D(const int index_1d) const
Definition localcell_info.cpp:96
int get_bgrids_num() const
Definition localcell_info.h:31
Vec3i get_bgrid_global_idx_3D(const Vec3i index_3d) const
Definition localcell_info.cpp:36
int startidx_bz_
Definition localcell_info.h:95
int get_mgrids_num() const
Definition localcell_info.h:32
Vec3i get_mgrid_global_idx_3D(const Vec3i index_3d) const
Definition localcell_info.cpp:98
int get_startidx_by() const
Definition localcell_info.h:26
std::shared_ptr< const BigGridInfo > biggrid_info_
Definition localcell_info.h:126
std::shared_ptr< const UnitCellInfo > get_unitcell_info() const
Definition localcell_info.h:33
int nmy_
Definition localcell_info.h:116
int startidx_bx_
Definition localcell_info.h:93
Definition batch_biggrid.cpp:4
ModuleBase::Vector3< double > Vec3d
Definition gint_type.h:11
ModuleBase::Vector3< int > Vec3i
Definition gint_type.h:12