6 #beginMacro getTranslationAndRotationSolution(evalSolution,U,ERR,X,t,I1,I2,I3)
8 const int v1c = parameters.dbase.get<
int >(
"v1c");
9 const int v2c = parameters.dbase.get<
int >(
"v2c");
10 const int v3c = parameters.dbase.get<
int >(
"v3c");
13 const int s11c = parameters.dbase.get<
int >(
"s11c");
14 const int s12c = parameters.dbase.get<
int >(
"s12c");
15 const int s13c = parameters.dbase.get<
int >(
"s13c");
16 const int s21c = parameters.dbase.get<
int >(
"s21c");
17 const int s22c = parameters.dbase.get<
int >(
"s22c");
18 const int s23c = parameters.dbase.get<
int >(
"s23c");
19 const int s31c = parameters.dbase.get<
int >(
"s31c");
20 const int s32c = parameters.dbase.get<
int >(
"s32c");
21 const int s33c = parameters.dbase.get<
int >(
"s33c");
23 const int pc = parameters.dbase.get<
int >(
"pc");
29 printF(
"\n\n **************** FIX ME: getTranslationAndRotationSolution: finish me for HEMP **********\n\n");
36 std::vector<real> &
trd = parameters.dbase.get<std::vector<real> >(
"translationAndRotationSolutionData");
43 real
rx[3]={cos(omega*t)-1.,-sin(omega*t), 0.};
44 real
ry[3]={sin(omega*t) , cos(omega*t)-1., 0.};
45 real
rxt[3]={-omega*sin(omega*t),-omega*cos(omega*t), 0.};
46 real
ryt[3]={ omega*cos(omega*t),-omega*sin(omega*t), 0.};
48 #define U0(x,y,z,n,t) (vcenter[n-uc]*(t) + rx[n-uc]*((x)-xcenter) + ry[n-uc]*((y)-ycenter))
49 #define U0T(x,y,z,n,t) (vcenter[n-uc] + rxt[n-uc]*((x)-xcenter) + ryt[n-uc]*((y)-ycenter))
50 #define U0X(x,y,z,n,t) ( rx[n-uc] )
51 #define U0Y(x,y,z,n,t) ( ry[n-uc] )
54 printF(
"**** translationAndRotationSolution, t=%8.2e omega=%8.2e (x0,x1,x2)=(%8.2e,%8.2e,%8.2e) "
55 " (v0,v1,v2)=(%8.2e,%8.2e,%8.2e) *********\n",t,omega,xcenter,ycenter,zcenter,
56 vcenter[0],vcenter[1],vcenter[2]);
60 if(
mg.numberOfDimensions()==2 )
65 real x0 =
X(i1,i2,i3,0);
66 real y0 =
X(i1,i2,i3,1);
67 real u1 =
U0(x0,y0,z0,uc,t);
68 real u2 =
U0(x0,y0,z0,vc,t);
77 ERR(i1,i2,i3,uc) =
U(i1,i2,i3,uc) - u1;
78 ERR(i1,i2,i3,vc) =
U(i1,i2,i3,vc) - u2;
83 if( assignVelocities )
87 real x0 =
X(i1,i2,i3,0);
88 real y0 =
X(i1,i2,i3,1);
89 real v1 =
U0T(x0,y0,z0,uc,t);
90 real v2 =
U0T(x0,y0,z0,vc,t);
101 ERR(i1,i2,i3,v1c) =
U(i1,i2,i3,v1c) - v1;
102 ERR(i1,i2,i3,v2c) =
U(i1,i2,i3,v2c) - v2;
111 real x0 =
X(i1,i2,i3,0);
112 real y0 =
X(i1,i2,i3,1);
113 real f11 = 1. +
U0X(x0,y0,z0,uc,t);
114 real f12 =
U0Y(x0,y0,z0,uc,t);
115 real f21 =
U0X(x0,y0,z0,vc,t);
116 real f22 = 1. +
U0Y(x0,y0,z0,vc,t);
117 real e11 = .5*(f11*f11+f21*f21-1.);
118 real e12 = .5*(f11*f12+f21*f22 );
119 real e22 = .5*(f12*f12+f22*f22-1.);
120 real trace = e11 + e22;
125 real p11 = s11*f11 + s12*f12;
126 real p12 = s11*f21 + s12*f22;
127 real p21 = s21*f11 + s22*f12;
128 real p22 = s21*f21 + s22*f22;
131 U(i1,i2,i3,s11c) = p11;
132 U(i1,i2,i3,s12c) = p12;
133 U(i1,i2,i3,s21c) = p21;
134 U(i1,i2,i3,s22c) = p22;
138 ERR(i1,i2,i3,s11c) =
U(i1,i2,i3,s11c) - p11;
139 ERR(i1,i2,i3,s12c) =
U(i1,i2,i3,s12c) - p12;
140 ERR(i1,i2,i3,s21c) =
U(i1,i2,i3,s21c) - p21;
141 ERR(i1,i2,i3,s22c) =
U(i1,i2,i3,s22c) - p22;
148 OV_ABORT(
"translationAndRotationSolution: finish me for 3d");
151 real x0 =
X(i1,i2,i3,0);
152 real y0 =
X(i1,i2,i3,1);
153 real z0 =
X(i1,i2,i3,2);
154 U(i1,i2,i3,uc) =
U0(x0,y0,z0,uc,t);
155 U(i1,i2,i3,vc) =
U0(x0,y0,z0,vc,t);
156 U(i1,i2,i3,
wc) =
U0(x0,y0,z0,
wc,t);