[Pw_forum] how to fix cellside
Maxim Arsentev
arsentev at isc.nw.ru
Tue Jan 16 08:13:51 CET 2018
Dear Quantum-Espresso users and developers,
I need to fix cell side during geometry optimization in espresso. How it
can be done?
Best wishes,
Maxim Arsent'ev, Ph.D. (Chemistry)
Laboratory of research of nanostructures
Institute of Silicate Chemistry of RAS
-------------- next part --------------
#!/bin/sh
# run from directory where this script is
cd `echo $0 | sed 's/\(.*\)\/.*/\1/'` # extract pathname
EXAMPLE_DIR=`pwd`
# check whether echo has the -e option
if test "`echo -e`" = "-e" ; then ECHO=echo ; else ECHO="echo -e" ; fi
$ECHO
$ECHO "$EXAMPLE_DIR : starting"
$ECHO
$ECHO "This example shows how to use pw.x with vdw-DF functional. In the"
$ECHO "first part a cell relaxation of graphite will be calculated and"
$ECHO "then the energy of two water molecules far apart will be computed."
$ECHO "Optionally, at the end, you can see how to set up a force relaxation"
$ECHO "of an Argon dimer, not activated by default in the distribution."
PREFIX=`cd /usr/share/doc/quantum-espresso ; pwd`
BIN_DIR=/usr/bin
PSEUDO_DIR=/home/mxm2/Documents/vdwDF_TiS3_with_soft_parameters
# Beware: everything in $TMP_DIR will be destroyed !
TMP_DIR=/home/mxm2/Documents/vdwDF_TiS3_with_soft_parameters/temp
# required executables and pseudopotentials
BIN_LIST="pw.x generate_vdW_kernel_table.x"
PSEUDO_LIST="Ti.pbe-spn-rrkjus_psl.0.3.1.UPF S.pbe-n-rrkjus_psl.0.1.UPF"
VDW_TABLE="vdW_kernel_table"
$ECHO
$ECHO " executables directory: $BIN_DIR"
$ECHO " pseudo directory: $PSEUDO_DIR"
$ECHO " temporary directory: $TMP_DIR"
$ECHO " checking that needed directories and files exist...\c"
# check for directories
for DIR in "$BIN_DIR" "$PSEUDO_DIR" ; do
if test ! -d $DIR ; then
$ECHO
$ECHO "ERROR: $DIR not existent or not a directory"
$ECHO "Aborting"
exit 1
fi
done
for DIR in "$TMP_DIR" "$EXAMPLE_DIR/results" ; do
if test ! -d $DIR ; then
mkdir $DIR
fi
done
cd $EXAMPLE_DIR/results
# check for executables
for FILE in $BIN_LIST ; do
if test ! -x $BIN_DIR/$FILE ; then
$ECHO
$ECHO "ERROR: $BIN_DIR/$FILE not existent or not executable"
$ECHO "Aborting"
exit 1
fi
done
# check for pseudopotentials
for FILE in $PSEUDO_LIST ; do
if test ! -r $PSEUDO_DIR/$FILE ; then
$ECHO
$ECHO "Downloading $FILE to $PSEUDO_DIR...\c"
$WGET $PSEUDO_DIR/$FILE $NETWORK_PSEUDO/$FILE 2> /dev/null
fi
if test $? != 0; then
$ECHO
$ECHO "ERROR: $PSEUDO_DIR/$FILE not existent or not readable"
$ECHO "Aborting"
exit 1
fi
done
$ECHO " done"
# how to run executables
PW_COMMAND="$PARA_PREFIX $BIN_DIR/pw.x $PARA_POSTFIX"
GEN_COMMAND="$PARA_PREFIX $BIN_DIR/generate_vdW_kernel_table.x $PARA_POSTFIX"
# check for vdw kernel table
if test ! -r $PSEUDO_DIR/$VDW_TABLE ; then
$ECHO " "
$ECHO " "
$ECHO " WARNING: $PSEUDO_DIR/$VDW_TABLE not existent or not readable"
$ECHO " WARNING: a new table will be generated, this process will"
$ECHO " WARNING: probably take about 20 mins (depending on your cpu"
$ECHO " WARNING: power and configuration)."
$ECHO
$ECHO " Generating $VDW_TABLE...\c"
if $GEN_COMMAND ; then
if test ! -r $VDW_TABLE ; then
$ECHO " ERROR: cannot generate vdW_kernel_table !!"
exit 1
fi
$ECHO "done ! Table moved to $PSEUDO_DIR"
mv $VDW_TABLE $PSEUDO_DIR
fi
fi
$ECHO " done"
# Print how we run executables
$ECHO
$ECHO " running pw.x as: $PW_COMMAND"
$ECHO
#
# TiS3 cell relaxation
#
cat > TiS3.scf.in << EOF
&control
prefix='TiS3',
calculation = 'vc-relax',
restart_mode = 'from_scratch'
pseudo_dir='$PSEUDO_DIR',
outdir = '$TMP_DIR',
forc_conv_thr = 1.0d-3 ,
!forc_conv_thr = 1.0d-2 ,
nstep = 99,
etot_conv_thr = 1.0d-4 ,
!etot_conv_thr = 2.0d-10 ,
/
&system
ibrav= 0, nat= 8, ntyp= 2,
celldm(1)=1.889726,
ecutwfc = 39.0, ecutrho = 300,
occupations ='smearing', smearing ='gaussian',
degauss=0.02,
/
&electrons
conv_thr = 1e-6,
mixing_beta=0.3,
electron_maxstep=500
/
&ions
ion_dynamics= 'bfgs',
/
&cell
cell_factor = 1.5
/
ATOMIC_SPECIES
Ti 47.86700 Ti.pbe-spn-rrkjus_psl.0.3.1.UPF
S 32.0660 S.pbe-n-rrkjus_psl.0.1.UPF
ATOMIC_POSITIONS crystal
Ti 0.287200000 0.250000000 0.151000000
Ti 0.712800000 0.750000000 0.849000000
S 0.461400000 0.250000000 0.676400000
S 0.538600000 0.750000000 0.323600000
S 0.760100000 0.250000000 0.051400000
S 0.239900000 0.750000000 0.948600000
S 0.888300000 0.250000000 0.673000000
S 0.111700000 0.750000000 0.327000000
CELL_PARAMETERS (alat)
4.9476000000 0.0000000000 0.0000000000
0.0000000000 3.3787000000 0.0000000000
-1.1595383790 0.0000000000 8.6707107643
K_POINTS {automatic}
6 8 4 0 0 0
EOF
$ECHO " running the graphite cell relaxation...\c"
$PW_COMMAND < TiS3.scf.in > TiS3.scf.out
check_failure $?
$ECHO " done"
# clean TMP_DIR
$ECHO " cleaning $TMP_DIR...\c"
rm -rf $TMP_DIR/TiS3*
$ECHO " done"
# clean TMP_DIR
$ECHO " cleaning $TMP_DIR...\c"
rm -rf $TMP_DIR/ar_vdw*
$ECHO " done"
$ECHO
$ECHO "$EXAMPLE_DIR : done"
-------------- next part --------------
&control
prefix='TiS3',
calculation = 'vc-relax',
restart_mode = 'from_scratch'
pseudo_dir='/home/mxm2/Documents/vdwDF_TiS3_with_soft_parameters',
outdir = '/home/mxm2/Documents/vdwDF_TiS3_with_soft_parameters/temp',
forc_conv_thr = 1.0d-3 ,
!forc_conv_thr = 1.0d-2 ,
nstep = 99,
etot_conv_thr = 1.0d-4 ,
!etot_conv_thr = 2.0d-10 ,
/
&system
ibrav= 0, nat= 8, ntyp= 2,
celldm(1)=1.889726,
ecutwfc = 39.0, ecutrho = 300,
occupations ='smearing', smearing ='gaussian',
degauss=0.02,
/
&electrons
conv_thr = 1e-6,
mixing_beta=0.3,
electron_maxstep=500
/
&ions
ion_dynamics= 'bfgs',
/
&cell
cell_factor = 1.5
/
ATOMIC_SPECIES
Ti 47.86700 Ti.pbe-spn-rrkjus_psl.0.3.1.UPF
S 32.0660 S.pbe-n-rrkjus_psl.0.1.UPF
ATOMIC_POSITIONS crystal
Ti 0.287200000 0.250000000 0.151000000
Ti 0.712800000 0.750000000 0.849000000
S 0.461400000 0.250000000 0.676400000
S 0.538600000 0.750000000 0.323600000
S 0.760100000 0.250000000 0.051400000
S 0.239900000 0.750000000 0.948600000
S 0.888300000 0.250000000 0.673000000
S 0.111700000 0.750000000 0.327000000
CELL_PARAMETERS (alat)
4.9476000000 0.0000000000 0.0000000000
0.0000000000 3.3787000000 0.0000000000
-1.1595383790 0.0000000000 8.6707107643
K_POINTS {automatic}
6 8 4 0 0 0
More information about the users
mailing list