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

SCM Repository

[diderot] Diff of /branches/charisee_dev/examples/mode/mode-vr-byhand.diderot
ViewVC logotype

Diff of /branches/charisee_dev/examples/mode/mode-vr-byhand.diderot

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

revision 3318, Sat Oct 17 04:50:28 2015 UTC revision 3319, Sat Oct 17 05:41:18 2015 UTC
# Line 2  Line 2 
2  input real thick = 0.8;  input real thick = 0.8;
3    
4  field#2(3)[3,3] V = c4hexic ⊛ image("slab-c4h-ten9-small.nrrd");  field#2(3)[3,3] V = c4hexic ⊛ image("slab-c4h-ten9-small.nrrd");
5    field#0(3)[3,3,3] G=∇⊗V;
6  field#0(1)[3] cmap = tent ⊛ image("diverg-cmap.nrrd");  field#0(1)[3] cmap = tent ⊛ image("diverg-cmap.nrrd");
7    
8  function vec3 color(vec3 x,real k) =cmap(clamp(-1,1,3*sqrt(6)*k/2));  function vec3 color(vec3 x,real k) =cmap(clamp(-1,1,3*sqrt(6)*k/2));
# Line 40  Line 41 
41    real transp = 1;    real transp = 1;
42    vec3 rgb = [0, 0, 0];    vec3 rgb = [0, 0, 0];
43    output vec4 rgba = [0, 0, 0, 0];    output vec4 rgba = [0, 0, 0, 0];
   
44    update {    update {
45      vec3 x = camEye + rayN*rayVec;      vec3 x = camEye + rayN*rayVec;
46      if (inside(x,V)) {      if (inside(x,V)) {
# Line 48  Line 48 
48        vec3 grad = [0,0,0];        vec3 grad = [0,0,0];
49       tensor [3,3] e1=V (x)- trace(V(x))*identity[3]/3;       tensor [3,3] e1=V (x)- trace(V(x))*identity[3]/3;
50       real e2=sqrt(e1:e1);       real e2=sqrt(e1:e1);
51       vec3 XXXX=(∇(trace(V)))(x);//<<< need to remove trace      tensor[3,3,3] g=G(x);
52        vec3 XXXX=[g[0,0,0]+g[0,1,1]+g[0,2,2],g[1,0,0]+g[1,1,1]+g[1,2,2],g[2,0,0]+g[2,1,1]+g[2,2,2]];//(∇(trace(V)))(x);//<<< need to remove trace
53       tensor [3,3,3] dele1=∇⊗V(x)- (XXXX⊗identity[3]/3);       tensor [3,3,3] dele1=∇⊗V(x)- (XXXX⊗identity[3]/3);
54      tensor [3,3,3] t4=∇⊗V(x)- (XXXX⊗identity[3]/3);      tensor [3,3,3] t4=∇⊗V(x)- (XXXX⊗identity[3]/3);     //∇|E|;
55      vec3 t3 =2*(t4:(e1));//product rule      vec3 t3 =2*(t4:(e1));//product rule
56      vec3 dele2=(1/2)*t3/sqrt(e1:e1);      vec3 dele2=(1/2)*t3/sqrt(e1:e1);
57      tensor[3,3] probeQ= e1/sqrt(e1:e1); //E/|E|;      tensor[3,3] probeQ= e1/sqrt(e1:e1); //E/|E|;

Legend:
Removed from v.3318  
changed lines
  Added in v.3319

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