3 # create POSCAR files for db combinations
11 if [ ! -f $file ]; then
12 echo "no CONTCAR file in $1 ..."
17 if [ -z $lnumber ]; then
18 echo "no line number specified ..."
22 gline="`sed -n 6p $file`"
23 sic=`echo $gline | awk '{ print $1 }'`
24 cc=`echo $gline | awk '{ print $2 }'`
28 ltm=`sed -n ${lnumber}p $file`
30 echo "line to modify:"
33 x=`echo $ltm | awk '{ print $1 }'`
34 y=`echo $ltm | awk '{ print $2 }'`
35 z=`echo $ltm | awk '{ print $3 }'`
36 s1=`echo $ltm | awk '{ print $4 }'`
37 s2=`echo $ltm | awk '{ print $5 }'`
38 s3=`echo $ltm | awk '{ print $6 }'`
41 nz=`echo $z $deltaSi $clen | awk '{
43 if(res>1.0) print res-1.0
44 else if(res<0.0) print res+1.0
47 sed "s%$ltm%$x $y $nz $s1 $s2 $s3%" $file > POSCAR.00-1
48 nz=`echo $z $deltaC $clen | awk '{
50 if(res>1.0) print res-1.0
51 else if(res<0.0) print res+1.0
55 $x $y $nz T T T" POSCAR.00-1
58 nz=`echo $z $deltaSi $clen | awk '{
60 if(res>1.0) print res-1.0
61 else if(res<0.0) print res+1.0
64 sed "s%$ltm%$x $y $nz $s1 $s2 $s3%" $file > POSCAR.001
65 nz=`echo $z $deltaC $clen | awk '{
67 if(res>1.0) print res-1.0
68 else if(res<0.0) print res+1.0
72 $x $y $nz T T T" POSCAR.001
75 ny=`echo $y $deltaSi $clen | awk '{
77 if(res>1.0) print res-1.0
78 else if(res<0.0) print res+1.0
81 sed "s%$ltm%$x $ny $z $s1 $s2 $s3%" $file > POSCAR.0-10
82 ny=`echo $y $deltaC $clen | awk '{
84 if(res>1.0) print res-1.0
85 else if(res<0.0) print res+1.0
89 $x $ny $z T T T" POSCAR.0-10
92 ny=`echo $y $deltaSi $clen | awk '{
94 if(res>1.0) print res-1.0
95 else if(res<0.0) print res+1.0
98 sed "s%$ltm%$x $ny $z $s1 $s2 $s3%" $file > POSCAR.010
99 ny=`echo $y $deltaC $clen | awk '{
101 if(res>1.0) print res-1.0
102 else if(res<0.0) print res+1.0
106 $x $ny $z T T T" POSCAR.010
109 nx=`echo $x $deltaSi $clen | awk '{
111 if(res>1.0) print res-1.0
112 else if(res<0.0) print res+1.0
115 sed "s%$ltm%$nx $y $z $s1 $s2 $s3%" $file > POSCAR.-100
116 nx=`echo $x $deltaC $clen | awk '{
118 if(res>1.0) print res-1.0
119 else if(res<0.0) print res+1.0
123 $nx $y $z T T T" POSCAR.-100
126 nx=`echo $x $deltaSi $clen | awk '{
128 if(res>1.0) print res-1.0
129 else if(res<0.0) print res+1.0
132 sed "s%$ltm%$nx $y $z $s1 $s2 $s3%" $file > POSCAR.100
133 nx=`echo $x $deltaC $clen | awk '{
135 if(res>1.0) print res-1.0
136 else if(res<0.0) print res+1.0
140 $nx $y $z T T T" POSCAR.100