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() const;
33 int get_nat(int it) const;
35 int get_ntype() const;
37 int get_nw() const;
39 int get_nw(int iat) const;
41 int get_iwt(int iat, int orbital_index) const;
43 int get_maxL(int iat) const;
45 int get_nchi(int iat, int L) const;
47 std::string get_atom_label(int iat, bool order = false) const;
49 void write_orb_info(const std::string& out_dir) const;
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) const;
71 int iat2ia(int iat) const;
73 int iw2l(int iat, int iw) const;
75 int iw2z(int iat, int iw) const;
77 int iw2m(int iat, int iw) const;
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
int iw2m(int iat, int iw) const
get m from iw
Definition cell_index.cpp:215
int iw2l(int iat, int iw) const
get L from iw
Definition cell_index.cpp:165
void write_orb_info(const std::string &out_dir) const
write orbital info into file
Definition cell_index.cpp:264
int get_maxL(int iat) const
get maximum L of a given atom
Definition cell_index.cpp:85
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_nchi(int iat, int L) const
get nchi of a given atom and a give L
Definition cell_index.cpp:92
int get_nw() const
get nw
Definition cell_index.cpp:40
bool check_nspin(int nspin)
check nspin
Definition cell_index.cpp:240
void cal_orbitalCounts()
calculate orbitalCounts from lnchiCounts
Definition cell_index.cpp:249
int get_iwt(int iat, int orbital_index) const
get iwt
Definition cell_index.cpp:56
int npol_
npol is determined by nspin and used in get_iwt and get_nw
Definition cell_index.h:61
std::string get_atom_label(int iat, bool order=false) const
get atom label of a given atom
Definition cell_index.cpp:121
CellIndex()=default
void check_atomCounts()
check if atomCounts is set ok
Definition cell_index.cpp:102
int get_nat() const
the total number of atoms
Definition cell_index.cpp:25
std::vector< int > atomCounts
atomCounts is a vector used to store the number of atoms for each type
Definition cell_index.h:53
int get_ntype() const
get ntype
Definition cell_index.cpp:20
int iat2ia(int iat) const
get index of atom in the same type
Definition cell_index.cpp:153
int iw2z(int iat, int iw) const
get Z from iw
Definition cell_index.cpp:190
int iat2it(int iat) const
get type of atom from total order
Definition cell_index.cpp:131