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

SCM Repository

[diderot] Diff of /branches/pure-cfg/test/zslice-k1k2.diderot
ViewVC logotype

Diff of /branches/pure-cfg/test/zslice-k1k2.diderot

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

revision 823, Thu Apr 14 14:28:33 2011 UTC revision 824, Thu Apr 14 15:54:24 2011 UTC
# Line 20  Line 20 
20      update      update
21      {      {
22          if (inside (pos,F)) {          if (inside (pos,F)) {
23             // HEY want: (syntax from matlab) tensor[3,3] G = zeros(3,3);             tensor[3,3] G = zeros[3,3];
            tensor[3,3] G = [[0.0,0.0,0.0],[0.0,0.0,0.0],[0.0,0.0,0.0]];  
24             vec3 g = -∇F@pos;             vec3 g = -∇F@pos;
25             if (|g| > 0.0) {             if (|g| > 0.0) {
26                tensor[3,3] H = ∇(∇F)@pos;                tensor[3,3] H = ∇(∇F)@pos;
27                vec3 n = normalize(g);                vec3 n = normalize(g);
28                // HEY NEED: (matlab) "eye(3)", or (pylab) "identity(3)"                tensor[3,3] P = identity[3] - n⊗n;
29                // HEY NEED: tensor product of two vectors u⊗v;                G = (P•H•P)/|g|;
               // should be: tensor[3,3] P = identity(3) - n⊗n;  
               tensor[3,3] P = I; // fake  
               // HEY NEED: matrix • matrix multiply  
               // should be: G = (P•H•P)/|g|;  
               G = P•H•P; // fake  
30             }             }
31             // HEY NEED: norm works on tensor[3,3], e.g. |G|             // HEY NEED: norm works on tensor[3,3], e.g. |G|
32             real Gnorm = 2.0*trace(G); // fake; should be |G|             real Gnorm = 2.0*trace(G); // fake; should be |G|
33             // HEY want: x^y == x*x*... for integral y < 5 and pow(x,y) otherwise             // HEY want: x^y == x*x*... for integral y < 5 and pow(x,y) otherwise
34             real disc = sqrt(2.0*Gnorm*Gnorm - trace(G)*trace(G));             real disc = sqrt(2.0*Gnorm^2 - trace(G)^2);
35             // should be: real disc = sqrt(2*|G|^2 - trace(G)^2);             // should be: real disc = sqrt(2*|G|^2 - trace(G)^2);
36             k1k2 = [trace(G) + disc, trace(G) - disc]/2.0;             k1k2 = [trace(G) + disc, trace(G) - disc]/2.0;
37          }          }

Legend:
Removed from v.823  
changed lines
  Added in v.824

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