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

SCM Repository

[diderot] View of /branches/charisee/ertest/vispaper/viso3d/resamp.diderot
ViewVC logotype

View of /branches/charisee/ertest/vispaper/viso3d/resamp.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2911 - (download) (annotate)
Mon Mar 2 21:43:27 2015 UTC (4 years, 4 months ago) by glk
File size: 2146 byte(s)
tweaks
/*

to run:

../../../bin/diderotc resamp.diderot \
 && ./resamp \
 && unu reshape -i resamp.txt -s 30 30 30 | \
    unu dnorm -o tmp.nrrd \
 && unu minmax tmp.nrrd

BUG1 line won't compile

BUG2 line should lead to "unu minmax tmp.nrrd" output of min,max ~= 1.0

*/

int sz0 = 30;
int sz1 = 30;
int sz2 = 30;
real width = 2;
vec3 spc = [width/(sz0-1), width/(sz1-1), width/(sz2-1)];

vec3 pp = [0.0,0.0,0.0];
vec3 xdir = [spc[0], 0.0, 0.0];
vec3 ydir = [0.0, spc[1], 0.0];
vec3 zdir = [0.0, 0.0, spc[2]];
vec3 orig = -(xdir*(sz0-1) + ydir*(sz1-1) + zdir*(sz2-1))/2;

field#2(3)[3] V= bspln3 ⊛ load("helix0.nrrd");
//field#2(3)[3] V= bspln3 ⊛ image("helix0.nrrd"); // for compiling with vis12 branch

// BUG1: does not compile (• not lifted)
field#1(3)[] func= [0,0,1]•(∇×V);

// BUG2: does compile, but values can't be right (not in range [-1,1]); maybe related to resamp-cnm.diderot?
//field#1(3)[] func= (V•(∇×V))/(|∇×V|*|V|);

// (seem ok) __________________________________
//field#1(3)[] func= |V|;  // compiles
//field#1(3)[] func= |∇×V|; // compiles
//field#1(3)[] func= V•(∇×V); // helicity (non-normalized) compiles
//field#1(3)[] func= |V|*|∇×V|; // does not compile (different differentiabilities in * operands)
//field#1(3)[] func= |∇×V|*|V|; // ah ha- *does* compile!
// (seem ok) """"""""""""""""""""""""""""""""""


strand sample(int xi, int yi, int zi) {
  output real vv = 0;
  update {
    vec3 p  = orig + xi*xdir + yi*ydir + zi*zdir;
    vv = func(p);
    // ----------- these are here for GLK's debugging
    //vv = (V(p))•(∇×V(p)); // to generate volume to double-check hiso3d
    //vv = func(p)/(|V(p)|*|∇×V(p)|); // hack for normalized helicity
    //vv = (∇×V(p))[2]; // to pick off components of curl
    //vv = (V(p)/|V(p)|) • ((∇×V(p))/(|∇×V(p)|));  // alternate expression of normalized helicity
    //vv = (V(p)/|V(p)|);  // testing vector normalization
    //vv = |(∇×V(p))/(|∇×V(p)|)|; // BUG: says length is 0.3333 ... (see resamp-cnm.diderot)
    stabilize;
  }
}
initially [ sample(xi, yi, zi) | zi in 0..(sz2-1), yi in 0..(sz1-1), xi in 0..(sz0-1) ];

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