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

SCM Repository

[diderot] View of /branches/vis15/src/tests/synthetic/field_slice/slice_v2d3.diderot
ViewVC logotype

View of /branches/vis15/src/tests/synthetic/field_slice/slice_v2d3.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4218 - (download) (annotate)
Fri Jul 15 17:06:43 2016 UTC (3 years, 2 months ago) by cchiw
File size: 1669 byte(s)
added grad_inner_d2 program
// data for field v2d3.nrrd
//def v1(x,y,z):
//...     return 5*x+7*x*y+z*8*y*y+ z*z*3*y*y
// def v2(x,y,z):
//...     return (2*y*x*x) + (5*y*y*x*x)+z+(z*z*9*y*y*x*x)

//>>> def def_grad_axis0(x,y,z):
//...     return [5+7*y, 7*x+z*8*2*y+z*z*3*y*2,8*y*y+2*z*3*y*y]


//>>> def def_grad_axis1(x,y,z):
//...     return [(2*y*2*x) + (5*y*y*2*x)+(z*z*9*y*y*2*x),(2*x*x) + (5*2*y*x*x)+(z*z*9*2*y*x*x),  1+(2*z*9*y*y*x*x)]

field#1(3)[2] f = image("v2d3.nrrd") ⊛ c4hexic;
field#1(3)[] fx =f[0];
field#1(3)[] fy =f[1];
field#0(3)[3] gx =∇fx;
field#0(3)[3] gy =∇fy;

int imgSize = 10;

strand fieldTest (int xi, int yi, int zi) {

    real xx = lerp(-0.5, 0.5, -0, xi, imgSize-0);
    real yy = lerp(-0.5, 0.5, -0, yi, imgSize-0);
    real zz = lerp(-0.5, 0.5, -0, zi, imgSize-0);
   // tensor[3] pos = [xx, yy, zz];
    tensor[3] pos =[ 0.0, 0.1, 0.2];

      // output tensor [2] out = [99,99];
     // output tensor [] out = 99;
    output tensor [3] out =  [99, 99, 99];
     //output tensor [6] out =  [99, 99, 99, 99, 99, 99];
     update
        {
            if(inside(pos,f)){
                // out = [pos[0],pos[1],pos[2]];
                //out = f(pos);
                // out = [f(pos)[0],f(pos)[1],3];
                // out = fx(pos);
                // out = fy(pos);
                // out = [fx(pos), fy(pos)];
               // out = [pos[0],pos[1],pos[2],gx(pos)[0],gx(pos)[1],gx(pos)[2]];
                //out = [pos[0],pos[1],pos[2],gy(pos)[0],gy(pos)[1],gy(pos)[2]];
                out = gx(pos);
            }

        stabilize;
    }
}
initially [ fieldTest(xi, yi, zi) |  zi in 0..(imgSize-1), yi in 0..(imgSize-1), xi in 0..(imgSize-1)];


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