Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /tests/lamont-tests/unit-sphere-go.sh
ViewVC logotype

View of /tests/lamont-tests/unit-sphere-go.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4652 - (download) (as text) (annotate)
Wed Sep 28 17:57:14 2016 UTC (2 years, 10 months ago) by glk
File size: 1307 byte(s)
3D particle system
#!/bin/bash
set -o errexit
set -o nounset
shopt -s expand_aliases
JUNK=""
function junk {
  JUNK="$JUNK $@"
}
function cleanup {
  rm -rf $JUNK
}
trap cleanup err exit int term

export NRRD_STATE_VERBOSE_IO=0

PROG=unit-sphere


NN=1
RNG=1
echo "0 0 0 0 0 0" | unu reshape -s 3 2 | unu resample -s = $NN | unu 1op nrand -s $RNG -o vec3.nrrd
unu project -i vec3.nrrd -a 0 -m l2 | unu axinsert -a 0 -s 3 | unu 2op / vec3.nrrd - -o vec3.nrrd

/Users/gk/diderot/diderot/branches/vis15/bin/diderotc -g --double --exec $PROG.diderot

rm -f phi-???.nrrd
rm -f jh-???.png

   unu dice -i vec3.nrrd -a 0 -o ./
   unu 2op gt 2.nrrd 0 | unu 2op x - 2.2 | unu 2op + - 0.nrrd |
   unu jhisto -i - 1.nrrd -min -1.1 -1.1 -max 3.3 1.1 -b 1200 600 -t float |
     unu resample -s x1 x1 -k gauss:1.5,3 | unu quantize -b 8 -min 0 -max 0.02 -o jh-000.png

#I=1
for I in $(seq 1 200); do
   III=$(printf "%03d" $I)
   echo $III
   #valgrind \
   ./$PROG -initPos vec3.nrrd -iterMax $I -rad 0.35 -pcp 2 -noDie true -o pos.nrrd;
   unu dice -i pos.nrrd -a 0 -o ./
   unu 2op gt 2.nrrd 0 | unu 2op x - 2.2 | unu 2op + - 0.nrrd |
   unu jhisto -i - 1.nrrd -min -1.1 -1.1 -max 3.3 1.1 -b 1200 600 -t float |
     unu resample -s x1 x1 -k gauss:1.5,3 | unu quantize -b 8 -min 0 -max 0.02 -o jh-$III.png
done
junk 0.nrrd 1.nrrd 2.nrrd

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0