]> hackdaworld.org Git - physik/posic.git/commitdiff
some checkins
authorhackbard <hackbard@sage.physik.uni-augsburg.de>
Tue, 23 Mar 2010 16:38:33 +0000 (17:38 +0100)
committerhackbard <hackbard@sage.physik.uni-augsburg.de>
Tue, 23 Mar 2010 16:38:33 +0000 (17:38 +0100)
vasp_tools/disp_calc
vasp_tools/search_bonds
vasp_tools/visualize_contcar

index 253226f74043ca7d09bc3ab50f46f013b0129d82..00ef43e377a36ecbf8db6bf1be1ba28244615136 100755 (executable)
@@ -126,10 +126,26 @@ results=`echo "$xa $ya $za $scale" | \
                Z1=ENVIRON["Z1"]; Z2=ENVIRON["Z2"]; Z3=ENVIRON["Z3"]
        }       
        {
-               X=sqrt(X1^2+X2^2+X3^2)*$4
-               Y=sqrt(Y1^2+Y2^2+Y3^2)*$4
-               Z=sqrt(Z1^2+Z2^2+Z3^2)*$4
-               print $1*X " " $2*Y " " $3*Z
+               X=sqrt(X1^2+X2^2+X3^2)
+               Y=sqrt(Y1^2+Y2^2+Y3^2)
+               Z=sqrt(Z1^2+Z2^2+Z3^2)
+               x=$1*X
+               if(x>1.0)
+                       x-=1.0;
+               if(x<-1.0)
+                       x+=1.0;
+               y=$2*Y
+               if(y>1.0)
+                       y-=1.0;
+               if(y<-1.0)
+                       y+=1.0;
+               z=$3*Z
+               if(z>1.0)
+                       z-=1.0;
+               if(z<-1.0)
+                       z+=1.0;
+
+               print x*$4 " " y*$4 " " z*$4
        }'`
 
 xi=`echo $results | awk '{ print $1 }'`
index 5fa2e93fc2a51e87663227c7284139c97b66c022..29b6d1c5c1200612581fb937aa382f9cd7cd8425 100755 (executable)
@@ -86,7 +86,7 @@ while [ "1" ]; do
                        yb=`echo $tmpb | awk '{ print $2 }'`
                        zb=`echo $tmpb | awk '{ print $3 }'`
 
-                       echo "$xa $ya $za $xb $yb $zb $scale $len $delta" | \
+                       echo "$xa $ya $za $xb $yb $zb $scale $len $delta $count $ic" | \
                        awk ' \
                        BEGIN {
                        dxt=0; dyt=0; dzt=0
@@ -122,6 +122,7 @@ while [ "1" ]; do
                        dist*=$7
                        if((dist>=($8-$9))&&(dist<=($8+$9))) {
                                print ""
+                               print "atoms: " $10 " - " $11
                                print $1 " " $2 " " $3
                                print $4 " " $5 " " $6 " (" dist " - " $8 ")"
                                print "displace: " dx*X " " dy*Y " " dz*Z
index 611ed6dd74b7f6f3984be43405dc99df7f6d0865..61ed14382264ab1c5b77bd9596023752d740e276 100755 (executable)
@@ -49,6 +49,7 @@ mx1=0; mx2=0; mx3=0;
 my1=0; my2=0; my3=0;
 mz1=0; mz2=0; mz3=0;
 ab=0
+sym=0
 
 # parse argv
 
@@ -81,6 +82,7 @@ while [ "$1" ]; do
                                        ((cnt+=1))
                                done
                                cutoff=$1;              shift 1;;
+               -s)             sym=$2;                 shift 2;;
                *)
                                echo "options:"
                                echo "########"
@@ -107,6 +109,9 @@ while [ "$1" ]; do
                                echo "  -l <x> <y> <z> (light source)"
                                echo "bonds:"
                                echo "  -ab <atom number> <cutoff> (auto bonds)"
+                               echo "symmetry:"
+                               echo "  -s <sym nr>"
+                               echo "     1: sym by <1 -1 0> at 1/4 <1 1 0>"
                                exit 1;;
        esac
 done
@@ -221,6 +226,8 @@ EOF
        
        export x0 y0 z0 x1 y1 z1 radius
 
+       export sym
+
        # atoms
        ((count=1))
        checktsd=`sed -n 7p $file | awk '{ print $1 }'`
@@ -263,6 +270,7 @@ EOF
                        Z1=ENVIRON["Z1"]; Z2=ENVIRON["Z2"]; Z3=ENVIRON["Z3"];
                        radius=ENVIRON["radius"]; scale=ENVIRON["scale"];
                        color=ENVIRON["color"]
+                       sym=ENVIRON["sym"]
                        x=0; y=0; z=0;
                        xt=0; yt=0; zt=0;
                        i=0; j=0; k=0;
@@ -274,6 +282,15 @@ EOF
 
                        nx=$1+i; ny=$2+j; nz=$3+k;
 
+                       if(sym==1) {
+                               xt=nx-1.0/12.0;
+                               yt=ny-1.0/12.0;
+                               nx=-yt;
+                               ny=-xt;
+                               nx+=1.0/12.0;
+                               ny+=1.0/12.0;
+                       }
+
                        xt=nx*X1+ny*Y1+nz*Z1;
                        yt=nx*X2+ny*Y2+nz*Z2;
                        zt=nx*X3+ny*Y3+nz*Z3;
@@ -347,6 +364,7 @@ EOF
                        Y1=ENVIRON["Y1"]; Y2=ENVIRON["Y2"]; Y3=ENVIRON["Y3"];
                        Z1=ENVIRON["Z1"]; Z2=ENVIRON["Z2"]; Z3=ENVIRON["Z3"];
                        bcr=ENVIRON["bcr"]; scale=ENVIRON["scale"];
+                       sym=ENVIRON["sym"];
                        }
                        {
                                for(i=-1;i<=1;i++) {
@@ -358,6 +376,16 @@ EOF
                                                for(ik=-1;ik<=1;ik++) {
        
                                nx=$1+i; ny=$2+j; nz=$3+k;
+
+                               if(sym==1) {
+                                       xt=nx-1.0/12.0;
+                                       yt=ny-1.0/12.0;
+                                       nx=-yt;
+                                       ny=-xt;
+                                       nx+=1.0/12.0;
+                                       ny+=1.0/12.0;
+                               }
+
                                xt=nx*X1+ny*Y1+nz*Z1;
                                yt=nx*X2+ny*Y2+nz*Z2;
                                zt=nx*X3+ny*Y3+nz*Z3;
@@ -369,6 +397,16 @@ EOF
                                   (xt<=x1)&&(yt<=y1)&&(zt<=z1)) {
 
                                inx=$4+ii; iny=$5+ij; inz=$6+ik;
+
+                               if(sym==1) {
+                                       ixt=inx-1.0/12.0;
+                                       iyt=iny-1.0/12.0;
+                                       inx=-iyt;
+                                       iny=-ixt;
+                                       inx+=1.0/12.0;
+                                       iny+=1.0/12.0;
+                               }
+
                                ixt=inx*X1+iny*Y1+inz*Z1;
                                iyt=inx*X2+iny*Y2+inz*Z2;
                                izt=inx*X3+iny*Y3+inz*Z3;
@@ -378,6 +416,9 @@ EOF
 
                                dist=sqrt((xt-ixt)^2+(yt-iyt)^2+(zt-izt)^2);
 
+                               if((ixt>=x0)&&(iyt>=y0)&&(izt>=z0)&&\
+                                  (ixt<=x1)&&(iyt<=y1)&&(izt<=z1)) {
+
                                #if((xt>=x0)&&(yt>=y0)&&(zt>=z0)&&\
                                #   (xt<=x1)&&(yt<=y1)&&(zt<=z1)) {
                                        if(dist<=$7) {
@@ -389,6 +430,8 @@ EOF
                                        }
                                #}
 
+                               }
+
                                }
        
                                                }