Home My Page Projects Code Snippets Project Openings diderot

SCM Repository

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

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

revision 2234, Fri Mar 1 22:58:37 2013 UTC revision 2235, Fri Mar 1 23:04:50 2013 UTC
# Line 4  Line 4
4  //  //
6  int numOfParticles = length(initPosns)/2;  int numOfParticles = length(initPosns)/2;
7  input real rr = 0.08;       // particle radius  input real rr = 0.08;     // actual particle radius
8  input real dd = 0.16;       // desired difference of radius (d < r && d > 0)  input real RR = 0.15;     // neighbor query radius (MUST be bigger than rr, but should get same results for any RR > rr)
input real RR = 0.15;       // neighbor radius
9  input real hh = 0.001;        // integration step size to control how quickly iterations change position.  input real hh = 0.001;        // integration step size to control how quickly iterations change position.
10  input int MAX_ITER = 200;   // maximum number of steps in the program  input int MAX_ITER = 200;   // maximum number of steps in the program
11  vec2 xDom = [-1,1];  vec2 xDom = [-1,1];
# Line 35  Line 34
34          real energy = 0;          real energy = 0;
35          vec2 force = [0,0];          vec2 force = [0,0];
36          foreach (Particle p_j in sphere(RR)) {          foreach (Particle p_j in sphere(RR)) {
37              vec2 r_ij = pos - p_j.pos;              vec2 r_ij = (pos - p_j.pos)/rr;
38              vec2 d_ij = normalize(r_ij);              vec2 d_ij = normalize(r_ij);
39              print("===== ", id, ": with ", p_j.id, "; |r_ij| = ", |r_ij|, "\n");              print("===== ", id, ": with ", p_j.id, "; |r_ij| = ", |r_ij|, "\n");
40
# Line 45  Line 44
44              }              }
45          }          }
46
47          vec2 step = hh*force;          vec2 step = hh*force/rr;
48          pos = normalize(pos + step);          pos = normalize(pos + step);
49
50          outPos = pos;          outPos = pos;

Legend:
 Removed from v.2234 changed lines Added in v.2235