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_fv2d3.diderot
ViewVC logotype

Diff of /branches/ein16/synth/d2/symb/symb_fv2d3.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 65  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  //-- field defined by coefficients --  input tensor[4] setA2_z0 =[0,0,0,0];
85  // z=1  input tensor[4] setB2_z0 =[0,0,0,0];
86  input vec2 base2_z0 = [0, 0];    // b*x, c*y  input tensor[4] setC2_z0 =[0,0,0,0];
87  input vec2 xsq2_z0 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setD2_z0 =[0,0,0,0];
88  input vec2 ysq2_z0 = [0, 0];     // f*y^2, h*x*y^2  
89  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];
90  // z=z  input tensor[4] setB2_z1 =[0,0,0,0];
91  input vec2 base2_z1 = [0, 0];    // b*x, c*y  input tensor[4] setC2_z1 =[0,0,0,0];
92  input vec2 xsq2_z1 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setD2_z1 =[0,0,0,0];
93  input vec2 ysq2_z1 = [0, 0];     // f*y^2, h*x*y^2  
94  input vec3 diag2_z1 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  input tensor[4] setA2_z2 =[0,0,0,0];
95  // z=z*z  input tensor[4] setB2_z2 =[0,0,0,0];
96  input vec2 base2_z2 = [0, 0];    // b*x, c*y  input tensor[4] setC2_z2 =[0,0,0,0];
97  input vec2 xsq2_z2 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setD2_z2 =[0,0,0,0];
98  input vec2 ysq2_z2 = [0, 0];     // f*y^2, h*x*y^2  
99  input vec3 diag2_z2 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  function real cvt(real x, real y, real z, tensor[4] setA, tensor[4] setB, tensor[4] setC, tensor[4] setD) {
100        real a = setA[0];
101        real b = setA[1];
102  function real cvt(real x, real y, real z, vec2 base, vec2 xsq, vec2 ysq, vec3 diag){      real c = setA[2];
103      real b = base[0];      real d = setA[3];
104      real c = base[1];      real e = setB[0];
105      real d = xsq[0];      real f = setB[1];
106      real g = xsq[1];      real g = setB[2];
107      real f = ysq[0];      real h = setB[3];
108      real h = ysq[1];      real i = setC[0];
109      real a = diag[0];      real j = setC[1];
110      real e = diag[1];      real k = setC[2];
111      real i = diag[2];      real l = setC[3];
112      real t0 = b*x + c*y;      real m = setD[0];
113      real t1 = d*x^2 + g*y*x^2;      real n = setD[1];
114      real t2 = f*y^2 + h*x*y^2;      real o = setD[2];
115      real t3 = a + e*x*y + i*(y^2)*(x^2);      real p = setD[3];
116      return z*(t0+t1+t2+t3);  
117        // as intended to be represented
118        real tA = a + b*y + c*x*y+ d*x;
119        real tB = ((e+f*x+g*(x*x))*y*y) + (h*(x*x)*y);
120        real tC = i*(x*x) + (j+k*x+l*(x*x))*y*y*y;
121        real tD = (x*x*x)*((m*y*y*y)+(n*y*y)+(o*y)+p);
122        return  z*(tA+tB+tC+tD);
123  }  }
124    
125    
# Line 122  Line 128 
128      real y = pos[1];      real y = pos[1];
129      real z = pos[2];      real z = pos[2];
130    
131      real axis1_z0 = cvt(x,y,1,base1_z0,xsq1_z0,ysq1_z0,diag1_z0);      real axis1_z0 = cvt(x,y,1, setA1_z0, setB1_z0, setC1_z0, setD1_z0);
132      real axis1_z1 = cvt(x,y,z,base1_z1,xsq1_z1,ysq1_z1,diag1_z1);      real axis1_z1 = cvt(x,y,z, setA1_z1, setB1_z1, setC1_z1, setD1_z1);
133      real axis1_z2 = cvt(x,y,z*z,base1_z2,xsq1_z2,ysq1_z2,diag1_z2);      real axis1_z2 = cvt(x,y,z*z,setA1_z2, setB1_z2, setC1_z2, setD1_z2);
134      real axis1_val = axis1_z0+axis1_z1+axis1_z2;      real axis1= axis1_z0+axis1_z1+axis1_z2;
135    
136      real axis2_z0 = cvt(x,y,1,base2_z0,xsq2_z0,ysq2_z0,diag2_z0);      real axis2_z0 = cvt(x,y,1, setA2_z0, setB2_z0, setC2_z0, setD2_z0);
137      real axis2_z1 = cvt(x,y,z,base2_z1,xsq2_z1,ysq2_z1,diag2_z1);      real axis2_z1 = cvt(x,y,z, setA2_z1, setB2_z1, setC2_z1, setD2_z1);
138      real axis2_z2 = cvt(x,y,z*z,base2_z2,xsq2_z2,ysq2_z2,diag2_z2);      real axis2_z2 = cvt(x,y,z*z,setA2_z2, setB2_z2, setC2_z2, setD2_z2);
139      real axis2_val = axis2_z0+axis2_z1+axis2_z2;      real axis2= axis2_z0+axis2_z1+axis2_z2;
140      return [axis1_val, axis2_val];      return [axis1,axis2];
141    
142  }  }
143    

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