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

SCM Repository

[diderot] Diff of /branches/ein16/synth/d2/symb/symb_fm3x3d3.diderot
ViewVC logotype

Diff of /branches/ein16/synth/d2/symb/symb_fm3x3d3.diderot

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4455, Wed Aug 24 23:39:30 2016 UTC revision 4456, Thu Aug 25 04:03:27 2016 UTC
# Line 31  Line 31 
31  input vec3 axis ("axis (non-normalized) of rotation of sampling grid") = [1,1,1];  input vec3 axis ("axis (non-normalized) of rotation of sampling grid") = [1,1,1];
32  input real angle ("angle (in degrees) of rotation of sampling grid") = 0;  input real angle ("angle (in degrees) of rotation of sampling grid") = 0;
33  input vec3 off ("translation offset, in index space, from origin-centered grid") = [0,0,0];  input vec3 off ("translation offset, in index space, from origin-centered grid") = [0,0,0];
34    
35  input vec3 parm0 ("parameters that functions may use") = [0,0,0];  input vec3 parm0 ("parameters that functions may use") = [0,0,0];
36  input vec3 parm1 ("more parameters that functions may use") = [0,0,0];  input vec3 parm1 ("more parameters that functions may use") = [0,0,0];
37  input vec3 parm2 ("even more parameters that functions may use") = [0,0,0];  input vec3 parm2 ("even more parameters that functions may use") = [0,0,0];
# Line 64  Line 65 
65  vec3 orig = -(edge0*(sz0-1) + edge1*(sz1-1) + edge2*(sz2-1))/2 + offws;  vec3 orig = -(edge0*(sz0-1) + edge1*(sz1-1) + edge2*(sz2-1))/2 + offws;
66    
67  //-- field defined by coefficients --  //-- field defined by coefficients --
68  // z=1  input tensor[4] setA1_z0 =[0,0,0,0];
69  input vec2 base1_z0 = [0, 0];    // b*x, c*y  input tensor[4] setB1_z0 =[0,0,0,0];
70  input vec2 xsq1_z0 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setC1_z0 =[0,0,0,0];
71  input vec2 ysq1_z0 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setD1_z0 =[0,0,0,0];
72  input vec3 diag1_z0 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
73  // z=z  input tensor[4] setA1_z1 =[0,0,0,0];
74  input vec2 base1_z1 = [0, 0];    // b*x, c*y  input tensor[4] setB1_z1 =[0,0,0,0];
75  input vec2 xsq1_z1 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setC1_z1 =[0,0,0,0];
76  input vec2 ysq1_z1 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setD1_z1 =[0,0,0,0];
77  input vec3 diag1_z1 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
78  // z=z*z  input tensor[4] setA1_z2 =[0,0,0,0];
79  input vec2 base1_z2 = [0, 0];    // b*x, c*y  input tensor[4] setB1_z2 =[0,0,0,0];
80  input vec2 xsq1_z2 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setC1_z2 =[0,0,0,0];
81  input vec2 ysq1_z2 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setD1_z2 =[0,0,0,0];
82  input vec3 diag1_z2 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
83    
84  // z=1  input tensor[4] setA2_z0 =[0,0,0,0];
85  input vec2 base2_z0 = [0, 0];    // b*x, c*y  input tensor[4] setB2_z0 =[0,0,0,0];
86  input vec2 xsq2_z0 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setC2_z0 =[0,0,0,0];
87  input vec2 ysq2_z0 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setD2_z0 =[0,0,0,0];
88  input vec3 diag2_z0 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  input tensor[4] setA2_z1 =[0,0,0,0];
89  // z=z  input tensor[4] setB2_z1 =[0,0,0,0];
90  input vec2 base2_z1 = [0, 0];    // b*x, c*y  input tensor[4] setC2_z1 =[0,0,0,0];
91  input vec2 xsq2_z1 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setD2_z1 =[0,0,0,0];
92  input vec2 ysq2_z1 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setA2_z2 =[0,0,0,0];
93  input vec3 diag2_z1 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  input tensor[4] setB2_z2 =[0,0,0,0];
94  // z=z*z  input tensor[4] setC2_z2 =[0,0,0,0];
95  input vec2 base2_z2 = [0, 0];    // b*x, c*y  input tensor[4] setD2_z2 =[0,0,0,0];
96  input vec2 xsq2_z2 = [0, 0];     // d*x^2, g*y*x^2  
97  input vec2 ysq2_z2 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setA3_z0 =[0,0,0,0];
98  input vec3 diag2_z2 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  input tensor[4] setB3_z0 =[0,0,0,0];
99    input tensor[4] setC3_z0 =[0,0,0,0];
100    input tensor[4] setD3_z0 =[0,0,0,0];
101  // z=1  input tensor[4] setA3_z1 =[0,0,0,0];
102  input vec2 base3_z0 = [0, 0];    // b*x, c*y  input tensor[4] setB3_z1 =[0,0,0,0];
103  input vec2 xsq3_z0 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setC3_z1 =[0,0,0,0];
104  input vec2 ysq3_z0 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setD3_z1 =[0,0,0,0];
105  input vec3 diag3_z0 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  input tensor[4] setA3_z2 =[0,0,0,0];
106  // z=z  input tensor[4] setB3_z2 =[0,0,0,0];
107  input vec2 base3_z1 = [0, 0];    // b*x, c*y  input tensor[4] setC3_z2 =[0,0,0,0];
108  input vec2 xsq3_z1 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setD3_z2 =[0,0,0,0];
109  input vec2 ysq3_z1 = [0, 0];     // f*y^2, h*x*y^2  
110  input vec3 diag3_z1 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
111  // z=z*z  input tensor[4] setA4_z0 =[0,0,0,0];
112  input vec2 base3_z2 = [0, 0];    // b*x, c*y  input tensor[4] setB4_z0 =[0,0,0,0];
113  input vec2 xsq3_z2 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setC4_z0 =[0,0,0,0];
114  input vec2 ysq3_z2 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setD4_z0 =[0,0,0,0];
115  input vec3 diag3_z2 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  input tensor[4] setA4_z1 =[0,0,0,0];
116    input tensor[4] setB4_z1 =[0,0,0,0];
117    input tensor[4] setC4_z1 =[0,0,0,0];
118    input tensor[4] setD4_z1 =[0,0,0,0];
119    input tensor[4] setA4_z2 =[0,0,0,0];
120    input tensor[4] setB4_z2 =[0,0,0,0];
121    input tensor[4] setC4_z2 =[0,0,0,0];
122    input tensor[4] setD4_z2 =[0,0,0,0];
123    
124    input tensor[4] setA5_z0 =[0,0,0,0];
125    input tensor[4] setB5_z0 =[0,0,0,0];
126    input tensor[4] setC5_z0 =[0,0,0,0];
127    input tensor[4] setD5_z0 =[0,0,0,0];
128    input tensor[4] setA5_z1 =[0,0,0,0];
129    input tensor[4] setB5_z1 =[0,0,0,0];
130    input tensor[4] setC5_z1 =[0,0,0,0];
131    input tensor[4] setD5_z1 =[0,0,0,0];
132    input tensor[4] setA5_z2 =[0,0,0,0];
133    input tensor[4] setB5_z2 =[0,0,0,0];
134    input tensor[4] setC5_z2 =[0,0,0,0];
135    input tensor[4] setD5_z2 =[0,0,0,0];
136    
137    
138    input tensor[4] setA6_z0 =[0,0,0,0];
139    input tensor[4] setB6_z0 =[0,0,0,0];
140    input tensor[4] setC6_z0 =[0,0,0,0];
141    input tensor[4] setD6_z0 =[0,0,0,0];
142    input tensor[4] setA6_z1 =[0,0,0,0];
143    input tensor[4] setB6_z1 =[0,0,0,0];
144    input tensor[4] setC6_z1 =[0,0,0,0];
145    input tensor[4] setD6_z1 =[0,0,0,0];
146    input tensor[4] setA6_z2 =[0,0,0,0];
147    input tensor[4] setB6_z2 =[0,0,0,0];
148    input tensor[4] setC6_z2 =[0,0,0,0];
149    input tensor[4] setD6_z2 =[0,0,0,0];
150    
151    
152    input tensor[4] setA7_z0 =[0,0,0,0];
153    input tensor[4] setB7_z0 =[0,0,0,0];
154    input tensor[4] setC7_z0 =[0,0,0,0];
155    input tensor[4] setD7_z0 =[0,0,0,0];
156    input tensor[4] setA7_z1 =[0,0,0,0];
157    input tensor[4] setB7_z1 =[0,0,0,0];
158    input tensor[4] setC7_z1 =[0,0,0,0];
159    input tensor[4] setD7_z1 =[0,0,0,0];
160    input tensor[4] setA7_z2 =[0,0,0,0];
161    input tensor[4] setB7_z2 =[0,0,0,0];
162    input tensor[4] setC7_z2 =[0,0,0,0];
163    input tensor[4] setD7_z2 =[0,0,0,0];
164    
165    
166    input tensor[4] setA8_z0 =[0,0,0,0];
167    input tensor[4] setB8_z0 =[0,0,0,0];
168    input tensor[4] setC8_z0 =[0,0,0,0];
169    input tensor[4] setD8_z0 =[0,0,0,0];
170    input tensor[4] setA8_z1 =[0,0,0,0];
171    input tensor[4] setB8_z1 =[0,0,0,0];
172    input tensor[4] setC8_z1 =[0,0,0,0];
173    input tensor[4] setD8_z1 =[0,0,0,0];
174    input tensor[4] setA8_z2 =[0,0,0,0];
175    input tensor[4] setB8_z2 =[0,0,0,0];
176    input tensor[4] setC8_z2 =[0,0,0,0];
177    input tensor[4] setD8_z2 =[0,0,0,0];
178    
179    input tensor[4] setA9_z0 =[0,0,0,0];
180    input tensor[4] setB9_z0 =[0,0,0,0];
181    input tensor[4] setC9_z0 =[0,0,0,0];
182    input tensor[4] setD9_z0 =[0,0,0,0];
183    input tensor[4] setA9_z1 =[0,0,0,0];
184    input tensor[4] setB9_z1 =[0,0,0,0];
185    input tensor[4] setC9_z1 =[0,0,0,0];
186    input tensor[4] setD9_z1 =[0,0,0,0];
187    input tensor[4] setA9_z2 =[0,0,0,0];
188    input tensor[4] setB9_z2 =[0,0,0,0];
189    input tensor[4] setC9_z2 =[0,0,0,0];
190    input tensor[4] setD9_z2 =[0,0,0,0];
191    
192    
193    function real cvt(real x, real y, real z, tensor[4] setA, tensor[4] setB, tensor[4] setC, tensor[4] setD) {
194        real a = setA[0];
195        real b = setA[1];
196        real c = setA[2];
197        real d = setA[3];
198        real e = setB[0];
199        real f = setB[1];
200        real g = setB[2];
201        real h = setB[3];
202        real i = setC[0];
203        real j = setC[1];
204        real k = setC[2];
205        real l = setC[3];
206        real m = setD[0];
207        real n = setD[1];
208        real o = setD[2];
209        real p = setD[3];
210    
211        // as intended to be represented
212        real tA = a + b*y + c*x*y+ d*x;
213        real tB = ((e+f*x+g*(x*x))*y*y) + (h*(x*x)*y);
214        real tC = i*(x*x) + (j+k*x+l*(x*x))*y*y*y;
215        real tD = (x*x*x)*((m*y*y*y)+(n*y*y)+(o*y)+p);
216        return  z*(tA+tB+tC+tD);
217    }
218    
 //-- field defined by coefficients --  
219    
220  // z=1  function tensor[3,3] func(vec3 pos) {
221  input vec2 base4_z0 = [0, 0];    // b*x, c*y      real x = pos[0];
222  input vec2 xsq4_z0 = [0, 0];     // d*x^2, g*y*x^2      real y = pos[1];
223  input vec2 ysq4_z0 = [0, 0];     // f*y^2, h*x*y^2      real z = pos[2];
 input vec3 diag4_z0 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
 // z=z  
 input vec2 base4_z1 = [0, 0];    // b*x, c*y  
 input vec2 xsq4_z1 = [0, 0];     // d*x^2, g*y*x^2  
 input vec2 ysq4_z1 = [0, 0];     // f*y^2, h*x*y^2  
 input vec3 diag4_z1 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
 // z=z*z  
 input vec2 base4_z2 = [0, 0];    // b*x, c*y  
 input vec2 xsq4_z2 = [0, 0];     // d*x^2, g*y*x^2  
 input vec2 ysq4_z2 = [0, 0];     // f*y^2, h*x*y^2  
 input vec3 diag4_z2 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
   
 input vec2 base5_z0 = [0, 0];    // b*x, c*y  
 input vec2 xsq5_z0 = [0, 0];     // d*x^2, g*y*x^2  
 input vec2 ysq5_z0 = [0, 0];     // f*y^2, h*x*y^2  
 input vec3 diag5_z0 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
 // z=z  
 input vec2 base5_z1 = [0, 0];    // b*x, c*y  
 input vec2 xsq5_z1 = [0, 0];     // d*x^2, g*y*x^2  
 input vec2 ysq5_z1 = [0, 0];     // f*y^2, h*x*y^2  
 input vec3 diag5_z1 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
 // z=z*z  
 input vec2 base5_z2 = [0, 0];    // b*x, c*y  
 input vec2 xsq5_z2 = [0, 0];     // d*x^2, g*y*x^2  
 input vec2 ysq5_z2 = [0, 0];     // f*y^2, h*x*y^2  
 input vec3 diag5_z2 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
   
 input vec2 base6_z0 = [0, 0];    // b*x, c*y  
 input vec2 xsq6_z0 = [0, 0];     // d*x^2, g*y*x^2  
 input vec2 ysq6_z0 = [0, 0];     // f*y^2, h*x*y^2  
 input vec3 diag6_z0 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
 // z=z  
 input vec2 base6_z1 = [0, 0];    // b*x, c*y  
 input vec2 xsq6_z1 = [0, 0];     // d*x^2, g*y*x^2  
 input vec2 ysq6_z1 = [0, 0];     // f*y^2, h*x*y^2  
 input vec3 diag6_z1 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
 // z=z*z  
 input vec2 base6_z2 = [0, 0];    // b*x, c*y  
 input vec2 xsq6_z2 = [0, 0];     // d*x^2, g*y*x^2  
 input vec2 ysq6_z2 = [0, 0];     // f*y^2, h*x*y^2  
 input vec3 diag6_z2 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
   
 input vec2 base7_z0 = [0, 0];    // b*x, c*y  
 input vec2 xsq7_z0 = [0, 0];     // d*x^2, g*y*x^2  
 input vec2 ysq7_z0 = [0, 0];     // f*y^2, h*x*y^2  
 input vec3 diag7_z0 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
 // z=z  
 input vec2 base7_z1 = [0, 0];    // b*x, c*y  
 input vec2 xsq7_z1 = [0, 0];     // d*x^2, g*y*x^2  
 input vec2 ysq7_z1 = [0, 0];     // f*y^2, h*x*y^2  
 input vec3 diag7_z1 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
 // z=z*z  
 input vec2 base7_z2 = [0, 0];    // b*x, c*y  
 input vec2 xsq7_z2 = [0, 0];     // d*x^2, g*y*x^2  
 input vec2 ysq7_z2 = [0, 0];     // f*y^2, h*x*y^2  
 input vec3 diag7_z2 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
   
 input vec2 base8_z0 = [0, 0];    // b*x, c*y  
 input vec2 xsq8_z0 = [0, 0];     // d*x^2, g*y*x^2  
 input vec2 ysq8_z0 = [0, 0];     // f*y^2, h*x*y^2  
 input vec3 diag8_z0 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
 // z=z  
 input vec2 base8_z1 = [0, 0];    // b*x, c*y  
 input vec2 xsq8_z1 = [0, 0];     // d*x^2, g*y*x^2  
 input vec2 ysq8_z1 = [0, 0];     // f*y^2, h*x*y^2  
 input vec3 diag8_z1 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
 // z=z*z  
 input vec2 base8_z2 = [0, 0];    // b*x, c*y  
 input vec2 xsq8_z2 = [0, 0];     // d*x^2, g*y*x^2  
 input vec2 ysq8_z2 = [0, 0];     // f*y^2, h*x*y^2  
 input vec3 diag8_z2 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
   
 input vec2 base9_z0 = [0, 0];    // b*x, c*y  
 input vec2 xsq9_z0 = [0, 0];     // d*x^2, g*y*x^2  
 input vec2 ysq9_z0 = [0, 0];     // f*y^2, h*x*y^2  
 input vec3 diag9_z0 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
 // z=z  
 input vec2 base9_z1 = [0, 0];    // b*x, c*y  
 input vec2 xsq9_z1 = [0, 0];     // d*x^2, g*y*x^2  
 input vec2 ysq9_z1 = [0, 0];     // f*y^2, h*x*y^2  
 input vec3 diag9_z1 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
 // z=z*z  
 input vec2 base9_z2 = [0, 0];    // b*x, c*y  
 input vec2 xsq9_z2 = [0, 0];     // d*x^2, g*y*x^2  
 input vec2 ysq9_z2 = [0, 0];     // f*y^2, h*x*y^2  
 input vec3 diag9_z2 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
   
 input int cat=0;  
   
   
   
 function real cvt(real x, real y, real z, vec2 base, vec2 xsq, vec2 ysq, vec3 diag){  
     real b = base[0];  
     real c = base[1];  
     real d = xsq[0];  
     real g = xsq[1];  
     real f = ysq[0];  
     real h = ysq[1];  
     real a = diag[0];  
     real e = diag[1];  
     real i = diag[2];  
     real t0 = b*x + c*y;  
     real t1 = d*x^2 + g*y*x^2;  
     real t2 = f*y^2 + h*x*y^2;  
     real t3 = a + e*x*y + i*(y^2)*(x^2);  
     return z*(t0+t1+t2+t3);  
 }  
224    
225        real axis1_z0 = cvt(x,y,1, setA1_z0, setB1_z0, setC1_z0, setD1_z0);
226        real axis1_z1 = cvt(x,y,z, setA1_z1, setB1_z1, setC1_z1, setD1_z1);
227        real axis1_z2 = cvt(x,y,z*z,setA1_z2, setB1_z2, setC1_z2, setD1_z2);
228        real axis1= axis1_z0+axis1_z1+axis1_z2;
229    
230        real axis2_z0 = cvt(x,y,1, setA2_z0, setB2_z0, setC2_z0, setD2_z0);
231        real axis2_z1 = cvt(x,y,z, setA2_z1, setB2_z1, setC2_z1, setD2_z1);
232        real axis2_z2 = cvt(x,y,z*z,setA2_z2, setB2_z2, setC2_z2, setD2_z2);
233        real axis2= axis2_z0+axis2_z1+axis2_z2;
234    
235        real axis3_z0 = cvt(x,y,1, setA3_z0, setB3_z0, setC3_z0, setD3_z0);
236        real axis3_z1 = cvt(x,y,z, setA3_z1, setB3_z1, setC3_z1, setD3_z1);
237        real axis3_z2 = cvt(x,y,z*z,setA3_z2, setB3_z2, setC3_z2, setD3_z2);
238        real axis3= axis3_z0+axis3_z1+axis3_z2;
239    
240        real axis4_z0 = cvt(x,y,1, setA4_z0, setB4_z0, setC4_z0, setD4_z0);
241        real axis4_z1 = cvt(x,y,z, setA4_z1, setB4_z1, setC4_z1, setD4_z1);
242        real axis4_z2 = cvt(x,y,z*z,setA4_z2, setB4_z2, setC4_z2, setD4_z2);
243        real axis4= axis4_z0+axis4_z1+axis4_z2;
244    
245        real axis5_z0 = cvt(x,y,1, setA5_z0, setB5_z0, setC5_z0, setD5_z0);
246        real axis5_z1 = cvt(x,y,z, setA5_z1, setB5_z1, setC5_z1, setD5_z1);
247        real axis5_z2 = cvt(x,y,z*z,setA5_z2, setB5_z2, setC5_z2, setD5_z2);
248        real axis5= axis5_z0+axis5_z1+axis5_z2;
249    
250        real axis6_z0 = cvt(x,y,1, setA6_z0, setB6_z0, setC6_z0, setD6_z0);
251        real axis6_z1 = cvt(x,y,z, setA6_z1, setB6_z1, setC6_z1, setD6_z1);
252        real axis6_z2 = cvt(x,y,z*z,setA6_z2, setB6_z2, setC6_z2, setD6_z2);
253        real axis6= axis6_z0+axis6_z1+axis6_z2;
254    
255        real axis7_z0 = cvt(x,y,1, setA7_z0, setB7_z0, setC7_z0, setD7_z0);
256        real axis7_z1 = cvt(x,y,z, setA7_z1, setB7_z1, setC7_z1, setD7_z1);
257        real axis7_z2 = cvt(x,y,z*z,setA7_z2, setB7_z2, setC7_z2, setD7_z2);
258        real axis7= axis7_z0+axis7_z1+axis7_z2;
259    
260        real axis8_z0 = cvt(x,y,1, setA8_z0, setB8_z0, setC8_z0, setD8_z0);
261        real axis8_z1 = cvt(x,y,z, setA8_z1, setB8_z1, setC8_z1, setD8_z1);
262        real axis8_z2 = cvt(x,y,z*z,setA8_z2, setB8_z2, setC8_z2, setD8_z2);
263        real axis8= axis8_z0+axis8_z1+axis8_z2;
264    
265        real axis9_z0 = cvt(x,y,1, setA9_z0, setB9_z0, setC9_z0, setD9_z0);
266        real axis9_z1 = cvt(x,y,z, setA9_z1, setB9_z1, setC9_z1, setD9_z1);
267        real axis9_z2 = cvt(x,y,z*z,setA9_z2, setB9_z2, setC9_z2, setD9_z2);
268        real axis9= axis9_z0+axis9_z1+axis9_z2;
269        return [[axis1, axis2, axis3], [axis4, axis5, axis6], [axis7, axis8, axis9]];
270    
271  strand sample(int idx0, int idx1, int idx2) {  }
272    
273    strand sample(int idx0, int idx1, int idx2) {
274    
275    
276     output tensor [3,3] out = [[0,0,0],[0,0,0],[0,0,0]];     output tensor [3,3] out = [[0,0,0],[0,0,0],[0,0,0]];
277     update {     update {
         if(cat==1){  
             print ("\n\n_------top");  
             print ("\n\n\nbase 1");  
             print("\nbase1-z0",base1_z0,xsq1_z0,ysq1_z0,diag1_z0);  
             print("\nbase1-z1",base1_z1,xsq1_z1,ysq1_z1,diag1_z1);  
             print("\nbase1-z2",base1_z2,xsq1_z2,ysq1_z2,diag1_z2);  
             print ("\n\n\ndiag2-z0");  
             print("\ndiag2_z0",diag2_z0);  
             print ("\n\n\n diag3_z0");  
             print("diag3_z0",diag3_z0);  
278    
         }  
279    
280        /* see comment in ../fs2d/fs2d-scl.diderot about the need for these        /* see comment in ../fs2d/fs2d-scl.diderot about the need for these
281           conditionals around the print statements */           conditionals around the print statements */
# Line 272  Line 302 
302           print("data file: out.nrrd\n");           print("data file: out.nrrd\n");
303           print("byte skip: -1\n");           print("byte skip: -1\n");
304        }        }
305    // out = func(orig + idx0*edge0 + idx1*edge1 + idx2*edge2);        out = func(orig + idx0*edge0 + idx1*edge1 + idx2*edge2);
     vec3 pos = orig + idx0*edge0 + idx1*edge1 + idx2*edge2;  
     real x = pos[0];  
     real y = pos[1];  
     real z = pos[2];  
     real axis1_z0 = cvt(x,y,1,base1_z0,xsq1_z0,ysq1_z0,diag1_z0);  
     real axis1_z1 = cvt(x,y,z,base1_z1,xsq1_z1,ysq1_z1,diag1_z1);  
     real axis1_z2 = cvt(x,y,z*z,base1_z2,xsq1_z2,ysq1_z2,diag1_z2);  
     real axis1_val = axis1_z0+axis1_z1+axis1_z2;  
   
     real axis2_z0 = cvt(x,y,1,base2_z0,xsq2_z0,ysq2_z0,diag2_z0);  
     real axis2_z1 = cvt(x,y,z,base2_z1,xsq2_z1,ysq2_z1,diag2_z1);  
     real axis2_z2 = cvt(x,y,z*z,base2_z2,xsq2_z2,ysq2_z2,diag2_z2);  
     real axis2_val = axis2_z0+axis2_z1+axis2_z2;  
   
     real axis3_z0 = cvt(x,y,1,base3_z0,xsq3_z0,ysq3_z0,diag3_z0);  
     real axis3_z1 = cvt(x,y,z,base3_z1,xsq3_z1,ysq3_z1,diag3_z1);  
     real axis3_z2 = cvt(x,y,z*z,base3_z2,xsq3_z2,ysq3_z2,diag3_z2);  
     real axis3_val = axis3_z0+axis3_z1+axis3_z2;  
   
   
 real axis4_z0 = cvt(x,y,1,base4_z0,xsq4_z0,ysq4_z0,diag4_z0);  
 real axis4_z1 = cvt(x,y,z,base4_z1,xsq4_z1,ysq4_z1,diag4_z1);  
 real axis4_z2 = cvt(x,y,z*z,base4_z2,xsq4_z2,ysq4_z2,diag4_z2);  
 real axis4_val = axis4_z0+axis4_z1+axis4_z2;  
   
 real axis5_z0 = cvt(x,y,1,base5_z0,xsq5_z0,ysq5_z0,diag5_z0);  
 real axis5_z1 = cvt(x,y,z,base5_z1,xsq5_z1,ysq5_z1,diag5_z1);  
 real axis5_z2 = cvt(x,y,z*z,base5_z2,xsq5_z2,ysq5_z2,diag5_z2);  
 real axis5_val = axis5_z0+axis5_z1+axis5_z2;  
   
 real axis6_z0 = cvt(x,y,1,base6_z0,xsq6_z0,ysq6_z0,diag6_z0);  
 real axis6_z1 = cvt(x,y,z,base6_z1,xsq6_z1,ysq6_z1,diag6_z1);  
 real axis6_z2 = cvt(x,y,z*z,base6_z2,xsq6_z2,ysq6_z2,diag6_z2);  
 real axis6_val = axis6_z0+axis6_z1+axis6_z2;  
   
 real axis7_z0 = cvt(x,y,1,base7_z0,xsq7_z0,ysq7_z0,diag7_z0);  
 real axis7_z1 = cvt(x,y,z,base7_z1,xsq7_z1,ysq7_z1,diag7_z1);  
 real axis7_z2 = cvt(x,y,z*z,base7_z2,xsq7_z2,ysq7_z2,diag7_z2);  
 real axis7_val = axis7_z0+axis7_z1+axis7_z2;  
   
 real axis8_z0 = cvt(x,y,1,base8_z0,xsq8_z0,ysq8_z0,diag8_z0);  
 real axis8_z1 = cvt(x,y,z,base8_z1,xsq8_z1,ysq8_z1,diag8_z1);  
 real axis8_z2 = cvt(x,y,z*z,base8_z2,xsq8_z2,ysq8_z2,diag8_z2);  
 real axis8_val = axis8_z0+axis8_z1+axis8_z2;  
   
 real axis9_z0 = cvt(x,y,1,base9_z0,xsq9_z0,ysq9_z0,diag9_z0);  
 real axis9_z1 = cvt(x,y,z,base9_z1,xsq9_z1,ysq9_z1,diag9_z1);  
 real axis9_z2 = cvt(x,y,z*z,base9_z2,xsq9_z2,ysq9_z2,diag9_z2);  
 real axis9_val = axis9_z0+axis9_z1+axis9_z2;  
   
   
     out = [[axis1_val, axis2_val, axis3_val],[axis4_val, axis5_val, axis6_val],[axis7_val, axis8_val, axis9_val]];  
   
306        stabilize;        stabilize;
307     }     }
308  }  }

Legend:
Removed from v.4455  
changed lines
  Added in v.4456

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