--- branches/pure-cfg/test/zslice-k1k2.diderot 2011/04/14 14:28:33 823 +++ branches/pure-cfg/test/zslice-k1k2.diderot 2011/04/14 15:54:24 824 @@ -20,24 +20,18 @@ update { if (inside (pos,F)) { - // HEY want: (syntax from matlab) 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]]; + tensor[3,3] G = zeros[3,3]; vec3 g = -∇F@pos; if (|g| > 0.0) { tensor[3,3] H = ∇(∇F)@pos; vec3 n = normalize(g); - // HEY NEED: (matlab) "eye(3)", or (pylab) "identity(3)" - // HEY NEED: tensor product of two vectors u⊗v; - // 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 + tensor[3,3] P = identity[3] - n⊗n; + G = (P•H•P)/|g|; } // HEY NEED: norm works on tensor[3,3], e.g. |G| real Gnorm = 2.0*trace(G); // fake; should be |G| // HEY want: x^y == x*x*... for integral y < 5 and pow(x,y) otherwise - real disc = sqrt(2.0*Gnorm*Gnorm - trace(G)*trace(G)); + real disc = sqrt(2.0*Gnorm^2 - trace(G)^2); // should be: real disc = sqrt(2*|G|^2 - trace(G)^2); k1k2 = [trace(G) + disc, trace(G) - disc]/2.0; }
Click to toggle
does not end with </html> tag
does not end with </body> tag
The output has ended thus: al disc = sqrt(2*|G|^2 - trace(G)^2); k1k2 = [trace(G) + disc, trace(G) - disc]/2.0; }