ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
dos_test.h
Go to the documentation of this file.
1#ifndef DOS_TEST_H
2#define DOS_TEST_H
3
4#include <string>
5#include <vector>
6
9
10#include "./dos_test_data.h"
11
13{
14public:
15 DosPrepare(int is_in,
16 std::string fa_in,
17 double de_ev_in,
18 double emax_ev_in,
19 double emin_ev_in,
20 double bcoeff_in,
21 int nks_in,
22 int nkstot_in,
23 int nbands_in):
24 is(is_in),fa(fa_in),
25 de_ev(de_ev_in),emax_ev(emax_ev_in),
26 emin_ev(emin_ev_in),bcoeff(bcoeff_in),
27 nks(nks_in),nkstot(nkstot_in),nbands(nbands_in){}
28
29 int is;
30 std::string fa;
31 double de_ev;
32 double emax_ev;
33 double emin_ev;
34 double bcoeff;
35 int nks;
36 int nkstot;
37 int nbands;
38 std::vector<int> isk;
39 std::vector<double> wk;
42
43 void set_isk()
44 {
45 this->isk.resize(nks, 0); // spin-unpolarized case, only 1 spin
46 }
47
48 void set_wk()
49 {
50 this->wk = dos_test_data::wk;
51 }
52
54 {
55 this->ekb.create(nks, nbands);
56 this->wg.create(nks, nbands);
57 for (int ik = 0; ik < nks; ++ik)
58 {
59 for (int ib = 0; ib < nbands; ++ib)
60 {
61 this->ekb(ik, ib) = dos_test_data::ekb_ev[ik * nbands + ib];
62 this->wg(ik, ib) = dos_test_data::wg[ik * nbands + ib];
63 }
64 }
65 this->ekb *= 1.0 / ModuleBase::Ry_to_eV; // eV -> Ry
66 }
67};
68
69#endif
double emax_ev
Definition dos_test.h:32
ModuleBase::matrix ekb
Definition dos_test.h:40
std::string fa
Definition dos_test.h:30
double de_ev
Definition dos_test.h:31
void set_istate_info()
Definition dos_test.h:53
double bcoeff
Definition dos_test.h:34
int nks
Definition dos_test.h:35
int is
Definition dos_test.h:29
std::vector< int > isk
Definition dos_test.h:38
int nbands
Definition dos_test.h:37
void set_wk()
Definition dos_test.h:48
double emin_ev
Definition dos_test.h:33
void set_isk()
Definition dos_test.h:43
std::vector< double > wk
Definition dos_test.h:39
DosPrepare(int is_in, std::string fa_in, double de_ev_in, double emax_ev_in, double emin_ev_in, double bcoeff_in, int nks_in, int nkstot_in, int nbands_in)
Definition dos_test.h:15
int nkstot
Definition dos_test.h:36
ModuleBase::matrix wg
Definition dos_test.h:41
Definition matrix.h:15
void create(const int nrow, const int ncol, const bool flag_zero=true)
Definition matrix.cpp:131
const double Ry_to_eV
Definition constants.h:81
const std::vector< double > wg
Definition dos_test_data.h:28
const std::vector< double > wk
Definition dos_test_data.h:17
const std::vector< double > ekb_ev
Definition dos_test_data.h:20