X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=vasp_tools%2Fvisualize_contcar;h=611ed6dd74b7f6f3984be43405dc99df7f6d0865;hb=83fc5a2dccab15ccce5a579ca4b4975c4614e816;hp=d272d181ab23c450fc4978e6f2922d4696277c28;hpb=8d4b140464e036fe920497805d47cf53b28eeeb2;p=physik%2Fposic.git diff --git a/vasp_tools/visualize_contcar b/vasp_tools/visualize_contcar index d272d18..611ed6d 100755 --- a/vasp_tools/visualize_contcar +++ b/vasp_tools/visualize_contcar @@ -223,10 +223,23 @@ EOF # atoms ((count=1)) - ((offset=8)) + checktsd=`sed -n 7p $file | awk '{ print $1 }'` + if [ "$checktsd" = "Transformed" ]; then + ((offset=9)) + echo "tsd: yes, offset = $offset" + # but maybe not + checkmore=`sed -n 8p $file | awk '{ print $1 }'` + if [ "$checkmore" = "Direct" ]; then + ((offset=8)) + echo "tsd: yes, but anyways using offset $offset" + fi + else + ((offset=8)) + echo "tsd: no, offset = $offset" + fi while [ "1" ]; do - echo -en "$count " + [ $count -gt $ntot ] && break if [ $count -le $nsi ]; then color="Yellow" @@ -241,7 +254,7 @@ EOF y=`echo $line | awk '{ print $2 }'` z=`echo $line | awk '{ print $3 }'` - echo $x $y $z | awk '\ + echo $x $y $z $count | awk '\ BEGIN { x0=ENVIRON["x0"]; y0=ENVIRON["y0"]; z0=ENVIRON["z0"]; x1=ENVIRON["x1"]; y1=ENVIRON["y1"]; z1=ENVIRON["z1"]; @@ -271,6 +284,7 @@ EOF if((xt>=x0)&&(yt>=y0)&&(zt>=z0)&&\ (xt<=x1)&&(yt<=y1)&&(zt<=z1)) { + print "// atom " $4; print "sphere { <"xt","zt","yt">, "radius" "; print "texture { pigment { color " color " } "; print "finish { phong 1 metallic } } }"; @@ -283,6 +297,7 @@ EOF # see, whether there are bonds to draw if [ "$ab" = "0" ]; then + echo -en "$count " ((count+=1)) continue fi @@ -297,9 +312,12 @@ EOF ((cnt+=1)) done if [ "$ab" = "-1" ]; then - dobond=yes + if [ -n "`grep \/\/\ atom\ $count temp.pov`" ]; then + dobond=yes + fi fi if [ "$dobond" = "no" ]; then + echo -en "$count " ((count+=1)) continue; fi @@ -347,6 +365,9 @@ EOF yt*=scale; zt*=scale; + if((xt>=x0)&&(yt>=y0)&&(zt>=z0)&&\ + (xt<=x1)&&(yt<=y1)&&(zt<=z1)) { + inx=$4+ii; iny=$5+ij; inz=$6+ik; ixt=inx*X1+iny*Y1+inz*Z1; iyt=inx*X2+iny*Y2+inz*Z2; @@ -357,8 +378,8 @@ EOF dist=sqrt((xt-ixt)^2+(yt-iyt)^2+(zt-izt)^2); - if((xt>=x0)&&(yt>=y0)&&(zt>=z0)&&\ - (xt<=x1)&&(yt<=y1)&&(zt<=z1)) { + #if((xt>=x0)&&(yt>=y0)&&(zt>=z0)&&\ + # (xt<=x1)&&(yt<=y1)&&(zt<=z1)) { if(dist<=$7) { print "cylinder {"; print "<"xt","zt","yt">,"; @@ -366,6 +387,8 @@ EOF print "pigment { color Blue }"; print "}"; } + #} + } } @@ -381,6 +404,7 @@ EOF done + echo -en "[$count] " ((count+=1)) [ $count -gt $ntot ] && break; @@ -389,6 +413,7 @@ EOF echo # manually drawing the 3x4 boundaries specified by argv ... + if [ -n "$bx0" ]; then draw_cyl $bx0 $by0 $bz0 $bx1 $by0 $bz0 draw_cyl $bx0 $by0 $bz0 $bx0 $by1 $bz0 draw_cyl $bx1 $by1 $bz0 $bx1 $by0 $bz0 @@ -403,6 +428,7 @@ EOF draw_cyl $bx0 $by1 $bz1 $bx0 $by1 $bz0 draw_cyl $bx1 $by0 $bz1 $bx1 $by0 $bz0 draw_cyl $bx1 $by1 $bz1 $bx1 $by1 $bz0 + fi # add camera and light source cat >> temp.pov <<-EOF