#!/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 cp.x to perform molecular dynamics" $ECHO "simulation of SiO2." # set the needed environment variables . ../../../environment_variables # required executables and pseudopotentials BIN_LIST="cp.x" PSEUDO_LIST="Si.pz-vbc.UPF O.pz-rrkjus.UPF" $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 \ http://www.quantum-espresso.org/pseudo/1.3/UPF/$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 CP_COMMAND="$PARA_PREFIX $BIN_DIR/cp.x $PARA_POSTFIX" $ECHO $ECHO " running cp.x as: $CP_COMMAND" $ECHO # clean TMP_DIR $ECHO " cleaning $TMP_DIR...\c" rm -rf $TMP_DIR/* $ECHO " done" # molecular dynamics calculation cat > sio2.cp.start.xml << EOF 1.73206 1.09955 0.0 0.0 0.0 16.00 O.pz-rrkjus.UPF 1.0 28.00 Si.pz-vbc.UPF 1.0 3.18829368 14.83237039 1.22882961 7.83231469 6.78704039 1.22882961 2.07443467 5.99537992 4.73758250 6.72031366 14.04231898 4.73758250 3.96307134 11.26989826 7.87860582 8.60802134 3.22295920 7.87860582 3.96307134 4.81915267 9.14625133 8.60802134 12.86448267 9.14625133 3.18736469 1.25668055 5.58029607 7.83324368 9.30201055 5.58029607 2.07536366 10.09206195 2.07358613 6.71938467 2.04673195 2.07358613 0.28891589 8.04533000 3.40456284 4.93386589 0.00000000 3.40456284 2.13389003 12.27717358 -0.04188031 6.77884003 4.23184358 -0.04188031 2.13389003 3.81348642 6.85202747 6.77884003 11.85881642 6.85202747 $PSEUDO_DIR/ $TMP_DIR/ from_scratch 20 random 20.0 150.0 48 150.0 2.0 16.0 1 20 5.0 none 20 16 16 16 damp 0.2 700.0 3.0 90 91 0.01 EOF $ECHO " running the calculation with fixed ions...\c" $CP_COMMAND < sio2.cp.start.xml > sio2.cp.start.out check_failure $? $ECHO " done" # molecular dynamics calculation cat > sio2.cp.restart.xml << EOF 1.73206 1.09955 0.0 0.0 0.0 16.00 O.pz-rrkjus.UPF 1.0 28.00 Si.pz-vbc.UPF 1.0 3.18829368 14.83237039 1.22882961 7.83231469 6.78704039 1.22882961 2.07443467 5.99537992 4.73758250 6.72031366 14.04231898 4.73758250 3.96307134 11.26989826 7.87860582 8.60802134 3.22295920 7.87860582 3.96307134 4.81915267 9.14625133 8.60802134 12.86448267 9.14625133 3.18736469 1.25668055 5.58029607 7.83324368 9.30201055 5.58029607 2.07536366 10.09206195 2.07358613 6.71938467 2.04673195 2.07358613 0.28891589 8.04533000 3.40456284 4.93386589 0.00000000 3.40456284 2.13389003 12.27717358 -0.04188031 6.77884003 4.23184358 -0.04188031 2.13389003 3.81348642 6.85202747 6.77884003 11.85881642 6.85202747 $PSEUDO_DIR/ $TMP_DIR/ reset_counters 50 20.0 150.0 48 150.0 2.0 16.0 1 50 15.0 none 50 16 16 16 damp 0.2 700.0 3.0 91 92 EOF $ECHO " running the calculation with fixed ions, restart...\c" $CP_COMMAND < sio2.cp.restart.xml > sio2.cp.restart.out check_failure $? $ECHO " done" # molecular dynamics calculation cat > sio2.vc-cp.xml << EOF 1.73206 1.09955 0.0 0.0 0.0 16.00 O.pz-rrkjus.UPF 1.0 28.00 Si.pz-vbc.UPF 1.0 3.18829368 14.83237039 1.22882961 7.83231469 6.78704039 1.22882961 2.07443467 5.99537992 4.73758250 6.72031366 14.04231898 4.73758250 3.96307134 11.26989826 7.87860582 8.60802134 3.22295920 7.87860582 3.96307134 4.81915267 9.14625133 8.60802134 12.86448267 9.14625133 3.18736469 1.25668055 5.58029607 7.83324368 9.30201055 5.58029607 2.07536366 10.09206195 2.07358613 6.71938467 2.04673195 2.07358613 0.28891589 8.04533000 3.40456284 4.93386589 0.00000000 3.40456284 2.13389003 12.27717358 -0.04188031 6.77884003 4.23184358 -0.04188031 2.13389003 3.81348642 6.85202747 6.77884003 11.85881642 6.85202747 $PSEUDO_DIR/ $TMP_DIR/ reset_counters 10 20.0 150.0 48 150.0 2.0 16.0 1 10 pr 1.0 12.0 verlet nose 300.0 10 16 16 16 verlet 700.0 3.0 92 93 30 6.6666 6.6666 6.6666 6.6666 nose 300.0 8.6071 EOF $ECHO " running the variable-cell calculation...\c" $CP_COMMAND < sio2.vc-cp.xml > sio2.vc-cp.out check_failure $? $ECHO " done" # molecular dynamics calculation cat > sio2.vc-cp.restart.xml << EOF 1.73206 1.09955 0.0 0.0 0.0 16.00 O.pz-rrkjus.UPF 1.0 28.00 Si.pz-vbc.UPF 1.0 3.18829368 14.83237039 1.22882961 7.83231469 6.78704039 1.22882961 2.07443467 5.99537992 4.73758250 6.72031366 14.04231898 4.73758250 3.96307134 11.26989826 7.87860582 8.60802134 3.22295920 7.87860582 3.96307134 4.81915267 9.14625133 8.60802134 12.86448267 9.14625133 3.18736469 1.25668055 5.58029607 7.83324368 9.30201055 5.58029607 2.07536366 10.09206195 2.07358613 6.71938467 2.04673195 2.07358613 0.28891589 8.04533000 3.40456284 4.93386589 0.00000000 3.40456284 2.13389003 12.27717358 -0.04188031 6.77884003 4.23184358 -0.04188031 2.13389003 3.81348642 6.85202747 6.77884003 11.85881642 6.85202747 $PSEUDO_DIR/ $TMP_DIR/ reset_counters 10 20.0 150.0 48 150.0 2.0 16.0 1 10 pr 1.0 12.0 verlet nose 300.0 10 16 16 16 verlet 700.0 3.0 93 94 30 6.6666 6.6666 6.6666 6.6666 nose 300.0 8.6071 EOF $ECHO " running the variable-cell calculation, restart...\c" $CP_COMMAND < sio2.vc-cp.restart.xml > sio2.vc-cp.restart.out check_failure $? $ECHO " done" $ECHO $ECHO "$EXAMPLE_DIR : done"