Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
qbox-public
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
qbox
qbox-public
Commits
a23e6450
Commit
a23e6450
authored
Aug 31, 2018
by
Francois Gygi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove static_cast and cleanup RSH and HSE functionals
parent
de21bb80
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
16 deletions
+10
-16
HSEFunctional.C
src/HSEFunctional.C
+5
-8
RSHFunctional.C
src/RSHFunctional.C
+5
-8
No files found.
src/HSEFunctional.C
View file @
a23e6450
...
...
@@ -203,13 +203,13 @@ void approximateIntegral(const double omega_kF, const double Hs2,
for
(
int
i
=
1
;
i
<
no_integral
/
2
;
i
++
)
{
term1
=
term1
/
bw2_D_term
*
static_cast
<
double
>
(
i
)
;
term1
=
i
*
term1
/
bw2_D_term
;
factor2
=
-
factor2
*
r9_4A
;
term2
=
term2
+
arg_n
;
integral
[
2
*
(
i
+
1
)]
=
term1
+
factor2
*
term2
;
arg_n
=
-
arg_n
*
static_cast
<
double
>
(
i
)
/
arg
;
arg_n
=
-
arg_n
*
i
/
arg
;
}
// The n = 1 integral is
...
...
@@ -537,9 +537,8 @@ void HSE_enhance(const double s_inp, const double kF, const double w,
{
// update values
prefactor
*=
static_cast
<
double
>
(
i
)
*
r1_D_term
;
summand
*=
static_cast
<
double
>
(
2
*
i
-
1
)
/
static_cast
<
double
>
(
2
*
i
)
*
q_q_1
;
prefactor
*=
i
*
r1_D_term
;
summand
*=
(
2
.
0
*
i
-
1
.
0
)
/
(
2
.
0
*
i
)
*
q_q_1
;
sum
-=
summand
;
intYExpErfc
.
push_back
(
prefactor
*
sum
);
...
...
@@ -682,7 +681,7 @@ void gcor2(double a, double a1, double b1, double b2, double b3, double b4,
////////////////////////////////////////////////////////////////////////////////
//
// calculate correl
etation energy of
PBE functional
// calculate correl
ation energy of the
PBE functional
// K.Burke's modification of PW91 codes, May 14, 1996.
// Modified again by K.Burke, June 29, 1996, with simpler Fx(s)
// Translated into C and modified by F.Gygi, Dec 9, 1996.
...
...
@@ -900,7 +899,6 @@ void HSEFunctional::setxc(void)
if
(
_np
==
0
)
return
;
if
(
_nspin
==
1
)
{
// test for void pointer
assert
(
rho
!=
0
);
assert
(
grad_rho
[
0
]
!=
0
&&
grad_rho
[
1
]
!=
0
&&
grad_rho
[
2
]
!=
0
);
assert
(
exc
!=
0
);
...
...
@@ -928,7 +926,6 @@ void HSEFunctional::setxc(void)
}
else
{
// test for void pointer
assert
(
rho_up
!=
0
);
assert
(
rho_dn
!=
0
);
assert
(
grad_rho_up
[
0
]
!=
0
&&
grad_rho_up
[
1
]
!=
0
&&
grad_rho_up
[
2
]
!=
0
);
...
...
src/RSHFunctional.C
View file @
a23e6450
...
...
@@ -212,13 +212,13 @@ void RSHFunctional::approximateIntegral(const double omega_kF, const double Hs2,
for
(
int
i
=
1
;
i
<
no_integral
/
2
;
i
++
)
{
term1
=
term1
/
bw2_D_term
*
static_cast
<
double
>
(
i
)
;
term1
=
i
*
term1
/
bw2_D_term
;
factor2
=
-
factor2
*
r9_4A
;
term2
=
term2
+
arg_n
;
integral
[
2
*
(
i
+
1
)]
=
term1
+
factor2
*
term2
;
arg_n
=
-
arg_n
*
static_cast
<
double
>
(
i
)
/
arg
;
arg_n
=
-
arg_n
*
i
/
arg
;
}
// The n = 1 integral is
...
...
@@ -546,9 +546,8 @@ void RSHFunctional::RSH_enhance(const double s_inp, const double kF,
{
// update values
prefactor
*=
static_cast
<
double
>
(
i
)
*
r1_D_term
;
summand
*=
static_cast
<
double
>
(
2
*
i
-
1
)
/
static_cast
<
double
>
(
2
*
i
)
*
q_q_1
;
prefactor
*=
i
*
r1_D_term
;
summand
*=
(
2
.
0
*
i
-
1
.
0
)
/
(
2
.
0
*
i
)
*
q_q_1
;
sum
-=
summand
;
intYExpErfc
.
push_back
(
prefactor
*
sum
);
...
...
@@ -691,7 +690,7 @@ void RSHFunctional::gcor2(double a, double a1, double b1, double b2,
////////////////////////////////////////////////////////////////////////////////
//
// calculate correl
etation energy of
PBE functional
// calculate correl
ation energy of the
PBE functional
// K.Burke's modification of PW91 codes, May 14, 1996.
// Modified again by K.Burke, June 29, 1996, with simpler Fx(s)
// Translated into C and modified by F.Gygi, Dec 9, 1996.
...
...
@@ -909,7 +908,6 @@ void RSHFunctional::setxc(void)
if
(
_np
==
0
)
return
;
if
(
_nspin
==
1
)
{
// test for void pointer
assert
(
rho
!=
0
);
assert
(
grad_rho
[
0
]
!=
0
&&
grad_rho
[
1
]
!=
0
&&
grad_rho
[
2
]
!=
0
);
assert
(
exc
!=
0
);
...
...
@@ -937,7 +935,6 @@ void RSHFunctional::setxc(void)
}
else
{
// test for void pointer
assert
(
rho_up
!=
0
);
assert
(
rho_dn
!=
0
);
assert
(
grad_rho_up
[
0
]
!=
0
&&
grad_rho_up
[
1
]
!=
0
&&
grad_rho_up
[
2
]
!=
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment