2 #include "../Numerics/types.h"
3 #include "../Exceptions/exceptions.h"
14 EstarOmega(&omega[0],vx,vy,vz,vmag,dvx,dvy,dvz,dvmag);
17 nrsp[0] = vy*omega[2] - vz*omega[1];
18 nrsp[1] = vz*omega[0] - vx*omega[2];
19 nrsp[2] = vx*omega[1] - vy*omega[0];
22 nrsp_norm = sqrt(nrsp[0]*nrsp[0] + nrsp[1]*nrsp[1] + nrsp[2]*nrsp[2]);
29 nrsp[0] =nrsp[0]/nrsp_norm;
30 nrsp[1] =nrsp[1]/nrsp_norm;
31 nrsp[2] =nrsp[2]/nrsp_norm;
35 eps[0][0] = dvx[0]; eps[0][1] = .5*(dvx[1]+dvy[0]); eps[0][2] = .5*(dvx[2]+dvz[0]);
36 eps[1][0] = .5*(dvx[1]+dvy[0]); eps[1][1] = dvy[1]; eps[1][2] = .5*(dvy[2]+dvz[1]);
37 eps[2][0] = .5*(dvx[2]+dvz[0]); eps[2][1] = .5*(dvy[2]+dvz[1]); eps[2][2] = dvz[2];
46 epsprime[i] += eps[i][j]*nrsp[j];
53 epsprime[j] += -nrsp[i]*eps[i][k]*nrsp[k]*nrsp[j];
61 epsprime[j] += -nrsp[i]*eps[i][k]*omega[k]*omega[j];
67 epsprime_norm = sqrt(epsprime[0]*epsprime[0] + epsprime[1]*epsprime[1] + epsprime[2]*epsprime[2]);
70 *pepsprime_norm=epsprime_norm;
79 _assert_(dvx && dvy && dvz && dvmag);
80 if(vmag<1e-12)vmag=1e-12;
90 omega_rigid[0] = 2*(vy*(vx*dvz[0]+vy*dvz[1]+vz*dvz[2]) - vz*(vx*dvy[0]+vy*dvy[1]+vz*dvy[2]))/(vmag*vmag);
91 omega_rigid[1] = 2*(vz*(vx*dvx[0]+vy*dvx[1]+vz*dvx[2]) - vx*(vx*dvz[0]+vy*dvz[1]+vz*dvz[2]))/(vmag*vmag);
92 omega_rigid[2] = 2*(vx*(vx*dvy[0]+vy*dvy[1]+vz*dvy[2]) - vy*(vx*dvx[0]+vy*dvx[1]+vz*dvx[2]))/(vmag*vmag);
94 omega[0] = (dvz[1] - dvy[2]) - omega_rigid[0];
95 omega[1] = (dvx[2] - dvz[0]) - omega_rigid[1];
96 omega[2] = (dvy[0] - dvx[1]) - omega_rigid[2];
99 IssmDouble wdotv = vx/vmag*omega[0] + vy/vmag*omega[1] + vz/vmag*omega[2];
100 omega[0] = omega[0] - wdotv*vx/vmag;
101 omega[1] = omega[1] - wdotv*vy/vmag;
102 omega[2] = omega[2] - wdotv*vz/vmag;
105 omega_norm = sqrt(omega[0]*omega[0] + omega[1]*omega[1] + omega[2]*omega[2]);
112 omega[0] =omega[0]/omega_norm;
113 omega[1] =omega[1]/omega_norm;
114 omega[2] =omega[2]/omega_norm;
126 lambdas=sqrt(epsprime_norm*epsprime_norm/(epseff*epseff));