[Pw_forum] Constraints

yuva rani syuva2987 at gmail.com
Tue Jun 14 03:56:45 CEST 2011


Hi, thank for your suggestion. But still I am not clear for
constraining the parameters. I have attached the input file for
aluminium pentacene stack with 148 atoms. I need to constraint the
interplanar distance between the top layer of aluminium and pentacene
stack during relaxaton. So please give me the conditions used for such
constraints.
I also have another question about K_points. Give me the suggestion of
how to set the k_points for the system we contructed.

Thanks in advance.
-------------- 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

# function to test the exit status of a job
. ../check_failure.sh

$ECHO
$ECHO "$EXAMPLE_DIR : starting"
$ECHO
$ECHO "This example shows how to use pw.x to compute the equilibrium geometry"
$ECHO "of a simple molecule, alpen."
$ECHO "In the latter case the relaxation is performed in two ways:"
$ECHO "1) using the quasi-Newton BFGS algorithm"
$ECHO "2) using a damped dynamics algorithm."

# set the needed environment variables
#. ../environment_variables

# required executables and pseudopotentials
BIN_LIST="pw.x"
PSEUDO_LIST="  Al.pz-vbc.UPF H.pz-vbc.UPF C.pz-vbc.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 "ERROR: $PSEUDO_DIR/$FILE not existent or not readable"
        $ECHO "Aborting"
        exit 1
    fi
done
$ECHO " done"

# for parallel calculation
PARA_PREFIX="mpiexec -np 8"
PARA_POSTFIX="-npool 4"

# how to run executables
PW_COMMAND="$PARA_PREFIX $BIN_DIR/pw.x $PARA_POSTFIX"
$ECHO
$ECHO "  running pw.x as: $PW_COMMAND"
$ECHO

# clean TMP_DIR
$ECHO "  cleaning $TMP_DIR...\c"
rm -rf $TMP_DIR/*
$ECHO " done"

# self-consistent calculation
cat > alpen148.rx.in << EOF
&CONTROL
  calculation  = "relax",
  nstep        = 200,
  pseudo_dir   = "$PSEUDO_DIR",
  outdir       = "$TMP_DIR",
/
&SYSTEM
  ibrav       = 8,
  celldm(1)   = 16,
  celldm(2)   = 0.5,
  celldm(3)   = 1.77,
  nat         = 148,
  ntyp        = 3,
  ecutwfc     = 12.D0,
  occupations = "smearing",
  smearing    = "methfessel-paxton",
  degauss     = 0.05D0, 
/
&ELECTRONS
  electron_maxstep = 700
  conv_thr    = 1.D-6,
  mixing_beta = 0.3D0,
/
&IONS
  bfgs_ndim         = 3,
/
ATOMIC_SPECIES
Al  1.00  Al.pz-vbc.UPF
H   1.00  H.pz-vbc.UPF
C   1.00  C.pz-vbc.UPF
ATOMIC_POSITIONS {bohr}
Al     11.039040    5.580000   24.296861
Al     15.088000    5.580000   24.296861
Al      2.940000    5.580000   24.296861
Al      6.988960    5.580000   24.296861
Al     11.039040    5.580000    0.000000
Al     15.088000    5.580000    0.000000
Al      2.940000    5.580000    0.000000
Al      6.988960    5.580000    0.000000
Al     11.039040    5.580000    4.050043
Al     15.088000    5.580000    4.050043
Al      2.940000    5.580000    4.050043
Al      6.988960    5.580000    4.050043
Al     11.039040    5.580000    8.098954
Al     15.088000    5.580000    8.098954
Al      2.940000    5.580000    8.098954
Al      6.988960    5.580000    8.098954
Al     11.039040    5.580000   12.148997
Al     15.088000    5.580000   12.148997
Al      2.940000    5.580000   12.148997
Al      6.988960    5.580000   12.148997
Al     11.039040    5.580000   16.197907
Al     15.088000    5.580000   16.197907
Al      2.940000    5.580000   16.197907
Al      6.988960    5.580000   16.197907
Al     11.039040    5.580000   20.247101
Al     15.088000    5.580000   20.247101
Al      2.940000    5.580000   20.247101
Al      6.988960    5.580000   20.247101
Al     13.063040    3.555040   24.296861
Al      0.915040    3.555040   24.296861
Al      4.964000    3.555040   24.296861
Al      9.013920    3.555040   24.296861
Al     13.063040    3.555040    0.000000
Al      0.915040    3.555040    0.000000
Al      4.964000    3.555040    0.000000
Al      9.013920    3.555040    0.000000
Al     13.063040    3.555040    4.050043
Al      0.915040    3.555040    4.050043
Al      4.964000    3.555040    4.050043
Al      9.013920    3.555040    4.050043
Al     13.063040    3.555040    8.098954
Al      0.915040    3.555040    8.098954
Al      4.964000    3.555040    8.098954
Al      9.013920    3.555040    8.098954
Al     13.063040    3.555040   12.148997
Al      0.915040    3.555040   12.148997
Al      4.964000    3.555040   12.148997
Al      9.013920    3.555040   12.148997
Al     13.063040    3.555040   16.197907
Al      0.915040    3.555040   16.197907
Al      4.964000    3.555040   16.197907
Al      9.013920    3.555040   16.197907
Al     13.063040    3.555040   20.247101
Al      0.915040    3.555040   20.247101
Al      4.964000    3.555040   20.247101
Al      9.013920    3.555040   20.247101
Al     11.039040    3.555040   26.297102
Al     15.088000    3.555040   26.297102
Al      2.940000    3.555040   26.297102
Al      6.988960    3.555040   26.297102
Al     11.039040    3.555040    2.024880
Al     15.088000    3.555040    2.024880
Al      2.940000    3.555040    2.024880
Al      6.988960    3.555040    2.024880
Al     11.039040    3.555040    6.074074
Al     15.088000    3.555040    6.074074
Al      2.940000    3.555040    6.074074
Al      6.988960    3.555040    6.074074
Al     11.039040    3.555040   10.124117
Al     15.088000    3.555040   10.124117
Al      2.940000    3.555040   10.124117
Al      6.988960    3.555040   10.124117
Al     11.039040    3.555040   14.173027
Al     15.088000    3.555040   14.173027
Al      2.940000    3.555040   14.173027
Al      6.988960    3.555040   14.173027
Al     11.039040    3.555040   18.223070
Al     15.088000    3.555040   18.223070
Al      2.940000    3.555040   18.223070
Al      6.988960    3.555040   18.223070
Al     11.039040    3.555040   22.271981
Al     15.088000    3.555040   22.271981
Al      2.940000    3.555040   22.271981
Al      6.988960    3.555040   22.271981
Al     13.063040    5.580000   26.297102
Al      0.915040    5.580000   26.297102
Al      4.964000    5.580000   26.297102
Al      9.013920    5.580000   26.297102
Al     13.063040    5.580000    2.024880
Al      0.915040    5.580000    2.024880
Al      4.964000    5.580000    2.024880
Al      9.013920    5.580000    2.024880
Al     13.063040    5.580000    6.074074
Al      0.915040    5.580000    6.074074
Al      4.964000    5.580000    6.074074
Al      9.013920    5.580000    6.074074
Al     13.063040    5.580000   10.124117
Al      0.915040    5.580000   10.124117
Al      4.964000    5.580000   10.124117
Al      9.013920    5.580000   10.124117
Al     13.063040    5.580000   14.173027
Al      0.915040    5.580000   14.173027
Al      4.964000    5.580000   14.173027
Al      9.013920    5.580000   14.173027
Al     13.063040    5.580000   18.223070
Al      0.915040    5.580000   18.223070
Al      4.964000    5.580000   18.223070
Al      9.013920    5.580000   18.223070
Al     13.063040    5.580000   22.271981
Al      0.915040    5.580000   22.271981
Al      4.964000    5.580000   22.271981
Al      9.013920    5.580000   22.271981
C       5.627040    0.000000   22.367986
C       4.193920    0.000000   22.362888
C       6.326080    0.000000   21.194971
C       5.647040    0.000000   19.929067
C       4.192000    0.000000   19.923970
C       3.504960    0.000000   21.183926
C       6.332000    0.000000   18.720936
C       5.657920    0.000000   17.477122
C       4.200960    0.000000   17.472024
C       3.516960    0.000000   18.709891
C       6.343040    0.000000   16.253131
C       5.667040    0.000000   15.024043
C       4.210080    0.000000   15.018946
C       3.524960    0.000000   16.242086
C       6.351040    0.000000   13.785043
C       5.676000    0.000000   12.572098
C       4.220000    0.000000   12.565867
C       3.535040    0.000000   13.775131
C       6.364000    0.000000   11.311008
C       5.675040    0.000000   10.132046
C       4.240960    0.000000   10.126949
C       3.542080    0.000000   11.299963
H       6.155040    0.000000   23.318971
H       3.660000    0.000000   23.309059
H       7.412960    0.000000   21.196104
H       2.416960    0.000000   21.177979
H       7.420960    0.000000   18.724901
H       2.428000    0.000000   18.705926
H       7.431040    0.000000   16.257096
H       2.436960    0.000000   16.238122
H       7.440000    0.000000   13.789008
H       2.447040    0.000000   13.770883
H       7.451040    0.000000   11.318088
H       6.208960    0.000000    9.185875
H       3.713920    0.000000    9.177096
H       2.455040    0.000000   11.297981

K_POINTS
 3
 0.125  0.125  0.0  1.0
 0.125  0.375  0.0  2.0
 0.375  0.375  0.0  1.0
EOF
$ECHO "  running the geometry relaxation for alpen...\c"
$PW_COMMAND < alpen148.rx.in > alpen148.rx.out
check_failure $?
$ECHO " done"

$ECHO
$ECHO "$EXAMPLE_DIR: done"


More information about the users mailing list