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

SCM Repository

[diderot] Annotation of /branches/vis12/bugs/open/bug053.diderot
ViewVC logotype

Annotation of /branches/vis12/bugs/open/bug053.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3375 - (view) (download)

1 : glk 3375 /*
2 :     ** BUG: ∇ doesn't seem to work on 1D fields;
3 :     ** compiling with: ../../bin/diderotc --exec bug053.diderot
4 :     ** generates:
5 :    
6 :     ***** Internal error after translation to MidIL: see log file for details
7 :    
8 :     which is due to the "∇F(pos1);" line. If that line is commented out,
9 :     the following "∇⊗∇F(pos1)" line causes this error:
10 :    
11 :     [bug053.diderot:24.15-25] Error: type error for unary operator "'∇⊗'"
12 :     expected: field#1(1)'shp0108;'dim0107
13 :     but found: field#1(1)[]
14 :     [bug053.diderot:10.1-30.0] Error: program does not have any strands
15 :    
16 :     Which raises the question: what is the correct way to express the
17 :     second (or higher) derivative of a 1D field?
18 :     */
19 :    
20 :     field#2(2)[] G = image("../data/data2D.nrrd") ⊛ bspln3;
21 :     field#2(1)[] F = image("../data/data1D.nrrd") ⊛ bspln3;
22 :    
23 :     strand foo (int xi, int yi) {
24 :     real xx = lerp(5, 25, 0, xi, 2);
25 :     real yy = lerp(5, 25, 0, yi, 2);
26 :     vec2 pos2 = [xx,yy];
27 :     real pos1 = xx;
28 :     output real out = 0;
29 :    
30 :     update {
31 :     out += |∇G(pos2)|;
32 :     out += |∇⊗∇G(pos2)|;
33 :     out += ∇F(pos1); // how should 1st deriv be expressed for 1D fields?
34 :     out += ∇⊗∇F(pos1); // how should 2nd deriv be expressed for 1D fields?
35 :     stabilize;
36 :     }
37 :     }
38 :    
39 :     initially [ foo(xi, yi) | yi in 0..2, xi in 0..2 ];

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0