Skip to content

Commit

Permalink
Fix: update the example of vdwd3 acoording to the latest impl. (#5418)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirk0830 authored Nov 6, 2024
1 parent dd862ea commit d533ad5
Show file tree
Hide file tree
Showing 12 changed files with 117 additions and 3 deletions.
File renamed without changes.
8 changes: 5 additions & 3 deletions examples/vdw/si2/INPUT2 → examples/vdw/si2-vdwd2/INPUT2
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions examples/vdw/si2-vdwd3/INPUT1
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions examples/vdw/si2-vdwd3/INPUT2
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions examples/vdw/si2-vdwd3/INPUT3
Original file line number Diff line number Diff line change
@@ -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

4 changes: 4 additions & 0 deletions examples/vdw/si2-vdwd3/KPT
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
K_POINTS
0
Gamma
4 4 4 0 0 0
24 changes: 24 additions & 0 deletions examples/vdw/si2-vdwd3/STRU
Original file line number Diff line number Diff line change
@@ -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
33 changes: 33 additions & 0 deletions examples/vdw/si2-vdwd3/run.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d533ad5

Please sign in to comment.