FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
abacus-develop/source/source_cell/read_pp_blps.cpp at develop · pplab/abacus-develop · GitHub
pplab
/
abacus-develop
Public
forked from
deepmodeling/abacus-develop
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
abacus-develop
/
source
/
source_cell
/
read_pp_blps.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
159 lines (143 loc) · 3.59 KB
Breadcrumbs
abacus-develop
/
source
/
source_cell
/
read_pp_blps.cpp
Copy path
File metadata and controls
159 lines (143 loc) · 3.59 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#
include
"
read_pp.h
"
#
include
"
source_base/atom_in.h
"
#
include
"
source_base/element_name.h
"
int
Pseudopot_upf::read_pseudo_blps
(std::ifstream &ifs, Atom_pseudo& pp)
{
//
double bohr2a = 0.529177249;
pp.
nlcc
=
false
;
pp.
tvanp
=
false
;
pp.
has_so
=
false
;
pp.
nbeta
=
0
;
pp.
kkbeta
=
0
;
pp.
lll
= std::vector<
int
>(pp.
nbeta
,
0
);
pp.
betar
.
create
(
0
,
0
);
pp.
dion
.
create
(pp.
nbeta
, pp.
nbeta
);
pp.
nchi
=
0
;
pp.
nn
= std::vector<
int
>(pp.
nchi
,
0
);
pp.
jchi
= std::vector<
double
>(pp.
nchi
,
0.0
);
pp.
jjj
= std::vector<
double
>(pp.
nchi
,
0.0
);
ifs >> pp.
psd
;
//
if(!SCAN_BEGIN(ifs,"BLPS")) WARNING_QUIT("read_pp_blps","Find no PP_HEADER");
ifs.
ignore
(
300
,
'
\n
'
);
double
zatom;
double
zion;
ifs >> zatom >> zion;
pp.
zv
= zion;
ifs.
ignore
(
300
,
'
\n
'
);
atom_in ai;
for
(
auto
each_type: ModuleBase::element_name)
{
if
(zatom == ai.
atom_Z
[each_type])
{
pp.
psd
= each_type;
break
;
}
}
int
pspcod, pspxc, lloc, r2well;
ifs >> pspcod >> pspxc >> pp.
lmax
>> lloc >> pp.
mesh
>> r2well;
this
->
mesh_changed
=
false
;
if
(pp.
mesh
%
2
==
0
)
{
pp.
mesh
-=
1
;
this
->
mesh_changed
=
true
;
}
if
(pspxc ==
2
)
{
pp.
xc_func
=
"
PZ
"
;
}
else
if
(pspxc ==
11
)
{
pp.
xc_func
=
"
PBE
"
;
}
else
{
std::string msg =
"
Unknown pspxc:
"
+
std::to_string
(pspxc);
ModuleBase::WARNING_QUIT
(
"
Pseudopot_upf::read_pseudo_blps
"
, msg);
}
if
(pspcod ==
8
)
{
for
(
int
i =
0
; i <
5
; ++i)
{
ifs.
ignore
(
300
,
'
\n
'
);
}
}
else
if
(pspcod ==
6
)
{
for
(
int
i =
0
; i <
17
; ++i)
{
ifs.
ignore
(
300
,
'
\n
'
);
}
}
else
{
std::string msg =
"
Unknown pspcod:
"
+
std::to_string
(pspcod);
ModuleBase::WARNING_QUIT
(
"
Pseudopot_upf::read_pseudo_blps
"
, msg);
}
assert
(pp.
mesh
>
0
);
pp.
r
= std::vector<
double
>(pp.
mesh
,
0.0
);
//
Bohr
pp.
rab
= std::vector<
double
>(pp.
mesh
,
0.0
);
pp.
vloc_at
= std::vector<
double
>(pp.
mesh
,
0.0
);
//
Hartree
int
num =
0
;
if
(pspcod ==
8
)
{
for
(
int
i =
0
;i < pp.
mesh
; ++i)
{
ifs >> num >> pp.
r
[i] >> pp.
vloc_at
[i];
pp.
vloc_at
[i] = pp.
vloc_at
[i]*
2
;
//
Hartree to Ry
}
}
else
if
(pspcod ==
6
)
{
double
temp =
0
.;
for
(
int
i =
0
;i < pp.
mesh
; ++i)
{
ifs >> num >> pp.
r
[i] >> temp >> pp.
vloc_at
[i];
pp.
vloc_at
[i] = pp.
vloc_at
[i]*
2
;
//
Hartree to Ry
}
}
pp.
rab
[
0
] = pp.
r
[
1
] - pp.
r
[
0
];
for
(
int
i =
1
; i < pp.
mesh
-
1
; ++i)
{
pp.
rab
[i] = (pp.
r
[i+
1
] - pp.
r
[i-
1
])/
2.0
;
}
pp.
rab
[pp.
mesh
-
1
] = pp.
r
[pp.
mesh
-
1
] - pp.
r
[pp.
mesh
-
2
];
pp.
rho_at
= std::vector<
double
>(pp.
mesh
,
0.0
);
double
charge = zion/pp.
r
[pp.
mesh
-
1
];
for
(
int
i =
0
;i < pp.
mesh
; ++i)
{
pp.
rho_at
[i] = charge;
}
return
0
;
}
//
parameters
//
read_pp.h <--> blps_real
//
nv -
//
psd head
//
pp_type(NC or US) -
//
tvanp False
//
nlcc False
//
dft pspxc 2->lda, 11->gga
//
zp zion
//
etotps -
//
ecutwfc -
//
ecutrho -
//
lmax lmax
//
mesh mmax
//
nwfc -
//
nbeta -
//
els -
//
lchi -
//
oc -
//
rab rab[ir]=(r[ir+1]-r[ir-1])/2.0
//
rho_atc(nonlocal) -
//
vloc
//
chi -
//
rho_at -
//
lll -
//
kbeta -
//
beta -
//
dion -
//
nn -
//
jchi -
//
jjj -
//
nd -
Back
|
FazBrowse Home
|
New Git URL