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

SCM Repository

[diderot] Diff of /branches/lamont/test/implicit-surface/unit-circle.diderot
ViewVC logotype

Diff of /branches/lamont/test/implicit-surface/unit-circle.diderot

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

revision 2131, Fri Feb 8 20:28:51 2013 UTC revision 2132, Fri Feb 8 22:06:12 2013 UTC
# Line 6  Line 6 
6    
7    
8  strand Particle (int i) {  strand Particle (int i) {
9      output vec2 pos = [lerp(0.0, 1.0, -0.5, real(ui), real(gridSize)-0.5),      output vec2 pos = [0.0,0.0];
                        lerp(0.0, 1.0, -0.5, real(vi), real(gridSize)-0.5)];  
10    
11      real isoval = 1;      real isoval = 1;
12      int steps = 0;      int steps = 0;
13    
14      update {      update {
15        // We bail if we're no longer inside or taken too many steps.          real energy = 0.0;
16        /*  if (!inside(pos, F) || steps > stepsMax) {          real force = 0.0;
17              die;          real raduis =0.01;
18          } */  
19            for(Particle neighbor in sphere(raidus) {
20                real d = distance (pos,neighbor.pos);
21                if(d > 0) {
22                    if(d >= 0 && d <= 1) {
23                       force += -4.0 * ((1 - d)^3);
24                       energy += ((1 - d)^4);
25                    }
26                }
27            }
28    
29    
30    
31          vec2 grad = ∇F(pos);          vec2 grad = ∇F(pos);
32          if (|grad| == 0.0) {    // can't compute step if |∇F|, so have to bail          if (|grad| == 0.0) {    // can't compute step if |∇F|, so have to bail

Legend:
Removed from v.2131  
changed lines
  Added in v.2132

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