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

SCM Repository

[diderot] View of /tests/slinebug/sline.diderot
ViewVC logotype

View of /tests/slinebug/sline.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4640 - (download) (annotate)
Tue Sep 27 20:54:47 2016 UTC (2 years, 9 months ago) by glk
File size: 1225 byte(s)
initial result of svn export --username anonsvn --password=anonsvn https://svn.smlnj-gforge.cs.uchicago.edu/svn/diderot/branches/vis15/src/tests/
/*
This program exhibits two different bugs in vis15.
You can uncomment either section AAAAAAAA or BBBBBBBB;
one or the other must be uncommented.
*/

vec2 {} x0s = load("seeds.txt");
real h = 0.02;
int stepNum = 180;
input real arrow = 0.15;

field#1(2)[2] V = bspln3 ⊛ clamp(image("flow.nrrd"));

strand sline (vec2 x0) {
  int step = 0;
  vec2 x = x0;
  output vec2{} p = {x0};

  update {
    if (inside(x, V)) {
      x += h*V(x + 0.5*h*V(x));
      p = p @ x;
    } /* would use "else { stabilize; }" but vis12 can't compile that */
    step += 1;
    if (step == stepNum) {
/* */
      // begin AAAAAAAA vvvvvvvv
      // if this section is uncommented, the program segfaults
      vec2 a = arrow*V(x);
      vec2 b = 0.4*[-a[1],a[0]];
      p = p @ (x - b);
      p = p @ (x + a);
      p = p @ (x + b);
      p = p @ x;
      //   end AAAAAAAA ^^^^^^^^
/* */
      stabilize;
    }
  }
/*
  // begin BBBBBBBB vvvvvvvv
  // if this is uncommented; there is a compile error
  stabilize {
    vec2 a = arrow*V(x);
    vec2 b = 0.4*[-a[1],a[0]];
    p = p @ (x - b);
    p = p @ (x + a);
    p = p @ (x + b);
    p = p @ x;
  }
  //   end BBBBBBBB ^^^^^^^^
*/
}

initially [ sline(x0s{ii}) | ii in 0..length(x0s)-1 ];

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