-
Notifications
You must be signed in to change notification settings - Fork 35
/
constants.h
169 lines (149 loc) · 4.05 KB
/
constants.h
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
160
161
162
163
164
165
166
167
168
169
// ---------------------------------------------------------------------
//
// Copyright (c) 2017-2022 The Regents of the University of Michigan and DFT-FE
// authors.
//
// This file is part of the DFT-FE code.
//
// The DFT-FE code is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// Public License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// The full text of the license can be found in the file LICENSE at
// the top level of the DFT-FE distribution.
//
// ---------------------------------------------------------------------
//
// @author Sambit Das and Phani Motamarri
//
#ifndef constants_H_
#define constants_H_
namespace dftfe
{
//
// Add prefix C_ to all constants
//
/// Boltzmann constant
const double C_kb = 3.166811429e-06;
const double C_haPerBohrToeVPerAng = 27.211386245988 / 0.529177210903;
const double C_haToeV = 27.211386245988;
const double C_bohrToAng = 0.529177210903;
const double C_pi = 3.14159265359;
const double C_AngTobohr = 1.0 / 0.529177210903;
/// 1d quadrature rule order
template <unsigned int FEOrder>
constexpr unsigned int
C_num1DQuad()
{
return FEOrder + 1;
}
/// 1d quad rule smeared nuclear charge
constexpr unsigned int
C_num1DQuadSmearedCharge()
{
return 10;
}
/// number of copies 1d quad rule smeared nuclear charge
constexpr unsigned int
C_numCopies1DQuadSmearedCharge()
{
return 2; // can be changed from 2 to 3
}
/// 1d quad rule smeared nuclear charge
/// if a very coarse FE mesh is used (e.g. softer pseudopotentials)
constexpr unsigned int
C_num1DQuadSmearedChargeHigh()
{
return 10;
}
/// number of copies 1d quad rule smeared nuclear charge
/// if a very coarse FE mesh is used (e.g. softer pseudpotentials)
constexpr unsigned int
C_numCopies1DQuadSmearedChargeHigh()
{
return 3;
}
/// 1d quad rule smeared nuclear charge if cell stress calculation is on
constexpr unsigned int
C_num1DQuadSmearedChargeStress()
{
return 10;
}
/// number of copies 1d quad rule smeared nuclear charge if cell stress
/// calculation is on
constexpr unsigned int
C_numCopies1DQuadSmearedChargeStress()
{
return 5; //
}
#ifdef DFTFE_WITH_HIGHERQUAD_PSP
/// rho nodal polynomial order
template <unsigned int FEOrder, unsigned int FEOrderElectro>
constexpr unsigned int
C_rhoNodalPolyOrder()
{
return ((FEOrder + 2) > FEOrderElectro ? (FEOrder + 2) : FEOrderElectro);
}
/// 1d quadrature rule order for non-local part of pseudopotential
template <unsigned int FEOrder>
constexpr unsigned int
C_num1DQuadNLPSP()
{
return 14; // Can be changed from 14 to 18 Step 1
}
/// number of copies 1d quad rule non-local PSP
constexpr unsigned int
C_numCopies1DQuadNLPSP()
{
return 1;
}
/// 1d quadrature rule order for local part of pseudopotential
template <unsigned int FEOrder>
constexpr unsigned int
C_num1DQuadLPSP()
{
return 14;
}
/// number of copies 1d quad rule local PSP
constexpr unsigned int
C_numCopies1DQuadLPSP()
{
return 1;
}
#else
/// rho nodal polynomial order
template <unsigned int FEOrder, unsigned int FEOrderElectro>
constexpr unsigned int
C_rhoNodalPolyOrder()
{
return ((FEOrder + 2) > FEOrderElectro ? (FEOrder + 2) : FEOrderElectro);
}
/// 1d quadrature rule order for non-local part of pseudopotential
template <unsigned int FEOrder>
constexpr unsigned int
C_num1DQuadNLPSP()
{
return 10;
}
/// number of copies 1d quad rule non-local PSP
constexpr unsigned int
C_numCopies1DQuadNLPSP()
{
return 1;
}
/// 1d quadrature rule order for local part of pseudopotential
template <unsigned int FEOrder>
constexpr unsigned int
C_num1DQuadLPSP()
{
return 10;
}
/// number of copies 1d quad rule local PSP
constexpr unsigned int
C_numCopies1DQuadLPSP()
{
return 1;
}
#endif
} // namespace dftfe
#endif