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

SCM Repository

[diderot] View of /benchmarks/programs/lic2d/hact2.diderot
ViewVC logotype

View of /benchmarks/programs/lic2d/hact2.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1615 - (download) (annotate)
Mon Nov 7 21:02:31 2011 UTC (8 years ago) by glk
File size: 939 byte(s)
files associated with demonstrations of visual debugging
// lic-turb.diderot
// 
// demo of line integral convolution (LIC) on 2D turbulent flow
//
// process output with:
// unu reshape -i lic-turb2d.txt -s 3 1020 561 | unu quantize -b 8  -o lic-turb2d.ppm

int imgSizeX = 500;
int imgSizeY = 500;
real h = 0.005;    // step size of integration
int stepNum = 10; // take this many steps both upstream and downstream

// field#2(2)[2] V = load("imp-u.nrrd") ⊛ bspln3;
field#1(2)[2] V = load("imp-u.nrrd") ⊛ ctmr;
field#0(2)[] R = load("../../data/R.nrrd") ⊛ tent;

strand LIC (int xi, int yi) {
	real xx = lerp(0.0, 8.0, 0.0, real(xi), real(imgSizeX)-1.0);
	real yy = lerp(0.0, 8.0, 0.0, real(yi), real(imgSizeY)-1.0);
	vec2 pos0 = [xx,yy];
	output vec3 RGB = [0.0, 0.0, 0.0];

	update {
                tensor[2,2] J = ∇⊗V(pos0);
                RGB = [J[0,0], J[0,1], J[0,0]];
                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