FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
abacus-develop/source/source_cell/read_orb.cpp at develop · maki49/abacus-develop · GitHub
maki49
/
abacus-develop
Public
forked from
deepmodeling/abacus-develop
Notifications
You must be signed in to change notification settings
Fork
1
Star
3
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_orb.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
74 lines (72 loc) · 2.6 KB
Breadcrumbs
abacus-develop
/
source
/
source_cell
/
read_orb.cpp
Copy path
File metadata and controls
74 lines (72 loc) · 2.6 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
#
include
"
read_orb.h
"
#
include
"
source_base/formatter.h
"
namespace
unitcell
{
bool
read_orb_file
(
int
it, std::string &orb_file, std::ofstream &ofs_running, Atom* atom)
{
//
the maximum L is 9 like cc-pV9Z, according to the
//
basissetexchange https://www.basissetexchange.org/
//
there is no orbitals with L>9 presently
const
std::string spectrum =
"
SPDFGHIKLM
"
;
std::ifstream
ifs
(orb_file.
c_str
(), std::ios::in);
//
pengfei 2014-10-13
//
mohan add return 2021-04-26
if
(!ifs)
{
std::cout <<
"
Element index
"
<< it+
1
<< std::endl;
std::cout <<
"
orbital file:
"
<< orb_file << std::endl;
ModuleBase::WARNING
(
"
unitcell::read_orb_file
"
,
"
cannot open the ORBITAL file (NAO basis sets)
"
);
return
false
;
}
std::string word;
atom->
nw
=
0
;
while
(ifs.
good
())
{
ifs >> word;
if
(word ==
"
Element
"
)
//
pengfei Li 16-2-29
{
ModuleBase::GlobalFunc::READ_VALUE
(ifs, atom->
label_orb
);
}
if
(word ==
"
Lmax
"
)
{
ModuleBase::GlobalFunc::READ_VALUE
(ifs, atom->
nwl
);
atom->
l_nchi
.
resize
(atom->
nwl
+
1
,
0
);
}
//
assert(atom->nwl<10); // cannot understand why restrict the maximum value of atom->nwl
if
(word ==
"
Cutoff(a.u.)
"
)
//
pengfei Li 16-2-29
{
ModuleBase::GlobalFunc::READ_VALUE
(ifs, atom->
Rcut
);
}
if
(
FmtCore::endswith
(word,
"
orbital-->
"
))
{
bool
valid =
false
;
for
(
int
i =
0
; i < spectrum.
size
(); i++)
{
if
(word == spectrum.
substr
(i,
1
) +
"
orbital-->
"
)
{
ModuleBase::GlobalFunc::READ_VALUE
(ifs, atom->
l_nchi
[i]);
atom->
nw
+= (
2
*i +
1
) * atom->
l_nchi
[i];
std::stringstream ss;
ss <<
"
L=
"
<< i <<
"
, number of zeta
"
;
ModuleBase::GlobalFunc::OUT
(ofs_running,ss.
str
(),atom->
l_nchi
[i]);
valid =
true
;
break
;
}
}
if
(!valid)
{
ModuleBase::WARNING
(
"
unitcell::read_orb_file
"
,
"
ABACUS does not support NAO with L > 9,
"
"
or an invalid orbital label is found in the ORBITAL file.
"
);
return
false
;
}
}
}
ifs.
close
();
if
(!atom->
nw
)
{
ModuleBase::WARNING
(
"
unitcell::read_orb_file
"
,
"
get nw = 0, check the ORBITAL file
"
);
return
false
;
}
return
true
;
}
}
Back
|
FazBrowse Home
|
New Git URL