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

Diff of /branches/ein16/synth/d2/symb/symb_fsd3.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 37  Line 37 
37  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;
38    
39  //-- field defined by coefficients --  //-- field defined by coefficients --
40  // z=1  input tensor[4] setA_z0 =[0,0,0,0];
41  input vec2 base_z0 = [0, 0];    // b*x, c*y  input tensor[4] setB_z0 =[0,0,0,0];
42  input vec2 xsq_z0 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setC_z0 =[0,0,0,0];
43  input vec2 ysq_z0 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setD_z0 =[0,0,0,0];
44  input vec3 diag_z0 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
45  // z=z  input tensor[4] setA_z1 =[0,0,0,0];
46  input vec2 base_z1 = [0, 0];    // b*x, c*y  input tensor[4] setB_z1 =[0,0,0,0];
47  input vec2 xsq_z1 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setC_z1 =[0,0,0,0];
48  input vec2 ysq_z1 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setD_z1 =[0,0,0,0];
49  input vec3 diag_z1 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
50  // z=z*z  input tensor[4] setA_z2 =[0,0,0,0];
51  input vec2 base_z2 = [0, 0];    // b*x, c*y  input tensor[4] setB_z2 =[0,0,0,0];
52  input vec2 xsq_z2 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setC_z2 =[0,0,0,0];
53  input vec2 ysq_z2 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setD_z2 =[0,0,0,0];
54  input vec3 diag_z2 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
55    
56    function real cvt(real x, real y, real z, tensor[4] setA, tensor[4] setB, tensor[4] setC, tensor[4] setD) {
57        real a = setA[0];
58        real b = setA[1];
59  function real cvt(real x, real y, real z, vec2 base, vec2 xsq, vec2 ysq, vec3 diag){      real c = setA[2];
60      real b = base[0];      real d = setA[3];
61      real c = base[1];      real e = setB[0];
62      real d = xsq[0];      real f = setB[1];
63      real g = xsq[1];      real g = setB[2];
64      real f = ysq[0];      real h = setB[3];
65      real h = ysq[1];      real i = setC[0];
66      real a = diag[0];      real j = setC[1];
67      real e = diag[1];      real k = setC[2];
68      real i = diag[2];      real l = setC[3];
69      real t0 = b*x + c*y;      real m = setD[0];
70      real t1 = d*x^2 + g*y*x^2;      real n = setD[1];
71      real t2 = f*y^2 + h*x*y^2;      real o = setD[2];
72      real t3 = a + e*x*y + i*(y^2)*(x^2);      real p = setD[3];
73      return z*(t0+t1+t2+t3);  
74        // as intended to be represented
75        real tA = a + b*y + c*x*y+ d*x;
76        real tB = ((e+f*x+g*(x*x))*y*y) + (h*(x*x)*y);
77        real tC = i*(x*x) + (j+k*x+l*(x*x))*y*y*y;
78        real tD = (x*x*x)*((m*y*y*y)+(n*y*y)+(o*y)+p);
79        return  z*(tA+tB+tC+tD);
80  }  }
81    
82  function real func(vec3 pos) {  function real func(vec3 pos) {
83      real x = pos[0];      real x = pos[0];
84      real y = pos[1];      real y = pos[1];
85      real z = pos[2];      real z = pos[2];
86      real z0 = cvt(x,y,1,base_z0,xsq_z0,ysq_z0,diag_z0);      real z0 = cvt(x,y,1, setA_z0, setB_z0, setC_z0, setD_z0);
87      real z1 = cvt(x,y,z,base_z1,xsq_z1,ysq_z1,diag_z1);      real z1 = cvt(x,y,z, setA_z1, setB_z1, setC_z1, setD_z1);
88      real z2 = cvt(x,y,z*z,base_z2,xsq_z2,ysq_z2,diag_z2);      real z2 = cvt(x,y,z*z,setA_z2, setB_z2, setC_z2, setD_z2);
89      return z0+z1+z2;      return z0+z1+z2;
90    
91    

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