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