@@ -948,16 +948,13 @@ void CubicOps::getSchmidFactorAndSS(double load[3], double plane[3], double dire
948
948
949
949
double CubicOps::getmPrime (const QuatD& q1, const QuatD& q2, double LD[3 ]) const
950
950
{
951
- // double g1[3][3];
952
- // double g2[3][3];
953
- // double g1temp[3][3];
954
- // double g2temp[3][3];
955
951
EbsdLib::Matrix3X1D hkl1;
956
952
EbsdLib::Matrix3X1D uvw1;
957
953
EbsdLib::Matrix3X1D hkl2;
958
954
EbsdLib::Matrix3X1D uvw2;
959
955
EbsdLib::Matrix3X1D slipDirection;
960
956
EbsdLib::Matrix3X1D slipPlane;
957
+
961
958
double schmidFactor1 = 0 , schmidFactor2 = 0 , maxSchmidFactor = 0 ;
962
959
double directionComponent1 = 0 , planeComponent1 = 0 ;
963
960
double directionComponent2 = 0 , planeComponent2 = 0 ;
@@ -1047,10 +1044,6 @@ double CubicOps::getmPrime(const QuatD& q1, const QuatD& q2, double LD[3]) const
1047
1044
1048
1045
double CubicOps::getF1 (const QuatD& q1, const QuatD& q2, double LD[3 ], bool maxSF) const
1049
1046
{
1050
- // double g1[3][3];
1051
- // double g2[3][3];
1052
- // double g1temp[3][3];
1053
- // double g2temp[3][3];
1054
1047
EbsdLib::Matrix3X1D hkl1;
1055
1048
EbsdLib::Matrix3X1D uvw1;
1056
1049
EbsdLib::Matrix3X1D hkl2;
@@ -1112,7 +1105,7 @@ double CubicOps::getF1(const QuatD& q1, const QuatD& q2, double LD[3], bool maxS
1112
1105
hkl2 = hkl2.normalize ();
1113
1106
uvw2 = uvw2.normalize ();
1114
1107
1115
- directionMisalignment = std::fabs (EbsdLib::GeometryMath::CosThetaBetweenVectors (uvw2 .data (), uvw2.data ()));
1108
+ directionMisalignment = std::fabs (EbsdLib::GeometryMath::CosThetaBetweenVectors (uvw1 .data (), uvw2.data ()));
1116
1109
totalDirectionMisalignment = totalDirectionMisalignment + directionMisalignment;
1117
1110
}
1118
1111
F1 = schmidFactor1 * directionComponent1 * totalDirectionMisalignment;
@@ -1134,24 +1127,25 @@ double CubicOps::getF1(const QuatD& q1, const QuatD& q2, double LD[3], bool maxS
1134
1127
1135
1128
double CubicOps::getF1spt (const QuatD& q1, const QuatD& q2, double LD[3 ], bool maxSF) const
1136
1129
{
1137
- double g1[ 3 ][ 3 ] ;
1138
- double g2[ 3 ][ 3 ] ;
1139
- double g1temp[ 3 ][ 3 ] ;
1140
- double g2temp[ 3 ][ 3 ] ;
1141
- double hkl1[ 3 ], uvw1[ 3 ] ;
1142
- double hkl2[ 3 ], uvw2[ 3 ] ;
1143
- double slipDirection[ 3 ], slipPlane[ 3 ];
1130
+ EbsdLib::Matrix3X1D hkl1 ;
1131
+ EbsdLib::Matrix3X1D uvw1 ;
1132
+ EbsdLib::Matrix3X1D hkl2 ;
1133
+ EbsdLib::Matrix3X1D uvw2 ;
1134
+ EbsdLib::Matrix3X1D slipDirection ;
1135
+ EbsdLib::Matrix3X1D slipPlane ;
1136
+
1144
1137
double directionMisalignment = 0 , totalDirectionMisalignment = 0 ;
1145
1138
double planeMisalignment = 0 , totalPlaneMisalignment = 0 ;
1146
1139
double schmidFactor1 = 0 , maxSchmidFactor = 0 ;
1147
1140
double directionComponent1 = 0 , planeComponent1 = 0 ;
1148
- // s double directionComponent2 = 0, planeComponent2 = 0;
1149
1141
double maxF1spt = 0.0 ;
1150
1142
double F1spt = 0 .0f ;
1151
- OrientationTransformation::qu2om<QuatD, OrientationType>(q1).toGMatrix (g1temp);
1152
- OrientationTransformation::qu2om<QuatD, OrientationType>(q2).toGMatrix (g2temp);
1153
- EbsdMatrixMath::Transpose3x3 (g1temp, g1);
1154
- EbsdMatrixMath::Transpose3x3 (g2temp, g2);
1143
+
1144
+ EbsdLib::Matrix3X3D g (OrientationTransformation::qu2om<QuatD, OrientationType>(q1).data ());
1145
+ EbsdLib::Matrix3X3D g1 = g.transpose ();
1146
+
1147
+ g = EbsdLib::Matrix3X3D (OrientationTransformation::qu2om<QuatD, OrientationType>(q2).data ());
1148
+ EbsdLib::Matrix3X3D g2 = g.transpose ();
1155
1149
1156
1150
EbsdMatrixMath::Normalize3x1 (LD);
1157
1151
@@ -1167,12 +1161,14 @@ double CubicOps::getF1spt(const QuatD& q1, const QuatD& q2, double LD[3], bool m
1167
1161
slipPlane[0 ] = CubicHigh::SlipPlanes[i][0 ];
1168
1162
slipPlane[1 ] = CubicHigh::SlipPlanes[i][1 ];
1169
1163
slipPlane[2 ] = CubicHigh::SlipPlanes[i][2 ];
1170
- EbsdMatrixMath::Multiply3x3with3x1 (g1, slipPlane, hkl1);
1171
- EbsdMatrixMath::Multiply3x3with3x1 (g1, slipDirection, uvw1);
1172
- EbsdMatrixMath::Normalize3x1 (hkl1);
1173
- EbsdMatrixMath::Normalize3x1 (uvw1);
1174
- directionComponent1 = std::fabs (EbsdLib::GeometryMath::CosThetaBetweenVectors (LD, uvw1));
1175
- planeComponent1 = std::fabs (EbsdLib::GeometryMath::CosThetaBetweenVectors (LD, hkl1));
1164
+ hkl1 = g1 * slipPlane;
1165
+ uvw1 = g1 * slipDirection;
1166
+
1167
+ hkl1 = hkl1.normalize ();
1168
+ uvw1 = uvw1.normalize ();
1169
+
1170
+ directionComponent1 = std::fabs (EbsdLib::GeometryMath::CosThetaBetweenVectors (LD, uvw1.data ()));
1171
+ planeComponent1 = std::fabs (EbsdLib::GeometryMath::CosThetaBetweenVectors (LD, hkl1.data ()));
1176
1172
schmidFactor1 = directionComponent1 * planeComponent1;
1177
1173
if (schmidFactor1 > maxSchmidFactor || !maxSF)
1178
1174
{
@@ -1190,15 +1186,14 @@ double CubicOps::getF1spt(const QuatD& q1, const QuatD& q2, double LD[3], bool m
1190
1186
slipPlane[0 ] = CubicHigh::SlipPlanes[j][0 ];
1191
1187
slipPlane[1 ] = CubicHigh::SlipPlanes[j][1 ];
1192
1188
slipPlane[2 ] = CubicHigh::SlipPlanes[j][2 ];
1193
- EbsdMatrixMath::Multiply3x3with3x1 (g2, slipPlane, hkl2);
1194
- EbsdMatrixMath::Multiply3x3with3x1 (g2, slipDirection, uvw2);
1195
- EbsdMatrixMath::Normalize3x1 (hkl2);
1196
- EbsdMatrixMath::Normalize3x1 (uvw2);
1197
- // directionComponent2 = std::fabs(GeometryMath::CosThetaBetweenVectors(LD, uvw2));
1198
- // planeComponent2 = std::fabs(GeometryMath::CosThetaBetweenVectors(LD, hkl2));
1199
- // schmidFactor2 = directionComponent2 * planeComponent2;
1200
- directionMisalignment = std::fabs (EbsdLib::GeometryMath::CosThetaBetweenVectors (uvw1, uvw2));
1201
- planeMisalignment = std::fabs (EbsdLib::GeometryMath::CosThetaBetweenVectors (hkl1, hkl2));
1189
+
1190
+ hkl2 = g2 * slipPlane;
1191
+ uvw2 = g2 * slipDirection;
1192
+ hkl2 = hkl2.normalize ();
1193
+ uvw2 = uvw2.normalize ();
1194
+
1195
+ directionMisalignment = std::fabs (EbsdLib::GeometryMath::CosThetaBetweenVectors (uvw1.data (), uvw2.data ()));
1196
+ planeMisalignment = std::fabs (EbsdLib::GeometryMath::CosThetaBetweenVectors (hkl1.data (), hkl2.data ()));
1202
1197
totalDirectionMisalignment = totalDirectionMisalignment + directionMisalignment;
1203
1198
totalPlaneMisalignment = totalPlaneMisalignment + planeMisalignment;
1204
1199
}
@@ -1221,13 +1216,13 @@ double CubicOps::getF1spt(const QuatD& q1, const QuatD& q2, double LD[3], bool m
1221
1216
1222
1217
double CubicOps::getF7 (const QuatD& q1, const QuatD& q2, double LD[3 ], bool maxSF) const
1223
1218
{
1224
- double g1[ 3 ][ 3 ] ;
1225
- double g2[ 3 ][ 3 ] ;
1226
- double g1temp[ 3 ][ 3 ] ;
1227
- double g2temp[ 3 ][ 3 ] ;
1228
- double hkl1[ 3 ], uvw1[ 3 ] ;
1229
- double hkl2[ 3 ], uvw2[ 3 ] ;
1230
- double slipDirection[ 3 ], slipPlane[ 3 ];
1219
+ EbsdLib::Matrix3X1D hkl1 ;
1220
+ EbsdLib::Matrix3X1D uvw1 ;
1221
+ EbsdLib::Matrix3X1D hkl2 ;
1222
+ EbsdLib::Matrix3X1D uvw2 ;
1223
+ EbsdLib::Matrix3X1D slipDirection ;
1224
+ EbsdLib::Matrix3X1D slipPlane ;
1225
+
1231
1226
double directionMisalignment = 0 , totalDirectionMisalignment = 0 ;
1232
1227
double schmidFactor1 = 0.0 , maxSchmidFactor = 0.0 ;
1233
1228
double directionComponent1 = 0.0 ;
@@ -1237,10 +1232,11 @@ double CubicOps::getF7(const QuatD& q1, const QuatD& q2, double LD[3], bool maxS
1237
1232
double maxF7 = 0.0 ;
1238
1233
double F7 = 0 .0f ;
1239
1234
1240
- OrientationTransformation::qu2om<QuatD, OrientationType>(q1).toGMatrix (g1temp);
1241
- OrientationTransformation::qu2om<QuatD, OrientationType>(q2).toGMatrix (g2temp);
1242
- EbsdMatrixMath::Transpose3x3 (g1temp, g1);
1243
- EbsdMatrixMath::Transpose3x3 (g2temp, g2);
1235
+ EbsdLib::Matrix3X3D g (OrientationTransformation::qu2om<QuatD, OrientationType>(q1).data ());
1236
+ EbsdLib::Matrix3X3D g1 = g.transpose ();
1237
+
1238
+ g = EbsdLib::Matrix3X3D (OrientationTransformation::qu2om<QuatD, OrientationType>(q2).data ());
1239
+ EbsdLib::Matrix3X3D g2 = g.transpose ();
1244
1240
1245
1241
EbsdMatrixMath::Normalize3x1 (LD);
1246
1242
@@ -1252,12 +1248,12 @@ double CubicOps::getF7(const QuatD& q1, const QuatD& q2, double LD[3], bool maxS
1252
1248
slipPlane[0 ] = CubicHigh::SlipPlanes[i][0 ];
1253
1249
slipPlane[1 ] = CubicHigh::SlipPlanes[i][1 ];
1254
1250
slipPlane[2 ] = CubicHigh::SlipPlanes[i][2 ];
1255
- EbsdMatrixMath::Multiply3x3with3x1 (g1, slipPlane, hkl1) ;
1256
- EbsdMatrixMath::Multiply3x3with3x1 (g1, slipDirection, uvw1) ;
1257
- EbsdMatrixMath::Normalize3x1 ( hkl1);
1258
- EbsdMatrixMath::Normalize3x1 ( uvw1);
1259
- directionComponent1 = std::fabs (EbsdLib::GeometryMath::CosThetaBetweenVectors (LD, uvw1));
1260
- planeComponent1 = std::fabs (EbsdLib::GeometryMath::CosThetaBetweenVectors (LD, hkl1));
1251
+ hkl1 = g1 * slipPlane ;
1252
+ uvw1 = g1 * slipDirection ;
1253
+ hkl1 = hkl1. normalize ( );
1254
+ uvw1 = uvw1. normalize ( );
1255
+ directionComponent1 = std::fabs (EbsdLib::GeometryMath::CosThetaBetweenVectors (LD, uvw1. data () ));
1256
+ planeComponent1 = std::fabs (EbsdLib::GeometryMath::CosThetaBetweenVectors (LD, hkl1. data () ));
1261
1257
schmidFactor1 = directionComponent1 * planeComponent1;
1262
1258
if (schmidFactor1 > maxSchmidFactor || !maxSF)
1263
1259
{
@@ -1274,14 +1270,12 @@ double CubicOps::getF7(const QuatD& q1, const QuatD& q2, double LD[3], bool maxS
1274
1270
slipPlane[0 ] = CubicHigh::SlipPlanes[j][0 ];
1275
1271
slipPlane[1 ] = CubicHigh::SlipPlanes[j][1 ];
1276
1272
slipPlane[2 ] = CubicHigh::SlipPlanes[j][2 ];
1277
- EbsdMatrixMath::Multiply3x3with3x1 (g2, slipPlane, hkl2);
1278
- EbsdMatrixMath::Multiply3x3with3x1 (g2, slipDirection, uvw2);
1279
- EbsdMatrixMath::Normalize3x1 (hkl2);
1280
- EbsdMatrixMath::Normalize3x1 (uvw2);
1281
- // directionComponent2 = std::fabs(GeometryMath::CosThetaBetweenVectors(LD, uvw2));
1282
- // planeComponent2 = std::fabs(GeometryMath::CosThetaBetweenVectors(LD, hkl2));
1283
- // schmidFactor2 = directionComponent2 * planeComponent2;
1284
- directionMisalignment = std::fabs (EbsdLib::GeometryMath::CosThetaBetweenVectors (uvw1, uvw2));
1273
+ hkl2 = g2 * slipPlane;
1274
+ uvw2 = g2 * slipDirection;
1275
+ hkl2 = hkl2.normalize ();
1276
+ uvw2 = uvw2.normalize ();
1277
+
1278
+ directionMisalignment = std::fabs (EbsdLib::GeometryMath::CosThetaBetweenVectors (uvw1.data (), uvw2.data ()));
1285
1279
totalDirectionMisalignment = totalDirectionMisalignment + directionMisalignment;
1286
1280
}
1287
1281
F7 = directionComponent1 * directionComponent1 * totalDirectionMisalignment;
0 commit comments