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

SCM Repository

[diderot] Diff of /branches/vis12/test/tracto.diderot
ViewVC logotype

Diff of /branches/vis12/test/tracto.diderot

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 57, Fri Apr 30 14:41:31 2010 UTC revision 58, Mon May 3 03:46:16 2010 UTC
# Line 18  Line 18 
18  {  {
19      int         stepNum = 0;      int         stepNum = 0;
20      vec3        pos = seedPoint;      vec3        pos = seedPoint;
21        //// principleEvec : tensor[3,3] -> vec3
22        //// * : real x vec3 -> vec3
23      vec3        guide = seedSign * principleEvec(F@seedPoint);      vec3        guide = seedSign * principleEvec(F@seedPoint);
24      real        aniso = 0.0;      real        aniso = 0.0;
25    
26      update      update
27      {      {
28          if (inside (pos,F)) {          if (inside (pos,F)) {
29               //// @ : field x vec -> tensor[3,3]
30             tensor[3,3] ten = F@pos;             tensor[3,3] ten = F@pos;
31               //// CL : tensor[3,3] -> real
32             aniso = CL(ten);  // "CL" is a linear anisotropy measure             aniso = CL(ten);  // "CL" is a linear anisotropy measure
33               //// < : real x real -> bool
34             if (aniso < clmin) {             if (aniso < clmin) {
35                // terminate because anisotropy went too low                // terminate because anisotropy went too low
36                stabilize;                stabilize;
37             }             }
38             // else             // else
39             vec3 evec = principleEvec(ten);             vec3 evec = principleEvec(ten);
40               //// dot : vec3 x vec3 -> real
41               //// - : vec3 -> vec3
42             if (dot(evec, guide) < 0) { evec = -evec; } // fix eigenvector sign             if (dot(evec, guide) < 0) { evec = -evec; } // fix eigenvector sign
43               //// * : real x real -> real
44               //// * : real x vec3 -> vec3
45               //// + : vec3 x vec3 -> vec3
46             evec = principleEvec(F @ (pos + 0.5*stepSz*evec));             evec = principleEvec(F @ (pos + 0.5*stepSz*evec));
47             if (dot(evec, guide) < 0) { evec = -evec; } // fix eigenvector sign             if (dot(evec, guide) < 0) { evec = -evec; } // fix eigenvector sign
48             guide = evec;             guide = evec;
49             pos = pos + stepSz*evec;             pos = pos + stepSz*evec;
50               //// + : int x int -> int
51             stepNum = 1 + stepNum;             stepNum = 1 + stepNum;
52               //// > : real x real -> bool
53               //// && : bool x bool -> bool
54             if (stepNumMax > 0 && stepNum > stepNumMax) {             if (stepNumMax > 0 && stepNum > stepNumMax) {
55                 // terminate because we took too many steps                 // terminate because we took too many steps
56                 stabilize;                 stabilize;

Legend:
Removed from v.57  
changed lines
  Added in v.58

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