SCM Repository
[diderot] / branches / vis12 / test / curl-turb2d.diderot |
View of /branches/vis12/test/curl-turb2d.diderot
Parent Directory
|
Revision Log
Revision 2163 -
(download)
(annotate)
Fri Feb 22 19:31:40 2013 UTC (7 years, 10 months ago) by glk
File size: 1118 byte(s)
Fri Feb 22 19:31:40 2013 UTC (7 years, 10 months ago) by glk
File size: 1118 byte(s)
now actually doing curl
// curl-turb2d.diderot // // // process output with: // unu reshape -i curl-turb2d.txt -s 1020 561 | unu quantize -b 8 -o curl-turb2d.png int imgSizeX = 1020; int imgSizeY = 561; field#1(2)[2] V = image("../data/turb2d.nrrd") ⊛ ctmr; strand LIC (int xi, int yi) { real xx = lerp(0.3, 6.75, 0.0, real(xi), real(imgSizeX)-1.0); real yy = lerp(0.6, 3.69, 0.0, real(yi), real(imgSizeY)-1.0); vec2 pos0 = [xx,yy]; output real crl = ∇×V(pos0); update { stabilize; } } // strand LIC (int xi, int yi) { // real xx = lerp(0.3, 6.75, 0.0, real(xi), real(imgSizeX)-1.0); // real yy = lerp(0.6, 3.69, 0.0, real(yi), real(imgSizeY)-1.0); // vec2 pos0 = [xx,yy]; // // tensor[2,2] M = ∇V(pos0); // output real curl = 0.0; // // update { // // I'm not sure I remember the correct way to index into a tensor // //curl = M[0,1] - M[1,0]; // // // This should work, even if the above indexing was wrong // vec2 v = [0.0, 1.0]; // vec2 u = [1.0, 0.0]; // curl = v•M•u - u•M•v; // // stabilize; // } // } initially [ LIC(xi, yi) | yi in 0..(imgSizeY-1), xi in 0..(imgSizeX-1) ];
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |