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

SCM Repository

[diderot] Diff of /branches/charisee/ertest/vispaper/gmiso2d/gmiso2d.diderot
ViewVC logotype

Diff of /branches/charisee/ertest/vispaper/gmiso2d/gmiso2d.diderot

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

revision 2892, Fri Feb 27 06:03:15 2015 UTC revision 2893, Fri Feb 27 17:06:53 2015 UTC
# Line 16  Line 16 
16  real isoval = 1.0;  real isoval = 1.0;
17  field#2(2)[] V = bspln3 ⊛ load("parab1.nrrd");  field#2(2)[] V = bspln3 ⊛ load("parab1.nrrd");
18  field#1(2)[] F = |∇V| - isoval;  field#1(2)[] F = |∇V| - isoval;
 field#0(2)[2] gradF = ∇F;  
19    
20    
21  int grid = 150;  int grid = 150;
# Line 33  Line 32 
32        if (!inside(x, V) || steps > stepsMax)        if (!inside(x, V) || steps > stepsMax)
33           die;           die;
34    
         vec2 grad = gradF(x);  
         real m=|grad|;  
35        // subsequent expressions are undefined if |∇F| is zero        // subsequent expressions are undefined if |∇F| is zero
36        if (m == 0.0)        if (|∇F(x)| == 0.0)
37           die;           die;
38    
39        // the Newton-Raphson step        // the Newton-Raphson step
40         vec2 delta = normalize(grad) * F(x)/m;         vec2 delta = normalize(∇F(x)) * F(x)/|∇F(x)|;
41    
42        // we've converged if the change is small enough        // we've converged if the change is small enough
43        if (|delta| < epsilon)        if (|delta| < epsilon)
# Line 50  Line 47 
47     }     }
48  }  }
49    
50  initially { RootFind(lerp(-1.5, 1.5, -0.5, ui, grid-0.5),  initially { RootFind(lerp(-2.5, 0.5, -0.5, ui, grid-0.5),
51                        lerp(-1.5, 1.5, -0.5, vi, grid-0.5))                        lerp(-1.5, 1.5, -0.5, vi, grid-0.5))
52              | vi in 0..(grid-1), ui in 0..(grid-1) };              | vi in 0..(grid-1), ui in 0..(grid-1) };
53    

Legend:
Removed from v.2892  
changed lines
  Added in v.2893

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