PWDFT: Print the band gap and total energy

This commit is contained in:
Taillefumier Mathieu 2024-01-15 16:48:06 +01:00 committed by GitHub
parent 75a566c04f
commit 6e730ce092
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 9 deletions

View file

@ -205,7 +205,7 @@ CONTAINS
print_scine
LOGICAL :: calculate_forces, calculate_stress_tensor, energy_consistency, eval_ef, &
linres_run, my_skip, print_components
REAL(KIND=dp) :: checksum, e_pot, sum_energy, &
REAL(KIND=dp) :: checksum, e_gap, e_pot, sum_energy, &
sum_pv_virial, sum_stress_tensor
REAL(KIND=dp), DIMENSION(3) :: grand_total_force, total_force
REAL(KIND=dp), DIMENSION(3, 3) :: atomic_stress_tensor, diff_stress_tensor
@ -227,6 +227,8 @@ CONTAINS
calculate_forces = .TRUE.
energy_consistency = .FALSE.
linres_run = .FALSE.
e_gap = -1.0_dp
IF (PRESENT(eval_energy_forces)) eval_ef = eval_energy_forces
IF (PRESENT(skip_external_control)) my_skip = skip_external_control
IF (PRESENT(calc_force)) calculate_forces = calc_force
@ -259,6 +261,7 @@ CONTAINS
ELSE
CALL pwdft_calc_energy_force(force_env%pwdft_env, calculate_forces, .FALSE.)
END IF
e_gap = force_env%pwdft_env%energy%band_gap
CASE (use_eip_force)
IF (force_env%eip_env%eip_model == use_lenosky_eip) THEN
CALL eip_lenosky(force_env%eip_env)
@ -332,6 +335,10 @@ CONTAINS
IF (output_unit > 0) THEN
WRITE (output_unit, '(/,T2,"ENERGY| Total FORCE_EVAL ( ",A," ) energy [a.u.]: ",T55,F26.15)') &
ADJUSTR(TRIM(use_prog_name(force_env%in_use))), e_pot
IF (e_gap .GT. -.1_dp) THEN
WRITE (output_unit, '(/,T2,"ENERGY| Total FORCE_EVAL ( ",A," ) gap [a.u.]: ",T55,F26.15)') &
ADJUSTR(TRIM(use_prog_name(force_env%in_use))), e_gap
END IF
END IF
CALL cp_print_key_finished_output(output_unit, logger, force_env%force_env_section, &
"PRINT%PROGRAM_RUN_INFO")

View file

@ -54,6 +54,7 @@ MODULE pwdft_environment_types
! **************************************************************************************************
TYPE pwdft_energy_type
REAL(KIND=dp) :: etotal = 0.0_dp
REAL(KIND=dp) :: band_gap = -1.0_dp
END TYPE pwdft_energy_type
! **************************************************************************************************

View file

@ -690,6 +690,10 @@ CONTAINS
CALL pwdft_env_get(pwdft_env=pwdft_env, energy=energy)
etotal = 0.0_C_DOUBLE
CALL sirius_get_energy(gs_handler, 'band-gap', etotal)
energy%band_gap = etotal
etotal = 0.0_C_DOUBLE
CALL sirius_get_energy(gs_handler, 'total', etotal)
energy%etotal = etotal

View file

@ -83,7 +83,7 @@ HOMO SCF Cycle: 4!9
DEBUG| Sum of differences:!5
1\[\ \ \ 1\]\ -\ 2\[\ \ \ 1\]!7
Ionization potential of the excited atom:!7
( SIRIUS ) !9
Total FORCE_EVAL ( SIRIUS ) energy!9
DIPOLE : CheckSum =!5
POLAR : CheckSum =!5
XAS excitation energy (eV): !7

View file

@ -6,8 +6,8 @@
[ "${BASH_SOURCE[0]}" ] && SCRIPT_NAME="${BASH_SOURCE[0]}" || SCRIPT_NAME=$0
SCRIPT_DIR="$(cd "$(dirname "$SCRIPT_NAME")/.." && pwd -P)"
sirius_ver="7.4.3"
sirius_sha256="015679a60a39fa750c5d1bd8fb1ce73945524bef561270d8a171ea2fd4687fec"
sirius_ver="7.5.2"
sirius_sha256="9ae01935578532c84f1d0d673dbbcdd490e26be22efa6c4acf7129f9dc1a0c60"
source "${SCRIPT_DIR}"/common_vars.sh
source "${SCRIPT_DIR}"/tool_kit.sh
@ -160,8 +160,8 @@ case "$with_sirius" in
-DCMAKE_Fortran_COMPILER="${MPIFC}" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DBUILD_SHARED_LIBS=OFF \
-DUSE_MEMORY_POOL=OFF \
-DUSE_ELPA=OFF \
-DSIRIUS_USE_MEMORY_POOL=OFF \
-DSIRIUS_USE_ELPA=OFF \
${EXTRA_CMAKE_FLAGS} .. \
> cmake.log 2>&1 || tail -n ${LOG_LINES} cmake.log
@ -185,10 +185,10 @@ case "$with_sirius" in
-DCMAKE_CXX_FLAGS_RELEASE="${SIRIUS_OPT}" \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="${SIRIUS_DBG}" \
-DCMAKE_CUDA_FLAGS="-std=c++14 -allow-unsupported-compiler" \
-DUSE_CUDA=ON \
-DUSE_ELPA=OFF \
-DSIRIUS_USE_CUDA=ON \
-DSIRIUS_USE_ELPA=OFF \
-DGPU_MODEL=P100 \
-DUSE_MEMORY_POOL=OFF \
-DSIRIUS_USE_MEMORY_POOL=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_CXX_COMPILER="${MPICXX}" \
-DCMAKE_C_COMPILER="${MPICC}" \