From: hackbard Date: Mon, 13 Aug 2007 16:32:45 +0000 (+0200) Subject: visualization stuff X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e67bb08cb64bf21a6d4e7e8275007bdc5e769154;p=physik%2Fposic.git visualization stuff --- diff --git a/ppm2avi b/ppm2avi index 6987317..3680b80 100755 --- 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 bf33e16..be75aad 100644 --- 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); /* diff --git a/visualize b/visualize index f24e7b7..6255e89 100755 --- 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