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

SCM Repository

[diderot] Diff of /branches/vis12/test/particles-iso.diderot
ViewVC logotype

Diff of /branches/vis12/test/particles-iso.diderot

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

trunk/test/particles-iso.diderot revision 480, Fri Nov 19 17:07:01 2010 UTC branches/vis12/test/particles-iso.diderot revision 1927, Sat Jun 23 18:09:16 2012 UTC
# Line 3  Line 3 
3  // distributes particles on an isosurface  // distributes particles on an isosurface
4  //  //
5    
 input string dataFile;           // name of dataset  
6  input real radius = 0.2;         // radius of particle  input real radius = 0.2;         // radius of particle
7  input real isovalue = 0.0;       // isocontour value  input real isovalue = 0.0;       // isocontour value
8  input real cnstrEps = 0.01;      // epsilon test for constraint satisfaction  input real cnstrEps = 0.01;      // epsilon test for constraint satisfaction
# Line 15  Line 14 
14  input int pointNum = 100;        // number of initial seed points  input int pointNum = 100;        // number of initial seed points
15  input real energyConvg = 0.1;    // convergence threshold on system energy  input real energyConvg = 0.1;    // convergence threshold on system energy
16    
17  image(3)[] img = load (dataFile);  input image(3)[] img = image (dataFile);
18  field#2(3)[] F = img ⊛ bspln3;  field#2(3)[] F = img ⊛ bspln3;
19    
20  // should allow functions to take actors, but sensible semantics  // should allow functions to take actors, but sensible semantics
# Line 120  Line 119 
119    
120          (energyOrig, force) = totalEnergy(pos);          (energyOrig, force) = totalEnergy(pos);
121          // project force onto tangent plane          // project force onto tangent plane
122          force -= outer(∇F@pos, ∇F@pos)*force          vec3 norm = ∇F@pos/|∇F@pos|;
123            force -= outer(norm, norm)*force
124          // ensures that step*force is a reasonable distance          // ensures that step*force is a reasonable distance
125          step = min(step, travelMax/|force|);          step = min(step, travelMax/|force|);
         if (step*|force| > travelMax) {  
            step = travelMax/|force|;  
         }  
126          do {          do {
127             (bool ok, posNew) = constrain(pos + step*force);             (bool ok, posNew) = constrain(pos + step*force);
128             if (!ok) {             if (!ok) {

Legend:
Removed from v.480  
changed lines
  Added in v.1927

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