From: hackbard Date: Tue, 22 Sep 2009 15:37:22 +0000 (+0200) Subject: mirror feature + new std vis X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f17f94afdc7977c7e16528a0b09a74ec2bf95124;p=physik%2Fposic.git mirror feature + new std vis --- diff --git a/vasp_tools/stdvis b/vasp_tools/stdvis index ceb7e1a..8a4d86e 100755 --- a/vasp_tools/stdvis +++ b/vasp_tools/stdvis @@ -11,6 +11,8 @@ else type=$2 fi +if [ "$type" != "disp" ]; then + for i in $1/video*; do @@ -18,7 +20,7 @@ for i in $1/video*; do if [ "$type" = "default" -o "$type" = "1" ]; then echo "type: 1 no rotation" ./visualize -w 640 -h 480 -d $i \ - -nll -0.20 -0.20 -0.20 -fur 1.20 1.20 1.20 \ + -nll -0.20 -0.20 -0.50 -fur 1.20 1.20 1.20 \ -b 0.0 0.0 0.0 1.0 1.0 1.0 \ -c 0.8 -1.7 0.9 -L 0.5 -1.0 0.5 \ -r 0.6 @@ -34,6 +36,16 @@ echo "type: 3 no rotation" -r 0.6 fi +# unti cell 3,0,2 +if [ "$type" = "3x2z" ]; then +echo "type: 3x2z no rotation" +./visualize -w 640 -h 480 -d $i \ + -nll 1.8 -0.2 0.8 -fur 3.20 1.20 2.20 \ + -b 2.0 0.0 1.0 3.0 1.0 2.0 \ + -c 2.3 -3.7 2.4 -L 1.5 -1.0 1.5 \ + -r 0.6 +fi + # first unit cell rotated by 45 degrees about z-axis if [ "$type" = "1r" ]; then echo "type: 1 rotated" @@ -44,20 +56,44 @@ echo "type: 1 rotated" #-b 0.0 0.0 0.0 0.0 0.0 1.0 \ fi -# 100 db in type 1 sc (insdide sc) -#for i in $1/video/atomic_conf_*.xyz; do -# displace=`echo $i | awk -F_ '{ print $5 }' | sed 's/\.xyz//'` -#echo "$i $displace ..." -#./visualize -w 640 -h 480 -d $i \ -# -nll 1.44 -0.56 0.84 -fur 2.56 0.56 2.06 \ -# -b 1.5 -0.5 1.0 2.5 0.5 2.0 \ -# -c 2.1 -2.0 1.6 -L 2.0 0 1.5 \ -# -r 0.6 -B 0.1 -D $displace -#done +# first unit cell displaying mirrored atoms +if [ "$type" = "1m" ]; then +echo "type: 1 no rotation, mirrored" +./visualize -w 640 -h 480 -d $i \ + -nll -0.20 -0.20 -0.50 -fur 1.20 1.20 1.20 \ + -b 0.0 0.0 0.0 1.0 1.0 1.0 \ + -c 0.8 -1.7 0.9 -L 0.5 -1.0 0.5 \ + -r 0.6 -m 2.0 -2.0 0.0 2.0 2.0 0.0 0.0 0.0 3.0 +fi + +# three unit cells in each direction displaying mirrored atoms +if [ "$type" = "3m" ]; then +echo "type: 3 no rotation, mirrored" +./visualize -w 640 -h 480 -d $i \ + -nll -0.20 -0.20 -0.20 -fur 3.20 3.20 3.20 \ + -b 0.0 0.0 0.0 3.0 3.0 3.0 \ + -c 1.3 -3.7 2.4 -L 1.5 -1.0 1.5 \ + -r 0.6 -m 2.0 -2.0 0.0 2.0 2.0 0.0 0.0 0.0 3.0 +fi ./ppm2avi $i done +else + +# 100 db in type 1 sc (insdide sc) +for i in $1/video/atomic_conf_*.xyz; do + displace=`echo $i | awk -F_ '{ print $7 }' | sed 's/\.xyz//'` + echo "$i $displace ..." +./visualize -w 640 -h 480 -d $i \ + -nll -0.20 -0.20 -0.50 -fur 1.20 1.20 1.20 \ + -b 0.0 0.0 0.0 1.0 1.0 1.0 \ + -c 0.8 -1.7 0.9 -L 0.5 -1.0 0.5 \ + -r 0.6 -B 0.1 -D $displace -m 2.0 -2.0 0.0 2.0 2.0 0.0 0.0 0.0 3.0 +done + +fi + #mplayer $1/video/md.avi diff --git a/vasp_tools/visualize b/vasp_tools/visualize index 74b352b..8d1e98f 100755 --- a/vasp_tools/visualize +++ b/vasp_tools/visualize @@ -41,6 +41,10 @@ bcr=""; clx="0"; cly="0"; clz="0"; extra=0 displace="" +mirror=0 +mx1=0; mx2=0; mx3=0; +my1=0; my2=0; my3=0; +mz1=0; mz2=0; mz3=0; # parse argv @@ -62,6 +66,11 @@ while [ "$1" ]; do -C) lc=$2; shift 2;; -e) extra=1; shift 1;; -D) displace=$2; shift 2;; + -m) mx1=$2; mx2=$3; mx3=$4; + my1=$5; my2=$6; my3=$7; + mz1=$8; mz2=$9; mz3=${10}; + mirror=1; shift 10;; + *) echo "options:" echo "########" @@ -75,6 +84,7 @@ while [ "$1" ]; do echo " -B " echo "unit cell:" echo " -C " + echo " -m (mirror atoms)" echo "visualization volume:" echo " -nll (near lower left)" echo " -fur (far upper right)" @@ -92,7 +102,7 @@ done # calculation from lattic eunits to angstroms [ "$lc" = "sic" ] && lc=4.359 -[ "$lc" = "si" ] && lc=5.429 +[ "$lc" = "si" ] && lc=5.480 [ "$lc" = "c" ] && lc=3.566 #offset=`echo 0.125 \* $lc | bc` @@ -105,6 +115,16 @@ x1=`echo $x1 \* $lc + $offset | bc` y1=`echo $y1 \* $lc + $offset | bc` z1=`echo $z1 \* $lc + $offset | bc` +mx1=`echo $mx1 \* $lc + $offset | bc` +my1=`echo $my1 \* $lc + $offset | bc` +mz1=`echo $mz1 \* $lc + $offset | bc` +mx2=`echo $mx2 \* $lc + $offset | bc` +my2=`echo $my2 \* $lc + $offset | bc` +mz2=`echo $mz2 \* $lc + $offset | bc` +mx3=`echo $mx3 \* $lc + $offset | bc` +my3=`echo $my3 \* $lc + $offset | bc` +mz3=`echo $mz3 \* $lc + $offset | bc` + clx=`echo $clx \* $lc + $offset | bc` cly=`echo $cly \* $lc + $offset | bc` clz=`echo $clz \* $lc + $offset | bc` @@ -165,25 +185,25 @@ EOF #echo "-----> $x0 $y0 $z0 $x1 $y1 $z1 <-----" if [ -n "$x0" ]; then export x0 y0 z0 x1 y1 z1 radius extra + export mx1 mx2 mx3 + export my1 my2 my3 + export mz1 mz2 mz3 + export mirror cat $file | grep -v '#' | awk '\ BEGIN { x0=ENVIRON["x0"]; y0=ENVIRON["y0"]; z0=ENVIRON["z0"]; x1=ENVIRON["x1"]; y1=ENVIRON["y1"]; z1=ENVIRON["z1"]; + mx1=ENVIRON["mx1"]; my1=ENVIRON["my1"]; + mz1=ENVIRON["mz1"]; mx2=ENVIRON["mx2"]; + my2=ENVIRON["my2"]; mz2=ENVIRON["mz2"]; + mx3=ENVIRON["mx3"]; my3=ENVIRON["my3"]; + mz3=ENVIRON["mz3"]; mirror=ENVIRON["mirror"]; radius=ENVIRON["radius"]; extra=ENVIRON["extra"]; + nx=0; ny=0; nz=0; } { -# print "----> " x0 " " y0 " " z0 " " $2 " " $3 " " $4 -# print "----> " x1 " " y1 " " z1 " " $2 " " $3 " " $4 -#if(($2>=x0)) print $2 " groesser " x0 -#if(($3>=y0)) print $3 " groesser " y0 -#if(($4>=z0)) print $4 " groesser " z0 -#if(($2<=x1)) print $2 " kleiner " x1 -#if(($3<=y1)) print $3 " kleiner " y1 -#if(($4<=z1)) print $4 " kleiner " z1 if(($2>=x0)&&($3>=y0)&&($4>=z0)&&\ ($2<=x1)&&($3<=y1)&&($4<=z1)) { -# if(($2<=x0)&&($3<=y0)&&($4<=z0)&&\ -# ($2>=x1)&&($3>=y1)&&($4>=z1)) { print "sphere { <"$2","$4","$3">, "radius" "; if(extra) print "texture { pigment { color rgb<"$6/4.4",0,"1-$6/4.4"> } "; @@ -191,6 +211,43 @@ EOF print "texture { pigment { color "$5" } "; print "finish { phong 1 metallic } } }"; } + + if(mirror) { + + nx=$2-mx1; ny=$3-mx2; nz=$4-mx3; + if((nx>=x0)&&(ny>=y0)&&(nz>=z0)&&\ + (nx<=x1)&&(ny<=y1)&&(nz<=z1)) { +print "// translation: "$2/5.480" "$3/5.480" "$4/5.480" -> "nx/5.480" "ny/5.480" "nz/5.480" ..."; + print "sphere { <"nx","nz","ny">, "radius" "; + if(extra) + print "texture { pigment { color rgb<"$6/4.4",0,"1-$6/4.4"> } "; + else + print "texture { pigment { color "$5" } "; + print "finish { phong 1 metallic } } }"; + } + nx=$2-my1; ny=$3-my2; nz=$4-my3; + if((nx>=x0)&&(ny>=y0)&&(nz>=z0)&&\ + (nx<=x1)&&(ny<=y1)&&(nz<=z1)) { + print "sphere { <"nx","nz","ny">, "radius" "; + if(extra) + print "texture { pigment { color rgb<"$6/4.4",0,"1-$6/4.4"> } "; + else + print "texture { pigment { color "$5" } "; + print "finish { phong 1 metallic } } }"; + } + nx=$2-mz1; ny=$3-mz2; nz=$4-mz3; + if((nx>=x0)&&(ny>=y0)&&(nz>=z0)&&\ + (nx<=x1)&&(ny<=y1)&&(nz<=z1)) { + print "sphere { <"nx","nz","ny">, "radius" "; + if(extra) + print "texture { pigment { color rgb<"$6/4.4",0,"1-$6/4.4"> } "; + else + print "texture { pigment { color "$5" } "; + print "finish { phong 1 metallic } } }"; + } + + } + }' >> temp.pov else cat $file | grep -v '#' | while read name x y z color temp; do