ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
cell_index.h
Go to the documentation of this file.
1#ifndef CELL_INDEX_H
2#define CELL_INDEX_H
3#include <map>
4#include <string>
5#include <vector>
6
21{
22 public:
23 CellIndex() = default;
24 CellIndex(const std::vector<std::string>& atomLabels_in,
25 const std::vector<int>& atomCounts_in,
26 const std::vector<std::vector<int>>& lnchiCounts_in,
27 const int& nspin);
28
29 public:
31 int get_nat();
33 int get_nat(int it);
35 int get_ntype();
37 int get_nw();
39 int get_nw(int iat);
41 int get_iwt(int iat, int orbital_index);
43 int get_maxL(int iat);
45 int get_nchi(int iat, int L);
47 std::string get_atom_label(int iat, bool order = false);
49 void write_orb_info(std::string out_dir);
50
51 private:
53 std::vector<int> atomCounts = {};
55 std::vector<int> orbitalCounts = {};
57 std::vector<std::vector<int>> lnchiCounts = {};
59 std::vector<std::string> atomLabels = {};
61 int npol_ = 1;
63 void cal_orbitalCounts();
65 bool check_nspin(int nspin);
67 void check_atomCounts();
69 int iat2it(int iat);
71 int iat2ia(int iat);
73 int iw2l(int iat, int iw);
75 int iw2z(int iat, int iw);
77 int iw2m(int iat, int iw);
78};
79
80#endif // CELL_INDEX_H
This class is used to get the information of the atoms and orbitals indices in the unit cell.
Definition cell_index.h:21
std::vector< std::string > atomLabels
atomLabels is a vector used to store the atom labels
Definition cell_index.h:59
std::vector< int > orbitalCounts
orbitalCounts is a vector used to store the number of orbitals for each type
Definition cell_index.h:55
std::vector< std::vector< int > > lnchiCounts
lnchiCounts is a vector used to store the number of chi for each L
Definition cell_index.h:57
int get_nw()
get nw
Definition cell_index.cpp:41
int get_ntype()
get ntype
Definition cell_index.cpp:21
bool check_nspin(int nspin)
check nspin
Definition cell_index.cpp:241
void cal_orbitalCounts()
calculate orbitalCounts from lnchiCounts
Definition cell_index.cpp:250
int get_nat()
the total number of atoms
Definition cell_index.cpp:26
std::string get_atom_label(int iat, bool order=false)
get atom label of a given atom
Definition cell_index.cpp:122
int get_iwt(int iat, int orbital_index)
get iwt
Definition cell_index.cpp:57
int npol_
npol is determined by nspin and used in get_iwt and get_nw
Definition cell_index.h:61
CellIndex()=default
int iat2ia(int iat)
get index of atom in the same type
Definition cell_index.cpp:154
void check_atomCounts()
check if atomCounts is set ok
Definition cell_index.cpp:103
int iw2z(int iat, int iw)
get Z from iw
Definition cell_index.cpp:191
int iat2it(int iat)
get type of atom from total order
Definition cell_index.cpp:132
void write_orb_info(std::string out_dir)
write orbital info into file
Definition cell_index.cpp:265
int get_nchi(int iat, int L)
get nchi of a given atom and a give L
Definition cell_index.cpp:93
std::vector< int > atomCounts
atomCounts is a vector used to store the number of atoms for each type
Definition cell_index.h:53
int iw2l(int iat, int iw)
get L from iw
Definition cell_index.cpp:166
int iw2m(int iat, int iw)
get m from iw
Definition cell_index.cpp:216
int get_maxL(int iat)
get maximum L of a given atom
Definition cell_index.cpp:86