FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
abacus-develop/source/source_estate/fp_energy.cpp at develop · deepmodeling/abacus-develop · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
deepmodeling
/
abacus-develop
Public
forked from
abacusmodeling/abacus-develop
Notifications
You must be signed in to change notification settings
Fork
247
Star
291
Code
Issues
252
Pull requests
11
Discussions
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
abacus-develop
/
source
/
source_estate
/
fp_energy.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
123 lines (114 loc) · 3.56 KB
Breadcrumbs
abacus-develop
/
source
/
source_estate
/
fp_energy.cpp
Copy path
File metadata and controls
123 lines (114 loc) · 3.56 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#
include
"
fp_energy.h
"
#
include
"
source_base/global_variable.h
"
#
include
"
source_base/tool_quit.h
"
#
include
<
iomanip
>
#
include
<
iostream
>
namespace
elecstate
{
//
/ @brief calculate etot
double
fenergy::calculate_etot
()
{
etot = eband + deband + (etxc - etxcc) + ewald_energy + hartree_energy + demet + descf + exx + efield
+ gatefield + evdw + correction_el + esol_el + esol_cav + edftu + edeepks_scf + escon + ml_exx;
return
etot;
}
//
/ @brief calculate etot_harris
double
fenergy::calculate_harris
()
{
etot_harris = eband + deband_harris + (etxc - etxcc) + ewald_energy + hartree_energy + demet + descf + exx
+ efield + gatefield + evdw + correction_el + esol_el + esol_cav + edftu + edeepks_scf + escon + ml_exx;
return
etot_harris;
}
//
/ @brief set all energies to zero
void
fenergy::clear_all
()
{
etot = etot_old = eband = deband = etxc = etxcc = vtxc = ewald_energy = hartree_energy = demet = descf = exx
= efield = gatefield = evdw = correction_el = etot_harris = deband_harris = esol_el = esol_cav = edftu = edeepks_scf = escon
= ml_exx =
0.0
;
}
//
/ @brief print all energies
void
fenergy::print_all
()
const
{
std::cout <<
std::resetiosflags
(std::ios::scientific) << std::endl;
std::cout <<
std::setprecision
(
16
) << std::endl;
std::cout <<
"
eband=
"
<< eband << std::endl;
std::cout <<
"
deband=
"
<< deband << std::endl;
std::cout <<
"
etxc-etxcc=
"
<< etxc - etxcc << std::endl;
std::cout <<
"
ewld=
"
<< ewald_energy << std::endl;
std::cout <<
"
ehart=
"
<< hartree_energy << std::endl;
std::cout <<
"
entropy(-TS)=
"
<< demet << std::endl;
std::cout <<
"
descf=
"
<< descf << std::endl;
std::cout <<
"
exx=
"
<< exx << std::endl;
std::cout <<
"
ml_exx=
"
<< ml_exx << std::endl;
std::cout <<
"
efiled=
"
<< efield << std::endl;
std::cout <<
"
gatefiled=
"
<< gatefield << std::endl;
std::cout <<
"
evdw=
"
<< evdw << std::endl;
std::cout <<
"
correction_el=
"
<< correction_el << std::endl;
std::cout <<
"
esol_el=
"
<< esol_el << std::endl;
std::cout <<
"
esol_cav=
"
<< esol_cav << std::endl;
std::cout <<
"
edftu=
"
<< edftu << std::endl;
std::cout <<
"
edeepks_scf=
"
<< edeepks_scf << std::endl;
std::cout <<
"
escon=
"
<< escon << std::endl;
std::cout << std::endl;
std::cout <<
"
total=
"
<< etot << std::endl;
}
//
/ @brief set Efermi of a specific spin
//
/ @param is SPIN
//
/ @param ef_in fermi(is)
void
Efermi::set_efval
(
const
int
& is,
const
double
& ef_in)
{
if
(!two_efermi)
{
this
->
ef
= ef_in;
}
else
if
(is ==
0
)
{
this
->
ef_up
= ef_in;
}
else
if
(is ==
1
)
{
this
->
ef_dw
= ef_in;
}
else
{
ModuleBase::WARNING_QUIT
(
"
energy
"
,
"
Please check NSPIN when TWO_EFERMI is true
"
);
__builtin_unreachable
();
}
}
//
/ @brief get the value of fermi of a specific spin
//
/ @param is SPIN
//
/ @return value of fermi(is)
double
Efermi::get_efval
(
const
int
& is)
const
{
if
(!two_efermi)
{
return
this
->
ef
;
}
else
if
(is ==
0
)
{
return
this
->
ef_up
;
}
else
if
(is ==
1
)
{
return
this
->
ef_dw
;
}
else
{
ModuleBase::WARNING_QUIT
(
"
energy
"
,
"
Please check NSPIN when TWO_EFERMI is true
"
);
__builtin_unreachable
();
}
}
//
/ @brief get all fermi energies for all spins
//
/ @return all fermi energies for all spins
std::vector<
double
>
Efermi::get_all_ef
()
const
{
if
(two_efermi)
{
return
{ef_up, ef_dw};
}
else
{
return
{ef, ef};
//
For NSPIN=1, ef_up=ef_dw=ef
}
}
}
//
namespace elecstate
Back
|
FazBrowse Home
|
New Git URL