/* ../../../bin/diderotc giso3d.diderot \ && ./giso3d \ && unu crop -i giso3d.txt -min 0 0 -max 1 M | \ unu jhisto -b 600 600 -min -1.2 -1.2 -max 1.2 1.2 -t float | \ unu 1op log1p | \ unu quantize -b 8 -o giso3d.png \ && open giso3d.png */ field#4(3)[] V= c4hexic ⊛ load("parab0.nrrd"); field#3(3)[3] N = ∇V/|∇V|; field#3(3)[3,3] P = identity[3] - N⊗N; field#2(3)[3,3] H = ∇⊗∇V; field#3(3)[3,3] G = -(P•H•P)/|∇V|; // HEY why is field#3 allowed? should want field#2 // compilation stalls out with either of these field#2(3)[] F = trace(G) - -3; //field#2(3)[] F = G:G - 9; // (to try later after this is fixed: isosurfaces of flowline curvature) int grid = 30; int stepsMax = 10; real epsilon = 0.000001; strand RootFind(real xi,real xj, real xk) { output vec3 x = [xi,xj,xk]; int steps = 0; update { // Stop if we're no longer inside or taken too many steps. if (!inside(x, V) || steps > stepsMax) die; // subsequent expressions are undefined if |∇F| is zero if (|∇F(x)| == 0.0) die; // the Newton-Raphson step vec3 delta = normalize(∇F(x)) * F(x)/|∇F(x)|; // we've converged if the change is small enough if (|delta| < epsilon) stabilize; x -= delta; steps += 1; } } initially { RootFind(lerp(-2, 2, -0.5, ui, grid-0.5), lerp(-2, 2, -0.5, vi, grid-0.5), lerp(-2, 2, -0.5, wi, grid-0.5)) | wi in 0..(grid-1), vi in 0..(grid-1), ui in 0..(grid-1) };
Click to toggle
does not end with </html> tag
does not end with </body> tag
The output has ended thus: -2, 2, -0.5, wi, grid-0.5)) | wi in 0..(grid-1), vi in 0..(grid-1), ui in 0..(grid-1) };