11 const double l2,
const double l3,
const SVector3 &t1,
31 tmp(0, 0) = l1 * e(0, 0);
32 tmp(0, 1) = l2 * e(0, 1);
33 tmp(0, 2) = l3 * e(0, 2);
34 tmp(1, 0) = l1 * e(1, 0);
35 tmp(1, 1) = l2 * e(1, 1);
36 tmp(1, 2) = l3 * e(1, 2);
37 tmp(2, 0) = l1 * e(2, 0);
38 tmp(2, 1) = l2 * e(2, 1);
39 tmp(2, 2) = l3 * e(2, 2);
43 _val[0] = tmp(0, 0) * e(0, 0) + tmp(0, 1) * e(1, 0) + tmp(0, 2) * e(2, 0);
44 _val[1] = tmp(1, 0) * e(0, 0) + tmp(1, 1) * e(1, 0) + tmp(1, 2) * e(2, 0);
45 _val[2] = tmp(1, 0) * e(0, 1) + tmp(1, 1) * e(1, 1) + tmp(1, 2) * e(2, 1);
46 _val[3] = tmp(2, 0) * e(0, 0) + tmp(2, 1) * e(1, 0) + tmp(2, 2) * e(2, 0);
47 _val[4] = tmp(2, 0) * e(0, 1) + tmp(2, 1) * e(1, 1) + tmp(2, 2) * e(2, 1);
48 _val[5] = tmp(2, 0) * e(0, 2) + tmp(2, 1) * e(1, 2) + tmp(2, 2) * e(2, 2);
53 for(
int i = 0; i < 3; i++) {
54 for(
int j = 0; j < 3; j++) { mat(i, j) =
_val[
getIndex(i, j)]; }
60 for(
int i = 0; i < 3; i++)
61 for(
int j = 0; j < 3; j++)
_val[
getIndex(i, j)] = mat(i, j);
109 me.eig(
S, im, left, V, s);
114 printf(
" metric %s : %12.5E %12.5E %12.5E %12.5E %12.5E %12.5E \n", s,
115 (*
this)(0, 0), (*
this)(1, 1), (*
this)(2, 2), (*
this)(0, 1),
116 (*
this)(0, 2), (*
this)(1, 2));
126 SVector3 v0(V(0, 0), V(1, 0), V(2, 0));
127 SVector3 v1(V(0, 1), V(1, 1), V(2, 1));
128 SVector3 v2(V(0, 2), V(1, 2), V(2, 2));
129 double l0 = std::max(
dot(v0, m1, v0),
dot(v0, m2, v0));
130 double l1 = std::max(
dot(v1, m1, v1),
dot(v1, m2, v1));
131 double l2 = std::max(
dot(v2, m1, v2),
dot(v2, m2, v2));
135 static const double eps = 1.e-2;
137 const double max_eig = std::max(
S(0), std::max(
S(1),
S(2)));
138 const double min_eig = std::min(
S(0), std::min(
S(1),
S(2)));
139 const double range_eig = fabs((max_eig - min_eig) / max_eig);
140 if(range_eig < eps)
return (max_eig >= 1.) ? m2 : m1;
142 SMetric3 iv(l0, l1, l2, v0, v1, v2);
153 SVector3 v0(V(0, 0), V(1, 0), V(2, 0));
154 SVector3 v1(V(0, 1), V(1, 1), V(2, 1));
155 SVector3 v2(V(0, 2), V(1, 2), V(2, 2));
156 double l0 = std::max(
dot(v0, m1, v0),
dot(v0, m2, v0));
157 double l1 = std::max(
dot(v1, m1, v1),
dot(v1, m2, v1));
158 double l2 = std::max(
dot(v2, m1, v2),
dot(v2, m2, v2));
159 SMetric3 iv(l0, l1, l2, v0, v1, v2);
171 SVector3 v0(V(0, 0), V(1, 0), V(2, 0));
172 SVector3 v1(V(0, 1), V(1, 1), V(2, 1));
173 SVector3 v2(V(0, 2), V(1, 2), V(2, 2));
174 double l0 = std::max(
dot(v0, m1, v0),
dot(v0, m2, v0));
175 double l1 = std::max(
dot(v1, m1, v1),
dot(v1, m2, v1));
176 double l2 = std::max(
dot(v2, m1, v2),
dot(v2, m2, v2));
177 SMetric3 iv(l0, l1, l2, v0, v1, v2);
183 double anisoRatio2D(
double v0x,
double v0y,
double v0z,
double v1x,
184 double v1y,
double v1z,
double v2x,
double v2y,
185 double v2z,
double s0,
double s1,
double s2)
187 static const double eps = 1.e-8;
190 if(v0x * v0x + v0y * v0y + (v0z - 1.) * (v0z - 1.) <
193 std::min(fabs(s1 / s2),
195 else if(v1x * v1x + v1y * v1y + (v1z - 1.) * (v1z - 1.) <
198 std::min(fabs(s0 / s2),
200 else if(v2x * v2x + v2y * v2y + (v2z - 1.) * (v2z - 1.) <
203 std::min(fabs(s0 / s1),
206 printf(
"Error in anisoRatio2D: z direction not found!\n");
220 m1.
eig(V1, S1,
true);
225 m2.
eig(V2, S2,
true);
241 m1.
eig(V1, S1,
false);
243 anisoRatio2D(V1(0, 0), V1(1, 0), V1(2, 0), V1(0, 1), V1(1, 1), V1(2, 1),
244 V1(0, 2), V1(1, 2), V1(2, 2), S1(0), S1(1), S1(2));
248 m2.
eig(V2, S2,
false);
250 anisoRatio2D(V2(0, 0), V2(1, 0), V2(2, 0), V2(0, 1), V2(1, 1), V2(2, 1),
251 V2(0, 2), V2(1, 2), V2(2, 2), S2(0), S2(1), S2(2));
271 const SMetric3 &m3,
const double u,
const double v)
286 const double v,
const double w)
292 im1 *= (1. - u - v - w);
304 for(
int i = 0; i < 3; i++) {
305 for(
int j = 0; j < 3; j++) { mat(i, j) =
_val[
getIndex(i, j)]; }
311 for(
int i = 0; i < 3; i++)
312 for(
int j = 0; j < 3; j++)
_val[
getIndex(i, j)] = mat(i, j);
320 me.eig(
S, im, left, V, s);
327 " %12.5E %12.5E %12.5E \n %12.5E %12.5E %12.5E \n %12.5E %12.5E %12.5E \n",
328 s, (*
this)(0, 0), (*
this)(0, 1), (*
this)(0, 2), (*
this)(1, 0),
329 (*
this)(1, 1), (*
this)(1, 2), (*
this)(2, 0), (*
this)(2, 1), (*
this)(2, 2));