forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathORB_nonlocal.cpp
More file actions
66 lines (54 loc) · 1.39 KB
/
ORB_nonlocal.cpp
File metadata and controls
66 lines (54 loc) · 1.39 KB
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
#include "ORB_nonlocal.h"
#include "../module_base/global_function.h"
Numerical_Nonlocal::Numerical_Nonlocal()
{
//make std::pair of new and delete
//question remains
this->type = 0;
this->lmax = 0;
this->Proj = new Numerical_Nonlocal_Lm[1];
this->nproj = -1;
//zhengdy-soc, for optimize nonlocal part
}
Numerical_Nonlocal::~Numerical_Nonlocal()
{
delete[] Proj;
}
void Numerical_Nonlocal::set_type_info
(
const int& type_in,
const std::string& label_in,
const std::string& type_ps_in,
const int& lmax_in,
const int& nproj_in,
const Numerical_Nonlocal_Lm* Proj_in
)
{
//ModuleBase::TITLE("Numerical_Nonlocal","set_type_info");
this->type = type_in;
this->label = label_in;
this->type_ps = type_ps_in;
if (lmax_in < -1 || lmax_in > 20)
{
ModuleBase::WARNING_QUIT("Numerical_Nonlocal", "bad input of lmax : should be between -1 and 20");
}
this->lmax = lmax_in;
this->nproj = nproj_in;
assert(nproj >= 0);
//----------------------------------------------------------
// EXPLAIN : non_local pseudopotential projector for each l
//----------------------------------------------------------
//only store radial function
delete[] Proj;
this->Proj = new Numerical_Nonlocal_Lm[this->nproj];
for (int p1=0; p1<nproj; p1++)
{
this->Proj[p1] = Proj_in[p1];
}
this->rcut_max = 0.0;
for(int p1=0; p1<nproj; p1++)
{
this->rcut_max = max( this->Proj[p1].getRcut(), rcut_max );
}
return;
}