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

SCM Repository

[diderot] View of /branches/vis12/test/curl-turb2d.diderot
ViewVC logotype

View of /branches/vis12/test/curl-turb2d.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1927 - (download) (annotate)
Sat Jun 23 18:09:16 2012 UTC (7 years, 1 month ago) by jhr
File size: 1124 byte(s)
  converting to use "image" instead of "load" for image nrrd loading
// 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 tensor[2,2] M = ∇⊗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