]> hackdaworld.org Git - physik/posic.git/commitdiff
visualization stuff
authorhackbard <hackbard@sage.physik.uni-augsburg.de>
Mon, 13 Aug 2007 16:32:45 +0000 (18:32 +0200)
committerhackbard <hackbard@sage.physik.uni-augsburg.de>
Mon, 13 Aug 2007 16:32:45 +0000 (18:32 +0200)
ppm2avi
sic.c
visualize

diff --git a/ppm2avi b/ppm2avi
index 6987317414dcb383a7d51e5e602a5f58b543a169..3680b807798583e662ba455524648a0abde6c904 100755 (executable)
--- a/ppm2avi
+++ b/ppm2avi
@@ -2,4 +2,7 @@
 #      convert $i $1/$(basename $i ppm)png
 #done
 
-mencoder mf://$1/*.png -ovc copy -o $1/md.avi >/dev/null 2>&1
+OUTFILE=md.avi
+[ -n "$2" ] && OUTFILE=$2
+
+mencoder mf://$1/*.png -ovc copy -o $1/$OUTFILE >/dev/null 2>&1
diff --git a/sic.c b/sic.c
index bf33e1634f95ac9a62c6a2256f0a69568de70188..be75aad2692ecfccf9a67b3411b34cf04e7013cf 100644 (file)
--- a/sic.c
+++ b/sic.c
@@ -26,8 +26,8 @@
 #define R_C            1.0
 #define T_C            10.0
 #define LCNT           5
-#define PRERUN         200
-#define POSTRUN                500
+#define PRERUN         500
+#define POSTRUN                1000
 
 typedef struct s_hp {
        int a_count;    /* atom count */
@@ -361,8 +361,8 @@ int main(int argc,char **argv) {
        moldyn_set_log(&md,LOG_TOTAL_ENERGY,1);
        moldyn_set_log(&md,LOG_TEMPERATURE,1);
        moldyn_set_log(&md,LOG_PRESSURE,1);
-       moldyn_set_log(&md,VISUAL_STEP,100);
-       moldyn_set_log(&md,SAVE_STEP,100);
+       moldyn_set_log(&md,VISUAL_STEP,10);
+       moldyn_set_log(&md,SAVE_STEP,10);
        moldyn_set_log(&md,CREATE_REPORT,0);
 
        /*
index f24e7b76490b011ef4766078ab190eaf586f316c..6255e89e95af46f95fc9af50f9e1ca3b6cc052c8 100755 (executable)
--- a/visualize
+++ b/visualize
@@ -5,6 +5,18 @@
 # author: frank.zirkelbach@physik.uni-augsburg.de
 #
 
+# help function
+draw_cyl() {
+       cat >> temp.pov <<-EOF
+cylinder {
+<$1, $3, $2>, <$4, $6, $5>, 0.05
+pigment { color White }
+}
+EOF
+}
+
+       
+
 directory="doesnt_exist____for_sure"
 width="1024"
 height="768"
@@ -45,7 +57,7 @@ while [ "$1" ]; do
                                exit 1;;
        esac
 done
-               
+
 if [ ! -d $directory ] ; then
        echo "no valid directory"
        exit 1
@@ -76,8 +88,8 @@ EOF
                export x0 y0 z0 x1 y1 z1 radius
                cat $file | grep -v '#' | awk '\
                BEGIN {
-                       x0=ENVIRON["x0"]; y0==ENVIRON["y0"]; z0==ENVIRON["z0"];
-                       x1=ENVIRON["x1"]; y0==ENVIRON["y1"]; z0==ENVIRON["z1"];
+                       x0=ENVIRON["x0"]; y0=ENVIRON["y0"]; z0=ENVIRON["z0"];
+                       x1=ENVIRON["x1"]; y1=ENVIRON["y1"]; z1=ENVIRON["z1"];
                        radius=ENVIRON["radius"];
                }
                {
@@ -85,7 +97,7 @@ EOF
                           ($2<=x1)&&($3<=y1)&&($4<=z1)) {
                                print "sphere { <"$2","$4","$3">, "radius" ";
                                print "texture { pigment { color "$5" } ";
-                               print "finish { phong 1, metallic } } }";
+                               print "finish { phong 1 metallic } } }";
                        }
                }' >> temp.pov
        else
@@ -115,6 +127,22 @@ pigment { color White }
 }
 EOF
        done
+       else
+               # manually drawing the 3x4 boundaries ...
+               draw_cyl $x0 $y0 $z0 $x1 $y0 $z0
+               draw_cyl $x0 $y0 $z0 $x0 $y1 $z0
+               draw_cyl $x1 $y1 $z0 $x1 $y0 $z0
+               draw_cyl $x0 $y1 $z0 $x1 $y1 $z0
+
+               draw_cyl $x0 $y0 $z1 $x1 $y0 $z1
+               draw_cyl $x0 $y0 $z1 $x0 $y1 $z1
+               draw_cyl $x1 $y1 $z1 $x1 $y0 $z1
+               draw_cyl $x0 $y1 $z1 $x1 $y1 $z1
+
+               draw_cyl $x0 $y0 $z1 $x0 $y0 $z0
+               draw_cyl $x0 $y1 $z1 $x0 $y1 $z0
+               draw_cyl $x1 $y0 $z1 $x1 $y0 $z0
+               draw_cyl $x1 $y1 $z1 $x1 $y1 $z0
        fi
 
        # add camera and light source