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

SCM Repository

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

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

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

revision 3282, Tue Oct 13 19:46:34 2015 UTC revision 3283, Wed Oct 14 01:58:37 2015 UTC
# Line 4  Line 4 
4    
5    
6  field#2(3)[3,3] V = bspln3 ⊛ image("/Users/chariseechiw/diderot/charisee_dev/ertest/data/tball.nrrd");  field#2(3)[3,3] V = bspln3 ⊛ image("/Users/chariseechiw/diderot/charisee_dev/ertest/data/tball.nrrd");
7    field#0(3)[3,3,3] G=∇⊗V;
8    
9    
 //field#2(3)[3,3] E = V - trace(V)*identity[3]/3;  
 //field#2(3)[] F = sqrt(3.0/2.0)*|E|/|V| - isoval;  
   
 //tensor equivalent probes field  
 //field#2(3)[] e1= |E|;  
 //field#1(3)[3] dele1= ∇e1;  
 //field#2(3)[] e2 = |V|;  
 //field#2(3)[] dele2= ∇e2;  
 //field#1(3)[3] G = ∇(e1/e2);  
 //field#1(3)[3] G = (((∇e1)*e2)-((∇e2)*e1))/(e2*e2);//quotient rule  
10    
11  field#2(3)[3] hackRGB = bspln3 ⊛ image("/Users/chariseechiw/diderot/charisee_dev/data/const-curl3d.nrrd");  field#2(3)[3] hackRGB = bspln3 ⊛ image("/Users/chariseechiw/diderot/charisee_dev/data/const-curl3d.nrrd");
12  function vec3 color(vec3 x) = hackRGB(x);  function vec3 color(vec3 x) = hackRGB(x);
13    
14    
   
15  vec3 cutVec = [-1,-0.03,0.02];  vec3 cutVec = [-1,-0.03,0.02];
16  real cutPos = -1.5;  real cutPos = -1.5;
17    
# Line 69  Line 59 
59        real val = 0;        real val = 0;
60        vec3 grad = [0,0,0];        vec3 grad = [0,0,0];
61    
       //e1=|E|  
       tensor[3,3] e1inner=V(x)-trace(V(x))*identity[3]/3;  
       real e1=sqrt(e1inner:e1inner);  
   
         //∇|E|;  
          vec3 XXXX=(∇(trace(V)))(x);//<<< need to remove trace  
         tensor [3,3,3] t4=∇⊗V(x)- (XXXX⊗identity[3]/3); //can't do tensor outproduct op  
         vec3 t3 =2*(t4:(e1inner));//product rule  
         vec3 dele1=(1/2)*t3/sqrt(e1inner:e1inner);  
   
       //val = F(x);  
       val =sqrt(3.0/2.0)*e1/|V(x)|;  
   
   
       real e2=|V(x)|;  
       vec3 t0=  (V(x):∇⊗V(x))+(V(x):∇⊗V(x)) ;//product rule  
       vec3 dele2= (1/2)* t0/sqrt(V(x):V(x)) ; //chain rule  
   
62    
63        //grad=∇F(x)        real m=|V(x)|;
64        vec3 G= ((dele1*e2)-(dele2*e1))/(e2*e2);//quotient rule        tensor[3,3,3] g=G(x);
65        grad = -(sqrt(3.0/2.0)*G);       tensor[3] t1=(1/2)*(V(x):g+g:V(x))/m;
66    
67        vec3 t2=[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]];
68        tensor [3,3] E = V(x) - trace(V(x))*identity[3]/3;
69       tensor[3,3,3] t3= g-t2⊗identity[3]/3;
70        real t4=|E|;
71    tensor [3] t5=(1/2)*(t3:E +E:t3)/(E:E);
72    
73    val=sqrt(3.0/2.0)*t4/m - isoval;
74    
75    real t8=sqrt(3.0/2.0);
76      vec3 t6 =(m*t5);
77      vec3 t7 = (t4*t1);
78     grad =t8*(t6- t7)/(m*m);
79    
80        real a = alpha(val, |grad|);        real a = alpha(val, |grad|);
81        if (a > 0) {        if (a > 0) {

Legend:
Removed from v.3282  
changed lines
  Added in v.3283

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