From d533ad56b6f7ef1d199c1b33873ce115be0c2c71 Mon Sep 17 00:00:00 2001 From: kirk0830 <67682086+kirk0830@users.noreply.github.com> Date: Wed, 6 Nov 2024 22:36:13 +0800 Subject: [PATCH] Fix: update the example of vdwd3 acoording to the latest impl. (#5418) --- examples/vdw/{si2 => si2-vdwd2}/INPUT1 | 0 examples/vdw/{si2 => si2-vdwd2}/INPUT2 | 8 ++++--- examples/vdw/{si2 => si2-vdwd2}/KPT | 0 examples/vdw/{si2 => si2-vdwd2}/STRU | 0 examples/vdw/{si2 => si2-vdwd2}/c6.txt | 0 examples/vdw/{si2 => si2-vdwd2}/run.sh | 0 examples/vdw/si2-vdwd3/INPUT1 | 15 ++++++++++++ examples/vdw/si2-vdwd3/INPUT2 | 15 ++++++++++++ examples/vdw/si2-vdwd3/INPUT3 | 21 ++++++++++++++++ examples/vdw/si2-vdwd3/KPT | 4 ++++ examples/vdw/si2-vdwd3/STRU | 24 +++++++++++++++++++ examples/vdw/si2-vdwd3/run.sh | 33 ++++++++++++++++++++++++++ 12 files changed, 117 insertions(+), 3 deletions(-) rename examples/vdw/{si2 => si2-vdwd2}/INPUT1 (100%) rename examples/vdw/{si2 => si2-vdwd2}/INPUT2 (62%) rename examples/vdw/{si2 => si2-vdwd2}/KPT (100%) rename examples/vdw/{si2 => si2-vdwd2}/STRU (100%) rename examples/vdw/{si2 => si2-vdwd2}/c6.txt (100%) rename examples/vdw/{si2 => si2-vdwd2}/run.sh (100%) create mode 100644 examples/vdw/si2-vdwd3/INPUT1 create mode 100644 examples/vdw/si2-vdwd3/INPUT2 create mode 100644 examples/vdw/si2-vdwd3/INPUT3 create mode 100644 examples/vdw/si2-vdwd3/KPT create mode 100644 examples/vdw/si2-vdwd3/STRU create mode 100644 examples/vdw/si2-vdwd3/run.sh diff --git a/examples/vdw/si2/INPUT1 b/examples/vdw/si2-vdwd2/INPUT1 similarity index 100% rename from examples/vdw/si2/INPUT1 rename to examples/vdw/si2-vdwd2/INPUT1 diff --git a/examples/vdw/si2/INPUT2 b/examples/vdw/si2-vdwd2/INPUT2 similarity index 62% rename from examples/vdw/si2/INPUT2 rename to examples/vdw/si2-vdwd2/INPUT2 index 8b27ddf50c..dc3d7801d5 100644 --- a/examples/vdw/si2/INPUT2 +++ b/examples/vdw/si2-vdwd2/INPUT2 @@ -1,5 +1,6 @@ -#INPUT file for applying D3(BJ) correction -#with default VdW parameters +#INPUT file for applying D2 correction +#where I chose to manually set the C6 parameter +#in file c6.txt #in pw basis INPUT_PARAMETERS @@ -12,4 +13,5 @@ ecutwfc 50 scf_nmax 100 scf_thr 1e-6 basis_type pw -vdw_method d3_bj +vdw_method d2 +vdw_C6_file c6.txt diff --git a/examples/vdw/si2/KPT b/examples/vdw/si2-vdwd2/KPT similarity index 100% rename from examples/vdw/si2/KPT rename to examples/vdw/si2-vdwd2/KPT diff --git a/examples/vdw/si2/STRU b/examples/vdw/si2-vdwd2/STRU similarity index 100% rename from examples/vdw/si2/STRU rename to examples/vdw/si2-vdwd2/STRU diff --git a/examples/vdw/si2/c6.txt b/examples/vdw/si2-vdwd2/c6.txt similarity index 100% rename from examples/vdw/si2/c6.txt rename to examples/vdw/si2-vdwd2/c6.txt diff --git a/examples/vdw/si2/run.sh b/examples/vdw/si2-vdwd2/run.sh similarity index 100% rename from examples/vdw/si2/run.sh rename to examples/vdw/si2-vdwd2/run.sh diff --git a/examples/vdw/si2-vdwd3/INPUT1 b/examples/vdw/si2-vdwd3/INPUT1 new file mode 100644 index 0000000000..09c40e8103 --- /dev/null +++ b/examples/vdw/si2-vdwd3/INPUT1 @@ -0,0 +1,15 @@ +#INPUT file for applying D3(BJ) correction +#in lcao basis + +INPUT_PARAMETERS +#Parameters (General) +pseudo_dir ../../../tests/PP_ORB +orbital_dir ../../../tests/PP_ORB +ntype 1 +#Parameters (Accuracy) +ecutwfc 50 +scf_nmax 100 +scf_thr 1e-6 +basis_type lcao +vdw_method d3_bj +dft_functional MGGA_X_SCAN+MGGA_C_SCAN diff --git a/examples/vdw/si2-vdwd3/INPUT2 b/examples/vdw/si2-vdwd3/INPUT2 new file mode 100644 index 0000000000..1e7a68e5b4 --- /dev/null +++ b/examples/vdw/si2-vdwd3/INPUT2 @@ -0,0 +1,15 @@ +#INPUT file for applying D3(BJ) correction +#in pw basis + +INPUT_PARAMETERS +#Parameters (General) +pseudo_dir ../../../tests/PP_ORB +orbital_dir ../../../tests/PP_ORB +ntype 1 +#Parameters (Accuracy) +ecutwfc 50 +scf_nmax 100 +scf_thr 1e-6 +basis_type pw +vdw_method d3_bj +dft_functional pbe diff --git a/examples/vdw/si2-vdwd3/INPUT3 b/examples/vdw/si2-vdwd3/INPUT3 new file mode 100644 index 0000000000..8a5a4e9a2c --- /dev/null +++ b/examples/vdw/si2-vdwd3/INPUT3 @@ -0,0 +1,21 @@ +#INPUT file for applying D3(BJ) correction +#in lcao basis. This example illustrates +#the manually setting on vdw parameters + +INPUT_PARAMETERS +#Parameters (General) +pseudo_dir ../../../tests/PP_ORB +orbital_dir ../../../tests/PP_ORB +ntype 1 +#Parameters (Accuracy) +ecutwfc 50 +scf_nmax 100 +scf_thr 1e-6 +basis_type lcao +vdw_method d3_bj +dft_functional pbe +vdw_s6 1.000 +vdw_s8 0.722 +vdw_a1 1.217 +vdw_a2 1.000 + diff --git a/examples/vdw/si2-vdwd3/KPT b/examples/vdw/si2-vdwd3/KPT new file mode 100644 index 0000000000..253d74de39 --- /dev/null +++ b/examples/vdw/si2-vdwd3/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +4 4 4 0 0 0 diff --git a/examples/vdw/si2-vdwd3/STRU b/examples/vdw/si2-vdwd3/STRU new file mode 100644 index 0000000000..ecf106c93d --- /dev/null +++ b/examples/vdw/si2-vdwd3/STRU @@ -0,0 +1,24 @@ +#This is the atom file containing all the information +#about the lattice structure. + +ATOMIC_SPECIES +Si 1.000 Si_ONCV_PBE-1.0.upf #Element, Mass, Pseudopotential + +NUMERICAL_ORBITAL +Si_gga_6au_100Ry_2s2p1d.orb + +LATTICE_CONSTANT +10.2 #Lattice constant + +LATTICE_VECTORS +0.5 0.5 0.0 #Lattice vector 1 +0.5 0.0 0.5 #Lattice vector 2 +0.0 0.5 0.5 #Lattice vector 3 + +ATOMIC_POSITIONS +Cartesian #Cartesian(Unit is LATTICE_CONSTANT) +Si #Name of element +0.0 #Magnetic for this element. +2 #Number of atoms +0.00 0.00 0.00 0 0 0 #x,y,z, move_x, move_y, move_z +0.25 0.25 0.25 1 1 1 diff --git a/examples/vdw/si2-vdwd3/run.sh b/examples/vdw/si2-vdwd3/run.sh new file mode 100644 index 0000000000..ab26cc1663 --- /dev/null +++ b/examples/vdw/si2-vdwd3/run.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +ABACUS_PATH=$(awk -F "=" '$1=="ABACUS_PATH"{print $2}' ../../SETENV) +ABACUS_NPROCS=$(awk -F "=" '$1=="ABACUS_NPROCS"{print $2}' ../../SETENV) +ABACUS_THREADS=$(awk -F "=" '$1=="ABACUS_THREADS"{print $2}' ../../SETENV) + +cp INPUT1 INPUT +OMP_NUM_THREADS=${ABACUS_THREADS} mpirun -np ${ABACUS_NPROCS} ${ABACUS_PATH} | tee scf1.output +mv OUT.ABACUS/running_scf.log OUT.ABACUS/running_scf1.log +cp INPUT2 INPUT +OMP_NUM_THREADS=${ABACUS_THREADS} mpirun -np ${ABACUS_NPROCS} ${ABACUS_PATH} | tee scf2.output +mv OUT.ABACUS/running_scf.log OUT.ABACUS/running_scf2.log +cp INPUT3 INPUT +OMP_NUM_THREADS=${ABACUS_THREADS} mpirun -np ${ABACUS_NPROCS} ${ABACUS_PATH} | tee scf3.output +mv OUT.ABACUS/running_scf.log OUT.ABACUS/running_scf3.log +rm INPUT + +if [[ ! -f scf1.output ]] || + [[ ! -f scf2.output ]] || + [[ ! -f scf3.output ]] || + [[ ! -f OUT.ABACUS/running_scf1.log ]] || + [[ ! -f OUT.ABACUS/running_scf2.log ]] || + [[ ! -f OUT.ABACUS/running_scf3.log ]] || + [[ ! ( "$(tail -1 OUT.ABACUS/running_scf1.log)" == " Total Time :"* ) ]] || + [[ ! ( "$(tail -1 OUT.ABACUS/running_scf2.log)" == " Total Time :"* ) ]] || + [[ ! ( "$(tail -1 OUT.ABACUS/running_scf3.log)" == " Total Time :"* ) ]] +then + echo "job is failed!" + exit 1 +else + echo "job is successed!" + exit 0 +fi