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 2225, Thu Feb 28 05:14:28 2013 UTC revision 2226, Thu Feb 28 17:35:37 2013 UTC
# Line 3  Line 3 
3  // Demo of distributing particles on the unit circle  // Demo of distributing particles on the unit circle
4  //  //
5  real{} initPosns = load("../../data/implicit-surface/circlePosns.nrrd"); // file has 300 particle positions  real{} initPosns = load("../../data/implicit-surface/circlePosns.nrrd"); // file has 300 particle positions
6  int numOfParticles = 100; // But I'm only look at 100 for right now.  input int numOfParticles = 100;  // But I'm only look at 100 for right now.
7  input real r = 0.08;  // particle radius  input real r = 0.08;  // particle radius
8  input real d = 0.16;  // desired difference of radius (d < r && d > 0)  input real d = 0.16;  // desired difference of radius (d < r && d > 0)
9  input real R = 0.15;  // neighbor radius  input real R = 0.15;  // neighbor radius
10  real MAX_FORCE = 2;  real MAX_FORCE = 2;
11  input real h = 0.09;  // integration step size to control how quickly iterations change position.  input real h = 0.09;  // integration step size to control how quickly iterations change position.
12  input int maxi = 1000; // maximum number of steps in the program  input int MAX_ITER = 10;   // maximum number of steps in the program
13  vec4 qWinDim = [-1,1,-1,1]; // i.e. [XMIN, XMAX, YMIN, YMAX]  (required for the query function)  vec4 qWinDim = [-1,1,-1,1]; // i.e. [XMIN, XMAX, YMIN, YMAX]  (required for the query function)
14  vec2 qGridDim = [12,12];  // how many grid cells you want in each direction for the uniform grid (required for the query function)  vec2 qGridDim = [12,12];  // how many grid cells you want in each direction for the uniform grid (required for the query function)
15  vec2 qCellDim = [r,r];    // the length in each direction for a cell (required for the query function)  vec2 qCellDim = [r,r];    // the length in each direction for a cell (required for the query function)
# Line 33  Line 33 
33                     energy += (((1 - neighborDist)^4) * unitDirection);                     energy += (((1 - neighborDist)^4) * unitDirection);
34               }               }
35          }          }
36            if(id == 0)
37                print(steps, "\n");
38          real angle = 0.0;          real angle = 0.0;
39            angle = atan2(pos[1],pos[0])* 180/π;
40            angle = (angle + 360) if angle < 0 else angle; // atan2 rangs from (π,-π] so need to range from [0,2π)
41            //print("Angle = ", angle, "\n");
42          //Looking at how strand #0 changes for 30 iterations.          //Looking at how strand #0 changes for 30 iterations.
43          /*if(id == 0) {          /*if(id == 0) {
44             print("pos before = ", pos, "\n");             print("pos before = ", pos, "\n");
# Line 66  Line 70 
70          } */          } */
71          outPos = pos;          outPos = pos;
72    
73          if(steps >= 30) {          if(steps >= MAX_ITER) {
74              stabilize;              stabilize;
75          }          }
76      }      }

Legend:
Removed from v.2225  
changed lines
  Added in v.2226

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