ABACUS
develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
source
source_lcao
module_lr
utils
mo_type.h
Go to the documentation of this file.
1
#ifndef ABACUS_SOURCE_LCAO_MODULE_LR_UTILS_MO_TYPE_H
2
#define ABACUS_SOURCE_LCAO_MODULE_LR_UTILS_MO_TYPE_H
3
4
#include <stdexcept>
5
namespace
LR_Util
6
{
7
#ifndef MO_TYPE_H
8
#define MO_TYPE_H
9
enum
MO_TYPE
{
OO
,
VO
,
OV
,
VV
,
ALL
};
10
#endif
11
/* the first index is contiguous in memory
12
MO_TYPE: OO VO OV VV ALL
13
nmo1 nocc nocc nvirt nvirt nocc+nvirt
14
nmo2 nocc nvirt nocc nvirt nocc+nvirt
15
imo1 0 0 nocc nocc 0
16
imo2 0 nocc 0 nocc 0
17
*/
18
inline
void
set_dim
(
const
MO_TYPE
type,
const
int
& nocc,
const
int
& nvirt,
19
int
& nmo1,
int
& nmo2,
int
& imo1,
int
& imo2)
20
{
21
switch
(type)
22
{
23
case
MO_TYPE::OO
:
24
nmo1 = nocc; nmo2 = nocc; imo1 = 0; imo2 = 0;
25
break
;
26
case
MO_TYPE::VO
:
27
nmo1 = nocc; nmo2 = nvirt; imo1 = 0; imo2 = nocc;
28
break
;
29
case
MO_TYPE::OV
:
30
nmo1 = nvirt; nmo2 = nocc; imo1 = nocc; imo2 = 0;
31
break
;
32
case
MO_TYPE::VV
:
33
nmo1 = nvirt; nmo2 = nvirt; imo1 = nocc; imo2 = nocc;
34
break
;
35
case
MO_TYPE::ALL
:
36
nmo1 = nocc + nvirt;
37
nmo2 = nocc + nvirt;
38
imo1 = 0;
39
imo2 = 0;
40
break
;
41
default
:
42
throw
std::runtime_error(
"Error in LR::set_dim: unknown MO_TYPE"
);
43
}
44
}
45
}
46
47
#endif
// ABACUS_SOURCE_LCAO_MODULE_LR_UTILS_MO_TYPE_H
LR_Util
Definition
exciton_plotter.cpp:368
LR_Util::set_dim
void set_dim(const MO_TYPE type, const int &nocc, const int &nvirt, int &nmo1, int &nmo2, int &imo1, int &imo2)
Definition
mo_type.h:18
LR_Util::MO_TYPE
MO_TYPE
Definition
mo_type.h:9
LR_Util::VV
@ VV
Definition
mo_type.h:9
LR_Util::OV
@ OV
Definition
mo_type.h:9
LR_Util::OO
@ OO
Definition
mo_type.h:9
LR_Util::ALL
@ ALL
Definition
mo_type.h:9
LR_Util::VO
@ VO
Definition
mo_type.h:9
Generated by
1.15.0