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 2241, Sun Mar 3 01:02:44 2013 UTC revision 2244, Sun Mar 3 01:24:09 2013 UTC
# Line 4  Line 4 
4  //  //
5  real{} initPosns = load("-");  real{} initPosns = load("-");
6  int numOfParticles = length(initPosns)/2;  int numOfParticles = length(initPosns)/2;
7  input int iterMax = 300;  // maximum number of steps to run  input int iterMax = 500;  // maximum number of steps to run
8  input real rr = 0.2;      // actual particle radius  input real rr = 0.2;      // actual particle radius
9    
10  real RR = rr+0.0;         // neighbor query radius (MUST be >= rr; should get same results for any RR >= rr)  real RR = rr+0.0;         // neighbor query radius (MUST be >= rr; should get same results for any RR >= rr)
# Line 28  Line 28 
28      vec2 posOld1 = pos;   // remember last TWO positions      vec2 posOld1 = pos;   // remember last TWO positions
29      vec2 posOld2 = pos;      vec2 posOld2 = pos;
30      output vec2 outPos = pos;      output vec2 outPos = pos;
31      real energy = ii;     // should eventually do convergence test based on variance of energies      real energy = ii;     // HEY: can do convergence test based on variance of energies
32        vec2 force = [0,0];   // or can test convergence based on sum of |force|
33      update {      update {
34    
35          // print positions          // print positions
# Line 39  Line 40 
40    
41          // compute energy and forces on us          // compute energy and forces on us
42          energy = 0;          energy = 0;
43          vec2 force = [0,0];          force = [0,0];
44          foreach (Particle p_j in sphere(RR)) {          foreach (Particle p_j in sphere(RR)) {
45              vec2 r_ij = (pos - p_j.pos)/rr;              vec2 r_ij = (pos - p_j.pos)/rr;
46              vec2 d_ij = normalize(r_ij);              vec2 d_ij = normalize(r_ij);

Legend:
Removed from v.2241  
changed lines
  Added in v.2244

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