Home My Page Projects Code Snippets Project Openings diderot

SCM Repository

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

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

revision 3312, Fri Oct 16 20:11:52 2015 UTC revision 3313, Sat Oct 17 00:33:40 2015 UTC
# Line 46  Line 46
46      if (inside(x,V)) {      if (inside(x,V)) {
47        real val = 0;        real val = 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       vec3 XXXX=(∇(trace(V)))(x);//<<< need to remove trace
52       tensor [3,3,3] dele1=∇⊗V(x)- (XXXX⊗identity[3]/3);       tensor [3,3,3] dele1=∇⊗V(x)- (XXXX⊗identity[3]/3);

//∇|E|;
53      tensor [3,3,3] t4=∇⊗V(x)- (XXXX⊗identity[3]/3);      tensor [3,3,3] t4=∇⊗V(x)- (XXXX⊗identity[3]/3);
54      vec3 t3 =2*(t4:(e1));//product rule      vec3 t3 =2*(t4:(e1));//product rule
55      vec3 dele2=(1/2)*t3/sqrt(e1:e1);      vec3 dele2=(1/2)*t3/sqrt(e1:e1);

56      tensor[3,3] probeQ= e1/sqrt(e1:e1); //E/|E|;      tensor[3,3] probeQ= e1/sqrt(e1:e1); //E/|E|;
57      tensor[3,3,3] probedelQ=(e1⊗dele2-e2*dele1)/(e2*e2);      tensor[3,3,3] probedelQ=(e1⊗dele2-e2*dele1)/(e2*e2);

58        real qa=probeQ[0,0];        real qa=probeQ[0,0];
59        real qb=probeQ[0,1];        real qb=probeQ[0,1];
60        real qc=probeQ[0,2];        real qc=probeQ[0,2];
# Line 82  Line 77
77      real t1=(qd*qi) -(qf*qg);      real t1=(qd*qi) -(qf*qg);
78      real t2=(qd*qh) -(qe*qg);      real t2=(qd*qh) -(qe*qg);
79      real K=qa*t0 -qb*t1+qc*t2;//determinant of Q      real K=qa*t0 -qb*t1+qc*t2;//determinant of Q

80  val = 3*sqrt(6)*K/2; //F(x);  val = 3*sqrt(6)*K/2; //F(x);

81  vec3 r0=(t0*dqa)+qa*((qe*dqi+dqe*qi)-(qf*dqh+dqf*qh));  vec3 r0=(t0*dqa)+qa*((qe*dqi+dqe*qi)-(qf*dqh+dqf*qh));
82  vec3 r1=(t1*dqb)+qb*((qd*dqi+dqd*qi)-(qf*dqg+dqf*qg));  vec3 r1=(t1*dqb)+qb*((qd*dqi+dqd*qi)-(qf*dqg+dqf*qg));
83  vec3 r2=(t2*dqc)+qc*((qd*dqh+dqh*qd)-(qe*dqg+dqe*qg));  vec3 r2=(t2*dqc)+qc*((qd*dqh+dqh*qd)-(qe*dqg+dqe*qg));
84  vec3 del_K=r0-r1+r2; //derivative of determinant of Q  vec3 del_K=r0-r1+r2; //derivative of determinant of Q