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
136f424a
Commit
136f424a
authored
Jun 11, 2019
by
Francois Gygi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix total energy and stress calc with NLCC
parent
4e6d0f58
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
EnergyFunctional.C
src/EnergyFunctional.C
+15
-2
No files found.
src/EnergyFunctional.C
View file @
136f424a
...
...
@@ -282,6 +282,19 @@ void EnergyFunctional::update_vhxc(bool compute_stress, bool update_vh,
vxc_g
[
ig
]
=
0
.
5
*
(
vxc_g
[
ig
]
+
vtemp
[
ig
]
);
}
}
// correct dxc_ to include the core charge exchange-correlation term
// in Harris-Foulkes estimates
// dxc_correction = sum_ig vxc_g[ig] * rhocore_g[ig]
double
sum
=
0
.
0
;
complex
<
double
>
*
rh
=
&
cd_
.
rhocore_g
[
0
];
int
len
=
2
*
ngloc
,
inc1
=
1
;
sum
=
2
.
0
*
ddot
(
&
len
,(
double
*
)
&
vxc_g
[
0
],
&
inc1
,(
double
*
)
&
rh
[
0
],
&
inc1
);
// remove double counting for G=0
if
(
vbasis_
->
mype
()
==
0
)
sum
-=
real
(
conj
(
vxc_g
[
0
])
*
rh
[
0
]);
double
tsum
=
0
.
0
;
MPI_Allreduce
(
&
sum
,
&
tsum
,
1
,
MPI_DOUBLE
,
MPI_SUM
,
vbasis_
->
comm
());
dxc_
+=
tsum
;
}
tmap
[
"exc"
].
stop
();
...
...
@@ -621,7 +634,7 @@ double EnergyFunctional::energy(bool compute_hpsi, Wavefunction& dwf,
s
->
drhocoreg
(
g
,
rhoc_g
,
drhoc_g
);
// next line: keep only real part
// contribution of core correction
temp
-=
(
vxc_g
[
ig
].
real
()
*
sg
.
real
()
+
vxc_g
[
ig
].
imag
()
*
sg
.
imag
())
temp
-=
(
vxc_g
[
ig
].
real
()
*
sg
.
real
()
+
vxc_g
[
ig
].
imag
()
*
sg
.
imag
())
*
drhoc_g
*
gi
*
omega_inv
/
fpi
;
}
...
...
@@ -1009,7 +1022,7 @@ void EnergyFunctional::atoms_moved(void)
for
(
int
is
=
0
;
is
<
atoms
.
nsp
();
is
++
)
{
complex
<
double
>
*
s
=
&
sf
.
sfac
[
is
][
0
];
double
*
r
=
&
rhocore_sp_g
[
is
][
0
];
double
*
r
=
&
rhocore_sp_g
[
is
][
0
];
for
(
int
ig
=
0
;
ig
<
ngloc
;
ig
++
)
cd_
.
rhocore_g
[
ig
]
+=
spin_fac
*
s
[
ig
]
*
r
[
ig
];
}
...
...
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